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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PIKprint(opis)
{ 
var disp_setting="toolbar=no,location=no,directories=no,menubar=yes,"; 
	disp_setting+="scrollbars=yes,width=615, height=600"; 
var content_vlue = document.getElementById("zaw").innerHTML; 

var docprint=window.open("","",disp_setting); 
	docprint.document.open(); 
	docprint.document.write('<html><head><title>PIK - drukowanie strony</title>');
	docprint.document.write('<link href="css/printly.css" rel="stylesheet" type="text/css" media="all">');
	docprint.document.write('</head><body onLoad="self.print()"><center>');
	docprint.document.write('<div id="noselect"></div>');  
	docprint.document.write('<div id="opis"><h2>'+opis+'</h2></div>');   
	docprint.document.write(content_vlue); 
	docprint.document.write('</center></body></html>'); 
	docprint.document.close(); 
	docprint.focus(); 
}

function elewacja(plik) {
	window.open('/elewacja.php?plik='+plik,'elewacja','width=200,height=100,left='+(screen.availWidth/2-500)+',top='+(screen.availHeight/2-200)+',status=yes,resiazable=no,menubar=no,scroolbar=no');
}

function galeria(aktual,oferta) {
	window.open('/galeria_oferta.php?aktual='+aktual+'&oferta='+oferta,'elewacja','width=480,height=385,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-200)+',status=yes,resiazable=no,menubar=no,scroolbar=no');
}

function realizacja(nazwa,numer) {
	window.open('/txt/realizacja_'+nazwa+'_'+numer+'.html','realizacja','width=630,height=500,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-200)+',status=yes,resiazable=no,menubar=no,scroolbar=no');
}

function big_fotoreportaz(reportaz,id_photo) {
	window.open('/galeria_reportaz.php?reportaz='+reportaz+'&id_photo='+id_photo,'reportaz','width=480,height=385,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-200)+',status=yes,resiazable=no,menubar=no,scroolbar=no');
}

function elewacja_off(plik) {
	window.open(plik,'elewacja','width=200,height=100,left='+(screen.availWidth/2-500)+',top='+(screen.availHeight/2-200)+',status=yes,resiazable=no,menubar=no,scroolbar=no');
}

function galeria_off(plik) {
	window.open(plik,'elewacja','width=480,height=385,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-200)+',status=yes,resiazable=no,menubar=no,scroolbar=no');
}

function resize(szer,wys) {
	szer=szer+35;
	wys=wys+80;
	self.resizeTo(szer,wys);
}

function rozwin(co){
	with(document.getElementById(co)){className=className=='h'?'v':'h';}
}
function schowaj(co){
	with(document.getElementById(co)){className=className=='v'?'h':'v';}
}


// Stats
cstatus = "active";
visible = "0";
page_title = "Pracownia Projektowa PIK";
url_of_counter_file = "http://www.pik.pl/counter/counter.php";

page_url = unescape( location.href );
referrer = ( document.referrer ) ? document.referrer : "";
page_title = ( page_title.length == 0 ) ? document.title : page_title;
document.write( "<script type=\"text/javascript\" src=\"" );
document.write( url_of_counter_file + "?chCounter_mode=js&amp;jscode_version=3.0.0&amp;status=" + cstatus + "&amp;visible=" + visible + "&amp;page_title=" + encodeURIComponent( page_title ) );
document.write( "&amp;page_url=" + encodeURIComponent( page_url ) + "&amp;referrer=" + encodeURIComponent( referrer ) + "&amp;res_width=" + screen.width + "&amp;res_height=" + screen.height + "\"></" + "script>" );

