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.Vote");
Inpl.Vote=new function(){
var _4=this,d="default",ranks={},cName="V_",fn="Inpl.Vote.",en="Vote",img={"default":{"on":"/s/news_star_on.gif","off":"/s/star_off.gif"}},ttl=2592000,prl={};
this.Init=function(id,_6,_7,_8,_9,_a){
try{
var o,i,a,s,r,x=id;
prl[x+"n"]=new Image();
prl[x+"f"]=new Image();
if(_8||_9){
img[x]={"on":null,"off":null};
}
if(_8){
img[x].on=_8;
prl[x+"n"].src=_8;
//alert('1:' + _8);
}else{
prl[x+"n"].src=img[d].on;
//alert('2:' + img[d].on);
}
if(_9){
img[x].off=_9;
prl[x+"f"].src=_9;
}else{
prl[x+"f"].src=img[d].off;
}
ranks[x]=Math.floor(_7);
//alert(cName + ' ' + x);
r=parseInt(INTPL("getCookie",cName+x));
_4.Set(id,_6,(ranks[x]?ranks[x]:r));
if(r){
Voted(id,_6,r,_a);
}else{
o=$(en+'film'+x).getElementsByTagName("LI");
for(i=0;i<5;i++){
a=o[i].childNodes[0];
a.onmouseover=new Function("return "+fn+"Set("+id+",\""+_6+"\","+(i+1)+")");
a.onmouseout=new Function("return "+fn+"Clear("+id+",\""+_6+"\")");
a.onclick=new Function("return "+fn+"Vote("+id+",\""+_6+"\","+(i+1)+",\""+_a+"\")");
}
}
}
catch(e){
}
};
this.Set=function(id,_d,_e){
try{
var o=$(en+'film'+id).getElementsByTagName("LI"),i,a,s,x=_d+id;
for(i=0;i<5;i++){
s=(i<_e?"on":"off");
a=o[i].childNodes[0];
a.childNodes[0].src=(img[x]&&img[x][s]?img[x][s]:img[d][s]);
}
}
catch(e){
}
return false;
};
this.Clear=function(id,_11){
try{
_4.Set(id,_11,ranks[_11+id]);
}
catch(e){
}
return false;
};
this.Vote=function(id,_13,_14,_15){
try{
var i=document.createElement("IMG");
i.style.position="absolute";
i.style.top="1px";
i.style.left="1px";
i.style.visibility='hidden';
i.alt="";
i.src="/ocen,"+parseInt(id)+","+parseInt(_14)+"?t="+(new Date()).getTime();
document.body.appendChild(i);
//INTPL("setCookie",cName+id, _14, '/', false, '.interia.pl');
Voted(id,_14,_15);
}
catch(e){
}
return false;
};
function Voted(id,_19,_1a){
var o=$(en+'film'+id).getElementsByTagName("LI"),i,a,c=$("VoteC"+id);
if(c&&c.innerHTML=="-"){
c.innerHTML=parseInt(_19)+".00";
}
for(i=0;i<5;i++){
a=o[i].childNodes[0];
a.onclick=new Function("return false");
a.onmouseover=null;
a.onmouseout=null;
a.style.cursor=d;
}
$(en+id+"Text").innerHTML="Twoja ocena: "+_19;
$(en+"H"+id).className="voted";
$(en+"H"+id).innerHTML=_1a!="undefined"?_1a:"Dziękujemy, Twój głos został zarejestrowany";
}
function $(n){
return document.getElementById(n);
}
};

