// ------------------------------------------ funkce pro otevirani novych oken
function okno(soubor) {
  window.open(soubor,'','toolbar=yes,scrollbars=yes,location=yes,status=yes,resizable=1,menubar=yes')
}

// ------------------------------------------ funkce pro zaskrtnuti vsech polozek
function CheckAll(f,el) {
	for (var i=0;i<f.elements.length;i++)
	{
		var e=f.elements[i];
		if (e.id==el) e.checked=f.check_all.checked;
	}
}

// ------------------------------------------ funkce pro presun z formularoveho prvku SELECT
function jdi_na() {
	location=document.skoc.go.options[document.skoc.go.selectedIndex].value
}

// ------------------------------------------ funkce pro pridani mezi oblibene
function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}

// ------------------------------------------ funkce pro pridani smajliku do fora
function insert_smile(type) {
	document.getElementById("cely_text").value=document.getElementById("cely_text").value+" "+type+" ";
	document.getElementById("cely_text").value.focus();
}

// ------------------------------------------ funkce pro emailu pro odeslani clanku
function validate_odeslat(formular)  {
 	if((formular.email.value.indexOf("@") < 1 || formular.email.value.indexOf("@") != formular.email.value.lastIndexOf("@") || formular.email.value.lastIndexOf(".") < formular.email.value.lastIndexOf("@")+2  || formular.email.value.lastIndexOf(".") > (formular.email.value.length-3) || formular.email.value.lastIndexOf(".") < (formular.email.value.length-4))) { 
		alert ("CHYBA: vyplňte prosím správně svůj email!");
		return false;
  }
}

// ------------------------------------------ funkce pro kontrolu vyberu ve vyhledavani
function validate_search(formular)  {
	if (formular.search_input.value=="") {
		alert ("CHYBA: zadejte prosím text, který chcete vyhledat!");
		formular.search_input.focus();
		return false;
  }
}

// ------------------------------------------ funkce pro kontrolu vyberu v ankete
function validate_anketa(formular)  {
	if ((!formular.anketa[0].checked) && (!formular.anketa[1].checked) && (!formular.anketa[2].checked) && (!formular.anketa[3].checked) && (!formular.anketa[4].checked)) {
		alert ("CHYBA: vyberte prosím alespoň jednu možnost!");
		return false;
  }
}

// ------------------------------------------ zmeni tridu (class) objektu s danym ID
function ZmenTridu(trida,id)  {
  document.getElementById(id).className = trida;
}

function online(id)   {
window.open('http://www.onlajny.cz/match/index/id/'+id,'','toolbar=no,scrollbars=yes,location=no,status=yes,width=790,height=530,resizable=1')
}

function online_zap(id) {  		  window.open('http://www.onlajny.cz/match/index/id/'+id,'','toolbar=no,scrollbars=yes,location=no,status=no,width=790,height=590,resizable=1')
}


// ------------------------------------------ fce pro boxy

function showBox1() {
	document.getElementById('nasledujici-div').style.display = 'none';
	document.getElementById('odehrane-div').style.display = 'block';
	document.getElementById('zapasy-link').className = 'odehrane-bg';
	return false;
}

function showBox2() {
	document.getElementById('odehrane-div').style.display = 'none';
	document.getElementById('nasledujici-div').style.display = 'block';
	document.getElementById('zapasy-link').className = 'nasledujici-bg';
	return false;
}

// ------------------------------------------ fce pro vysouvaci menu
var PocetMenu = 9;
function Show(CisMenu)    {
  var menu = document.getElementById('submenu'+CisMenu);	
  var menu2 = document.getElementById('menu'+CisMenu);	
  menu.style.visibility="visible";
  menu2.className="show";
}

function Hide() {
  var menu,menu2, i;
  for(i=1; i<=PocetMenu; i++) {
      menu = document.getElementById('submenu'+i);	
      menu.style.visibility="hidden";
	  menu2 = document.getElementById('menu'+i);	
      menu2.className="";
  }
}



//reklamni rotace
function prepni_obr(id,id2,number){
		document.getElementById("partner_img").src=id[number].src;
		document.getElementById("partner_url").href=id2[number];
}
				
img = new Array();
pocet_log=36;
for (i=1; i <=pocet_log ; i++) {
	img[i] = new Image();
	img[i].src = "ads/rotace/box_partner_"+i+".gif";
}
				
odkazy = new Array();
	odkazy[1]= "http://www.valasskemezirici.cz/ ";
	odkazy[2]= "http://www.mariuspedersen.cz/";
	odkazy[3]= "http://www.lidl.cz/cz/home.nsf/pages/c.service.au.company.index";
	odkazy[4]= "http://www.loziska-bearings.cz/";
	odkazy[5]= "http://www.stavebni-mechanizace.cz/";
	odkazy[6]= "http://www.auto-lukas.cz/index.php";
	odkazy[7]= "http://www.vasttercia.cz/";
	odkazy[8]= "http://www.ckvalaska.cz/";
	odkazy[9]= "";
	odkazy[10]= "http://www.dv-hockey.com/";
	odkazy[11]= "http://www.cabot.cz/";
	odkazy[12]= "http://www.ponast.cz/";
	odkazy[13]= "http://www.silesiawm.cz/";
	odkazy[14]= "http://www.colora.cz/";
	odkazy[15]= "";
	odkazy[16]= "";
	odkazy[17]= "http://www.deza.cz/vgs/deza/d.htm";
	odkazy[18]= "http://www.pstronic.cz/";
	odkazy[19]= "http://www.hockeyland.cz/";
	odkazy[20]= "";
	odkazy[21]= "http://www.moravaokno.cz/";
	odkazy[22]= "http://www.holassport.cz/";
	odkazy[23]= "http://www.epo.cz/";
	odkazy[24]= "http://www.kompakt.cz/";
        odkazy[25]= "http://www.ith.cz/index.html";
	odkazy[26]= "";
	odkazy[27]= "http://www.vahala.cz/";
	odkazy[28]= "http://valassky.denik.cz/";
  	odkazy[29]= "http://www.susvs.cz/";
	odkazy[30]= "http://www.autotransit.cz/index.php";
	odkazy[31]= "";
        odkazy[32]= "http://www.skalkalahudky.cz/";
	odkazy[33]= "http://www.kr-zlinsky.cz/";
	odkazy[34]= "http://www.megas-frenstat.cz/default.aspx";
	odkazy[35]= "http://www.daliartstudio.com/";
	odkazy[36]= "http://www.primamobil.cz/";



				
function opakovana_reklama(count){
	count=count+1;
	if (count==pocet_log+1) {
		count=1;
	}
	casovac=window.setTimeout("opakovana_reklama("+count+")", 2000); // volá sebe samu odloženou o sekundu
	prepni_obr(img,odkazy,count);
}
