// JavaScript Document

window.onload = externalLinks;
windowid=0;

var timerID
var actual_Img = new Image()

function loadImg(url) {
	actual_Img = new Image();
	actual_Img.src  = url;
	checkLoad();
}

function checkLoad() {
	 if (actual_Img.height != 0) {
		showWin(actual_Img);
		return;
     }
	timerID = setTimeout("checkLoad()",10) 

}

function showWin(Img) {
	//alert(Img.height + "\n" + Img.width);
   imgWin("Kaizler",Img.src, Img.width+20, Img.height+20);
}

function imgWin(t,i,w,h) {
   windowid++; 
   id=name;	
   w=open("",windowid,"toolbar=no,directories=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h);
   w.document.write("<HTML><HEAD>");
   w.document.write("<TITLE>"+t+"</TITLE></HEAD>");
   w.document.write("<BODY leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><CENTER>");
   w.document.write("<IMG SRC=\""+i+"\">");
   w.document.write("</BODY></HTML></CENTER>");
}

/* Prida target=_blank vsem <a> s atribute rel=external
tribut target neexistuje v xhtml strict
*/
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"; 
 } 
} 
