var strroot,XmlHttp;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){}}}function RateArticle(){var artID=arguments[0],ratVal=arguments[1],cntrl=arguments[2],strroot=arguments[3],divRate=arguments[4],divRating=arguments[5];createXMLHttp();url="ratearticle.ajax?artid="+artID+"&ratVal="+ratVal+"&ratName=Image";XmlHttp.onreadystatechange=function(){rateStatus(XmlHttp,cntrl,strroot,divRate,divRating)};XmlHttp.open("GET",url,true);XmlHttp.send(null);return false}function rateStatus(XmlHttp){var responseTxt,cntrl=arguments[1],strroot=arguments[2],divRate=arguments[3],divRating=arguments[4];if(XmlHttp.readyState==4)if(XmlHttp.status==200){responseTxt=XmlHttp.responseText;SetGoldStar(responseTxt,responseTxt.substring(0,1),strroot,divRate,divRating)}}function SetGoldStar(){var strroot=arguments[2],divRate=arguments[3],divrating=arguments[4],responseTxt=arguments[0],starCnt=0,star="",star1="",ratings=0,point=0,whiteStars,remainder=0,value=arguments[1],title=value,imgSrc,j=1,cont=responseTxt.indexOf(".");if(cont!=-1)remainder=responseTxt.substring(responseTxt.indexOf("."));if(remainder!=0&&remainder!=""){imgSrc=strroot+"/images/halfgoldstar1.gif";title+=".5 of 5 stars";nam="imgRate"+j;star1="<img   src='"+imgSrc+"' align='middle' title='"+title+"'>";j=j+1;starCnt=starCnt+1}else title+=" of 5 stars";for(loop=0;loop<value;loop++){imgSrc=strroot+"/images/fullgoldstar.gif";nam="imgRate"+j;star+="<img  src='"+imgSrc+"' align='middle' title='"+title+"'>";j=j+1;starCnt=starCnt+1}star+=star1;if(value<5){whiteStars=5;if(remainder.length>0)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";nam="imgRate"+j;star+="<img  src='"+imgSrc+"' align='middle' title='"+title+"'>";j=j+1;starCnt=starCnt+1}}document.getElementById(divRate).innerHTML="<a class='rateslide'>RATE THIS IMAGE</a><span class='ratethx'>THANKS FOR RATING</span>";document.getElementById(divrating).innerHTML=star}
