//Reg positioning

function loadReg() {
if (window.addEventListener) {
					 window.addEventListener('resize',getXPos,false);
					 }
					 else {
					 if (window.attachEvent) {
						 window.attachEvent('onresize',getXPos);
						 }
					 else {
							var old2 = window.onscroll; 
							window.onresize = function() { if (old2) old2(); getXPos(); } // IE Mac
						}
					 }
					setXPos();
}

function FindTedX(oEl,iAdd) {
		var x = String(iAdd) == 'undefined' ? 0 : iAdd;
		if (oEl.offsetWidth) x += oEl.offsetWidth;
			if (oEl.offsetParent) {
				while (oEl.offsetParent) {
					x += oEl.offsetLeft
					oEl = oEl.offsetParent;
				}
			} else if (oEl.x) x += oEl.x;
		return x;
	}

function FindTedY(oEl,iAdd) {
	var y = String(iAdd) == 'undefined' ? 0 : iAdd;
	if (oEl.offsetHeight) y += oEl.offsetHeight;
	if (oEl.offsetParent) {
		while (oEl.offsetParent) {
			y += oEl.offsetTop
			oEl = oEl.offsetParent;
		}
	} else if (oEl.y) y += oEl.y;
	return y;
}	

function getSrchPos() {
	getHID=document.getElementById('srchAgn');
	newPY=(FindTedY(getHID)+15)
	if (this.chkBrowser('msie') && this.chkBrowser('mac')) {
		newPY=newPY-295;
	}
	newPY=newPY+'px';
	return newPY;
}
	
function gettWidth() {
	var theWidth; 
	if (window.innerWidth)
		theWidth=window.innerWidth;
		else if (document.documentElement && document.documentElement.clientWidth)
			theWidth=document.documentElement.clientWidth;
		else if (document.body)
			theWidth=document.body.clientWidth;
	return theWidth; 
}	
	
function setXPos() {
	getHID=document.getElementById('blueHeader');
	newPX=FindTedX(getHID);
	theWidth=gettWidth();
	adjVal=(theWidth-newPX)/1;	
	
	//if (rsz=1) {adjVal=adjVal;}
	
	adB=document.getElementById('ad');
	//if (this.chkBrowser('msie') && this.chkBrowser('mac')) {
	newPYad=FindTedY(getHID);
	if (chkBrowser('msie') && chkBrowser('mac')) {
	adB.style.left=(newPX-127)+'px';
	adB.style.left=(newPX-127)+'px';
	
	}
	else {
	adB.style.left=(newPX-127)+'px';
	}
	adB.style.top=(newPYad+5)+'px';
	
	if (document.getElementById('prctip')) {
	getPrc=document.getElementById('prctip');
	
	//getPrc.style.top=(newPYad+166)+'px';
	getPrc.style.top=(newPYad+156)+'px';
	if (chkBrowser('msie')) {
	getPrc.style.top=(newPYad+166)+'px';
	}
	//if (this.chkBrowser('msie') && this.chkBrowser('mac')) {
	if (chkBrowser('msie') && chkBrowser('mac')) {
			if (adjVal > 0 || adjVal ==0) {		
				getPrc.style.left=(newPX-adjVal)-114+'px';
				getPrc.style.left=(newPX-adjVal)-114+'px';		
			}
			else 
				getPrc.style.left='640px';
	}
	else {adjVal=717;
				
	getPrc.style.left=(newPX-127)+'px';
	}
	getPrc.style.display='block';
	}
	//if (this.chkBrowser('msie') && this.chkBrowser('mac')) {
	if (chkBrowser('msie') && chkBrowser('mac')) {
		if (adjVal > 0 || adjVal ==0) {
		
		}
		else {
			newPX=762;
		}
	}	
	if (document.getElementById('prctip')) {
	pXVal=newPX-100;
	}
	else {
	pXVal=newPX-135;
	}
	//if (this.chkBrowser('msie') && this.chkBrowser('mac')) {
	if (chkBrowser('msie') && chkBrowser('mac')) {
		if (adjVal >0 || adjVal == 0) {
			PX1Val=((newPX-adjVal)+19)-643;
			PX2Val=((newPX-adjVal)+19)-382;
		}
		else {
			PX1Val=129;
			PX2Val=390;
		}
	}
	else {
		PX1Val=newPX-643;
		PX2Val=newPX-382;
	}
}	

function getXPos() {
//if (this.chkBrowser('msie') && this.chkBrowser('mac')) {
getHID=document.getElementById('blueHeader');
newPYad=FindTedY(getHID);
if (chkBrowser('msie') && chkBrowser('mac')) {
	rsz=1;
	setXPos();
}
else {
	// repos for all others
	rsz=1;
	theWidth=gettWidth();
	newPX=FindTedX(getHID);
	
	adB=document.getElementById('ad');
	adB.display='none';
	adB.style.left=(newPX-127)+'px';
	
	if (document.getElementById('prctip')) {
	pXVal=newPX-100;
	}
	else {
	pXVal=newPX-135;
	}
	
	PX1Val=newPX-643;
	PX2Val=newPX-382;
	
	if (document.getElementById('prctip')) {
		getPrc=document.getElementById('prctip');
		adjVal=717;
		getPrc.style.left=(newPX-127)+'px';

	if (document.getElementById('prctlt1')) {
		mvtlt=document.getElementById('prctlt1');
		mvtlt.style.left=PX1Val+'px';
	}

	if (document.getElementById('prctlt2')) {
		mvtlt=document.getElementById('prctlt2');
		mvtlt.style.left=PX2Val+'px';
	}
	}
	}
}	



