var starGo='',starNum=0,starHold=true,docType=navigator.userAgent.indexOf("Firefox")!=-1?true:false,eX=0,eY=0;function getNewHTTPObject(){var xmlhttp;/*@cc_on@if(@_jscript_version>=5)try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){xmlhttp=false}}@else xmlhttp=false;@end@*/if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest()}catch(e){xmlhttp=false}}return xmlhttp}function getIdentifier(fullUrl){return fullUrl.substring(fullUrl.indexOf("-")+1,fullUrl.length-5)}function doGrabTitleOfResource(){if($SeElement('resourceRatingTitle').innerHTML!=''){return $SeElement('resourceRatingTitle').innerHTML}else{$SeElement('resourceRatingTitle').innerHTML='100';return $$('h1')[0].innerHTML}}function $SeElement(v){return(document.getElementById(v))}function $SeRate(v){return(document.getElementById(v).style)}function agent(v){return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0))}function absPos(o){var r={x:o.offsetLeft,y:o.offsetTop};if(o.offsetParent){var v=absPos(o.offsetParent);r.x+=v.x;r.y+=v.y}return(r)}function xy(e,v){return(v?(agent('msie')?event.clientY+document.body.scrollTop:e.pageY):(agent('msie')?event.clientX+document.body.scrollTop:e.pageX))}function starUpdate(e,o){var booLeftClick=true;if(document.layers){if(e.which==3){booLeftClick=false}}else{if(e.button==2||e.button==3){booLeftClick=false}}if(starHold==true&&booLeftClick==true){try{var v=parseInt($SeElement('starUser'+starNum).innerHTML);starNum=o.id.substr(4);$SeElement('starCurr'+starNum).title=v;req=getNewHTTPObject();req.open('GET','/common/Ajax_Star_Vote.aspx?vote='+(v)+'&t='+doGrabTitleOfResource()+'&u='+$SeElement('uiMark').innerHTML+'&a='+document.URL,false);req.send(null);catchStars(v)}catch(e){}}}function catchStars(v){$SeElement('starUser'+starNum).innerHTML='You have rated this<br /> resource at <strong>'+v+"%</strong>";$SeElement('starCurr0').innerHTML='';$SeElement('starCurr'+starNum).onmousemove='';$SeRate('starUser'+starNum).color='#000000';starHold=false}function starRevert(){var v=parseInt($SeElement('starCurr'+starNum).title);$SeRate('starCurr'+starNum).width=Math.round($SeElement("initialRating").innerHTML*84/33)+'px';$SeElement('starUser'+starNum).innerHTML=($SeElement("initialRating").innerHTML>0?Math.round($SeElement("initialRating").innerHTML)+'%':'');$SeElement('starUser'+starNum).style.color='#888';document.onmousemove=''}function getCurrPos(eX,eY){if(docType){if(eX<253||eX>0||eY<57||eY>0){return true}else{return false}}else{if($('button')==null?false:true){if(eX<0||eX>256||eY<-733||eY>-629){return true}else{return false}}else{if(eX>0||eX<256||eY<-733||eY>-629){return true}else{return false}}}}function starCurr(e,o){function starMove(e){try{if(starHold==true){var p=absPos($SeElement('star'+starNum));starNum=o.id.substr(4);eX=xy(e)-p.x;eY=xy(e,1)-p.y;if(getCurrPos(eX,eY)){starGo='';moveStarRating()}}}catch(err){}}if(!starGo){starGo=1;document.onmousemove=starMove}}function moveStarRating(){var per=(Math.round((eX/255*100)));if(per>=0&&per<=100){$SeRate('starCurr'+starNum).width=eX+'px';$SeRate('starUser'+starNum).color='#111';$SeElement('starUser'+starNum).innerHTML=per+'%'}}window.addEvent('domready',function(){starRevert();$('star0').addEvent('mouseleave',function(event){if($('starUser0').innerHTML.indexOf('You have')==-1){starRevert()}})});