function checksubmit()
{
	var breakseal = false;
	for (counter = 0; counter < document.form1.breakseal.length; counter++)
	{
		if (document.form1.breakseal[counter].checked)
		breakseal = true; 
	}
	
	var service = false;
	for (counter = 0; counter < document.form1.service.length; counter++)
	{
		if (document.form1.service[counter].checked)
		service = true; 
	}
	
	var text = "";
	if(get("contact_person") == "")
	{
		text += "Please enter name.\n";
	}
	if(get("company") == "")
	{
		text += "Please enter company or IC / passport no.\n";
	}
	if(!checkMail(get("email")))
	{
		text += "Please enter valid e-mail address.\n";
	}
	if(get("email") != get("email2"))
	{
		text += "Please check that your e-mail address is correct.\n";
	}
	if(get("contact_no") == "")
	{
		text += "Please enter telephone no.\n";
	}
	if(get("address") == "")
	{
		text += "Please enter address.\n";
	}
	if(get("country") == "")
	{
		text += "Please select country.\n";
	}

	if(get("interface") == "")
	{
		text += "Please select interface.\n";
	}
	if(get("operating_system") == "")
	{
		text += "Please select operating system.\n";
	}
	
	if(get("observation") == "")
	{
		text += "Please enter observation.\n";
	}
	if(get("attempts") == "")
	{
		text += "Please enter attempts.\n";
	}
	if(get("important_data") == "")
	{
		text += "Please enter most required data.\n";
	}
	
	if(!breakseal)
	{
		text += "Please select option on whether to allow us to open media.\n";
	}
	
	if(!service)
	{
		text += "Please select service type.\n";
	}

	if(get("code") == "")
	{
		text += "Please enter verification code.\n";
	}
	
	/*if(!document.form1.terms1.checked || !document.form1.terms2.checked || !document.form1.terms3.checked)
	{
		text += "Please agree to the terms before proceeding.\n";
	}*/

if(text != "")
	{
		alert(text);
		return false;
	}
	else
	{
		return true;
	}
}

/*function checkservice(value)
{
	if(document.form1.service[0].checked)
	{
		value = "Standard";
	}
	else if(document.form1.service[1].checked)
	{
		value = "Priority Evaluation";
	}
	else if(document.form1.service[2].checked)
	{
		value = "Express Service";
	}
	//alert(value);
	
	switch(value)
	{
		case "Standard": 
			document.getElementById("termstext").innerHTML = "I AGREE THAT I WILL HAVE TO PAY <b>S$50</b> CANCELLATION FEE IF I DO NOT WISH TO PROCEED BEYOND QUOTATION. NO CHARGES IF UNRECOVERABLE.<BR><BR>*For RAID disk configurations, additional cancellation fee of S$200 applies.";
			break;
		case "Priority Evaluation":
			document.getElementById("termstext").innerHTML = "I AGREE THAT I WILL HAVE TO PAY <b>S$100</b> CANCELLATION FEE IF I DO NOT WISH TO PROCEED BEYOND QUOTATION. NO CHARGES IF UNRECOVERABLE.<BR><BR>*For RAID disk configurations, additional cancellation fee of S$200 applies.";
			break;
		case "Express Service":
			document.getElementById("termstext").innerHTML = "ADRC WILL QUOTE BEFORE PROCEEDING. NO CHARGES IF UNRECOVERABLE.";
			break;
		default:
			document.getElementById("termstext").innerHTML = "I AGREE THAT I WILL HAVE TO PAY <b>S$50</b> (STANDARD) / <b>S$100</b> (PRIORITY) CANCELLATION FEE IF I DO NOT WISH TO PROCEED BEYOND QUOTATION. NO CHARGES IF UNRECOVERABLE.<BR><BR>*For RAID disk configurations, additional cancellation fee of S$200 applies.";
	}
}*/

function get(id)
{
	return document.getElementById(id).value;
}

function checkMail(x)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x))
	{
		return 1;
	}
	else 
	{
		return 0;
	}
}