var the_date = new Date(); // for url args added Jan 05
the_date.setMonth(the_date.getMonth() + 2);
var expiry_date=the_date.toGMTString();
var adDescriptor=location.search.substring(1);
 if (adDescriptor != "") {
   document.cookie='padvertiser='+adDescriptor+';expires='+expiry_date+';path=/';
   document.cookie='sadvertiser='+adDescriptor+';path=/';
 } 
document.cookie="lastpage="+escape('index.html')+"; path=/";



// Browser Check
ie=document.all
iens6=ie||document.getElementById
// GLOBALS
showed=0
winWidth=0
x=0
y=0
ytop=0
xleft=0
popoffbottom=0
popofftop=0
popofflow=0
winH=-1000
stayOnTop=0
stayOnBottom=0
stayOnLeft=0
stayOnRight=0
cellLeft=0
cellBottom=0
// END GLOBALS

function stopIt() {
 showed=0
 if (menObj) {
	menObj.className='popOff'
	menObj.innerHTML = ""
 }
}


function hideFloat() {
 if (FltMenObj) {
	FltMenObj.className='popOff'
	FltMenObj.innerHTML = ""
 }
}


function newgetXYie(e) {
	x=0; y=0
	x=event.clientX+document.body.scrollLeft; y=event.clientY+document.body.scrollTop;
	//see http://javascript.about.com/library/blmousepos.htm
	if (showed) {
		if (((y<stayOnTop)||(y>cellBottom)||(x<cellLeft)||(x>stayOnRight))&&((y<stayOnTop)||(y>stayOnBottom)||(x<stayOnLeft)||(x>stayOnRight))) stopIt();
        }
}


function getXYie(e) {
	x=0; y=0
	x=event.x; y=event.y;
//see http://javascript.about.com/library/blmousepos.htm
	if (showed) {
		if (((y<stayOnTop)||(y>cellBottom)||(x<cellLeft)||(x>stayOnRight))&&((y<stayOnTop)||(y>stayOnBottom)||(x<stayOnLeft)||(x>stayOnRight))) stopIt();
//		if ((y<stayOnTop)||(y>stayOnBottom)||(x<stayOnLeft)||(x>stayOnRight)) stopIt()
        }
}

function getXYns6(e) {
	x=0; y=0
	x=e.pageX; y=e.pageY
	if (showed) {
		if (((y<stayOnTop-5)||(y>cellBottom)||(x<cellLeft)||(x>stayOnRight))&&((y<stayOnTop)||(y>stayOnBottom)||(x<stayOnLeft)||(x>stayOnRight))) stopIt()
	}
}


 if (ie) {
	if (window.event!='undefined') document.onmousemove=getXYie
 } else {
	if (iens6) document.onmousemove=getXYns6
 }



function pop(msgNo,posn) {
	if (!iens6) return
	msg=getMenu(msgNo,"")
	if (posn==1) {
		popCell='img'+msgNo
		var xoffset=120
		var yoffset=0
		var topmargin=3
	} else {
		popCell='link'+msgNo
		var xoffset=130
		var yoffset=30
		popDiv='div'+msgNo
 		if (document.getElementById(popDiv)) {
			divObj=document.getElementById(popDiv)
			if (divObj.offsetHeight) yoffset=divObj.offsetHeight
		}
		var topmargin=yoffset+10
	}
	var cellTop=0;
	cellLeft=0;
 	if (document.getElementById(popCell)) {
		cellObj=document.getElementById(popCell)
		if (cellObj.offsetParent) {
			do {
				cellLeft += cellObj.offsetLeft;
				cellTop += cellObj.offsetTop;
			} while (cellObj = cellObj.offsetParent);
		}
		var xscroll=0; var yscroll=0;
		if (((document.body.scrollLeft)||(document.body.scrollTop))&&(ie)) {
			xscroll=document.body.scrollLeft
			yscroll=document.body.scrollTop
		}
		xleft=0
		ytop=0
		menObj=document.getElementById('pop')
		var menuTop=cellTop+yoffset
		menObj.style.top = menuTop
		var menuLeft=cellLeft+xoffset
		menObj.style.left = menuLeft
		menObj.innerHTML=msg
		menObj.className='topPopOn'
		showed=1
		var popupWidth=menObj.offsetWidth
		var popupHeight=menObj.offsetHeight
		stayOnTop=menuTop-yscroll-topmargin
		stayOnBottom=stayOnTop+popupHeight+topmargin+5
		stayOnLeft=menuLeft-xscroll
		stayOnRight=stayOnLeft+popupWidth
		cellBottom=cellTop+29
	}
}


