
//window.showModalDialog();


///////////////////////////////////////////////////////////////////////////////
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
///////////////////////////////////
//var message="Function Disabled!";

//function clickIE4(){
//if (event.button==2){
//alert(message);
//return false;
//}
//}

//function clickNS4(e){
//if (document.layers||document.getElementById&&!document.all){
//if (e.which==2||e.which==3){
//alert(message);
//return false;
//}
//}
//}

///if (document.layers){
//document.captureEvents(Event.MOUSEDOWN);
//document.onmousedown=clickNS4;
//}
//else if (document.all&&!document.getElementById){
//document.onmousedown=clickIE4;
//}

//document.oncontextmenu=new Function("alert(message);return false")
//////////////////////////////////////////////////////
// --> 





// FORM CODE
function validEmail(email) {
			invalidChars = " /:,;";	
			if (email == "") {						// cannot be empty
				return false;
			}
			for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
				badChar = invalidChars.charAt(i);
				if (email.indexOf(badChar,0) > -1) {
					return false;
				}
			}
			atPos = email.indexOf("@",1);			// there must be one "@" symbol
			if (atPos == -1) {
				return false;
			}
			if (email.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
				return false;
			}
			periodPos = email.indexOf(".",atPos);
			if (periodPos == -1) {					// and at least one "." after the "@"
				return false;

			}
			if (periodPos+3 > email.length)	{		// must be at least 2 characters after the "."
				return false;
			}
			return true;
}





function CheckIt(Form) {

			// make sure they enter a name

			thename = Form.myname.value;
			namelen=thename.length;
			if (namelen == 0) {
				alert("You must enter a Name");
				Form.myname.focus();
				Form.myname.select();
				return false;
			}
	
			// make sure they enter a company name

			//Cname = Form.CompanyName.value;
			//Clen=Cname.length;
			//if (Clen == 0) {
			//	alert("You must enter a Company Name. If you have no company enter 'none' ");
			//	Form.CompanyName.focus();
			//	Form.CompanyName.select();
			//	return false;
			//}

			// check to see if the email's valid

			if (!validEmail(Form.email.value)) {
				alert("Invalid email address");
				Form.email.focus();
				Form.email.select();
				return false;
			}
	

			
		
// make sure they enter a phone number

			phone = Form.PhoneNum.value;
			Plen=phone.length;
			if (Plen == 0) {
				alert("You must enter a Phone Number");
				Form.PhoneNum.focus();
				Form.PhoneNum.select();
				return false;
			}	
	
// make sure they enter a Fax number

			//fax = Form.FaxNum.value;
			//Flen=fax.length;
			//if (Flen == 0) {
			//	alert("You must enter a Fax Number");
			//	Form.FaxNum.focus();
			//	Form.FaxNum.select();
			//	return false;
			//}	
			// If we made it to here, everything's valid, so return true

			return true;
}


function CheckItQuest(Form) {

			// make sure they enter a name

			thename = Form.sender.value;
			namelen=thename.length;
			if (namelen == 0) {
				alert("You must enter a Name");
				Form.sender.focus();
				Form.sender.select();
				return false;
			}
	

			if (!validEmail(Form.email.value)) {
				alert("Invalid email address");
				Form.email.focus();
				Form.email.select();
				return false;
			}
			
	//		if (!validEmail(Form.com_email.value)) {
	//			alert("Invalid company contact email address");
	//			Form.com_email.focus();
	//			Form.com_email.select();
	//			return false;
	//		}

// make sure they enter a phone number

			phone = Form.phone_num.value;
			Plen=phone.length;
			if (Plen == 0) {
				alert("You must enter a Phone Number");
				Form.phone_num.focus();
				Form.phone_num.select();
				return false;
			}	
	

			return true;
}

function closer()
{
	if (window.showModalDialog)
	{
		this.window.close();
	}
	else
	{
		window.close();
	}
}
