var xmlhttp
if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false}}
function myXMLHttpRequest(){var xmlhttplocal;try{xmlhttplocal=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlhttplocal=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){xmlhttplocal=false;}}
if(!xmlhttplocal&&typeof XMLHttpRequest!='undefined'){try{var xmlhttplocal=new XMLHttpRequest();}catch(e){var xmlhttplocal=false;alert('couldn\'t create xmlhttp object');}}
return(xmlhttplocal);}
function sndReq(vote,id_num,units,units_detail,rating_image_width,rating_form_typ){var theUL=document.getElementById('unit_ul'+id_num);theUL.innerHTML='<div class="loading"></div>';xmlhttp.open('get','rating_new.php?action=new&j='+vote+'&q='+id_num+'&c='+units+'&cd='+units_detail+'&w='+rating_image_width+'&v='+rating_form_typ);xmlhttp.onreadystatechange=handleResponse;xmlhttp.send(null);}
function handleResponse(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){var response=xmlhttp.responseText;var update=new Array();if(response.indexOf('|')!=-1){update=response.split('|');changeText(update[0],update[1]);}}}}
function disp_notice(text)
{elid='ratingResults';changeText(elid,text);el=document.getElementById(elid);var theTop=30;if(window.innerHeight)
{pos=window.pageYOffset}
else if(document.documentElement&&document.documentElement.scrollTop)
{pos=document.documentElement.scrollTop}
else if(document.body)
{pos=document.body.scrollTop}
if(pos<theTop)pos=theTop;else pos+=30;el.style.top=pos+'px';new Effect.Appear(elid,{from:0.0,to:0.8});setTimeout('new Effect.Fade("ratingResults")',4000);}
function changeText(div2show,text){var IE=(document.all)?1:0;var DOM=0;if(parseInt(navigator.appVersion)>=5){DOM=1};if(DOM){var viewer=document.getElementById(div2show);viewer.innerHTML=text;}else if(IE){document.all[div2show].innerHTML=text;}}
var ratingAction={'a.rater':function(element){element.onclick=function(){var parameterString=this.href.replace(/.*\?(.*)/,"$1");var parameterTokens=parameterString.split("&");var parameterList=new Array();for(j=0;j<parameterTokens.length;j++){var parameterName=parameterTokens[j].replace(/(.*)=.*/,"$1");var parameterValue=parameterTokens[j].replace(/.*=(.*)/,"$1");parameterList[parameterName]=parameterValue;}
var theratingID=parameterList['q'];var theVote=parameterList['j'];var theunits=parameterList['c'];var theunits_detail=parameterList['cd'];var therating_image_width=parameterList['w'];var therating_form_typ=parameterList['v'];sndReq(theVote,theratingID,theunits,theunits_detail,therating_image_width,therating_form_typ);return false;}}};Behaviour.register(ratingAction);
