function pageWidth() {
    return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;
  }

  function pageHeight() {
    return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;
  }

  function GetObjHeight(objname){
    var doc = document.getElementById(objname);
    if (document.all) {
      H = doc.currentStyle.height;
    } else {
	  H = document.defaultView.getComputedStyle(doc, null).height;
	}
	H = H.substr(0,H.length-2);
    return Number(H);
  }

  function GetObjWidth(objname){
    var doc = document.getElementById(objname);
    if (document.all) {
      H = doc.currentStyle.width;
    } else {
	  H = document.defaultView.getComputedStyle(doc, null).width;
	}
	H = H.substr(0,H.length-2);
    return Number(H);
  }

  function scrollTop () {
    if (document.documentElement && document.documentElement.scrollTop)
	  theTop = document.documentElement.scrollTop;
	else if (document.body)
	  theTop = document.body.scrollTop
	return theTop;
  }

  function scrollLeft () {
    if (document.documentElement && document.documentElement.scrollLeft)
	  theLeft = document.documentElement.scrollLeft;
	else if (document.body)
	  theLeft = document.body.scrollLeft
	return theLeft;
  }

  function hidethis() {
    if (canclose==1) {
      var posiadss = document.getElementById('posi_sample')
	  posiadss.style.visibility='hidden';
	}
  }

  function starttime() {
    var positimeout = window.setTimeout('hidethis()',1000);
    canclose=1;
  }

  function stoptimeout() {
    var positimeout;
	canclose=0;
    clearTimeout(positimeout);
  }

   var place = (function(e) {
     function gC(e) {return {x: 0, y: 0};}
     function dC(e) {return {x: e.clientX, y: e.clientY};}
     function isN(o) {return 'number' == typeof o;}
     if(isN(e.clientX) && isN(e.clientY)) {gC = dC;}
     else if(isN(e.x) && isN(e.x)) {gC = mC;}
     (place = function(e,it) {
	   canclose=0;
       var div = gC(e);
	   var doc = document.getElementById('values');
	   var posiadss = document.getElementById('posi_sample');
	   thistemplate = '<center><table class="positext_copy">  <tr>    <td align="center"><a href="http://www.click4usa.com/index.php?ref_partenaire=16" class="positext_copy_a">POSITEXT AD</a></td>  </tr></table></center><table class="positext_table">  <tr>    <th><a target="_blank" href="http://www.shopzilla.com" class="positext_th_a">Catalogue - Bargain Prices	   </a></th>  </tr>  <tr>    <td align="left"><a target="_blank" href="http://www.shopzilla.com" class="positext_td_a">Shop fast. Buy smart. Smart shoppers Shopzilla! Every product from every store means you get a bargain price. Don\'t just shop, Shopzilla!</a></td>  </tr>  <tr>    <td align="right"><a target="_blank" href="http://www.shopzilla.com" class="positext_table_a">http/www.shopzilla.com</a></td>  </tr></table>';
	   posiadss.innerHTML = thistemplate;
	   var pageheight = pageHeight();
	   var divheight = GetObjHeight('posi_sample');
	   var pagewidth = pageWidth();
	   var divwidth = GetObjWidth('posi_sample');
	   divheight = 1;
	   divwidth = 1;
	   var evalu = eval(div.y)+eval(divheight)+110;
	   var Xcorrect = 0;
	   var Ycorrect = 0;

	   if (pageheight >= evalu) {
	     posiadss.style.top=(eval(div.y)+scrollTop()+10+Xcorrect)+'px';
	   } else {
	     posiadss.style.top=((eval(div.y)+scrollTop())-eval(divheight)-110+Xcorrect)+'px';
	   }
	   var evalu = eval(div.x)+eval(divwidth);
	   if (pagewidth >= evalu) {
	     posiadss.style.left=(eval(div.x)+scrollLeft()+10+Ycorrect)+'px';
	   } else {
	     posiadss.style.left=((eval(div.x)+scrollLeft())-eval(divwidth)-20+Ycorrect)+'px';
	   }
	   posiadss.style.visibility='visible';
     })(e);
    });

  function placed(event) {
	var browserName=navigator.appName;
	if (browserName!="Microsoft Internet Explorer") {
	  place(event);
	} else {
	  place(window.event);
	}
  }
