// skok do adresu
function selecturl(s) { 
   var gourl = s.options[s.selectedIndex].value;  window.top.location.href = gourl; 
} 


function preLoadPic(index) {
 if (Pic[index] != ''){
         window.status='Loading : '+Pic[index]
         preLoad[index] = new Image()
         preLoad[index].src = Pic[index]
         Pic[index] = ''
         window.status=''
 }
}

function runSlideShow() {
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter= "blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play()
}
pos = j
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
preLoadPic(j)
}

function SprawdzEmail(AdresEmail) {
var TestEmail =/^[^@]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/i;
var Wynik = AdresEmail.match(TestEmail);
if (Wynik == null) {
alert("Niepoprawnie wpisany adres e-mail.");
return false;
}
return true;
}

function show_hide (objekt) {
if (document.all[objekt].style.display=='') 
   {document.all[objekt].style.display='none'; return '0';} 
else 
   {document.all[objekt].style.display=''; return '1';}
}

function movein(which) {
which.style.background='#85BBEA';
}

function moveout(which) {
which.style.background='#0DA0FD';
}

function windowopen(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}

function toWindowopen(frm) {
  if (open('', 'nowe_okno', 'width=550,height=350,left=200,top=100')) {
    frm.target = 'nowe_okno';
    setTimeout(function() { frm.submit(); }, 1000);
    return false;
  }
  else return true;
} 

function showmap(StrLng,StrLat, destination) {
var new_window = null;
new_window = window.open("http://maps.google.com/maps?daddr=" +destination+ "&saddr=" +StrLat+ "," +StrLng,"google_map", "toolbar=no, height=500, width=800, top=30, left=30, scrollbars=yes");
return true;
}

function deg2dms(liczba,latlng) {
if(latlng!='lat' && latlng!='lng') return;
if(liczba>0)
	var znak=0;
else
	var znak=1;
liczba = Math.abs(liczba);
var d = Math.floor(liczba);
var s = ((liczba - Math.floor(liczba))*3600);
var m = Math.floor(s/60);
s = (s - m*60).toFixed(0);
if(s<10)
	s='0'+s;
if(m<10)
	m='0'+m;
if(latlng=='lat')
	var sufix=['N','S'];
else
	var sufix=['E','W'];
return sufix[znak]+' '+d+'&deg; '+m+'&rsquo; '+s+'&quot;';
} 

function szukaj_na_mapie (szukaj) {
var str = szukaj;
window.location.href='./maps/'+ str.replace(/ /i, "_") +'.htm';
return false;
}