var loadstatustext="<img src='image/loading.gif' /> Budnet.pl ..."

// pierwsza część kodu 
var ObiektXMLHttp = false; 
if (window.XMLHttpRequest) { 
	ObiektXMLHttp = new XMLHttpRequest(); 
} else if (window.ActiveXObject) { 
	ObiektXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
} 

// druga część kodu 
function getData(zrodlo, cel) { 
	if(ObiektXMLHttp) { 
		var cel = document.getElementById(cel); 
		ObiektXMLHttp.open("GET", zrodlo); 
		ObiektXMLHttp.onreadystatechange = function() 
		{
			if (ObiektXMLHttp.readyState == 4) { 
				cel.innerHTML = ObiektXMLHttp.responseText; 
			}
		} 
// trzecia część kodu 
ObiektXMLHttp.send(null); 
	}
} 


/* POPUP GALERIA */

PositionX = 272;
PositionY = 120;
defaultWidth  = 250;
defaultHeight = 120;
var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape") ? 1 : 0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1) ? 1 : 0;
	var isOp=(navigator.userAgent.indexOf("Opera")!=-1) ? 1 : 0; 
} 
	
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=274,height=468,left='+PositionX+',top='+PositionY;
var optOp='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+
PositionX+',top='+PositionY;	

function popImage(imageURL, imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	if (isOp){imgWin=window.open('about:blank','',optOp);}	
	
	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);');
	
		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;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<a href="javascript:window.close();"><img name="George" src='+imageURL+' border="0" style="display:block"></a></body></html>');
		close();
		imgWin.document.close();
	}
}

function load() {
	      if (GBrowserIsCompatible()) {
	        var map = new GMap2(document.getElementById("map"));
	        map.addControl(new GSmallMapControl());
	        //map.addControl(new GMapTypeControl());
	        map.setCenter(new GLatLng(52.473057, 16.992588), 15);
	
	        // Our info window content
	        var infoTabs = [
	          new GInfoWindowTab("STARPIPE Polska", "<b>STARPIPE Polska</b><br>ul. Gdyńska 51<br> 62-004 Czerwonak k/Poznania")
	        ];
	
	        // Place a marker in the center of the map and open the info window
	        // automatically
	        var marker = new GMarker(map.getCenter());
	        GEvent.addListener(marker, "click", function() {
	          marker.openInfoWindowTabsHtml(infoTabs);
	        });
	        map.addOverlay(marker);
	        marker.openInfoWindowTabsHtml(infoTabs);
	      }
	    }

/* przemieszcza strone do wskazanej etykiety */
function etykieta(nr){
  if(nr!=''){
  		window.location = '#lista'+nr;
  }
}

function switch_div(id){
	if(id.style.display=="none"){
		id.style.display="";
	}else{
		id.style.display="none";
	}
}

function switch_div_img(id,img){
	if(id.style.display=="none"){
		id.style.display="";img.src="image/strzalka2c.png";
	}else{
		id.style.display="none";img.src="image/strzalka3c.png"
	}
}

function _mi(oB) {
  oB.style.backgroundColor = "#F5F5F5";
}
function _mo(oB) {
  oB.style.backgroundColor = "#FFFFFF";
}

var u = 0;

var to;

var iv = 2000;

function changeC(id, newClass) {

	identity=document.getElementById(id);

	identity.className=newClass; 

}



function showMB(p) {

	document.getElementById("mb" + p).style.display = "";

	if (p == on) {

		document.getElementById("mb" + p).style.backgroundColor = "#79888E";

	}

}



function hideMB(p) {

	document.getElementById("mb" + p).style.display = "none";

	//document.getElementById("mb" + p).style.backgroundColor = "#5784A5";

}



function omo(p) {

	cT();

	for (i=1; i<=zak; i++) {

		if (i==p) {

			showMB(i);

			if (i == on) {

				changeC("z" + i, "on");

			} else {

				changeC("z" + i, "onH");

			}

		} else {

			hideMB(i);

			if (i == on) {

				changeC("z" + i, "on");

			} else if (i > (zak - zakR)) {

				changeC("z" + i, "em");

			} else {

				changeC("z" + i, "onL");

			}

		}

	}

}



function setDefault(p) {

	if (p !== on) {

		start();

		hideMB(p);

		if (p > (zak - zakR)) {

			changeC("z" + p, "em");

		} else {

			changeC("z" + p, "onL");

		}

	}

}



function oro(p) {

	to = setTimeout("setDefault(" + p + ");", iv);

}



function cT() {

	clearTimeout(to);

}



function oroS(p) {

	to = setTimeout("setDefault(" + p + ");", iv);

}



function start() {

	showMB(on);

	changeC("z" + on, "on");

}


