window.onload = init;

function dropDownValidation(entered, alertbox)
{
// Emptyfield Validation by Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove this line and the two lines above.
with (entered)
{
if (value==null || value=="empty" || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 

function emptyvalidation(entered, alertbox)
{
// Emptyfield Validation by Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove this line and the two lines above.
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
} 

function preveriFormoStatistika(thisform){
	with (thisform)
	{
		if (emptyvalidation(imeKonja,"Polje ime konja je prazno!")==false) {imeKonja.focus(); return false;};
	}
}

function preveriFormoPrijavaNaDirko(thisform){
	with (thisform)
	{
		if (dropDownValidation(idKonja,"Izberite konja!")==false) {idKonja.focus(); return false;};
		if (dropDownValidation(idVoznika,"Izberite voznika!")==false) {idVoznika.focus(); return false;};
		if (dropDownValidation(idTrenerja,"Izberite trenerja!")==false) {idTrenerja.focus(); return false;};
	}
}

function dolociFocus($imeInputa){
	document.getElementById($imeInputa).focus();
}
/*
function odpri(){
	winpops=window.open('content/statistika/popKonji.php?idKonja=1','KONJI', 'toolbar=yes,directories=no,location=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=600');
}
*/
function odpri(param1){
var popurl="content/statistika/popKonji.php?idKonja="+param1+""
winpops=window.open(popurl,"","width=400,height=400,scrollbars=yes,toolbar=no")
}

function odpriNastopi(param1){
var popurl="content/statistika/popNastopi.php?idKonja="+param1+""
winpops=window.open(popurl,"","width=800,height=600,scrollbars=yes, status=1, toolbar=yes")
}

//pop up 
ns4 = document.layers
ie4 = document.all 
nn6 = document.getElementById && !document.all 

function hideObject() {
   if (ns4) {
      document.n1.visibility = "hide";
   }
   else if (ie4) {
      document.all['n1'].style.visibility = "hidden";
   }
   else if (nn6) {
      document.getElementById('n1').style.visibility = "hidden";
   }
}

// Show/Hide functions for pointer objects

function showObject(id) {
   if (ns4) {
      document.n1.visibility = "show";
   }
   else if (ie4) {
      document.all['n1'].style.visibility = "visible";
   }
   else if (nn6) {
      document.getElementById('n1').style.visibility = "visible";
   }
}

function init(){
	hideObject();
}