/*
Last edit 16.9.2005 10:26:11
*/




function send2friend(name, script) {
  
  attrbts = "height=380,width=360,status=yes,toolbar=no,menubar=no,location=no,resizable=no, scrollbars=no, top=50, left=50'";
  okenko = window.open(script + 'send2friend/send2friend.php?' + name, "PEJA", attrbts);
  
  if (okenko) {
     return false;
  } 
  return true;
  
}  




/* definujte homepage */
var homepage = "http://www.akro.cz/";




/** registrace fce, ktera se spusti po nacteni stranky v prohlizeci */
addEvent(window,'load',markinit);


/** fce init se spusti po nacteni stranky a skryje tlacitka tech
    fci, ktere dany prohlizec nepodporuje. V podstate budou obe fce ukryty
    ve vsech prohlizecich krom IE, protoze je nepodporuji */
function markinit() {
  if (checkBrowser("msie") && !document.addEventListener) { 
      var h = getElement("home").className = 'visible';  
     var f = getElement("bookmark").className = 'visible';  
  }
  var p = getElement("print").className = 'visible';
} 

/** fce ulozi adresu aktualniho dokumentu do oblibenych s popiskem title  u IE*/
function addFavorite(addUrl, addTitle) {
  if (document.all) {
    window.external.AddFavorite(addUrl, addTitle);
    return false;
  } 
  return false;
}

/** fce, ktera v IE nastavi domacistranku u IE*/
function setAsHomepage() {
   if (checkBrowser("msie")) {
     document.body.style.behavior='url(#default#homepage)';
     document.body.setHomePage(homepage);
   } 
}

/** fce pro rozpoznani prohlizece */
function checkBrowser(string) {
  var detect = navigator.userAgent.toLowerCase();
  var place = detect.indexOf(string) + 1;
  return place;
}

/** fce nalezeni elementu */
function getElement(id) {
  if(document.getElementById) return document.getElementById(id);
  if(document.all) return document.all(id);
  return document.layers[id];
}

/** fce vytiskne stranku */
function printMe() {
  window.print();
}

/** fce registruje funkce na udalosti objektu */
function addEvent(obj, evType, fn) {
  if(obj.addEventListener) {
	  obj.addEventListener(evType,fn,true);
		return true;
	} else if(obj.attachEvent) {
	  var r = obj.attachEvent("on"+evType,fn);
		return r;
	}
  return false;
}


/* erase input on focus */

function erase(object){
	if(document.getElementById(object).value==document.getElementById(object).defaultValue){
		document.getElementById(object).value="";
	}
}	

/* UnErase input on blur */	
	
function unErase(object){
	if(document.getElementById(object).value==""){
			document.getElementById(object).value=document.getElementById(object).defaultValue;
	}
}

/* open calendar */

function openCalendar(url){
  attrbts = "height=170,width=170,status=no,toolbar=no,menubar=no,location=no,resizable=no, scrollbars=no, top=50, left=50";
  window.open(url+'calendar.php', "calendar", attrbts);
}

function openGraphCalendar(url){
  attrbts = "height=170,width=170,status=no,toolbar=no,menubar=no,location=no,resizable=no, scrollbars=no, top=50, left=50";
  window.open(url+'graphcalendar.php', "graphcalendar", attrbts);
}
function openCalendar2(url){
  attrbts = "height=170,width=170,status=no,toolbar=no,menubar=no,location=no,resizable=no, scrollbars=no, top=50, left=50";
  window.open(url+'calendar2.php', "calendar", attrbts);
}
function openInfoCalendar(url){
  attrbts = "height=170,width=170,status=no,toolbar=no,menubar=no,location=no,resizable=no, scrollbars=no, top=50, left=50";
  window.open(url+'infocalendar.php', "infocalendar", attrbts);
}

/* send data to opener window */

function sendDate(month,day){
	if (window.opener && !window.opener.closed){
	  window.opener.document.getElementById('day').value = day;
	  window.opener.document.getElementById('month').value = month;
	  window.close();
	}
}
function sendGraphDate(year,month,day){
	if (window.opener && !window.opener.closed){
		window.opener.document.getElementById('graphyear').value = year;
	  window.opener.document.getElementById('graphday').value = day;
	  window.opener.document.getElementById('graphmonth').value = month;
	  window.close();
	}
}
function sendInfoDate(year,month,day){
	if (window.opener && !window.opener.closed){
		window.opener.document.getElementById('infoyear').value = year;
	  window.opener.document.getElementById('infoday').value = day;
	  window.opener.document.getElementById('infomonth').value = month;
	  window.close();
	}
}

/* IE (KB912945) & Opera9+ ActiveX focus fix */








