﻿function verify(form)
{
	var passed = false;
	var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;
	if (form.Email){
  			    intAtSign=form.Email.value.indexOf("@");
				intDot=form.Email.value.indexOf(".",intAtSign);
				intComma=form.Email.value.indexOf(",");
				intSpace=form.Email.value.indexOf(" ");
				intLastDot=form.Email.value.lastIndexOf(".");
				intDomain=intDot-intAtSign;
				intStrLen=form.Email.value.length;
		// *** CHECK FOR BLANK EMAIL VALUE
		   if (form.Email.value == "" )
		   {
		alert("You have not entered an email address.");
		form.Email.focus();
		passed = false;
		}
		// **** CHECK FOR THE  @ SIGN?
		else if (intAtSign == -1)
		{

		alert("Your email address is missing the \"@\".");
				form.Email.focus();
		passed = false;

		}
		// **** Check for commas ****

		else if (intComma != -1)
		{
		alert("Email address cannot contain a comma.");
		form.Email.focus();
		passed = false;
		}

		// **** Check for a space ****

		else if (intSpace != -1)
		{
		alert("Email address cannot contain spaces.");
		form.Email.focus();
		passed = false;
		}

		// **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot ****

		else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1) < 2))
		{
		alert("Please enter a valid Email address.\n" + form.Email.value + " is invalid.");
		form.Email.focus();
		passed = false;
		}
		else {
				passed = true;
		}
		}
		else    {
				passed = true;
		}
		alert(passed);
		return passed;
}


	function showMenu(id)
	{
		var subMenu = null;
		var i = 0;

		for (i=0; i < 15; i++)
		{
			subMenu = document.getElementById('subMenu' + i);
			if (subMenu && i==id)
				subMenu.style.display = 'inline';
			else if (subMenu)
				subMenu.style.display = 'none';
		}
	}

	function setMainMenu(id)
	{
		var mainMenu = null;
		var i = 0;

		for (i=0; i < 10; i++)
		{
			mainMenu = document.getElementById('main' + i);
			if (mainMenu && i==id)
				mainMenu.style.display = 'inline';
			else if (mainMenu)
				mainMenu.style.display = 'none';
		}
	}


//** start marquee replacement script **

var wtop = -1900;
var wwidth = 700;
var scrolldelay = 5;
var sspeed = 10;
var restart = scrolldelay;

function scrollDown(id){

	whichdiv = document.getElementById(id);
	if(whichdiv!=null){
		ns6divw=eval(whichdiv);
		ns6divw.style.top=wtop+"px";;
		sizeupw=ns6divw.offsetHeight;
		//alert(sizeupw);
		scrollDownText();
	}
}

function scrollDownText(){

	if(parseInt(ns6divw.style.top)<=sizeupw*(1)){
		ns6divw.style.top=parseInt(ns6divw.style.top)+scrolldelay+"px";;
		setTimeout("scrollDownText()",100);
	}
	else{
		ns6divw.style.top=wtop+"px";;
		scrollDownText();
	}
}

function scrollLeftText(){

	if(parseInt(ns6topdiv.style.left)>=sizeupt*(-1)){
		ns6topdiv.style.left=parseInt(ns6topdiv.style.left)-sspeed+"px";;
		setTimeout("scrollLeftText()",100);
	}
	else{
		ns6topdiv.style.left=wwidth+"px";;
		scrollLeftText();
	}
}

//** end marquee replacement script **

function noRightClick(id){
	document.getElementById(id).oncontextmenu = function() {
	alert("Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.");
	return false;
	}
}