PicWnd     = 0;
PrzetWnd = 0;

function Napisz(pUser, pDomain, pSubject)
{
	var mailto = "mailto:";
	var maupa = "@";
	var temat = "?subject=";
	if ( arguments.length == 3 )
	{
		_target = mailto + pUser + maupa + pDomain + temat + pSubject;
	} else {
		_target = mailto + pUser + maupa + pDomain;
	}
	document.location = _target;
}

function BOpenPicWnd(vObrazek,vNr)
{      
	  if (PicWnd)
	     { if (PicWnd.closed) {PicWnd=0} 
	  	   else    {PicWnd.document.close();
	                PicWnd.window.close();
	    			PicWnd=0;}
		 }		
				
    PicWnd=window.open("", "", "toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, copyhistory=no, width=850, height=650, top=0, left=0");
	PicWnd.location="obrazek.php?o="+vObrazek+"&amp;nr="+vNr;	
	PicWnd.moveTo(10,10);  	                      
   PicWnd.focus();	
}

function BOpenPrzetWnd(vPrzet)
{      
	  if (PrzetWnd)
	     { if (PrzetWnd.closed) {PrzetWnd=0} 
	  	   else    {PrzetWnd.document.close();
	                PrzetWnd.window.close();
	    			PrzetWnd=0;}
		 }		
				
    PrzetWnd=window.open("", "", "toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=yes, scrollbars=yes, copyhistory=no, width=850, height=650, top=0, left=0");
	PrzetWnd.location="przet.php?prz="+vPrzet;	
	PrzetWnd.moveTo(10,10);  	                      
   PrzetWnd.focus();	
}


function OtworzOkno(obrazek)
{
window.open ('titlepage.html', 'Zdjecia', config='height=100,width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}

function mapa(adr)
{
	map = new Object;
	url = 'http://www.jaworzno.pl/mapa/mapa.php4'+'?RUN='+adr;
	map = open(url, "MAPA", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,Width=750,Height=500,screenX=0,screenY=0");
	map.focus();
}

function BGetObject(obj)
{
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function BReplaceText(tekst1,tekst2)
{ 
BGetObject("numerek").innerHTML = tekst1;
BGetObject("opisik").innerHTML = tekst2;
}	

function BReplaceText1(obj)
{ 
zopis = BGetObject(obj).alt;
//TYTUL
pom = zopis.indexOf(';');
poms = zopis.substring(0,pom);
BGetObject("fopis").innerHTML = poms;

//APARAT
zopis = zopis.substring(pom+1);
pom = zopis.indexOf(';');
poms = zopis.substring(0,pom);
if (poms=='') {poms="&nbsp;"};
BGetObject("faparat").innerHTML = poms;

//ISO
zopis = zopis.substring(pom+1);
pom = zopis.indexOf(';');
poms = zopis.substring(0,pom);
if (poms=='') {poms="&nbsp;"};
if (poms!=0) {BGetObject("fiso").innerHTML = poms;};

//F
zopis = zopis.substring(pom+1);
pom = zopis.indexOf(';');
poms = zopis.substring(0,pom);
if (poms=='') {poms="&nbsp;"};
BGetObject("ff").innerHTML = poms;

//T
zopis = zopis.substring(pom+1);
pom = zopis.indexOf(';');
poms = zopis.substring(0,pom);
if (poms=='') {poms="&nbsp;"};
BGetObject("ft").innerHTML = poms;

//ORIENTACJA
zopis = zopis.substring(pom+1);
pom = zopis.indexOf(';');
poms = zopis.substring(0,pom);
if (poms==0) {poms='POZIOMA';} else {poms='PIONOWA';};
BGetObject("forientacja").innerHTML = poms;

//FORMAT
zopis = zopis.substring(pom+1);
pom = zopis.indexOf(';');
poms = zopis.substring(0,pom);
if (poms=='') {poms="&nbsp;"};
BGetObject("fformat").innerHTML = poms;

//UWAGI
zopis = zopis.substring(pom+1);
if (poms=='') {poms="&nbsp;"};
BGetObject("fuwagi").innerHTML = zopis;
}	
