
function EmailValidator(theForm)
	{
		var emailField = theForm.Email.value;
		
		if ((emailField == "") || 
			(emailField == "Enter email address") || 
			(emailField == "enter email") ||
			(emailField == "name@domain.com") || 
			(emailField.indexOf("@") == -1) || 
		    (emailField.charAt(0) == ".") || 
		    (emailField.charAt(0) == "@") || 
		    (emailField.indexOf(".") == -1) || 
		    (emailField.charAt(emailField.length - 1) == ".") || 
		    (emailField.charAt(emailField.length - 1) == "@") || 
		    (emailField.charAt(emailField.indexOf("@")+1) == ".") || 
		    (emailField.charAt(emailField.indexOf("@")-1) == "."))
		{
			alert("Please enter your e-mail address to subscribe");
			theForm.Email.focus();
			return false;
		}
		else
			return true;
		
	}
	
function SearchValidator(theForm)
	{
		if ((theForm.q.value == "") || (theForm.q.value == "SEARCH") || (theForm.q.value == "Enter keyword(s)"))
        {
			alert("Please enter keyword(s) for search");
	        theForm.q.focus();
	        return (false);
        }
	}

function DTSearchValidator(theForm)
	{
		if ((theForm.request.value == "") || (theForm.request.value == "SEARCH") || (theForm.request.value == "Enter keyword(s)"))
        {
			alert("Please enter keyword(s) for search");
	        theForm.request.focus();
	        return (false);
        }
	}	
	
function ArchiveSearchValidator(theForm)
	{
		if ((theForm.query.value == "") || (theForm.query.value == "SEARCH") || (theForm.query.value == "Enter keyword(s)"))
        {
			alert("Please enter keyword(s) for search");
	        theForm.query.focus();
	        return (false);
        }
	}	


function popUpEmail(sSubj, iWidth, iHeight)
	{
		// this function is used for share this page;
    			
		var mywindow;
		var myURL;	
		
    	myURL =  "/utils/shareApage.asp?txtMisc=" + sSubj + "&txtWebAddress=" + location.href;

    	mywindow = window.open(myURL,"myWin","toolbar=0,menubar=0,resizable=no,left=247,screenx=247,top=134,screeny=134,location=0,directories=0,scrollbars=0,width=" + parseInt(iWidth)+ ",height=" + parseInt(iHeight));
		mywindow.focus();      
	}

function popUpSearchEmail(sURL, sSubj, iWidth, iHeight)
	{
		// this function is used for share this page;
    			
		var mywindow;
		var myURL;	
		
    	myURL =  "/utils/shareApage.asp?txtMisc=" + sSubj + "&txtWebAddress=" + sURL;

    	mywindow = window.open(myURL,"myWin","toolbar=0,menubar=0,resizable=no,left=247,screenx=247,top=134,screeny=134,location=0,directories=0,scrollbars=0,width=" + parseInt(iWidth)+ ",height=" + parseInt(iHeight));
		mywindow.focus();      
	}
	
function popUpWindow(sURL,sWidth,sHeight)
	{
			// this function is used to open a pop-up window for the quiz and survey
			
			var mywindow;
			
    	   	mywindow = window.open(sURL,"myWin","toolbar=0,menubar=0,resizable=yes,location=0,directories=0,scrollbars=1,width="+sWidth+",height="+sHeight+",left=100,screenX=100,top=100,screenY=100");
			mywindow.focus();  
	    	}	
			
function popUp(url) 
{
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin"; 
}

function BookmarkPage() {
	if (window.sidebar && window.sidebar.addPanel) {
	window.sidebar.addPanel(document.title,location.href,"");
	} else if (window.external && (navigator.platform=="Win32" || (window.ScriptEngine && ScriptEngine().indexOf("InScript") + 1))) {
	window.external.AddFavorite(location.href,document.title);
	} else if (window.opera && window.print) {
	return true;
	} else if (document.layers) {
	window.alert("Please click OK then press Ctrl+D to create a bookmark");
	} else {
	window.alert("Please use your browser\'s bookmarking facility to create a bookmark");
	}
}
