﻿//<script language="JavaScript">
var dayarray=new Array("Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota")
var montharray=new Array("januar","februar","marec","april","maj","junij","julij","avgust","september","oktober","november","december")

	var timer = null

	function stop()
	{
	clearTimeout(timer)
	}

	function getStaticDate(){
		var mydate=new Date()
		var year=mydate.getYear()
		if (year < 1000)
		year+=1900
		var day=mydate.getDay()
		var month=mydate.getMonth()
		var daym=mydate.getDate()
		//if (daym<10)
		//daym="0"+daym
		var hours=mydate.getHours()
		var minutes=mydate.getMinutes()
		var seconds=mydate.getSeconds()

		{
		 d = new Date();
		 Time24H = new Date();
		 Time24H.setTime(d.getTime() + (d.getTimezoneOffset()*60000) + 3600000);
		}
		if (hours==0)			hours=12
		if (minutes<=9)			minutes="0"+minutes
		if (seconds<=9)			seconds="0"+seconds
		//change font size here
		var cdate=dayarray[day]+", "+daym+". "+montharray[month]+" "+hours+":"+minutes+":"+seconds
		if (document.all)
			document.all.clock.innerHTML=cdate
		else if (document.getElementById)
				document.getElementById("date").innerHTML=cdate
			else
				document.write(cdate)

	//	timer = setTimeout("getthedate()",1000)
		}

	function getthedate(){
		var mydate=new Date()
		var year=mydate.getYear()
		if (year < 1000)
		year+=1900
		var day=mydate.getDay()
		var month=mydate.getMonth()
		var daym=mydate.getDate()
		//if (daym<10)
		//daym="0"+daym
		var hours=mydate.getHours()
		var minutes=mydate.getMinutes()
		var seconds=mydate.getSeconds()

		{
		 d = new Date();
		 Time24H = new Date();
		 Time24H.setTime(d.getTime() + (d.getTimezoneOffset()*60000) + 3600000);
		}
		if (hours==0)			hours=12
		if (minutes<=9)			minutes="0"+minutes
		if (seconds<=9)			seconds="0"+seconds
		//change font size here
		var cdate=dayarray[day]+", "+daym+". "+montharray[month]+" <br/>"+hours+":"+minutes+":"+seconds
		if (document.all)
			document.all.clock.innerHTML=cdate
		else if (document.getElementById)
				document.getElementById("clock").innerHTML=cdate
			else
				document.write(cdate)

	//	timer = setTimeout("getthedate()",1000)
		}

	if (!document.all&&!document.getElementById)
	getthedate()

	function goforit(){
		if (document.all||document.getElementById)
		setInterval("getthedate()",1000)
		timer = setTimeout("getthedate()",1000)
	}


   function swapClass(obj, cls) {
     obj.className = cls;
   }

/***** ISKALNIK *****/

function isci(a) {
	if (document.all)
		location.href= "podrocje.aspx?id=589&q=" + a;
	else
		location.href= "podrocje.aspx?id=589&q=" + a;
}

function handlePress(e) {
	code = 0;
	if(window.event) {	//IE
		code = e.keyCode;
		if(code == 13) e.keyCode = 0;
	}
	else if(e.which) {	//Firefox
			code = e.which;
	}

	if(code == 13) {
		location.href = "podrocje.aspx?id=589&q=" + document.myForm.q.value;
		if (e.preventDefault) e.preventDefault();
	}
}



/*			SLIKA TEDNA 		*/
function newWin(imgSrc)
{
	winWidth = 200;
	winHeight= 200;
	var openWin = window.open(imgSrc,"winNameHere","width="+winWidth+",height="+winHeight+",scrollbars=0,status=0");
	openWin.focus();
}

/*  		POSLJI PRIJATELJU			*/

function POPUP (aUrl, aName, aX, aY) {
	Win1=window.open (aUrl, aName, 'toolbar=no,width='+aX+',height='+aY+',directories=no,status=no,scrollbars=no,resize=no,menubar=no,location=no,copyhistory=no');
/*    if (Win1!=null)
 	{  	if (Win1.closed)  Win1=window.open (aUrl, aName, 'toolbar=no,width='+aX+',height='+aY+',directories=no,status=no,scrollbars=no,resize=no,menubar=no,location=no,copyhistory=no');
	}
    else
     Win1=window.open (aUrl, aName, 'toolbar=no,width='+aX+',height='+aY+',directories=no,status=no,scrollbars=no,resize=no,menubar=no,location=no,copyhistory=no');
*/
}


/*  		STATISTIKA 			*/
	function statWinPodrocje(id)
	{
		var objDanes=new Date();
		var dan = objDanes.getDate();
		var mesec = objDanes.getMonth()+1;
		var leto = objDanes.getFullYear();
		var datum = dan.toString() + "." + mesec.toString() + "." + leto.toString();

		if (mesec == 3) if (dan>28)	dan=28;
		if (dan>30)	dan=30;
		if (mesec>1)	mesec=mesec-1;
		else {mesec=12; leto=leto-1; }

		var datumOd = dan.toString() + "." + mesec.toString() + "." + leto.toString();

		var openWin = window.open("statistika/StatPodrobno.aspx?tip=podrocja&xid=" + id + "&od=" + datumOd.toString() + "&do=" + datum.toString() + "&jid=1060","Statistika","width=500,height=700,scrollbars=0,status=0");
		openWin.focus();
	}

	function statWinPovezava(id, tip)
	{
		var objDanes=new Date();
		var dan = objDanes.getDate();
		var mesec = objDanes.getMonth()+1;
		var leto = objDanes.getFullYear();
		var datum = dan.toString() + "." + mesec.toString() + "." + leto.toString();

		if (mesec == 3) if (dan>28)	dan=28;
		if (dan>30)	dan=30;
		if (mesec>1)	mesec=mesec-1;
		else {mesec=12; leto=leto-1; }

		var datumOd = dan.toString() + "." + mesec.toString() + "." + leto.toString();

		var openWin = window.open("statistika/StatPodrobno.aspx?tip=" + tip.toString() + "&xid=" + id + "&od=" + datumOd.toString() + "&do=" + datum.toString() + "&jid=1060","Statistika","width=500,height=700,scrollbars=0,status=0");
		openWin.focus();
	}


	function statWin(pid)
	{
		winWidth = 400;
		winHeight= 400;
		var openWin = window.open("stat.aspx?pid=" + pid,"Stats","width="+winWidth+",height="+winHeight+",scrollbars=0,status=0");
		openWin.focus();
	}
/*
	function statWinPodrocje(id)
	{
		winWidth = 400;
		winHeight= 400;
		var openWin = window.open("stat.aspx?id=" + id,"Stats","width="+winWidth+",height="+winHeight+",scrollbars=0,status=0");
		openWin.focus();
	}
*/

//</script>