 function wstaw_text(okno, tresc)
 {
     var wynik = document.getElementById(okno);
     wynik.value = tresc;
 }
 
function otworz(adres, rozx, rozy) {

      window.open(adres, 'nazwa', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no, width='+rozx+', height='+rozy+', left=30, top=30').focus(); return false
}

function ShowButton(sel){
	if(sel){ document.getElementById('btn_vote').style.display='block'; }
}


function StarsHighlight(star,selected, pref){
 var selected=0;
 var star0=new Image();star0.src="gfx/star_clear.gif";
 var star1=new Image();star1.src="gfx/star_filled.gif";
 var star2=new Image();star2.src="gfx/star_filled.gif";
 
    var stars=new Array();
    stars[1]=document.getElementById('1_star_'+pref);
    stars[2]=document.getElementById('2_star_'+pref);
    stars[3]=document.getElementById('3_star_'+pref);
    stars[4]=document.getElementById('4_star_'+pref);
    stars[5]=document.getElementById('5_star_'+pref);
	for(i=1;i<=5;i++){
		if (selected){
			if(i<=star){
				if (i<=selected){
					if(stars[i].src!=star1.src){ stars[i].src=star1.src; }
				}else{
					if(stars[i].src!=star2.src){ stars[i].src=star2.src; }
				}
			}else{
				if(stars[i].src!=star0.src){ stars[i].src=star0.src; }
			}
		}else{
			if(i<=star){
			
				if(stars[i].src!=star1.src){ stars[i].src=star1.src; }
			}else{
				if(stars[i].src!=star0.src){ stars[i].src=star0.src; }
			}
		}
	}
}

function ClearStars(sel, pref){
 var star0=new Image();star0.src="gfx/star_clear.gif";
 var star1=new Image();star1.src="gfx/star_filled.gif";
 var star2=new Image();star2.src="gfx/star_filled.gif";

    var stars=new Array();
    stars[1]=document.getElementById('1_star_'+pref);
    stars[2]=document.getElementById('2_star_'+pref);
    stars[3]=document.getElementById('3_star_'+pref);
    stars[4]=document.getElementById('4_star_'+pref);
    stars[5]=document.getElementById('5_star_'+pref);
	if (sel){
		for(i=5;i>=1;i--){
			if (i<=sel){
				if (stars[i].src!=star1.src){ stars[i].src=star1.src; }
			}else{
				if (stars[i].src!=star0.src) { stars[i].src=star0.src; }
			}
		}
	}else{
		for(i=5;i>=1;i--){
			if (stars[i].src!=star0.src) { stars[i].src=star0.src; }
		}
	}
	
}


function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

if (typeof(WebToolKit) == "undefined") {
var WebToolKit = {};
};

pokaz = {

keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

decode : function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;

input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

do {
enc1 = this.keyStr.indexOf(input.charAt(i++));
enc2 = this.keyStr.indexOf(input.charAt(i++));
enc3 = this.keyStr.indexOf(input.charAt(i++));
enc4 = this.keyStr.indexOf(input.charAt(i++));

chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;

output = output + String.fromCharCode(chr1);

if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
} while (i < input.length);

if (typeof(String.prototype.utf8decode) !== "undefined") {
return output.utf8decode();
} else {
return output;
}
}

};


if (typeof(String.prototype.base64decode) == "undefined") {
String.prototype.base64decode = function () {
return WebToolKit.base64.decode(this);
};
};

