// google maps
var map = null;
var geocoder = null;

function gload(szer, dlug, tekst) {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById('map_canvas'));
    map.setCenter(new GLatLng(szer, dlug), 13);
  }
  map.openInfoWindow(new GLatLng(szer, dlug), tekst);
  map.addControl(new GSmallMapControl());
  map.addOverlay(new GMarker(new GLatLng(szer, dlug)), 13);
}
// google maps end

// funkcje

function podmien_flash(kolor) {
	temp = "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=980 HEIGHT=200> <PARAM NAME=movie VALUE=\"grafika/flash/";
	if (flaga) {
		temp += ob1;
	}
	else {
		temp += ob2;
	}
	temp += "\"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE='";
	temp += kolor + "'> <EMBED src=\"grafika/flash/";
	if (flaga) {
		temp += ob1;
		flaga = 0;
	}
	else {
		temp += ob2;
		flaga = 1;
	}
	temp += "\" quality=high bgcolor='";
	temp += kolor + "' WIDTH=980 HEIGHT=200 TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></EMBED></OBJECT>";
//	alert (temp);
	document.getElementById("obrazflash").innerHTML = temp; 
}


function podmien(obrazek,nowy_obrazek){
	if (!document.getElementById) return;
	
	imageRef = document.getElementById(obrazek);
	eval ("document.images[imageRef.id].src =" + nowy_obrazek + ".src");
}

// newsletter
function sprawdz_newsletter(){
	if (document.newsletter.akcja.value == ""){
		alert('Kliknij "zapisz się" albo "wypisz się".');
		return false;
	}
}

function newsletter_akcja(co_robi){
	if (sprawdz_email()){
		document.newsletter.akcja.value = co_robi; 
		document.newsletter.submit();
	}	
}

function sprawdz_email(){
	f = document.newsletter;

   if (!validateNotNull(f.e_mail, 'E-mail')) return false;
   if (!validateMatch(f.e_mail, email_exp, 'E-mail','j.kowalski@abc.pl')) return false;
   
   return true;
}

function naewsletter_akcja(co_robi){
	if (saprawdz_email()){
		document.newsletter.akcja.value = co_robi; 
		document.newsletter.submit();
	}	
}

function saprawdz_email(){
	f = document.newsletter;

   if (!validateNotNull(f.email, 'E-mail')) return false;
   if (!validateMatch(f.email, email_exp, 'E-mail','j.kowalski@abc.pl')) return false;
   
   return true;
}

// wyskakuj±ce okienko
function okno (plik, szerokosc, wysokosc) {
	eval("window.open (plik, 'okienko', 'toolbar=0, status=1, directories=0, location=0, menubar=0, resizable=1, left=20, top=20, scrollbars=yes, width=" + szerokosc + ", height=" + wysokosc + "')");
}

function openWindow(theURL,winName,wtitle,szer,features){ 
	var scr="<head><title>" + wtitle + "</title><script language='javascript'>;" +
	"var NS = (navigator.appName==\"Netscape\")?true:false;" +
	"function fitPic() {" +
	"iWidth=(NS)?window.innerWidth:document.body.clientWidth;iHeight=(NS)?window.innerHeight:document.body.clientHeight;" +
	"iWidth=document.images[0].width-iWidth;iHeight=document.images[0].height-iHeight;" +
	"window.resizeBy(iWidth,iHeight+4);self.focus();" +
	"\}" +
	"<\/script><\/head>"
    window1=window.open("",winName, features)
    window1.document.write("<html>" + scr + "<BODY onload='fitPic();' topmargin='0' marginheight='0' leftmargin='0' marginwidth='0'>" +
	"<a href=\"#\" onClick='window.close();'><img src='" + theURL + "' border='0' width='" + szer + "'><\/a><\/BODY><\/HTML>")
    window1.document.close()
}


