function RegisterNamespaces(){
for(var i=0;i<arguments.length;i++){
var p=arguments[i].split("."),w=window;
for(var j=0;j<p.length;j++){
if(!w[p[j]]){
w[p[j]]=new Object();
}
w=w[p[j]];
}
}
}
RegisterNamespaces("Inpl.Tools");
Inpl.Tools=new function(){
var _4=this,timeout={},current={},fn="Inpl.Tools.",pCn="INTERIA_PL_COOKIE_ANKIETA_",pCt=2592000,uc={},artSponsListId="",artSponsReplaceImage=false,artSponsReplaceLast=false;
var nT=["title","lead","foto"];
var _6="INPL_NEWS_VIEW";
var _7=315360000;
this.InitImageReplace=function(a){
var i,k,o,f;
for(i=0;i<a.length;i++){
o=$(a[i][0]).getElementsByTagName(a[i][1]);
for(k=0;k<o.length;k++){
f=fn+"SetImgTimeout(\""+a[i][2]+"\",\""+a[i][3][0]+"\",\""+a[i][0]+"\",\""+a[i][1]+"\","+0;
if(typeof a[i][4]!="undefined"){
f+=",\""+a[i][4]+"\",\""+a[i][5][0]+"\"";
_4.SetImageReplace(o[k],a[i][2],a[i][3][k],a[i][0],a[i][1],k,a[i][4],a[i][5][k]);
}else{
_4.SetImageReplace(o[k],a[i][2],a[i][3][k],a[i][0],a[i][1],k);
}
o[k].onmouseout=new Function(f+")");
}
current[a[i][2]]=0;
}
};
this.SetImageReplace=function(_a,i,s,o,e,k,a,b){
_a.onmouseover=new Function(fn+"SetImg(\""+i+"\",\""+s+"\",\""+o+"\",\""+e+"\","+k+(a?",\""+a+"\",\""+b+"\"":"")+")");
};
this.SetImgTimeout=function(i,s,o,e,k,a,b){
timeout[i]=window.setTimeout(fn+"SetImg(\""+i+"\",\""+s+"\",\""+o+"\",\""+e+"\","+k+(a?",\""+a+"\",\""+b+"\"":"")+")",25);
};
this.SetImg=function(i,s,o,e,k,a,b){
if(timeout[i]){
window.clearTimeout(timeout[i]);
timeout[i]=null;
}
$(i).src=(s?s:"/p.gif");
if(o){
var p=$(o).getElementsByTagName(e)[current[i]];
if(p){
p.className=p.className.replace("selected","");
}
$(o).getElementsByTagName(e)[k].className+=" selected";
if(a&&b){
$(a).innerHTML=b;
}
current[i]=k;
}
};
this.CheckMail=function(id,a){
var m=$(id).value;
if(""==m||-1==m.indexOf("@")||-1==m.indexOf(".")){
if(!a){
alert("Proszę podać adres e-mail");
}
return false;
}
return true;
};
this.CheckPoll=function(id){
var r=false,o,i;
for(i=1;i<16;i++){
o=$("poll_"+id+"_"+i);
if(o&&o.checked){
r=true;
break;
}
}
if(!r){
alert("Proszę zaznaczyć odpowiedź.");
}
return r;
};
this.InitPoll=function(id,o,r){
var c=INTPL("getCookie",pCn+id,pCt);
if(c){
$(r).className="";
$(o).className="hide";
}
};
this.InitList=function(id,_2b){
try{
var o=$(id+"Menu").getElementsByTagName("LI"),i;
for(i=0;i<o.length;i++){
o[i].childNodes[0].onclick=new Function("return Inpl.Tools.SetList(\""+id+"\","+i+")");
}
if(typeof _2b=="undefined"){
_2b=INTPL("getCookie",_6);
}
if(null!==_2b){
_4.SetList(id,_2b);
}
}
catch(e){
}
};
this.SetList=function(id,_2e){
try{
$(id).className=nT[_2e]||"";
var o=$(id+"Menu").getElementsByTagName("LI"),i;
for(i=0;i<o.length;i++){
o[i].className=o[i].className.replace(/[ ]*selected/g,"");
}
o[_2e].className+=" selected";
INTPL("setCookie",_6,_2e,_7,"/",document.location.host);
}
catch(e){
}
return false;
};
this.SendError=function(n){
INTPL("openPopup","http://bledy.interia.pl/popup/"+n+"/?url="+escape(document.location)+"&screen="+screen.width+"x"+screen.height+"x"+screen.colorDepth,"beta_"+n+"_error",750,430);
return false;
};
this.SetCommOpt=function(o,n){
INTPL("setCookie","CommSet"+o,n,_7,"/",".interia.pl");
};
this.GetCommOpt=function(o,v){
try{
if(uc[o.href]){
return true;
}
var o4,o5,r=(v?",,,":",");
o4=parseInt(INTPL("getCookie","CommSet4"));
o5=parseInt(INTPL("getCookie","CommSet5"));
if(o4&&(o4==2||o4==3)){
r+=o4;
}
r+=",";
if(o5&&o5>=1&&o5<=3){
r+=o5;
}
if((v&&",,,,"!=r)||(!v&&",,"!=r)){
o.href+=r;
uc[o.href]=true;
}
return true;
}
catch(e){
}
};
this.Back=function(o){
try{
var r=true,t,s,l1,l2;
if(o.href==document.referrer){
r=false;
}else{
if(document.referrer.length>o.href.length){
l1=o.href.indexOf(",");
l2=document.referrer.indexOf(",");
if(-1!=l1&&-1!=l2&&o.href.substr(0,l1)==document.referrer.substr(0,l2)){
t=document.referrer.substr(o.href.length,document.referrer.length-o.href.length);
s=t.replace(",","");
if(s&&s==parseInt(s)&&","==t.substr(0,1)){
r=false;
}
}
}
}
if(!r){
window.history.back();
return false;
}
}
catch(e){
}
};
this.InitArtSpons=function(id,_39,_3a){
artSponsListId=id;
artSponsReplaceImage=_3a||false;
artSponsReplaceLast=_39||false;
};
this.InsertArtSpons=function(_3b,_3c,_3d,_3e,_3f){
if(artSponsListId&&_3b&&_3c){
var nl=$(artSponsListId),li,html;
html="<a href=\""+_3c+"\"><strong>"+_3b+"</strong></a><img src=\"http://x.interia.pl/inpl/i/inpl_tools_artspons.gif\" width=\"66\" height=\"5\" alt=\"art. spons.\" align=\"absmiddle\" style=\"margin-left:5px\" />";
if(artSponsReplaceLast){
var lis=nl.getElementsByTagName("LI");
lis[lis.length-1].innerHTML=html;
}else{
li=document.createElement("LI");
li.innerHTML=html;
nl.appendChild(li);
}
if(_3d&&artSponsReplaceImage){
var i=nl.getElementsByTagName("LI").length-1;
o=$(artSponsListId).getElementsByTagName("LI")[i];
_4.SetImageReplace(o,artSponsReplaceImage,_3d,artSponsListId,"LI",i);
}
}
};
this.InsertSecondArtSpons=function(_43,_44,_45,_46,_47){
if(artSponsListId&&_43&&_44){
var nl=$(artSponsListId),li,html;
html="<a href=\""+_44+"\"><strong>"+_43+"</strong></a><img src=\"http://x.interia.pl/inpl/i/inpl_tools_artspons.gif\" width=\"66\" height=\"5\" alt=\"art. spons.\" align=\"absmiddle\" style=\"margin-left:5px\" />";
if(artSponsReplaceLast){
var lis=nl.getElementsByTagName("LI");
lis[lis.length-2].innerHTML=html;
}else{
li=document.createElement("LI");
li.innerHTML=html;
nl.appendChild(li);
}
if(_45&&artSponsReplaceImage){
var i=nl.getElementsByTagName("LI").length-2;
o=$(artSponsListId).getElementsByTagName("LI")[i];
_4.SetImageReplace(o,artSponsReplaceImage,_45,artSponsListId,"LI",i);
}
}
};
this.InsertSpecialArtSpons=function(_4b,_4c,_4d,_4e,_4f){
if(artSponsListId&&_4b&&_4c){
var nl=$(artSponsListId),n2=$(artSponsReplaceImage),li,html;
html="<a href=\""+_4c+"\"><strong>"+_4b+"</strong><img src=\"http://x.interia.pl/inpl/i/inpl_tools_artspons.gif\" width=\"66\" height=\"5\" alt=\"art. spons.\" align=\"absmiddle\" style=\"margin-left:5px\" /></a>";
if(artSponsReplaceLast){
var lis=nl.getElementsByTagName("LI");
lis[lis.length-1].innerHTML=html;
}else{
li=document.createElement("LI");
li.innerHTML=html;
nl.appendChild(li);
}
if(_4d&&artSponsReplaceImage){
html2="<a href=\""+_4c+"\"><img src=\""+_4d+"\" width=\"440\" height=\"300\" /></a><br /><div><p><a href=\""+_4c+"\"><span class=\"lead\">"+_4e+"</span>&nbsp;<span class=\"more\">&raquo;</span></p></div>";
if(artSponsReplaceLast){
var lis=n2.getElementsByTagName("LI");
lis[lis.length-1].innerHTML=html2;
}else{
li=document.createElement("LI");
li.innerHTML=html2;
nl.appendChild(li);
}
}
}
};
function $(n){
return document.getElementById(n);
}
};


