var LastTimerId=0;
var basketChanged=1;

function modifyBasket() {

	basketChanged=1;
}


 if((!document.getElementById) && document.all){
	document.getElementById = function(id){return document.all[id];};
}

function xObject(x) {
	return document.getElementById(x);
}
	
function send_httprequest(obsluha, method, url, content) {
	if (window.XMLHttpRequest) { 
		xmlhttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) { 
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (error) {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	xmlhttp.onreadystatechange = function() { obsluha(xmlhttp); };
	xmlhttp.open(method, url, true);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.send(content);
    return true;
}


function isRequestOk(xmlhttp) {
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		return true;
	}  else {
		return false;	
	}
}


	
	
function select_hide() {
	var allSelects = document.getElementsByTagName("select");
	for (i=0;i<allSelects.length;i++) {
		if (allSelects[i].getAttribute("id")!="currency") {
			allSelects[i].style.visibility='hidden';
		}
	}
	return true;
}

function select_show() {
	var allSelects = document.getElementsByTagName("select");
	for (i=0;i<allSelects.length;i++) {
		allSelects[i].style.visibility='visible';
	}
	return true;
}




function setOpacity(obj,opacity){
		opacity=(opacity==100)?99.999:opacity;
		obj.style.filter="alpha(opacity:"+opacity+",style=0)";
		obj.style.KHTMLOpacity=opacity/100;
		obj.style.MozOpacity=opacity/100;
		obj.style.opacity=opacity/100;

}


function getCookie(name) {
   var bites = document.cookie.split("; ");
   for (var i=0; i < bites.length; i++) {
       nextbite = bites[i].split("=");
      if (nextbite[0] == name) return unescape(nextbite[1]);
	}
    return null;
}


function ElementShow(elmId) {
  xObject(elmId).style.display='block';
}

function ElementHide(elmId) {
  window.clearTimeout(LastTimerId);
  xObject(elmId).style.display='none';

}

function TimedElementShow(elmId) {
  LastTimerId=window.setTimeout("ElementShow('"+elmId+"')",500);
}



function __getDdlKey(e)
{
  var code;
  if (!e)
    var e = window.event;
  if (e.keyCode)
    code = e.keyCode;
  else
   if (e.which)
     code = e.which;
  return code;
}
var lastValue = '';
function __searchDdlReset()
{
  lastValue = '';
  //window.status = 'Najít:';
}
function __searchDdlList(eventObj,slcObj)
{
  if (navigator.userAgent.indexOf('MSIE') > -1 || navigator.userAgent.indexOf('Opera') > -1)
  {
    var lastKey = __getDdlKey(eventObj);
    if (lastKey == 8 && lastValue.length > 1)
      lastValue = lastValue.substring(0,lastValue.length-1);
    else
      lastValue += String.fromCharCode(lastKey);
    //window.status = 'Najít: ' + lastValue;
    for (i=0; i<slcObj.length; i++)
    {
      if ((slcObj.options[i].text.toLowerCase().indexOf(lastValue.toLowerCase()) == 0) && (lastValue.value != ''))
      {
        slcObj.options[i].selected = true;
        return false;
      }
    }
    return false;
  }
  else
    return true;
}





function getScrollY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && (document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && (document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY ;
}




	function testBrowser() {
		var testcookie='testcookie=valid';
		document.cookie=testcookie;
		var iscookie=document.cookie.indexOf(testcookie);
		if (iscookie==-1) {
			//top.location="info o zapnu ti cookies ";
			return false;
		}
	}


	var showOkno = 1;
    function ShowImage(url, name)
	{
            var features = 'toolbar=0,directories=0,menubar=0,scrollbars=0,resizable=1,status=0,location=0,width=' + (620) + ',height=' + (500);
            win = window.open(url, name, features);
            return (typeof(win) == 'object');
	}

    function ShowWWW(url, name)
	{
            var features = 'toolbar=1,directories=1,menubar=1,scrollbars=1,resizable=1,status=1,location=1,width=' + (500) + ',height=' + (400);
            win = window.open(url, name, features);
            return (typeof(win) == 'object');
    }

	
	function showHelpW() {
		if (showOkno == 1) {
			document.getElementById('LoginHelp').style.display='block';
		}
		showOkno = 0;
	}
	

	
	function ResizePage()
	{
		var levy = document.getElementById("leftcol");
		var pravy = document.getElementById("rightcol");
		var prostredni = document.getElementById("centercol");
		var nejvetsi = levy.offsetHeight;
		if (nejvetsi < prostredni.offsetHeight) {nejvetsi = prostredni.offsetHeight;}
		if (nejvetsi < pravy.offsetHeight) {nejvetsi = pravy.offsetHeight;}
		 
		var rozmer = nejvetsi+"px";
		levy.style.height = rozmer; 
		pravy.style.height = rozmer; 
		//prostredni.style.height = rozmer; 
		//alert (rozmer);	
		return true;
		
		
	}



function AddFavorite(linkObj,addUrl,addTitle)
{
  if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    linkObj.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  }
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
  return false;
} 




