var Obj='', pX, pY;
document.onmouseup = MUp;
document.onmousemove = MMove;
function MDown(Object)
{
	Obj = Object.id;
	document.all(Obj).setCapture();
	pX = event.x-document.all(Obj).style.pixelLeft;
	pY = event.y-document.all(Obj).style.pixelTop;
}
function MMove()
{
	if (Obj != '') {
		document.all(Obj).style.left = event.x - pX;
		document.all(Obj).style.top = event.y - pY;
  }
}
function MUp()
{
	if (Obj != '') {
		document.all(Obj).releaseCapture();
		Obj='';
	}
}
function getCookie(str)
{
	var tmp, reg = new RegExp("(^| )" + str + "=([^;]*)(;|$)", "gi");
	if (tmp = reg.exec(document.cookie))
		return(tmp[2]);
	return '';
}
function showad()
{
	var show = getCookie('ad');
	if (show == '') {
		ad1.style.display = '';
		ad2.style.display = '';
		document.cookie = 'ad=1';
	} else if(show == '1') {
		ad1.style.display = '';
		ad2.style.display = '';
		document.cookie = 'ad=2';
	} else {
		ad1.style.display = 'none';
		ad2.style.display = 'none';
	}
}
function closead(ad)
{
	document.all(ad.id).style.display = 'none';
}
