function Check_Data() {
	if ((document.myform.Name.value == null) || (document.myform.Name.value == "")) {
		alert("Please enter your name");
		document.myform.Name.focus();
		return false;
	}  // end if
	else if ((document.myform.Subject.value == null) || (document.myform.Subject.value == "")) {
		alert("Please enter a subject");
		document.myform.Subject.focus();
		return false;
	}  // end else if
	else if ((document.myform.Message.value == null) || (document.myform.Message.value == "")) {
		alert("Please enter your message");
		document.myform.Message.focus();
		return false;
	}  // end else if
	else if ((document.myform.Email.value == null) || (document.myform.Email.value == "")) {
		alert("Please enter your email address");
		document.myform.Email.focus();
		return false;
	}  // end else if
	else {
		str1 = document.myform.Name.value;
		str2 = document.myform.Subject.value;
		str3 = document.myform.Message.value;
		str4 = document.myform.Email.value;

		var isInteger=/^[0-9]+$/;
		var isWord=/^[a-zA-Z ]+$/;
		var isAlpha=/^[\w .,]+$/;
		var isEmail=/^[\w|.|-]{1,}@{1}\w{1,}.{1}\w{1}[\w|.|-]{1,}$/;

		/*
		if (!isWord.test(str1)) {
			alert("The format of "+str1+" appears to be incorrect.");
			document.myform.Name.focus();
			return false;
		} else if (!isAlpha.test(str2)) {
			alert("The format of "+str2+" appears to be incorrect.");
			document.myform.Subject.focus();
			return false;
		} else if (!isAlpha.test(str3)) {
			alert("The format of "+str3+" appears to be incorrect.");
			document.myform.Message.focus();
			return false;
		} else if (!isEmail.test(str4)) {
			alert("The format of "+str4+" appears to be incorrect.");
			document.myform.Email.focus();
			return false;
		} else {
			return true;	
		}
		*/

		if (!isEmail.test(str4)) {
			alert("The format of "+str4+" appears to be incorrect.");
			document.myform.Email.focus();
			return false;
		} else {
			return true;	
		}

	}  // end else
} // end Check_Data()

function Check_Data1() {
	if ((document.myform.gpsx.checked == false) && (document.myform.capdet.checked == false) && (document.myform.arts.checked == false) ) {
		alert("Please select a product");
		return false;
		// end else if
	}else if ((document.myform.firstName.value == null) || (document.myform.firstName.value == "")) {
		alert("Please enter your first name");
		document.myform.firstName.focus();
		return false;
	}  // end if
	else if ((document.myform.lastName.value == null) || (document.myform.lastName.value == "")) {
		alert("Please enter your last name");
		document.myform.lastName.focus();
		return false;
	}  // end else if
	else if ((document.myform.companyName.value == null) || (document.myform.companyName.value == "")) {
		alert("Please enter your company name");
		document.myform.companyName.focus();
		return false;
	}  // end else if
	else if ((document.myform.phone.value == null) || (document.myform.phone.value == "")) {
		alert("Please enter your phone number");
		document.myform.phone.focus();
		return false;
	}  // end else if
	else if ((document.myform.email.value == null) || (document.myform.email.value == "")) {
		alert("Please enter your email address");
		document.myform.email.focus();
		return false;
	}  // end else if
	else {
		return true;	
	}  // end else
} // end Check_Data1()


function Check_Data2() {
	if ((document.myform.GPSX.checked == false) && (document.myform.ParaMetra.checked == false) && (document.myform.CapdetWorks.checked == false) && (document.myform.ARTS.checked == false) ) {
		alert("Please select a product");
		return false;
		// end else if
	}else if ((document.myform.firstName.value == null) || (document.myform.firstName.value == "")) {
		alert("Please enter your first name");
		document.myform.firstName.focus();
		return false;
	}  // end if
	else if ((document.myform.lastName.value == null) || (document.myform.lastName.value == "")) {
		alert("Please enter your last name");
		document.myform.lastName.focus();
		return false;
	}  // end else if
	else if (document.myform.position.selectedIndex == 0) {
		alert("Please choose your position");
		document.myform.position.focus();
		return false;
	}  // end else if
	else if ((document.myform.companyName.value == null) || (document.myform.companyName.value == "")) {
		alert("Please enter your company name");
		document.myform.companyName.focus();
		return false;
	}  // end else if
	else if ((document.myform.phone.value == null) || (document.myform.phone.value == "")) {
		alert("Please enter your phone number");
		document.myform.phone.focus();
		return false;
	}  // end else if
	else if ((document.myform.fax.value == null) || (document.myform.fax.value == "")) {
		alert("Please enter your fax number");
		document.myform.fax.focus();
		return false;
	}  // end else if
	else if ((document.myform.email.value == null) || (document.myform.email.value == "")) {
		alert("Please enter your email address");
		document.myform.email.focus();
		return false;
	}  // end else if
	else if ((document.myform.address.value == null) || (document.myform.address.value == "")) {
		alert("Please enter your address");
		document.myform.address.focus();
		return false;
	}  // end else if
	else if ((document.myform.city.value == null) || (document.myform.city.value == "")) {
		alert("Please enter your city");
		document.myform.city.focus();
		return false;
	}  // end else if
	else if ((document.myform.state.value == null) || (document.myform.state.value == "")) {
		alert("Please enter your state");
		document.myform.state.focus();
		return false;
	}  // end else if
	else if ((document.myform.zip.value == null) || (document.myform.zip.value == "")) {
		alert("Please enter your zip code");
		document.myform.zip.focus();
		return false;
	}  // end else if
	else if (document.myform.company_description.selectedIndex == 0) {
		alert("Please choose your company description");
		document.myform.company_description.focus();
		return false;
	}  // end else if
	else if (document.myform.number_of_people.selectedIndex == 0) {
		alert("Please choose the number of people employed by your company");
		document.myform.number_of_people.focus();
		return false;
	}  // end else if
	else if (document.myform.modelling.selectedIndex == 0) {
		alert("Please choose a description for your use of modelling and simulation");
		document.myform.modelling.focus();
		return false;
	}  // end else if
	else {
		return true;	
	}  // end else
} // end Check_Data2()

// Popup windows
function openWin( path )
{
	newWin=open(path,"","directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizable=no,width=600,height=400,top=55,left=30");
	// Close the stream to the document and bring the window to the front.
	newWin.document.close();
	newWin.focus();
}

function openWinSize(path, width, height)
{
	newWin=open(path,"","directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=no,resizable=yes,width="+width+",height="+height+",top=10,left=10");
	// Close the stream to the document and bring the window to the front.
	newWin.document.close();
	newWin.focus();
}

function openWinLrg( path )
{
	newWin=open(path,"","directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizable=no,width=650,height=550,top=55,left=30");
	// Close the stream to the document and bring the window to the front.
	newWin.document.close();
	newWin.focus();
}

function openWinMax( path )
{
	w = screen.availWidth-10;
	h = screen.availHeight-20;

	newWin=open(path,"","directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizable=yes,width="+w+",height="+h+",top=0,left=0,screenX=0,screenY=0");
}


//Common MM functions
var isNS = (navigator.appName == "Netscape" && navigator.appVersion.indexOf("Win") != -1 );
if (isNS) {
  document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="styles_hm.css">');
}
else {
  document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="styles_hm.css">');
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v3.ppk
   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)
   {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
   if(!(x=d[n])&&d.all) x=d.all[n]; if(!(x=d[n])&&d.getElementById) x=d.getElementById(n);
   for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
   return x;}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

