// JavaScript Document

document.onload = setpos1();
var myWidth = myHeight = 0;
function findPos(x,y) {
	var y2;
	var Dwidth = 250;
	var Dheight = 360;
	var x1=x-Dwidth;
	y1=y-Dheight;
	window.onscroll= function(){
		y2 = document.documentElement.scrollTop;
		var obj1 = new getObj('div1');
		y1=(y+y2)-Dheight;
		if(obj1.style){
			obj1.style.top=y1+"px";
			//obj1.style.left=x1+"px";
		}else{
			div1.style.top=y1;
			//div1.left=x1;
		}
	}
}
function getObj(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 setpos1() {
  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;
  } 
  findPos(myWidth,myHeight);
}