function Restore(){
	nCount = document.OriginImage.length; 
	ImgArray = document.OriginImage;

	if (document.OriginImage != null) {
		for (i = 0; i < (nCount - 1); i += 2)
			ImgArray[i].src = ImgArray[i+1]; }
			
	document.OriginImage = null;
}

function Replace(){
	j = 0;
	ImgArray = new Array;
	oldImgArray = document.OriginImage;

	for (i = 0; i < Replace.arguments.length; i += 2) {
		obj = Replace.arguments[i]
		ImgArray[j++] = obj;
		if (oldImgArray == null || oldImgArray[j-1] != obj)
			ImgArray[j++] = obj.src;
		else
			ImgArray[j++] = oldImgArray[j];
		obj.src = Replace.arguments[i + 1];
	}
	
	if (document.OriginImage == null)
		document.OriginImage = ImgArray;
}

function bookmarks_func() {
	document.location = "$bookmarksurl";
}
function registration_func() {
	document.location = "$registrationurl";
}

function showtip(i, ww, hh) {
 rozmeryatd = "height=" + hh + ",width=" + ww + ",menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0";
  adresa=i;
  okno=window.open(adresa,'okno',rozmeryatd);
  okno.focus();
}

function logos() {
	 if (check_logos) { 
	 toplogos();
	 change('toplogo', 'top0');
	 }
}

function showhome(i) {
  adresa=i;
  okno=window.open(adresa,'okno','width=680, height=750,toolbar=0,menubar=0,scrollbars=yes');
  okno.focus();
}

function ukaz(a)	{
	document.getElementById(a).style.visibility='visible';
	document.getElementById(a).style.display='block';
}

function schovej(a)	{
	document.getElementById(a).style.visibility='hidden';
	document.getElementById(a).style.display='none';
}

function zmenStyl_red(id) {
  document.getElementById(id).style.textDecoration='underline';	
  document.getElementById(id).style.color='#ff0000';
  companyShow = id;
}

function zmenStyl_normal(id) {
  document.getElementById(id).style.textDecoration='none';	
  document.getElementById(id).style.color='#000000';
}

function UkazRamecek()	{
	ukaz('popup_ramecek');
	if (homepage) {schovej('popup_schovej');}
}

function SchovejRamecek()	{
	schovej('popup_ramecek');
	if (homepage) {ukaz('popup_schovej');}
}

function stopclock()	{
	if(timerRunning)	{
		clearTimeout(timerID);
	}
	timerRunning = false;
}

function startclock()	{
	stopclock();
	timerID = setTimeout("SchovejRamecek()",1000);
	timerRunning = true;
}

function overeni(){
  var cislo, osoba, tel, mail, hlaska, maska, re;	
  hlaska=""; cislo=document.getElementById('pocet').value; osoba=document.getElementById('osoba').value; tel=document.getElementById('tel').value; 
  mail=document.getElementById('mail').value; re =/^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/;
  
  if(cislo==""){
    cislo=false;
    hlaska+="Nebyl zadán počet osob.\n"; 
  }else {
      if(isNaN(cislo)==true){
        hlaska+="Počet osob není číslo.\n";
        cislo=false;
      }else{
        cislo=true;
      } 
  }
  if (osoba!=""){ osoba=true; } else { osoba=false; hlaska+="Nebyla zadána kontaktní osoba.\n";  }
  if (tel!=""){ tel=true; } else { tel=false; hlaska+="Nebyl zadán telefon.\n"; }
  if(mail==""){
    mail=false;
    hlaska+="Nebyla zadána emailová adresa.\n"; 
  }else {
      if(!re.test(mail)){
        hlaska+="Zadaná emailová adresa není platná.\n";
        mail=false;
      }else{
        mail=true;
      } 
  }
  if(cislo==true && osoba==true && tel==true && mail==true){
    return true;
  } else {
    window.alert(hlaska);
    return false;
  }
}
