﻿// MAPA GOOGLE MAPS
    var map = null;
    var geocoder = null;
	var p_title = new Array();
	var p_info = new Array();
	var i=0;
	
	
   function showAddress(address, title, info) {
      if (geocoder) {
        geocoder.getLatLng (
          address,
          function(point) {
            if (!point) {
              alert("adresu: " + address + " nie znaleziono");
            } else {
              var marker = new GMarker(point);
			  marker.value = i;
			  p_title[i]=title;
			  p_info[i]=info;
              map.addOverlay(marker);
			  GEvent.addListener(marker,"click", function() {
					var myHtml = '<b>' + p_title[marker.value] + '</b><br/>' + p_info[marker.value];
					map.openInfoWindowHtml(point, myHtml);
				});
			  i=i+1;
            }
          } ); }
        }



    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        geocoder = new GClientGeocoder();
		showAddress("Gdyńska 51, 62-004 Czerwonak", "STAR PIPE POLSKA Sp. z o.o.", "Gdyńska 51,<br/>62-004 Czerwonak k. Poznania");
		showAddress("Kosmakova 28, 615 00 Brno", "ERDING a.s", "Kosmakova 28,<br/>615 00 Brno");
		showAddress("Puuvilla 19, 10 314 Tallinn", "AS Magma", "Puuvilla 19,<br/>10 314 Tallinn");
		showAddress("Kragujevská 398, 010 01 Žilina", "Energy trans, spol. s r.o.", "Kragujevská 398,<br/>010 01 Žilina");
		showAddress("Europos 110, LT 46351, Kaunas", "UAB TERMA", "Europos 110,<br/>LT 46351,<br/>Kaunas");
		map.setCenter(new GLatLng(53.124361,22.210693), 4);
      }
    }




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=yes,status=yes,resizable=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,status=yes,resizable=yes,width=274,height=468,left='+PositionX+',top='+PositionY;
var optOp='scrollbars=yes,status=yes,resizable=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;	

function popImage(image_url, imageTitle){
	var imageURL = "http://www.starpipe.american-systems.pl/"+image_url;
	
	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('<script>');
		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('</script>');
		if (!AutoClose) writeln('</head><body bgcolor="#000000" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor="#000000" 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();
	}
}

/* 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");

}

function zmien_lokacje(kat){			
	window.open(''+kat,'_self');
}



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=yes,status=yes,resizable=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,status=yes,resizable=yes,width=274,height=468,left='+PositionX+',top='+PositionY;
var optOp='scrollbars=yes,status=yes,resizable=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;	

function popImage(image_url, imageTitle){
	var imageURL = "http://www.starpipe.american-systems.pl/"+image_url;
	
	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('<script>');
		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('</script>');
		if (!AutoClose) writeln('</head><body bgcolor="#000000" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor="#000000" 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();
	}
}

/* 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");

}

function zmien_lokacje(kat){			
	window.open(''+kat,'_self');
}

