function initAll2(){
		//document.getElementById("warnMess").innerHTML += "<br/>Intrat in init2";
	
	document.getElementById("send").onclick = clickPeButonSend;

}

function clickPeButonSend(){
	var theMessage = document.getElementById("theMessage").value;
	var theEmail = document.getElementById("theEmail").value;
	var theName = document.getElementById("theName").value;
	var theSite = document.getElementById("theSite").value;	
	var theTel = document.getElementById("theTel").value;	
	
	document.getElementById("warnMess").innerHTML = "";
	
	var valid=true;
	
	if( theName.length==0){
		document.getElementById("warnMess").innerHTML += "<br/>Please fill in your name";
		valid = false;
	}
	
	if( theEmail.length==0){
		document.getElementById("warnMess").innerHTML += "<br/>Please fill in your e-mail address";
		valid = false;
	}
	
	if ( !validEmail(theEmail) ){
		valid = false;
		document.getElementById("warnMess").innerHTML += "<br/>Please enter a valid email address";
		
	}
	
	
		
	function validEmail(email){
		var invalidChars = " /:,;";
		
		if (email!=""){
			for (var k = 0; k<invalidChars.length; k++){
				var badChar = invalidChars.charAt(k);
				if (email.indexOf(badChar) > -1){
					return false;
				}
			}
			
			var atPos = email.indexOf("@",1);
			if (atPos == -1){
				return false;
			}
			if (email.indexOf("@",atPos+1) != -1){
				return false;
			}
			var periodPos = email.indexOf(".",atPos);
			if (periodPos == -1){
				return false;
			}
			if (periodPos+3>email.length){
				return false;
			}
		}
		return true;
	}
	
	
	
	if (valid){
		window.location = "contact.php?theEmail="+theEmail+"&theName="+theName+"&theMessage="+theMessage+"&theSite="+theSite+"&theTel="+theTel;	
	}
}
