function popImage(imageURL,imageTitle){
	
defaultWidth  = 500;
defaultHeight = 500;

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight;
var optIE='scrollbars=no,width=150,height=100';
	
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
writeln('<sc'+'ript>');
writeln('var isNN,isIE;')
;writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width)+20;');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');
writeln('window.innerHeight=document.images["George"].height+19;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');
writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}
}

function o(identyfikator) {
	return document.getElementById(identyfikator);
}

function ustawRozmiaryPopupa()
{
	var parametry = "";
	
	if (document.documentElement && document.documentElement.scrollTop)	 theTop = document.documentElement.scrollTop;
	else theTop = document.body.scrollTop;	
	o('powiekszenie').style.top = (theTop/2+((document.body.clientHeight)/2)-(obrazek.height/2)-45)+'px';	
	o('powiekszenie').style.left = (document.body.scrollLeft+((document.body.clientWidth)/2)-(obrazek.width/2)-5)+'px';
	
	o('powiekszenie').style.width = (obrazek.width+20)+"px";
	o('obrazek').style.width = (obrazek.width)+"px";
	o('obrazek').style.height = (obrazek.height)+"px";
	o('powiekszenie').style.width = (obrazek.width)+"px";
	o('powiekszenie').style.height = (obrazek.height+20)+"px";
}
		
var obrazek = new Image();
		
function popPrint2(){
	
	var picLayer = 	"<div class=\"powiekszenie\" id=\"powiekszenie\">"+
						"<div class=\"top\"><a href=\"#\" class=\"zamknij\" onClick=\"o('powiekszenie').style.display='none'; return false;\">x</a></div>"+
						"<div class=\"ladowanie\" id=\"ladowanie\">"+
						"<div class=\"obrazek\" id=\"obrazek\"></div>"+
						"</div>"+
						"</div>";
	document.body.innerHTML+=picLayer;
}

function popImage2(tPictureHref,tSymbol,tWidth,tHeight) {

	if(o("powiekszenie")==null){

		popPrint2();	
	}
	
	o('obrazek').style.backgroundImage = "url("+tPictureHref+")";
	o('powiekszenie').style.display = "block";
	
	width = tWidth;
	height = tHeight;
	
	o('powiekszenie').style.width = (width+20)+"px";
	o('obrazek').style.width = (width)+"px";
	o('obrazek').style.height = (height)+"px";
	o('powiekszenie').style.width = (width)+"px";
	o('powiekszenie').style.height = (height+20)+"px";
	
	if (document.documentElement && document.documentElement.scrollTop)	 theTop = document.documentElement.scrollTop;
	else theTop = document.body.scrollTop;	
	o('powiekszenie').style.top = (theTop/2+((document.body.clientHeight)/2)-(height/2)-45)+'px';	
	o('powiekszenie').style.left = (document.body.scrollLeft+((document.body.clientWidth)/2)-(width/2)-5)+'px';
}

function popImage3(tPictureHref,tSymbol,tWidth,tHeight) {				
	
	if(document.getElementById("shimg")==null){
		var picLayer = 	"<div id=\"shimg\" name=\"shimg\" style=\"position:absolute; left:0px; top:0px; width:100px; padding:5px 10px 10px 10px; border:1px solid #dddddd; background:#ffffff;\">"+
						"<div id=shimghead style=\"height:15px; margin-bottom:5px; font-size:12px; text-align:right;\"></div>"+
						"<div id=shimgi style='text-align:center;'>"+
						"<a href='javascript:popImage2Close();'><IMG id=pshimg src=\"include/templates/www/images/spacer.gif\" style=\"border:1px solid #dddddd\"></a>"+
						"</div>"+
						"</div>";

		document.body.innerHTML+=picLayer;
	}
	document.images.pshimg.src="";
	sshimg = document.getElementById("shimg");
	ifimg = document.getElementById("ifimg");	
	sshimghead = document.getElementById("shimghead");
	
	iHH=iH=tHeight; iWW=iW=tWidth;
	
	if (iW<305) { iWW=305; }
	if (iH+70>document.body.clientHeight) {
		scaled=1; iH=document.body.clientHeight-120;
		if (iH<300) iHH=300;
		iW=(iW*iH)/tHeight;
		}
		 
	sshimg.style.width = iW+'px';
	sshimg.style.height = iH+20+'px';
	
	if (document.documentElement && document.documentElement.scrollTop)	 theTop = document.documentElement.scrollTop;
	else theTop = document.body.scrollTop;
	
	sshimg.style.top=(theTop/2+((document.body.clientHeight)/2)-(iHH/2)-45)+'px';	
	sshimg.style.left=(document.body.scrollLeft+((document.body.clientWidth)/2)-(iWW/2)-5)+'px';
	
	document.images.pshimg.width=iW;
	document.images.pshimg.height=iH;
	document.images.pshimg.src=tPictureHref;
	//sshimgfoot.width=iW;
	sshimg.style.visibility='visible';
	sshimghead.innerHTML='<a href="javascript:popImage2Close();" style="color:#ffffff; background:#999999; padding:1px 4px 1px 4px; font-weight:bold; font-family:Verdana,sans-serif; font-size:12px; text-decoration:none;">X</a>';
	//sshimghead.innerHTML+='<img src="{#$www_templates_url#}/images/spacer.gif" height=13 width=1>'+tSymbol+'';
			
}

function popImage2Close(){
	sshimg.style.visibility='hidden';
	document.images.pshimg.src = "";
}


function openPage(theUrl,W,H){
    var theWin ="'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+W+",height="+H+"'"
	littleWin = window.open(theUrl,'',theWin);
	//littleWin.resizeTo(W+10,H+29);
 	littleWin.focus();
}


function OmnibusZZSubmit(typ){

	var form = document.forms['form_omnibus_zz'];

	form.form_type.value = typ;
	form.submit();
}


/*********************************************************/
/* Web Pages Menu                                        */
/*********************************************************/

function showSubMenu(obj){

	var selectObj = document.getElementById( obj );
	if (selectObj==null)	return;
	
	if (selectObj.style.display != ""){
		//alert('tak');
		selectObj.style.display = "";
	}
	else 
		selectObj.style.display = "none";
	
	return;
}

function hideSubMenu(obj){
	
	if ( obj!="" ){
		var selectObj = document.getElementById( obj );

		if (selectObj != null)
			selectObj.style.display = "none";
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}