// JavaScript Document
<!--
function changeEventLocation(customform){
	customform.Event_Address.value="";
	customform.Event_City.value="";
	customform.Event_Zip.value="";
	customform.elements['Event_Phone1[0]'].value = "";
	customform.elements['Event_Phone1[1]'].value = "";
	customform.elements['Event_Phone1[2]'].value = "";
	customform.elements['Event_Phone2[0]'].value = "";
	customform.elements['Event_Phone2[1]'].value = "";
	customform.elements['Event_Phone2[2]'].value = "";
	customform.elements['Event_Fax[0]'].value = "";
	customform.elements['Event_Fax[1]'].value = "";
	customform.elements['Event_Fax[2]'].value = "";
	customform.Event_Address.focus();
//	customform.Event_Phone1[1].value="";
//	customform.Event_Phone1[2].value="";
return false;
}

//check character
function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}

//checking the amount of word.
function checkwords(Object,maxwords){
	if (document.images){
	var temp=Object.value.split(" ");
		if (temp.length>maxwords){
			alert("Please restrain your input to "+maxwords+" or less words!")
			return false
		}
	}
}

// JavaScript Document

function checkLogin(loggin){
	var email = loggin.login.value;
	var passd = loggin.password.value;
	if (echeck(email)){
		if (email.length >3 ) {
			if (passd.length >4){
				document.login.submit();
			}else{
				alert('Password incorrect');						
			}
		}else{
			alert ('Invalid Email Address');	
		}
	}

return false;
}

function checkEnter(e){ //e is event object passed from function invocation
	var characterCode //literal character code will be stored in this variable

	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}else{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}

	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		checkLogin(document.login) //submit the form
		return false 
	}else{
		return true 
	}
}

///checking email validation.
function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid Email Address");
	   return (false);
	}	
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid Email Address");
	   return (false);
	}	
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Invalid Email Address");
		return (false);
	}	
	if (str.indexOf(at,(lat+1))!=-1){
		alert("Invalid Email Address");
		return (false);
	}	
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Invalid Email Address");
		return (false);
	}	
	if (str.indexOf(dot,(lat+2))==-1){
		alert("Invalid Email Address");
		return (false);
	}	
	if (str.indexOf(" ")!=-1){
		alert("Invalid Email Address");
		return (false);
	}	
	 return true;			
}
-->

