<!-- //
/*
Skrypty JS na stronie www.wgn.pl
copyright: e-century.com, www.e-century.com.pl
author: Tomasz Kamiński
*/

/* Zmiana koloru stylu */
function chgstyle_on(obn){
obj = document.getElementById(obn);
obj.style.textDecoration='underline';
}


function chgstyle_of(obn){
obj = document.getElementById(obn);
obj.style.textDecoration='none';	
}

/* dynamiczna pelnoekranowa prezentacja list ofert */
var i = 0;
var done = 0;
function counter() {
obj = document.getElementById("countid");
if(totalSecs != null && totalSecs > i) timerId = setTimeout("counter()", 1000);
if(i < totalSecs) {
  i += 1;
   obj.innerHTML = totalSecs - i;
 } else {
   location.href=jumpurl;   
 } 
}


/* zmiana zdjec na stronie glownej */

var l = 0
var max=0
var avg=0
var stotalSecs = 9
var si = stotalSecs
var simgarr  = new Array()
//var simgarr2 = new Array()


function slidercount() {	
	if(stotalSecs != null) timerId = setTimeout("slidercount()", 1000);
	if(si>0) {		
  		si -= 1
 	} else {
   		sputImages();
   		si=stotalSecs
    }    
}

function slidercountRap() {	
	if(stotalSecs != null) timerId = setTimeout("slidercountRap()", 1000);
	if(si>0) {		
  		si-= 1
 	} else {
   		sputImagesRap();
   		si=stotalSecs
    }    
}

function slidercountRap2() {	
	if(stotalSecs != null) timerId = setTimeout("slidercountRap2()", 1000);
	if(si>0) {		
  		si -= 1
 	} else {
   		sputImagesRap2();
   		si=stotalSecs
    }    
}


function sputImages(){
  dc = document.getElementById('imag')
  str = '<table border=0 cellspacing="0" cellpadding="0" width="95%" align="center"><tr>'
  na=0
  for(a=0;a<3;a++){  	
  	//na = a+(l*3)
  	na = a;
  	lang_str = (simgarr[na]['lang']!=main_lang)?'?lng='+simgarr[na]['lang']:''
    str += '<td align="center"><a href="/i/n,'+simgarr[na]['id']+','+simgarr[na]['lang']+','+simgarr[na]['altlink']+'news.html" title="'+simgarr[na]['alt']+'"><img src="/image/x,80,y,57,f,'+simgarr[na]['img']+'" border="0" class="nwimg" width=80 height=57 vspace=4 hspace=0 alt="'+simgarr[na]['alt']+'"></a></td>'
	na++;
  }
str +='</tr></table>'  
  dc.innerHTML = str  
  l++
  if(l==avg) l=0	
}

function sputImagesRap(){
  dc = document.getElementById('imag2')
  str = '<table border=0 cellspacing="0" cellpadding="0" width="95%" align="center"><tr>'
  na=0
  for(a=0;a<3;a++){  	
  	na = a+(l*3)
  	
  	lang_str = (simgarr2[na]['lang']!=main_lang)?'?lng='+simgarr2[na]['lang']:''
    str += '<td align="center"><a href="/i/a,'+simgarr2[na]['id_kat']+','+simgarr2[na]['id']+','+simgarr2[na]['lang']+',item.html" title="'+simgarr2[na]['alt']+'"><img src="/image/x,90,y,60,f,'+simgarr2[na]['img']+'" border="0" class="nwimg" width=60 height=60 vspace=4 hspace=0 alt="'+simgarr2[na]['alt']+'"></a></td>'
  }
str +='</tr></table>'  
  dc.innerHTML = str  
  l++
  if(l==avg) l=0	
}

function sputImagesRap2(){
  dc = document.getElementById('imag3')
  str = '<table border=0 cellspacing="0" cellpadding="0" width="95%" align="center"><tr>'
  na=0

  for(a=0;a<3;a++){  	
  	na = a+(l*1)
  	
  	//lang_str = (simgarr[na]['lang']!=main_lang)?'?lng='+simgarr[na]['lang']:''
    str += '<td align="center"><a href="/i/a,'+simgarr3[na]['id_kat']+','+simgarr3[na]['id']+','+simgarr3[na]['lang']+',item.html" title="'+simgarr3[na]['alt']+'"><img src="/image/x,90,y,60,f,'+simgarr3[na]['img']+'" border="0" class="nwimg" width=60 height=60 vspace=4 hspace=0 alt="'+simgarr3[na]['alt']+'"></a></td>'
  }
str +='</tr></table>'  
  dc.innerHTML = str  
  l++
  if(l==avg) l=0	
}

/* */
function preview(url){
 window.open(url+"?res="+screen.height,"preview","width="+screen.width+",height="+screen.height+",fullscreen=1");
}

function urlback(url){
opener.location.href=url;
window.close();
}

function printoffer(sygnatura){
window.open('/i/print,'+sygnatura+','+lng+',print.html',"print","width=640,height=800,resizable=1,scrollbars=1");
}
function printlist(a){
window.open('/i/'+a,"printlist","width=640,height=800,resizable=1,scrollbars=1");
}
function drukuj(x){
window.open('/i/p_'+x+','+lng+',print.html',"print","width=640,height=800,resizable=1,scrollbars=1");
}

function wyslij(x,l){
window.open('/m/'+lng+',send.html?url='+x,"send","width=500,height=500,resizable=0,scrollbars=0");
}


function druk(){
if(window.print()){ window.close();}
}

function make_ck(name,value,t){

expires = new Date();
expires.setTime(expires.getTime() + 60 * 30 * 1000 * t);
expiryDate = expires.toGMTString();
document.cookie = name + "=" + value + "; expires=" + expiryDate;
}
function powiekszenie(a,m,l,i){
linek="/PopupImage.php?foto="+a+"&miasto="+m+"&lng="+l+"&index="+i
open(linek,'WGN','status=no,toolbar=no,width=868,height=750,resizable=yes')
}

function powart(a,l,i){
linek="/artImage.php?foto="+a+"&lng="+l+"&index="+i
open(linek,'WGN','status=no,toolbar=no,width=868,height=750,resizable=yes')
}

function kalkulator_open(a){
linek="/CalcPopup.php?syg="+a
open(linek,'WGN','status=no,toolbar=no,width=600,height=200,resizable=yes')
}

function agencja(sg,lng){
linek="/pop_agencja.php?nr="+sg+"&lng="+lng
open(linek,'WGN','status=no,toolbar=no,width=500,height=550,resizable=no')
}

function agent_show(sg,lng){
linek="/popupagent.php?nr="+sg+"&lng="+lng
open(linek,'agent','status=no,toolbar=no,width=500,height=300,resizable=no')
}

function oferty(x){
opener.location.href="/i/b,all,all,"+lng+",list.html?agencja="+x+"&cn=-1";
window.close();
}

function oferty_agent(x,y){
opener.opener.location.href="/i/b,all,all,"+lng+",list.html?agencja="+x+"&agent="+y+"&cn=-1";
window.close();
}

function pop_foto(foto,lng){
linek="/popupfoto/image.html?plik="+foto+"&lng="+lng
open(linek,'WGN_foto','status=no,toolbar=no,width=500,height=550,resizable=no')
}

function pop_video(sygnatura,lng){
linek="/popvideo/clip.html?sygnatura="+sygnatura+"&lng="+lng
open(linek,'WGN_video','status=no,toolbar=no,width=500,height=550,resizable=no')
}

function pop_pano(sygnatura,lng){
linek="/panorama/clip.html?sygnatura="+sygnatura+"&lng="+lng
open(linek,'WGN_panorama','status=no,toolbar=no,width=800,height=550,resizable=no')
}

function pop_foto2(foto,lng){
linek="/popupfoto/image.html?plik="+foto+"&lng="+lng+"&x=1"
open(linek,'WGN_foto','status=no,toolbar=no,width=500,height=550,resizable=no')
}

function prenumsms(nr){
linek="/pren_sms.php?innr="+nr
open(linek,'WGN_prenumerata_sms','status=no,toolbar=no,width=500,height=500,resizable=no')
}

function prenum(nr){
linek="/prenumeruj.php?innr="+nr
open(linek,'WGN_prenumerata','status=no,toolbar=no,width=500,height=500,resizable=no')
}

function agent(sg){
linek="/pop_agencja.php?nr="+sg+"&lng="+lng
open(linek,'WGN','status=no,toolbar=no,width=500,height=500,resizable=no')
}
function calcOplat(cena){
linek="/PopupPrzelicz.php?lng="+lng+"&syg="+cena
open(linek,'WGN','status=no,toolbar=no,width=600,height=400,resizable=yes')
}
function Intres(a,b){
linek="/IntresPopup.php?lng="+lng+"&syg="+a+"&agent="+b;
open(linek,'WGNpop','status=no,toolbar=no,width=600,height=500,resizable=yes')
}
function SzukamAdv(a){
linek="/SzukamPopup.php?lng="+lng+"&syg="+a
open(linek,'WGN','status=no,toolbar=no,width=600,height=700,resizable=yes')
}
function przypomnij(){
linek="/PopPrzypominacz.php?lng="+lng
open(linek,'WGN','status=no,toolbar=no,width=600,height=700,resizable=yes')
}
function ZainteresowanieOferta(){
linek="/zgloszainteresowanie.php?lng="+lng;
open(linek,'WGNpop','status=no,toolbar=no,width=600,height=630,resizable=yes')
}
function frPrint(oTgt)
{
oTgt.focus();
oTgt.print();
}

function validate(f){
var v,i,e
for(i=0;e=f[i++];)
  if(v=window[e.getAttribute('valid')])
   if(!v(e.value))
    {alert(e.getAttribute('alert'));e.focus();return 1}
}

function niepuste(x){return x>''}
function ismail(e){return (/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e))||(e=='')}
function noempymail(e){return (/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e))>''}
function isnumopt(x){return x==~~x}
function isnum(x){return x==parseInt(x)}
function iscnum(x){return (/[\d]/.test(x))>''}
function istel(e){return (/\+[0-9]{11,18}/.test(e))>''}
// konstruktor rynku
function selectMarket(rynek,def)
{
 j=0
 nx=0
 for(a in rynki[rynek])
 {
   document.forms[0].elements['T[typ_obiektu]'].length=j+1              
   document.forms[0].elements['T[typ_obiektu]'][j].text=rynki[rynek][a]
   document.forms[0].elements['T[typ_obiektu]'][j].value=a  
   if(def == a) nx=j; 
   j++ 
 }   
 document.forms[0].elements['T[typ_obiektu]'].length=j
 document.forms[0].elements['T[typ_obiektu]'].selectedIndex = nx              
}

// konstruktor listy panstw / regionow           
function selectRegion(kraj,def)
         {
           j=0
					 nx=0
          for(n=0;n<=parseInt((regiony.length-1));n++)
               {                   
             if(regiony[n]['kraj']==kraj){                   
   			         document.forms[0].elements['T[lok_wojewodztwo]'].length=j+1;                   
             	   document.forms[0].elements['T[lok_wojewodztwo]'][j].text=regiony[n]['region']
                 document.forms[0].elements['T[lok_wojewodztwo]'][j].value=regiony[n]['region']
				         if(regiony[n]['region'] == def) nx=j 

                 j++;		
              }            					
             }   
              document.forms[0].elements['T[lok_wojewodztwo]'].length=j
 						  document.forms[0].elements['T[lok_wojewodztwo]'].selectedIndex = nx              
          }            


function calcNotus(cena){
linek="http://www.domkredytowy.pl/zdolnosc/calc_1.php?wartosc="+cena;
/*<http://www.domkredytowy.pl/zdolnosc/calc_1.php?wartosc=>*/
open(linek,'WGN','status=no,toolbar=no,width=440,height=550,resizable=yes')
} 

function flashPopOpen() {
linek="http://www.domkredytowy.pl/zdolnosc/Kalkulator6.php?idpos=2370&strona=2458";
open(linek,'Sprawdź swoją zdolność kredytową', 'status=no,toolbar=no,width=846,height=574,resizable=yes')
}		  

// -->

