function FP_preloadImgs() {
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
  
function Parodyti(vardas)
  { 
    //img= new Image();
    //img.src=(vardas);
	var width = 640;
	var height = 480;
	x = (screen.width - width) / 2;
	y = (screen.height - height) / 2;
	//x = 50;
	//y = 60;
    Langas = window.open("", "Preview", 
	  "toolbar=0,location=0,directories=0,status=yes,menubar=0,scrollbars=0,resizable=no,copyhistory=0,width=" + (width) +",height=" + (height) + ",left=" + x + ",top=" + y);
	Langas.moveTo(x, y);
	Langas.document.open();
	Langas.document.write("<html><head>");
	Langas.document.write("<title>Padubysio baidares</title>");
	Langas.document.write("</head>");
	Langas.document.write('<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"><center>');
	Langas.document.write('<img style="cursor:pointer" src=' + vardas + ' alt="Uždaryti langą" hspace=0 vspace=0 onclick="javascript:window.close()"/>');
	Langas.document.write("</center>");
	Langas.document.write("</body>");
	Langas.document.write("</html>");
	Langas.document.close();
	  
  }

function parodyti(vardas){
	var ilgis = 100;
	var aukstis = 100;
	var x = (screen.width - ilgis) / 2;
	var y = (screen.height - aukstis) / 2;
    Langas = window.open("rodyti.php?pic=" + vardas, "Preview", "toolbar=0,location=0,directories=0,status=yes,menubar=0,scrollbars=0," +
						 "resizable=yes,copyhistory=0,width=" + ilgis + ",height=" + aukstis + ",left=" + x + ",top=" + (y) );
}

function ParodytiMap()
  { 
    x = (screen.width - 800) / 2;
	y = (screen.height - 600) / 2;
    Langas = window.open("zemelapis.html", "Preview",  "toolbar=0,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=yes,copyhistory=0,width=800,height=600,left=" + x + ",top=" + y);
	Langas.moveTo(x, y);
  }
  
function siusti_mail(){
  var x = (screen.width - 360) / 2;
  var y = (screen.height - 340) / 2;
  MailLang = window.open("email.html", "Preview",  "toolbar=0,location=0,directories=0,status=yes,menubar=0,scrollbars=0,resizable=no,copyhistory=0,width=360,height=340,left=" + x + ",top=" + y);	
}
  
