myloadimage("/templates/noimage/image/star_blue.gif",
			"/templates/noimage/image/star_wh.gif",
			"/templates/noimage/image/working.gif");
function blockimage(myimage,$src){
	myimage.setAttribute("src", $src);
	while (true) {
		myimage = myprevSib(myimage);
		if (!myimage)break;
		myimage.setAttribute("src", $src);
	}
}
function noneimage(myimage,$src){
	myimage.setAttribute("src", $src);
	while (true) {
		myimage = myprevSib(myimage);
		if (!myimage)break;
		myimage.setAttribute("src", $src);
	}
}
function yesvote($scroe){
	var responseSpan = document.getElementById('votes');
	responseSpan.innerHTML='<img title="Loading ..." src="/templates/noimage/image/working.gif">';
	getscroe('/ajax.php?action=score&type=tv&value=' + $scroe);
}
function formatNumber(num,exponent) {
	if (exponent<1) return num;
	var str = num.toString();
	if (str.indexOf(".")!=-1) {
    if (str.split(".")[1].length>=exponent) {
    	return str;
    } else {
    	return formatNumber(str+"0",exponent);
    }
	} else {
    	return formatNumber(str+".0",exponent);
  }

}
function getscroe($url){
	$url+="&timestamp=" + new Date().getTime();
	xmlHttp.onreadystatechange = function(){
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
			var mystring = xmlHttp.responseText.split("|");
		//	alert(mystring);
			if (mystring[0] == "0"){
				alert(mystring[1]);
			}else{
				var responseSpan = document.getElementById('echoscore');
				var $votes= document.getElementById('votes');
				responseSpan.innerHTML=formatNumber(mystring[1],1);
				$votes.innerHTML="";
				mystring[1]=Math.round((mystring[1]/2),"10");
				$votes.innerHTML+='<img src="/templates/noimage/image/score/0'+mystring[1]+'.gif">';
			}
			delete xmlHttp;
			xmlHttp = null;
		}
	}
	xmlHttp.open("GET",$url);
	xmlHttp.send(null);
}
function fullsummary(myfull){
	var fullsummary=document.getElementById("scrollshow");
	var tempfull=document.getElementById("tempfull");
	var templess=document.getElementById("templess");
	if(myfull.childNodes[0].nodeValue=="full summary +"){
		fullsummary.innerHTML=tempfull.innerHTML;
		myfull.innerHTML="less summary -";
	}else{ 
		myfull.innerHTML="full summary +";
		fullsummary.innerHTML=templess.innerHTML;
	}	
}
adinit(function(){
document.getElementById("ad_ep_in_si").innerHTML='<iframe width="300" height="250" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="/templates/public/ad/episodes-index~300x250.html" ></iframe >';
document.getElementById("ad_ep_in_lo").innerHTML='<iframe width="160" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="/templates/public/ad/episodes-index~160x600.html" ></iframe >';
});