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 _5=this,d="default",_7={},_8="V_",fn="Inpl.Vote.",en="Vote",_b={"default":{"on":"/s/starOn.gif","off":"/s/star.gif"}},_c=2592000,_d={};
this.Init=function(id,_f,_10,_11,_12,_13){
try{
var o,i,a,s,r,x=_f+id;
_d[x+"n"]=new Image();
_d[x+"f"]=new Image();
if(_11||_12){
_b[x]={"on":null,"off":null};
}
if(_11){
_b[x].on=_11;
_d[x+"n"].src=_11;
}else{
_d[x+"n"].src=_b[d].on;
}
if(_12){
_b[x].off=_12;
_d[x+"f"].src=_12;
}else{
_d[x+"f"].src=_b[d].off;
}
_7[x]=Math.floor(_10);
r=parseInt(INTPL("getCookie",_8+x));
_5.Set(id,_f,(_7[x]?_7[x]:r));
if(r){
Voted(id,_f,r,_13);
}else{
o=$(en+x).getElementsByTagName("LI");
for(i=0;i<5;i++){
a=o[i].childNodes[0];
a.onmouseover=new Function("return "+fn+"Set("+id+",\""+_f+"\","+(i+1)+")");
a.onmouseout=new Function("return "+fn+"Clear("+id+",\""+_f+"\")");
a.onclick=new Function("return "+fn+"Vote("+id+",\""+_f+"\","+(i+1)+",\""+_13+"\")");
}
}
}
catch(e){
}
};
this.Set=function(id,_1b,_1c){
try{
var o=$(en+_1b+id).getElementsByTagName("LI"),i,a,s,x=_1b+id;
for(i=0;i<5;i++){
s=(i<_1c?"on":"off");
a=o[i].childNodes[0];
a.childNodes[0].src=(_b[x]&&_b[x][s]?_b[x][s]:_b[d][s]);
}
}
catch(e){
}
return false;
};
this.Clear=function(id,_23){
try{
_5.Set(id,_23,_7[_23+id]);
}
catch(e){
}
return false;
};
this.Vote=function(id,_25,_26,_27){
try{
var i=document.createElement("IMG");
i.style.position="absolute";
i.style.top="1px";
i.style.left="1px";
i.alt="";
i.src="/ocen,"+_25+","+parseInt(id)+","+parseInt(_26)+"?t="+(new Date()).getTime();
document.body.appendChild(i);
Voted(id,_25,_26,_27);
}
catch(e){
}
return false;
};
function Voted(id,_2a,_2b,_2c){
var o=$(en+_2a+id).getElementsByTagName("LI"),i,a,c=$("VoteC"+_2a+id);
if(c&&c.innerHTML=="-"){
c.innerHTML=parseInt(_2b)+".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+_2a+id+"Text").innerHTML="Twoja ocena: "+_2b;
$(en+"H"+_2a+id).className="voted";
$(en+"H"+_2a+id).innerHTML=(typeof (_2c)!="undefined"&&_2c!="undefined")?_2c:"Dziękujemy, Twój głos został zarejestrowany";
}
function $(n){
return document.getElementById(n);
}
};

