//FUNCTION: validateEmail
//Contains a least one character procedding the @
//Contains a "@" following the procedding character(s)
//Contains at least one character following the @, followed by a dot (.), 
//	followed by either a two character or three character string 
//	(a two character country code or the standard three character US code, such as com, edu etc)
function validateEmail(sEmailAddress){
	//create the regexp to test the email address text
	var oEmailRegExp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	//perform the test and return success as appropriate
	if (oEmailRegExp.test(sEmailAddress)){
		return true;
	}else{
		return false;
	}
}

var miDisplayedImageProductId = null;

function displayHoverImage(e, productId){
	//get the cursor position
	var iXPos = getCursorPosX(e) + 10;
	var iYPos = getCursorPosY(e) + 20;	

	//hide any other image panel showing
	if(miDisplayedImageProductId != null){
		hideHoverImage(miDisplayedImageProductId);
	}
	//get the image panel and the image to display
	var oImagePanel = document.getElementById("divHoverImage_" + productId);	
	if(oImagePanel){
		if(oImagePanel.className.indexOf("hoverImagePanelDisplay") == -1){
			oImagePanel.className += " hoverImagePanelDisplay";
		}				
		sXPos = iXPos + "px";
		sYPos = iYPos + "px";
		oImagePanel.style.left = sXPos;
		oImagePanel.style.top = sYPos;
		
		miDisplayedImageProductId = productId;
	}
}
function hideHoverImage(productId){
	var oImagePanel = document.getElementById("divHoverImage_" + productId);
	if(oImagePanel){
		oImagePanel.className = "hoverImagePanel";
	}
}

function getCursorPosX(e){
	ev = e || window.event;
	return ev.clientX;
}
function getCursorPosY(e){
	ev = e || window.event;
	return ev.clientY;
}

function selectLocation(){
	var oSelLocation = document.getElementById("selChooseWebsite");
	if(oSelLocation){
		window.location = oSelLocation.options[oSelLocation.selectedIndex].value;
	}
}