function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



var IE=(!this.isOpera&&document.all&&navigator.userAgent.match(/msie/gi))?true:false;
if (window.XMLHttpRequest) {
document.write("<DIV id=bottom_bar18><DIV id=goto_top18><A href='javascript:scroll(0,0);'><IMG alt='Go to top' border=0 src='icons/top.png'></A></DIV><DIV class=menu_floating><UL>  <LI><A href='/?a=home'><IMG alt=''  border=0  src='icons/bar_home.png'> Home</A> </LI><LI><A ><IMG alt=''   src='icons/bar_listings.png'> Listings</A>  <UL> <LI><A href='/?a=new'>New Added</A> </LI>   <LI><A href='/?type=1'>Premium</A> </LI>    <LI><A href='/?type=2'>Normal</A> </LI> <LI><A href='/?type=3'>Trial</A> </LI>   <LI><A href='/?type=6'>Scam</A> </LI>  </UL></LI><LI><A ><IMG alt='' src='icons/bar_advertise.png'> Advertise<!--[if gte IE 7]><!--></A><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--> <UL><LI><A href='/?a=add&type=1'>Add Premium</A> </LI> <LI><A href='/?a=add&type=2'>Add Normal</A> </LI>   <LI><A href='/?a=add&type=3'>Add Trial</A> </LI> <LI><A href='/?a=advertise'>Add Banners</A> </LI>    </UL><!--[if lte IE 6]></td></tr></table></a><![endif]--></LI><LI><A ><IMG alt=''  src='icons/bar_contact.png'>   Contact Us<!--[if gte IE 7]><!--></A><!--<![endif]--><!--[if lte IE 6]><table><tr><td>	<![endif]--> <UL> <LI><A href='/?a=support'>Support Forum</A> </LI><LI><A href='mailto:admin@serialhyip.com'>Mail Us</A> </LI><LI><A href='ymsgr:sendIM?serialhyip'>Our YM</A> </LI></UL></LI><LI><A><IMG alt=''  src='icons/bar_new.png'> Update Info</A><UL>  <LI><A href='/?a=news'>News</A></LI> </UL> </LI><LI><A href='/partner'><IMG alt='' border=0 src='icons/bar_toplist.png'> Partner</A></DIV></DIV>");}



/* Browser Window Size and Position */
function pageWidth() {
  return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

function pageHeight() {
  return window.innerHeight != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;
}

function posLeft() {
  return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}

function posTop() {
  return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

function posRight() {
  return posLeft() + pageWidth();
}

function posBottom() {
  return posTop() + pageHeight();
}

/* Mouse Position */
function getNsMouseXY(e) {
  if (document.getElementById && !document.all) {
    nsmousepos.pageX = e.pageX;
    nsmousepos.pageY = e.pageY;
    nsmousepos.clientX = e.clientX;
    nsmousepos.clientY = e.clientY;
  }
}

function ietruebody() {
  return (document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : document.body;
}

function getMouseX() {
  return (document.getElementById && ! document.all) ? nsmousepos.pageX : event.x + ietruebody().scrollLeft;
}

function getMouseY() {
  return (document.getElementById && ! document.all) ? nsmousepos.pageY : event.y + ietruebody().scrollTop;
}

/* Show rate banner */
function srb( item_id ) {
  
  var rateBannerWidth = 130;
  var rateBannerHeight = 150;
  var rateBannerMouseMarginX = 20;
  var rateBannerMouseMarginY = 40;
  var x = 0;
  var y = 0;

  if ( nbquery >= 240 ) {
    return null;
  }
  
  var myDiv = document.getElementById( 'divPic' );

  var mouseX = getMouseX();
  var maxPosRight = mouseX + rateBannerWidth + rateBannerMouseMarginX;
  if ( maxPosRight > posRight() ) {
    x = mouseX - rateBannerWidth - rateBannerMouseMarginX;
  } else {
    x = mouseX + rateBannerMouseMarginX;
  }

  var mouseY = getMouseY();
  var maxPosTop = mouseY - rateBannerMouseMarginY;
  var maxPosBottom = mouseY + rateBannerHeight - rateBannerMouseMarginY;
  if ( maxPosTop < posTop() ) {
    y = posTop() + 2;
  } else if ( maxPosBottom > posBottom() ) {
    y = posBottom() - rateBannerHeight - 2;
  } else {
    y = mouseY - rateBannerMouseMarginY;
  }

  if ( new Date().getTime() >= (timestampquery + 1000) ) {
    if ( myDiv.style.visibility == 'hidden' ) {
      nbquery++;
      myDiv.style.visibility = 'visible';
      timestampquery =  new Date().getTime();
      myDiv.innerHTML = '<img src="small.php/?a=image&lid='+item_id+'&amp;nocache='+nbquery+"-"+timestampquery+'" width="'+rateBannerWidth+'" height="'+rateBannerHeight+'">';
    }
  }
  
  y = ( y < 0 ) ? 0 : y;
  myDiv.style.top  = y + 'px';
  myDiv.style.left = x + 'px';
}

/* Hide Rate Banner */
function hrb() {
  var myDiv = document.getElementById( 'divPic' );
  myDiv.style.visibility = 'hidden';
  myDiv.innerHTML = '';
}

/* Start global section */
if (document.getElementById && !document.all) {
  var nsmousepos = new Object();
  nsmousepos.pageX = 0;
  nsmousepos.pageY = 0;
  nsmousepos.clientX = 0;
  nsmousepos.clientY = 0;
}

var nbquery = 0;
var timestampquery = new Date().getTime();

document.onmousemove = getNsMouseXY;


