// JavaScript Document

var myWidth = myHeight = 0;
function findPos2(x,y) {
	var gw = document.getElementById('div1').offsetWidth;
	var gh = document.getElementById('div1').offsetHeight;
	var Dheight = gh+20;
	var Dwidth= gw+20;
	var y1=y-Dheight;
	var x1=x-Dwidth
	var y2 = document.documentElement.scrollTop;
	var obj1 = new getObj2('div1');
	y1=(y+y2)-Dheight;
	if(obj1.style){
		obj1.style.top=y1+"px";
		//obj1.style.left=x1+"px";
	}else{
		div1.style.top=y1;
		div1.style.left=x1;
	}
}
function getObj2(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function setpos2() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  } 
  findPos2(myWidth,myHeight);
}