function windowOnLoad(){
	//setLinkBehaviours();
	externalLinks();
}
window.onload = windowOnLoad;

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

function objGetElm(ElmID)
{
	if (typeof ElmID != "string") return ElmID;
	else if (Boolean(document.getElementById)) return document.getElementById(ElmID);
	else if (Boolean(document.all)) return eval("document.all."+ElmID);
	else return null;
}


//vypise properties objectu pro debug
function  printProps(obj, objName) {
  var output = "" ;
  for (var prop in obj) {
    output += objName + "." + prop + " = " + obj[prop] + "<br />\n" ;
  }
  return output ;
}

function popUpProps(obj)
{
	subwin=window.open("","","height=700,width=550,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no");
    	subwin.document.write('<html><head></head>\n');
    	subwin.document.write('<body>'+printProps(obj, "obj")+'</body>\n');
    	subwin.document.write('</html>\n');
	subwin.focus();
}

function popUpImageKill()
{
   if (typeof(subwin)=='undefined')
    return;
   if (typeof(subwin.closed)=='undefined')
    return;
   if (subwin.closed==true)
    return;
   subwin.close();
}

function popUpImage(anch, width, height)
{
	var targetUrl = anch.href;
	var title = anch.firstChild.alt;
	popUpImageKill();
 //  	popUpProps(subwin);return false;

   	swleft  = Math.round((screen.width - width)/2);
   	swtop   = Math.round((screen.height - height)/3);

	subwin=window.open("","","height="+height+",width="+width+", left="+swleft+", top="+swtop+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
    	subwin.document.write('<html><head><title>'+title+'</title><style>body {background: #000; margin: 0px; padding: 0px; width:'+width+'; height:'+height+'}</style></head>\n');
    	subwin.document.write('<body><img width="'+width+'" height="'+height+'" src="'+targetUrl+'" onclick="window.close();" /></body>\n');
    	subwin.document.write('</html>\n');

	subwin.focus();
}
