// You can modify the following lines
var _path="/rating"; // path to script on the server
var _a=new Array("Rate this page","Very negative","Negative","Neutral","Positive","Very positive");
var _w=19,_h=19; // button image width and height
var _bgcolor="#CCCCCC";

// Leave the following unchanged
var _d=document,_i,_ia=new Array(),_p,_t,_s=0,_ts,_was,_hs;
function _repos() {
  _p.style.left=_d.body.scrollLeft+_d.body.clientWidth-_p.offsetWidth-16;
  _p.style.top=_d.body.scrollTop+_d.body.clientHeight-_p.offsetHeight-16;
  if (_s) (_s==1?_rp:_rt).style.left=_p.offsetLeft+((_p.offsetWidth-_w)>>1)+1-(_s==1?_rp:_rt).offsetWidth;
  if (_s==1) _rp.style.top=_p.offsetTop+6*_h-_rp.offsetHeight;
  if (_s==2) _rt.style.top=_p.offsetTop+_h-_rt.offsetHeight;
}
function _ch0() {
  _d.all._r0.style.display=''; _d.all._r1.style.display='none';
  _p=_d.all._r0; _repos();
}
function _ch1() {
  if (_was) { _thnk(); return; }
  _d.all._r0.style.display='none'; _d.all._r1.style.display='';
  _rt.style.display='none';
  _p=_d.all._r1; _repos();
}
function _cs() {
  _rp.style.display='none';
  _s=0;
}
function _flip0(x) {
  _t=setTimeout("_ch0()",200);
  _ts=setTimeout("_cs()",10);
  x.style.background="";
}
function _flip1(x) {
  if (_t) clearTimeout(_t);
  if (_s) {
    if (_ts) clearTimeout(_ts);
    _rp.style.display='';
    _repos();
  } else
    x.style.background=_bgcolor;
}
function _thnk() {
  _s=2; _rt.style.display='';
  setTimeout("_rt.style.display='none';",3000);
  _ch0();
}
function _setCookie(name, value, minutes) {
  if (minutes) { now = new Date(); now.setTime(now.getTime() + minutes*60*1000); }
  var curCookie = name + "=" + escape(value) + ((minutes) ? "; expires=" + now.toGMTString() : "");
  _d.cookie = curCookie;
}
function _getCookie(name) { 
  var prefix = name + "=";
  var cStartIdx = _d.cookie.indexOf(prefix); 
  if (cStartIdx == -1) return '';
  var cEndIdx = _d.cookie.indexOf(";", cStartIdx+prefix.length);
  if (cEndIdx == -1) cEndIdx = _d.cookie.length;
  return unescape( _d.cookie.substring(cStartIdx + prefix.length, cEndIdx) );
}
function _hash(str) {
  var _x=0,_c=new Array(0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f'),_r="";
  for (_i=0;_i<str.length;_i++)
    _x += (str.charCodeAt(_i))<<((_i%3)*8);
  for (;_x>0;_x>>=4) _r += _c[_x%16];
  return _r;
}
if (_d.forms.length!=1||_d.forms[0].name!="_rank") {
// ---
_i = _d.location.href.indexOf("/", 7);
_hs = "rating"+_hash(_i > 0 ? _d.location.href.substring(_i, _d.location.href.length) : "");
_was = _getCookie(_hs);
// ---
_d.write("<BODY onScroll='_repos()' onResize='_repos()'>");
_d.write("<DIV align=center id=_r0 style='position:absolute;cursor:hand;'><IMG src='"+_path+"/img/btn_display.gif' onMouseOver='_ch1()'><BR>");
_d.write("<IMG src='"+_path+"/img/feedback.gif' width=75 height=15></DIV>");
_d.write("<DIV align=center id=_r1 style='position:absolute;display:none;cursor:hand;'>");
for (_i=5;_i>=0;_i--) {
  if (_i) _d.write("<A href='"+_path+"/receive.php?r="+_i+"' onClick='_setCookie(_hs,1,24*60)'>");
  _d.write("<IMG src='"+_path+"/img/btn"+_i+".gif' width="+_w+" height="+_h+" border=0 title='"+_a[_i]+"' onMouseOver='_s="+(_i?0:1)+";_flip1(this)' onMouseOut='_flip0(this)'><BR>");
  if (_i) _d.write("</A>");
}
_d.write("<IMG src='"+_path+"/img/feedback.gif' width=75 height=15></DIV>");
_i="<A href='"+_path+"/comment.htm' onClick=\"window.open(this.href,'rating','width=675,height=200,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,left='+parseInt(_d.body.offsetLeft+(_d.body.offsetWidth-600)/2)+',top='+parseInt(_d.body.offsetTop+(_d.body.offsetHeight)/2));return false;\">";
_d.write(_i+"<IMG src='"+_path+"/img/o_pop.gif' border=0 id=_rp style='position:absolute;display:none;cursor:hand;' onMouseOver='_flip1(this)' onMouseOut='_flip0(this)'></A>");
_d.write(_i+"<IMG src='"+_path+"/img/o_pop2.gif' border=0 id=_rt style='position:absolute;display:none;'></A>");
_d.write("</BODY>");
// Preload images
if (_d.images)
  for (_i=0;_i<=5;_i++) {
    _ia[_i]=new Image;
    _ia[_i].src=_path+"/img/btn"+_i+".gif";
  }
if (_d.referrer==_d.location.href) _thnk();
else _ch0();
}
