/*
 Skrypt globalny dla nieruchomosci swiatokien.eu
*/

function Obiekt(jaki){
  var wynik;
  if (!document.layers&&!document.all){
   if (document.getElementById){
     wynik=document.getElementById(jaki);
    return (wynik);
   }
   return (wynik);
  }
  if (document.layers){
    wynik=document.layers[jaki];
   return (wynik);
  }
  if (document.all){
    wynik=document.all[jaki];
   return (wynik);
  }
 return (wynik);
}

function powiekszfoto(dx,dn,r){
 var xleft=screen.width/2-(180*3/2);
 var xtop=screen.height/2-(120*3/2);
 var wnd=open('./foto.php?r='+r+'&dx='+dx+'&dn='+dn,'_blank','width='+(180*3)+',height='+(120*3)+',top='+xtop+',left='+xleft+',history=no,scrollbars=auto');
}

//Gradual-Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
function high(which2){
 theobject=which2;
 highlighting=setInterval("highlightit(theobject)",50);
}
function low(which2){
 clearInterval(highlighting);
 if (which2.style.MozOpacity) which2.style.MozOpacity=0.3;
 else if (which2.filters) which2.filters.alpha.opacity=20;
}
function highlightit(cur2){
 if (cur2.style.MozOpacity<1) cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1;
 else if (cur2.filters&&cur2.filters.alpha.opacity<100) cur2.filters.alpha.opacity+=10;
 else if (window.highlighting) clearInterval(highlighting);
}

function open_window(idx){
  var wnd=Obiekt(idx);
  wnd.style.display="block";
 return;
}

function close_window(idx){
  var wnd=Obiekt(idx);
  wnd.style.display="none";
 return;
}

var gfx_wnd=true;
function gfx(idxDiv,idxImg){
  var imgsrc=Obiekt(idxImg);
  if (!gfx_wnd){
	 open_window(idxDiv);
	 imgsrc.src='./gfx/designe/close.png';
	 imgsrc.title='Zwi galeri...';
  }else{
	 close_window(idxDiv);
	 imgsrc.src='./gfx/designe/refresh.png';
	 imgsrc.title='Rozwi galeri...';
  }
  gfx_wnd=!gfx_wnd;
 return;
}

