	function checkAll() {
		var flag = 0;
		var counter;
		var counter2;
		var counter3;
		var i;
	
		if(isNaN(document.form1.contact.value) || document.form1.contact.value=="")
		{
			alert("Please Input a Valid Contact Number");
			document.form1.contact.focus();
			document.form1.contact.select();
			flag = 1;
			return;
		}
		
		if(document.form1.email.value == "")
		{
			alert("Please Input Your Email Address");
			document.form1.email.focus();
			flag = 1;
			return;			
		} else {
		
			var string1 = document.getElementById("email").value;
			var at1=document.getElementById("email").value.indexOf("@");
			if(at1>0) {
				var behindAt = string1.substr(at1);
				counter3=0;
				for(i=0;i<(behindAt.length);i++)
				{
					if(behindAt.charAt(i)=='.') counter3++;
				}
				if(counter3>2)
				{
					alert("Invalid Email Address.\n ex: example@example.com or\n example@example.com.sg");
					document.form1.email.focus();
					document.form1.email.select();	
					flag=1;			
					return;				
				} else {
					var dot=behindAt.indexOf(".");
					var at=behindAt.indexOf("@");
				}
			} else
			{
				var at=-1;
			}
			
			if(at==-1 || dot==-1 ||dot==0||dot==(behindAt.length)-1|| at==dot-1)
			{
				alert("Invalid Email Address.\n ex: example@example.com\n");
				document.form1.email.focus();
				document.form1.email.select();	
				flag=1;			
				return;
			}

			counter  = 0;
			counter2 = 0;
			for(i=0;i<(document.form1.email.value.length);i++)
			{
				if(document.form1.email.value.charAt(i)==' ') counter++;
				if(document.form1.email.value.charAt(i)=='@') counter2++;
			}
			
			if(counter2 >1 || counter>=1)
			{	
				alert("Invalid Email Address.\n ex: example@example.com\n");
				document.form1.email.focus();
				document.form1.email.select();		
				flag =1;		
				return;
			}
			
			var behindDot = behindAt.substr(dot);
			if(counter3 == 1) {
				var dotlen = behindDot.length-1;
				 if(dotlen<2 || dotlen > 4)
				 {
					alert("Invalid Email Address.\n ex: example@example.com\n");
					document.form1.email.focus();
					document.form1.email.select();		
					flag =1;		
					return;			 
				 }
			}			
			if(counter3 == 2) {
						
				var charBehindDot = behindDot.substr(1);
				var dot2 = charBehindDot.indexOf(".");
				if(dot2<2 || dot2 > 4)
				{
					alert("Invalid Email Address.\n ex: example@example.com\n");
					document.form1.email.focus();
					document.form1.email.select();		
					flag =1;		
					return;			 
				}
				 				
				var behindDot2 = charBehindDot.substr(dot2);
				
				var dotlen2 = behindDot2.length-1;
				 if(dotlen2 != 2)
				 {
					alert("Invalid Email Address.\n ex: example@example.com.sg\n");
					document.form1.email.focus();
					document.form1.email.select();		
					flag =1;		
					return;			 
				 }				
			}
		}
		
		if(flag == 0)
		{
			document.form1.submit();
		}
	}
