// BIGFOTO   -  (c) Marek Laco 1999
//              mlaco@alpha.euba.sk
//              http://www.euba.sk/~mlaco
//
// volne mozte sirit, len mi tu nechajte tento text. 
//
// pouzitie: Bigfoto(cesta,subor,sirka,vyska);
//     teda napr: Bigfoto('http://members.xoom.com/nevedko/imgs/','marek.gif',200,100);
//
//
// uprava 19.10.2001, aby sa zatvaralo okno po kliknuti na obrazok...

ie4 = false;

if ((navigator.appName == 'Microsoft Internet Explorer')  &&  (navigator.appVersion.substring(0, 1) >= 4)) ie4 = true;

function Bigfoto(path, file, width, height) {
var name2 = file.substring(1,4);
var name = "";

//------ neviem nazov fcie, tak na to ideme postupne:
for(i=0;i<name2.length;i++)
 if (((chr = name2.substring(i,i+1)) != '.') && (chr != "-"))
   name = name + chr;
//-------

iwidth = width;
iheight = height;

top_px=((screen.height / 2) - (height / 2) - 20);
left_px=((screen.width / 2) - (width / 2));

sbars="no";

if (screen.height < (height + 33)) {
sbars="yes"
if (ie4) width+=16; //sbars
top_px=5;
height=(screen.height-50-35);
}

if (screen.width < (width + 5)) {
sbars="yes"
if (ie4) height+=16; //sbars
left_px=5;
width=(screen.width-50);
}

msg=window.open("",name,"toolbar=no,directories=no,menubar=no,resizable=1,scrollbars="+sbars+",status=no,top="+top_px+",left="+left_px+",width="+width+",height="+height,"MIME-CONTENT=text/html");

//msg=document.open();

//msg=document.open("",name,"toolbar=no,directories=no,menubar=no,resizable=1,scrollbars="+sbars+",status=no,top="+top_px+",left="+left_px+",width="+width+",height="+height);

msg.document.writeln("<HTML><HEAD><TITLE>"+file+"</TITLE></HEAD>");

msg.document.writeln("<style>body {background-color: #F0F0F0; background-image: url(http://www.mlaco.sk/bicykel/imgs/loading.gif); background-repeat: no-repeat; background-position: 50% 80%; margin: 0px; padding: 0px;} </style><BODY>");
if (!ie4) msg.document.writeln("<DIV STYLE='position: absolute; left: 0px; top: 0px;'>");
msg.document.writeln("<a href='javascript:window.close()'><img src='"+path+file+"' border=0 width='"+iwidth+"' height='"+iheight+"'></a><br>");
if (!ie4) msg.document.writeln("</DIV>");
msg.document.writeln("</BODY></HTML>");
msg.document.close();
}
