// JavaScript Document
var _obj = null;
var _i = 0;
function setupCentering() {
	/*try { document.body.onresize = doCenter; } catch(e) {}
	try { document.onresize = doCenter; } catch(e) {}
	try { window.onresize = doCenter; } catch(e) {}*/
	_obj = document.getElementById("aw");
	_i = setInterval(MeasureXM, 100);
}

function doCenter() {
	//setTimeout(actualAction,10);
	setTimeout(MeasureXM,10);
}

function actualAction() {
	try {
		var w = Math.max(document.body.scrollWidth, document.documentElement.offsetWidth);
		var h = Math.max(document.body.scrollHeight, document.documentElement.offsetHeight);
		_obj.style.left = Math.max(Math.round((w - _w) / 2),0) + "px";
		_obj.style.top = Math.max(Math.round((h - _h) / 2),0) + "px";
	} catch(e) {}
}

function showDroplist() {
	document.getElementById("ddlist").style.display = "block";
	document.body.onmouseup = hideDroplist;
}

function hideDroplist() {
	document.getElementById("ddlist").style.display = "none";
	document.body.onmouseup = null;
}

function selectedDDL(val) {
	document.getElementById("txtPhonePrefix").value = val;
}

function cbClick(who) {
	if (who.className.indexOf(" on") > -1) {
		who.className = who.className.replace(" on", " off");
		document.getElementById("hdnGetNewsletter").value = "0";
	} else {
		who.className = who.className.replace(" off", " on");
		document.getElementById("hdnGetNewsletter").value = "1";
	}
}

function MeasureXM() {
	try {
		//var xm = document.getElementById("_xm");
		//var w = Math.max(document.body.scrollWidth, document.documentElement.offsetWidth);
		var h = Math.max(document.body.scrollHeight, document.documentElement.offsetHeight);
		//_obj.style.left = Math.max(Math.round((xm.offsetLeft*2 - _w) / 2),0) + "px";
		_obj.parentNode.style.paddingTop = Math.max(Math.round((h - _h) / 2),0) + "px";
	} catch(e) {}
}