var strroot;function createXMLHttp(){if(window.XMLHttpRequest){XmlHttp=new XMLHttpRequest;if(XmlHttp.overrideMimeType)XmlHttp.overrideMimeType("text/xml")}else if(window.ActiveXObject)try{XmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{XmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}var XmlHttp;function RateArticle(){var artID=arguments[0],ratVal=arguments[1],cntrl=arguments[2],strroot=arguments[3],divRate=arguments[4];createXMLHttp();url="ratearticle.ajax?artid="+artID+"&ratVal="+ratVal+"&dt="+Math.random();XmlHttp.onreadystatechange=function(){rateStatus(XmlHttp,cntrl,strroot,divRate)};XmlHttp.open("GET",url,true);XmlHttp.send(null);return false}function rateStatus(XmlHttp){var responseTxt,cntrl=arguments[1],strroot=arguments[2],divRate=arguments[3];if(XmlHttp.readyState==4)if(XmlHttp.status==200){responseTxt=XmlHttp.responseText;SetGoldStar(responseTxt,responseTxt.substring(0,1),responseTxt.substring(responseTxt.indexOf(".")),strroot,divRate)}}function SetGoldStar(){var strroot=arguments[3],divRate=arguments[4],starCnt=0,star="",star1="",ratings=0,point=0,whiteStars,remainder=arguments[2],value=arguments[1],title=value,imgSrc;if(remainder!=0&&value<5){imgSrc=strroot+"/images/halfgoldstar1.gif";title+=".5 of 5 stars";star1="<img src='"+imgSrc+"' align='middle' title='"+title+"'>";starCnt=starCnt+1}else title+=" of 5 stars";for(loop=0;loop<value;loop++){imgSrc=strroot+"/images/fullgoldstar.gif";star+="<img src='"+imgSrc+"' align='middle' title='"+title+"'>";starCnt=starCnt+1}star+=star1;if(value<5){whiteStars=5;remainder=remainder.substring(1,remainder.length);if(remainder!=0)whiteStars=whiteStars-1;for(loop=parseInt(value)+1;loop<=whiteStars;loop++)if(starCnt<5){imgSrc=strroot+"/images/FullWhiteStar.gif";star+="<img src='"+imgSrc+"' align='middle' title='"+title+"'>";starCnt=starCnt+1}}document.getElementById(divRate).innerHTML=star}