// JavaScript Document
var myWidth = 0, myHeight = 0;
var Moffset = 400;
function resetPos() {
	cookievalue = readCookie('hidevideo');
	if(!cookievalue){		
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		//myHeight = window.innerHeight;
		myHeight = window.pageYOffset+Moffset;
	  } else if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		// myHeight = document.documentElement.clientHeight;
		myHeight = document.documentElement.scrollTop+Moffset;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.scrollTop+Moffset;
		//myHeight = document.body.clientHeight;
	  }
		obj1 = document.getElementById('vidplay');
		str = myHeight;// -240;
		strleft = myWidth/2+100;
		obj1.style.left = strleft+'px';
		obj1.style.top  = str+'px';
		obj1.style.display = '';
	}
}
function hidediv() {
	obj1 = document.getElementById('vidplay');
	obj1.style.display = 'none';
	createCookie('hidevideo',1);
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name) {
	createCookie(name,"",-1);
	resetPos();
}
window.onscroll=resetPos;