﻿// Check to see if browser supports rollovers.
var blnImageSupport = (document.images)? true:null;

//Image Replacer, much faster than the Macromedia version
function CV_ChangeImage(strImageName,sNewImagePath) { 
   // Change the original scource with the new one..
   if (blnImageSupport) { 
      document.images[strImageName].src = sNewImagePath;
   }
}

function openPopUp(PageName){
	new_window = window.open(PageName,"new_window","width=400,height=400,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50"); 
	if (new_window.opener == null) { 
		new_window.opener = self; 
	} 
	new_window.focus();
}
function openSizedPopUp(PageName, Width, Height){
	new_window = window.open(PageName,"new_window","width="+Width+",height="+Height+",location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50"); 
	if (new_window.opener == null) { 
		new_window.opener = self; 
	} 
	new_window.focus();
}

function newsletterSignUp(form)
		{
		  var field = frmEmail_RN.email; // email field
		  var str = field.value; // email string
		  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
		  if (!reg1.test(str) && reg2.test(str))
		  {
			return true;
		  }
		  alert(str + " is an invalid e-mail!");
		  field.focus();
		  field.select();
		  return false;
		}
		
		function validateQuickOrder(form) {
	if ((form.pn.value == "")||(form.pn.value == "Enter Item #")) {
		alert("Please enter an item number.");
		form.pn.focus();
		return false;
	}
	return true;
}
