function FF(){return false;}
function FT(){return true;}
var cnitr=0,d=document,df=d.forms,/*PogodaArrL=new Array(PogodaArr.length),*/w=window,IEv=onet('getIEVer')
if(typeof(Stan)=='undefined')Stan=0
if(typeof(CzB)=='undefined')CzB=0
if(typeof(BrakWiadPlus)=='undefined')BrakWiadPlus=0
if(typeof(brakPanel3)=='undefined')brakPanel3=0
if(typeof(fraza)=='undefined')fraza=''
/*
for(var itr in PogodaArr){
	PogodaArrL[cnitr]=itr
	cnitr++
}*/
function GetLoc(){
	if (d.cookie.indexOf('onet_loc=')>=0)return d.cookie.replace(/^.*onet_loc=([0-9]+).*$/,"$1")
	return false
}
function SetLoc(id){
	var expi=new Date
	extime=expi.getTime()+63072000000
	expi.setTime(extime)
	expire=expi.toGMTString()
	d.cookie="onet_loc="+id+"; expires="+expire+"; path=/; domain=.tvn24.pl;"
}

function O(id){if(typeof(d.getElementById)!='undefined'){return d.getElementById(id);}else{return false;}}

function ChBK(NrBK,SwC){
	if(typeof(O())!='undefined'){
	NrBK==5?document.getElementById('nowe').src='_d/zumi/zumismall.gif':document.getElementById('nowe').src='_d/zumi/zumismallr'+(CzB?'b':'')+'.gif'
		if (SwC||SwCO){
			if (NrBK!=ActBK){
				link=O('z'+NrBK).href.replace(/^http:\/\/.*\//,'')
				if(link.length==3)onet('clickIt',link)
				if(ActBK==6&&ActZN==3){ActNNr=df.mf.mrrn[0].checked?0:1;}

				ov=EZo(ActBK,ActZN).value
            if (NrBK!=5 && ActBK==5 && !lok_ch && ov=='pizza, kino')  ov='';
            df.mf.mp52m_lok.style.color='#b5b5b5';
            if (!lok_ch && NrBK!=5)
            {
               df.mf.mp5.value='';
               df.mf.mp5.style.color='#b5b5b5';
            }
            if (NrBK==5)
            {	
            	var inputLok=document.getElementById('mp52m_lok');
            	if (inputLok)
            		inputLok.value='miasto, ulica numer';
            	if (!document.getElementById('sugscript'))
            	{
            		var html_doc = document.getElementsByTagName('head')[0];
    						js = document.createElement('script');
    						js.setAttribute('id', 'sugscript');
    						js.setAttribute('type', 'text/javascript');
    						js.setAttribute('src', '/_s/suggest/clienthint01.js');
    						html_doc.appendChild(js);
    					}
            }	            
            if (NrBK==5 && ov!='')
               df.mf.mp5.style.color='#000000';
            if (NrBK==5 && ov=='')
            {
               df.mf.mp5.style.color='#b5b5b5';
               lok_ch=0;
            } 				

				df.mf.reset()
				if(NrBK==6){
					df.mf.mr6[ActZN-1].checked=true
					df.mf.mrrn[ActNNr].checked=true
				}
        
            if (ov!=fraza) EZo(NrBK,ActZN).value=ov
            if (NrBK==1 && ov=='') EZo(NrBK,ActZN).value=fraza
				for(i=1;i<SzukCount;i++){
					if (i!=NrBK){
						OC('z'+i,'mztxt');OC('mz1r'+i,'mznr');	OC('mz2r'+i,'mznr');	OC('mz2rl'+i,'mznr'); OC('mz2rr'+i,'mznr'); OC('mztx'+i,'mzdvn');	OC('mz3rl'+i,'mzab'+NrBK);	OC('mz3rr'+i,'mzab'+NrBK); OC('mz4r'+i,'mzab'+NrBK); O('mzIm'+i).style.display='none';
					}
					else{
						OC('z'+i,'mztxta'); OC('mz1r'+i,'mzar'+i); OC('mz2r'+i,'mzar'+i); OC('mz2rl'+i,'mzar'+i); OC('mz2rr'+i,'mzar'+i); OC('mztx'+i,'mzdva'); OC('mz3rl'+i,'mzar'+i); OC('mz3rr'+i,'mzab'+i); OC('mz4r'+i,'mzab'+NrBK); O('mzIm'+i).style.display='block';
					}
				}
				OC('mzzd1','mzab'+NrBK);
				OC('mzzd2','mzab'+NrBK);
				OC('mzzg1','mzab'+NrBK);
				OC('mzzg2','mzab'+NrBK);
				OC('mcg','mzab'+NrBK)
				O('mc'+ActBK).style.display='none'
				O('mc'+NrBK).style.display='block'
				df.mf.k.value=NrBK
				if(NrBK!=8){
				  eval('df.mf.mp'+NrBK+(NrBK==6?'['+(ActZN>1?4-ActZN:0)+']':'')+'.focus()')
				}
				else {
				ChSymZN();
					df.mf.main_wiek.selectedIndex=SymPull;	
					df.mf.p[0].focus();	
				}
				ActBK=NrBK
			}
			if(SwC)SwCO=0
		}else if(!SwC){SwCO=1;}
		return false;
	}else return true;
}
var SymZN=0;SymPull=1;
function ChSymZN(){
	if (SymZN==0){
		df.mf.p[SymZN].checked=true;
		OC('symk','a1b');
		OC('symm','a1');
	}
	else {
		df.mf.p[SymZN].checked=true;
		OC('symk','a1');
		OC('symm','a1b');
	}
}
function ChZN(NrZN){
	if (NrZN!=ActZN){
		ov=EZo(ActBK,ActZN).value
		if(ActZN==3){ActNNr=df.mf.mrrn[0].checked?0:1;}
		df.mf.reset()
		EZo(ActBK,NrZN).value=ov
		if(NrZN==3){df.mf.mrrn[ActNNr].checked=true;}
		df.mf.k.value=ActBK
		OC('znn'+ActZN,'a1')
		OC('znn'+NrZN,'a1b')
		df.mf.mr6[NrZN-1].checked=true
		O('mc6'+ActZN).style.display='none'
		O('mc6'+NrZN).style.display='block'
		ActZN=NrZN
		eval('df.mf.mp6['+(ActZN>1?4-ActZN:0)+'].focus()')
	}
}
function MLoad(){
	if(IEv>=5){
		w.onerror=FT
		d.body.style.behavior='url(#default#userData)'
		d.body.load("M")
		if(onet('get','pgid')==d.body.getAttribute("pgid")){
			ab=d.body.getAttribute("ActBK")
			ChBK(ab,1)
			if(ab==6)ChZN(d.body.getAttribute("ActZN"))
			EZo(ActBK,ActZN).value=d.body.getAttribute("q")
			if(ActBK==3)df.mf.q7m_lokalizator.value=d.body.getAttribute("q7m_lokalizator")
    		else if(ActBK==6&&ActZN==3){
		        df.mf.mrrn[d.body.getAttribute("r0")=='1'?0:1].checked=true
		        if(d.body.getAttribute("r0")=='0'){OC('nmie','a1');OC('ndom','a1b');}
		    }
		}
		w.onerror=FF
	}
}
function MSave(){
	if(IEv>=5){
		w.onerror=FT
		d.body.setAttribute("ActBK",ActBK)
		d.body.setAttribute("ActZN",ActZN)
		d.body.setAttribute("pgid",onet('get','pgid'))
		d.body.setAttribute("q",EZo(ActBK,ActZN).value)
		if(ActBK==5)d.body.setAttribute("q7m_lokalizator",df.mf.q7m_lokalizator.value)
	    else if(ActBK==6&&ActZN==3)d.body.setAttribute("r0",df.mf.mrrn[0].checked*1)
	    d.body.save("M");
		w.onerror=FF
	}
}
function FS(keyn){

	if (typeof(keyn)!='number')keyn=event.keyCode
	if (typeof(keyn)=='number'&&keyn==13){MSave();df.mf.submit()}
	return true
}
var ActNrR=0,ChWpIId=0,CuPo=0,ClPo=0,TrSw=-1,SwSlwp=0,fse=0
function ShWp(){
	if (BrakWiadPlus) return
	if(O('Rp'+ActNrR)){
		O('Rp'+ActNrR).style.display='none'
		ActNrR=parseInt(Math.random()*2)    //#---#
		O('Rp'+ActNrR).style.display='block'
	}
}
function ChWpRi(st){
	if(st){clearTimeout(ChWpIId);ChWpIId=0}
	else ChWpIId=setTimeout('ChWp(1)',8000)
}
function ChWp(NrR,St){
	if (BrakWiadPlus) return
	if(St&&ChWpIId){clearTimeout(ChWpIId);ChWpIId=0;}
	if(O('bodyg')){
	   if(!O('trn')) return
		if(TrSw==-1)TrSw=O('trn').filters&&typeof(O('trn').filters[0])=='object'
		if(TrSw){
			if(!SwSlwp){
				O('trn').style.width='428px'
				fse=w.screen.fontSmoothingEnabled
				SwSlwp=1
			}
			if(!fse){
				O('trn').filters[0]("DXImageTransform.Microsoft.GradientWipe").Motion=(NrR==1)?'forward':'reverse'
				O('trn').filters[0].Apply()
			}
		}
		O('Rp'+ActNrR).style.display='none'
		ActNrR+=NrR;ActNrR%=3    //#---#
		if(ActNrR==2&&brakPanel3) ActNrR=0; //StarLight
		if(ActNrR==-1)(brakPanel3)?ActNrR=1:ActNrR=2   //#---#
		O('Rp'+ActNrR).style.display='block'
		if(TrSw&&!fse)O('trn').filters[0].Play()
		if(ChWpIId)ChWpIId=setTimeout('ChWp(1)',8000)
	}
	return false
}
if(Stan!=1)onet("onPageLoad","ChWpIId=setTimeout('ChWp(1)',8000);")
var swCI=new Array()
var swSh=new Array()
function ShPo(Id){
	ShPoIIId=0
	var TBg=(CzB)?'#F6F6F6':'#ECF5FF' 
	var TBo=(CzB)?'#828282':'#0A016F' 
	if(O('bodyg')&&d.body){
		ClPo=1
		if(CuPo!=Id&&CuPo)O('po'+CuPo).style.display='none'
		if(Id){
			if(typeof(swCI[Id])=='undefined'){
				link=O('ap'+Id).href.replace(/^http:\/\/.*\//,'')
				if(link.length==3)onet('clickIt',link)
				swCI[Id]=1
			}
			fiid=''
			if(typeof(swSh[Id])=='undefined'){
				eval('fobj=df.pli.plh'+Id)
				if (typeof(fobj)=='undefined') {return true;}
				dpda = fobj.value.split('@')
				swSh[Id]=1
				i=0
				r='<TABLE cellspacing=0 cellpadding=0 style="border:1px solid '+TBo+';" width=170><TR><TD><TABLE cellspacing=0 cellpadding=0 border=0 width=170 class=pobo>'
				//moc=(Stan>0&&Stan<3)?'#F6F6F6':'#ECF5FF'
				for(idr in dpda){
					if(i>=2){
						dpds=dpda[idr].split('|')
						r+='<TR><TD onClick="location.href=O(\'p_'+Id+'_'+(i-1)+'\').href" class="dpna a2" NOWRAP><DIV onMouseOut="this.style.backgroundColor=\''+TBg+'\'" onMouseOver="this.style.backgroundColor=\'#FFFFFF\'"><DIV class=p6>'+(dpds[2]=='bo'?'<B>':'')+'<A class=popl href="'+dpds[0]+'" id="p_'+Id+'_'+(i-1)+'">'+dpds[1]+'</A>'+(dpds[2]=='bo'?'</B>':'')+'</DIV></DIV></TD></TR>'
						r+='<TR><TD class=pobr><IMG src=0 height=1 width=1 alt=""></TD></TR>'
					}else if(i==0) r+='<TR><TD class=a2b NOWRAP><DIV class=p6w onClick="ClPo=1;return false;">'+dpda[idr]+'</DIV></TD></TR>'
					else  if(i==1) rf='<TR><TD onClick="location.href=O(\'p_'+Id+'w\').href" class="dpna a1" NOWRAP><DIV onMouseOut="this.style.backgroundColor=\''+TBg+'\'" onMouseOver="this.style.backgroundColor=\'#FFFFFF\'"><DIV class=p6><A class=popl href="'+dpda[idr]+'" id="p_'+Id+'w">wiêcej...</A></DIV></DIV></TD></TR>'
					i++
				}
				r+=rf+'</TABLE></TD></TR></TABLE>'
				O('po'+Id).innerHTML=r
			}
			O('po'+Id).style.display='block'
			if(CuPo!=Id){
				O('po'+Id).style.marginTop=(Id!=234?-11:-12)+'px'
				if(Id==234)O('po'+Id).style.marginLeft='30px'
				ot=O('po'+Id).offsetTop
				if(ot){
					dr=O('po'+Id).offsetHeight+ot
					dk=d.body.clientHeight+d.body.scrollTop
					dp=dr-dk
					if(dp>0&&dk)O('po'+Id).style.marginTop=-dp-10+'px'
				}
			}
		}
		CuPo=Id
		return false
	}else return true
}
function BoCl(){
	if(!ClPo&&CuPo)O('po'+CuPo).style.display='none'
	ClPo=0
}
var ShPoIIId=0
function Inv(obj,s,Id){
	if(ShPoIIId){clearTimeout(ShPoIIId);ShPoIIId=0;}
	if(s){ShPoIIId=setTimeout('ShPo('+Id+')',200);}
	else{ShPoIIId=setTimeout('ShPo(0)',400);}
	if(obj)obj.style.filter='progid:DXImageTransform.Microsoft.BasicImage(invert='+s+')';
}

function znakw(znak){if(parent.onet('getIEVer')){document.write('&nbsp;');if(znak=='G')document.write('<SPAN class=ding>&#225;</SPAN>');if(znak=='D')document.write('<SPAN class=ding>&#226;</SPAN>');if(znak=='S')document.write('<SPAN class=a09><SPAN class=r>*</SPAN></SPAN>');}}

function Insert_Panel($kod,$panelname,$width,$height) 
{
	document.write('<DIV id='+$panelname+' style="overflow:hidden; display:none;"></DIV>');
	if (window.document.getElementById) {
		var $panel = window.document.getElementById($panelname);
		if ($panel.style) {
			$panel.innerHTML = $kodpanela;
			$panel.style.width = $width;
			$panel.style.height = $height;
			$panel.style.display = "block";
		}
	}
}
function checkVisited(nID)
{
   var vnews=O(nID);
   var visited = 0;
   if (vnews && 'offsetTop' in vnews)
   {
      if (vnews.offsetTop == 100)visited=1
   }
   if (vnews && 'currentStyle' in vnews && 'color' in vnews.currentStyle)
      if (vnews.currentStyle.color == '#FF0000')visited=1
   if (visited)return 1;
   else return 0;
}

function rotateNews(rIDList)
{
   var rIDTab=rIDList.split(",");
   if(location.pathname.indexOf('ickma')!=-1)
   {
      for(i=1;i<rIDTab.length;i++)
      {
         O('bulrow'+rIDTab[i]).style.display='block';
      }
      return
   }
   if(!checkVisited('news'+rIDTab[0])) 
   {
      return;
   }
   for(i=1;i<rIDTab.length;i++)
   {
      if (!checkVisited('news'+rIDTab[i])) 
      {
         O('bulrow'+rIDTab[0]).style.display='none';
         O('bulrow'+rIDTab[i]).style.display='block';
         return;
      }
   }
}

function OpenReg()
{
   window.open("pl,,informacja.html","Reg1","width=500,height=350,scrollbars=0,status=0,titlebar=0;toolbar=0,resizeable=1");
}
