var bookmarkurl="http://www.turistika-brno.cz/"
var bookmarktitle="Vše pro cestování"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
function InsertFlash(src,width,height) { 
	document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + width + "\" height=\"" + height + "\">");
	document.writeln("    <param name=\"movie\" value=\"" + src + "\" />");
	document.writeln("    <param name=\"quality\" value=\"high\" />");
	document.writeln("    <embed src=\"" + src + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\"></embed></object>");
	}

function noactive(){
 if(document.getElementById("same").checked==true) bool=true;
  else bool=false
	document.registrace.d_jmeno.readOnly = bool;
	document.registrace.d_prijmeni.readOnly = bool;
	document.registrace.d_titul.readOnly = bool;
	document.registrace.d_titul2.readOnly = bool;
	document.registrace.d_ulice.readOnly = bool;
	document.registrace.d_firma.readOnly = bool;
	document.registrace.d_mesto.readOnly = bool;
	document.registrace.d_psc.readOnly = bool;
	document.registrace.d_telefon.readOnly = bool;
	if(bool==true){barva="#E8E8E8";}
	 else {barva="white";}
	document.registrace.d_jmeno.style.backgroundColor = barva;
	document.registrace.d_prijmeni.style.backgroundColor = barva;
	document.registrace.d_titul.style.backgroundColor = barva;
	document.registrace.d_titul2.style.backgroundColor = barva;
	document.registrace.d_firma.style.backgroundColor = barva;
	document.registrace.d_ulice.style.backgroundColor = barva;
	document.registrace.d_mesto.style.backgroundColor = barva;
	document.registrace.d_psc.style.backgroundColor = barva;
	document.registrace.d_telefon.style.backgroundColor = barva;
}

function clicks(radio){
 if(radio=="same")document.getElementById("difer").checked=false;
  else document.getElementById("same").checked=false;
 noactive();
}	
	
function delivery_address(bool){
	document.registrace.d_jmeno.readOnly = bool;
	if(bool==false){
		document.registrace.d_jmeno.style.backgroundColor = "#E8E8E8";
		}
	}

function vsevyber(radio){
 //if(radio=="rb_vyber")document.getElementById("rb_vse").checked=false;
 // else document.getElementById("rb_vyber").checked=false;
 //document.ProdCheck.submit();
}

function vyber(){
 //document.getElementById("rb_vse").checked=false;
 //document.getElementById("rb_vyber").checked=true;
 //document.ProdCheck.submit();
}

function checkbox_click(){
 document.getElementById("brch_all").checked=false;
 //document.getElementById("rb_vyber").checked=true;
 //document.getElementById("rb_vse").checked=false;
 //document.ProdCheck.submit();
}

function checkbox_clear()
//odskrkava checboxy
{
  f = document.getElementById("ProdCheck");
  e = f.elements;
  for(i= 0; i<e.length; i++)
   if(e[i].type=="checkbox")
     e[i].checked=false;
}

function ahref_click(chb){
 if(document.getElementById(chb).checked==true){document.getElementById(chb).checked=false;}
  else document.getElementById(chb).checked=true;
}

function intobasket_submit(idecko){
 toFloat=document.getElementById(idecko).ks.value;
 if(isNaN(parseFloat(toFloat))) {
  alert("Opravte prosím počet kusů");
 }else{
  document.getElementById(idecko).submit();
 }
}

function find_check(){
   vyr=document.vyhledavani.vyraz.value;
   vyr=vyr.replace(/^\s*/,'');
   vyr=vyr.replace(/\s*$/,'');
   if(vyr.length<3) {
    alert("Výraz musí mít minimálně 3 znaky.");
    return false;
   }
}


// funkce ke slide show
function zmen(){
 f_photosdir=document.getElementById("hid_photosdir").value;
 f_album=document.getElementById("hid_album").value;
 interval=document.getElementById("hid_interval").value;
 
 timer=setTimeout("zmen()", 1000*interval); 
 f_imglist=document.getElementById("hid_imglist").value.split(";");
 f_index=document.getElementById("hid_index").value;
 if((f_index<f_imglist.length)&&(f_index>=0)){
  document.getElementById("img_main").src="../"+f_photosdir+"/"+f_album+"/"+f_imglist[f_index];
  pausecomp(300);			//takova pauzicka aby to bylo plynulejsi
  document.getElementById("aktual_name").innerHTML=f_imglist[f_index];
  f_index++;
  document.getElementById("hid_index").value=f_index;
 }else{
  clearTimeout(timer);
  stop();
 }
 
}
function play(){
 document.getElementById("playy").src="../image/play1.gif";
 document.getElementById("hid_interval").disabled=true;
 zmen();
}
function stop(){
 document.getElementById("playy").src="../image/play0.gif";
 clearTimeout(timer);
 document.getElementById("hid_interval").disabled=false;
 f_index=document.getElementById("hid_index").value=0;
}
function pausecomp(millis){
 date = new Date();
 var curDate = null;
 do { var curDate = new Date(); } 
 while(curDate-date < millis);
}

function Insertpopup() {

setup='toolbar=no,location=no,directories=no,status=no,menubar=no,width=650,height=400' 
setup += 'scrollbars=no,resizable=no'
pop = window.open ("","pop",setup) ;
pop.document.write('<head>'); 
pop.document.write('<Title>'); 
pop.document.write('Novinka'); 
pop.document.write('</Title>'); 
pop.document.write('<style>'); 
pop.document.write('background-position: center;'); 
pop.document.write('</style>'); 
pop.document.write('</head>'); 
pop.document.write('<body background="image/novinka.jpg"'); 

pop.document.write('</body>'); 

}


function sel_only_chbox(prefix, vyjmka){
	var inputs = document.getElementsByTagName('input');	
    var pref_len = prefix.length;
	for(i=0;i<inputs.length;i++){
      if((inputs[i].name.substring(0,pref_len) == prefix) && (vyjmka != '' && (inputs[i].name != vyjmka))){
        inputs[i].checked = false;
      }
    }
}


//

