/*Atlas ZP v Praze - horni lista 
C Hydrosoft Veleslavín s.r.o. 2006*/

var lnkId = null;
var lnk = null;
var c_on = "#C61000";
var c_off = "#000000";

function testJava () {
	if ( !getCookie("klientAZP")) {
		if ( navigator.javaEnabled()) {
			setCookie ("klientAZP","JAVA",null);
			zmenColor("lnk1");
		} else {
			setCookie ("klientAZP","HTML",null);
			zmenColor("lnk2");
		}
	} else {
		if (getCookie("klientAZP") == "JAVA") {
			zmenColor("lnk1");
		} else {
			zmenColor("lnk2");
		}
	}
}

function pis_datum () {
		
		var now = new Date();
		var yr = now.getFullYear();
		var mName = now.getMonth() + 1;
		var dName = now.getDay() + 1.;
		var m = now.getMinutes();
		var h = now.getHours();
		var dayNr = ((now.getDate()<10) ? "" : "")+ now.getDate();
		if(dName==1) Day = "neděle";
		if(dName==2) Day = "pondělí";
		if(dName==3) Day = "úterý";
		if(dName==4) Day = "středa";
		if(dName==5) Day = "čtvrtek";
		if(dName==6) Day = "pátek";
		if(dName==7) Day = "sobota";
		if(mName==1) Month="ledna";
		if(mName==2) Month="února";
		if(mName==3) Month="března";
		if(mName==4) Month="dubna";
		if(mName==5) Month="května";
		if(mName==6) Month="června";
		if(mName==7) Month="července";
		if(mName==8) Month="srpna";
		if(mName==9) Month="září";
		if(mName==10) Month="října";
		if(mName==11) Month="listopadu";
		if(mName==12) Month="prosince";
		
		// String pro zobrazeni data
		  var todaysDate =(Day + "&nbsp;" + dayNr + ".&nbsp;" + Month + "&nbsp;" + yr + "&nbsp;" +h+ ":" +m);
		
		// Vypsani data na stranku
		//document.open();
		document.write( todaysDate);
		}

function pis_rok () {
		
		var now = new Date();
		var yr = now.getFullYear();
		
		
		// String pro zobrazeni data
		  var todaysYear =(yr);
		
		// Vypsani data na stranku
		//document.open();
		document.write( todaysYear);
		}
function write_date () {
		
		var now = new Date();
		var yr = now.getFullYear();
		var mName = now.getMonth() + 1;
		var dName = now.getDay() + 1.;
		var m = now.getMinutes();
		var h = now.getHours();
		var dayNr = ((now.getDate()<10) ? "" : "")+ now.getDate();
		
		if(dName==1) Day = "Sunday";
		if(dName==2) Day = "Monday";
		if(dName==3) Day = "Tuesday";
		if(dName==4) Day = "Wednesday";
		if(dName==5) Day = "Thursday";
		if(dName==6) Day = "Friday";
		if(dName==7) Day = "Saturday";
		if(mName==1) Month="January";
		if(mName==2) Month="February";
		if(mName==3) Month="March";
		if(mName==4) Month="April";
		if(mName==5) Month="May";
		if(mName==6) Month="June";
		if(mName==7) Month="July";
		if(mName==8) Month="August";
		if(mName==9) Month="September";
		if(mName==10) Month="October";
		if(mName==11) Month="November";
		if(mName==12) Month="December";
		
		// String pro zobrazeni data
		  var todaysDate =(Day + ",&nbsp;" + Month + "&nbsp;" + dayNr + ",&nbsp;" + yr+ "&nbsp;" +h+ ":" +m);
		
		// Vypsani data na stranku
		//document.open();
		document.write( todaysDate);
		}
		
function setCookie(name, value, expire) {
		   document.cookie = name + "=" + escape(value)  + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}

function getCookie(Name) {
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 
         // set index of end of cookie value
         if (end == -1) 
		 end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
     } 
  }
} 

function setKlient (klient) {
	if (klient == "JAVA") {
		setCookie("klientAZP", "JAVA", null);
		zmenColor('lnk1');
	} else {
		setCookie("klientAZP", "HTML", null);
		zmenColor('lnk2');
	}
}

function zmenColor (lnkId){
	if (lnk){
		divlnk = xGetElementById(lnk);
		xColor(divlnk, c_off);
		lnk = null;
	}
	divlnk = xGetElementById(lnkId);
	xColor(divlnk, c_on); 
	lnk = lnkId;
}
// window status function
function ws(txt) {
	window.status = txt;
	return true;
}