// JavaScript Document
function validate_trial()
{
	if(document.frm.txtcompany.value == "")
	{
		alert("Please enter your Company Name!");
		document.frm.txtcompany.focus();
		return false;
	}
	else if(document.frm.txtname.value == "")
	{
		alert("Please enter your Name!");
		document.frm.txtname.focus();
		return false;
	}
	
}
function validate()
{
	if(document.frm.txtcompany.value == "")
	{
		alert("Please enter your Company Name!");
		document.frm.txtcompany.focus();
		return false;
	}
	else if(document.frm.txtname.value == "")
	{
		alert("Please enter your Name!");
		document.frm.txtname.focus();
		return false;
	}
	else if(document.frm.txttitle.value == "")
	{
		alert("Please enter your Title!");
		document.frm.txttitle.focus();
		return false;
	}
	/*else if(document.frm.txtpartner.value == "")
	{
		alert("Please enter your Partner Name!");
		document.frm.txtpartner.focus();
		return false;
	}*/
	else if(document.frm.txtemail.value.search(/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i))
	{
	alert("Please Enter your valid E-Mail")
	document.frm.txtemail.focus()
	return false;
	}
	else if (document.frm.txtphone.value!="")
	{
		if(isNaN(document.frm.txtphone.value))
			{
				alert("Please enter your Phone Number!");
				document.frm.txtphone.focus();
				return false;
			}			
	}
	/*else if(document.frm.txtfax.value == "")
	{
		alert("Please enter your Fax Number!");
		document.frm.txtfax.focus();
		return false;
	}*/
	else if(document.frm.company_address.value == "")
	{
		alert("Please enter your Company Address!");
		document.frm.company_address.focus();
		return false;
	}
	/*else if(document.frm.txtvat.value == "")
	{
		alert("Please enter your VAT!");
		document.frm.txtvat.focus();
		return false;
	}*/
	else if(document.frm.txtmainperson.value == "")
	{
		alert("Please enter your Main Person!");
		document.frm.txtmainperson.focus();
		return false;
	}
		else if(isNaN(document.frm.txtphone1.value) || document.frm.txtphone1.value=="")
			{
				alert("Please enter your Phone Number!");
				document.frm.txtphone1.focus();
				return false;
			}	
	
	/*else if(!checkEmail(document.frm.txtemail1.value)||(document.frm.txtemail1.value==""))
	{
		alert("Please enter your Second Email Address!");
		document.frm.txtemail1.focus();
		return false;
	}
	else if(document.frm.txtalterphone.value == "")
	{
		alert("Please enter your Alternate Phone Number!");
		document.frm.txtalterphone.focus();
		return false;
	}
	else if(document.frm.txtfax1.value == "")
	{
		alert("Please enter your Second Fax Number!");
		document.frm.txtfax1.focus();
		return false;
	}
	else if(document.frm.txtaddressdiff.value == "")
	{
		alert("Please enter your Second Address!");
		document.frm.txtaddressdiff.focus();
		return false;
	}*/
	else if(document.frm.db_design.value == "")
	{
		alert("Do you require a website or a database to be designed?");
		document.frm.db_design.focus();
		return false;
	}
	else if(document.frm.web_database.value == "")
	{
		alert("Do you currently have a website or a database?");
		document.frm.web_database.focus();
		return false;
	}
	else if(document.frm.domain_email.value == "")
	{
		alert("Do you have a domain name and email facilities?");
		document.frm.domain_email.focus();
		return false;
	}
	else if(document.frm.email_address.value == "")
	{
		alert("What email address do you want to use?");
		document.frm.email_address.focus();
		return false;
	}
	else if(document.frm.domain_name.value == "")
	{
		alert("If you have more than one domain name, which one would you like to use? What are your domain names?");
		document.frm.domain_name.focus();
		return false;
	}
	else if(document.frm.short_bussiness.value == "")
	{
		alert("Please provide a short description of your business?");
		document.frm.short_bussiness.focus();
		return false;
	}
	else if(document.frm.specific_color.value == "")
	{
		alert("What ideas do you have in mind for the design of your website? Are there any specific colours that you would like to incorporate?");
		document.frm.specific_color.focus();
		return false;
	}
	else if(document.frm.theme_going.value == "")
	{
		alert("What theme are you going fo?");
		document.frm.theme_going.focus();
		return false;
	}
		else if(document.frm.accomplish_with.value == "")
	{
		alert("Do you have a specific layout in mind? Do you require us to show you some samples?");
		document.frm.accomplish_with.focus();
		return false;
	}
	else if (callchk()==false)
	{
	
		alert("What is the main purpose for this website? What do you hope to accomplish with it? Select all that apply!");
		return false;
	}
	else if (callchk1()==false)
	{
	
		alert("What type of image do you want to communicate? Select all that apply!");
		return false;
	}
	else if(document.frm.top_all.value == "")
	{
		alert("What type of menu display would you like? (Wide and across the top or tall and along the side)?");
		document.frm.top_all.focus();
		return false;
	}
	else if(document.frm.home_page.value == "")
	{
		alert("How would you like your home page to look? Do you have any specific designs in mind? Are there any websites that you would like us to follow the theme of?");
		document.frm.home_page.focus();
		return false;
	}
	else if(document.frm.wesite_incorporate.value == "")
	{
		alert("What features would you like your website to incorporate? I.e. newsletters, booking facilities, reservations service, security features (enables others to login with set user rights), shopping, private forum, members login, database functionalities (will require list of functionalities for this section), finance and marketing facilities, search facility, picture gallery, live chat (I M), SMS service, on screen music, hosting facilities, maintenance, flash movies, product catalogue, online calculator, internet search engine optimisation (listed on Google), as well as e-marketing. Please provide a full list of the required features below?");
		document.frm.wesite_incorporate.focus();
		return false;
	}
	else if(document.frm.logo_design.value == "")
	{
		alert("Do you require a logo to be designed? What sort of style would you like?");
		document.frm.logo_design.focus();
		return false;
	}
	else if(document.frm.require_assistance.value == "")
	{
		alert("Will the contents be provided or do you require assistance?");
		document.frm.require_assistance.focus();
		return false;
	}
	else if(document.frm.require_assistance.value == "")
	{
		alert("Will the contents be provided or do you require assistance?");
		document.frm.require_assistance.focus();
		return false;
	}	
	else if(document.frm.administrative_editor.value == "")
	{
		alert("If you do not require the services of our administrative and enhancement editor, please state here");
		document.frm.administrative_editor.focus();
		return false;
	}
	else if(document.frm.marketing_eflyers.value == "")
	{
		alert("Do you require branding for marketing or e-flyers to be designed? What frequency do you require them?");
		document.frm.marketing_eflyers.focus();
		return false;
	}
	else if(document.frm.clients_you.value == "")
	{
		alert("Will we be sending them to your clients or you?");
		document.frm.clients_you.focus();
		return false;
	}
	else if(document.frm.sort_of_design.value == "")
	{
		alert("What sort of design, theme or image do you require for the branding and e-marketing? Will you be supplying us with these or would you like us to design them for you?");
		document.frm.sort_of_design.focus();
		return false;
	}
	else if(document.frm.control_panel.value == "")
	{
		alert("Do you require a control panel? If so what features are needed?");
		document.frm.control_panel.focus();
		return false;
	}	
	else if(document.frm.technology.value == "")
	{
		alert("What technology do you want your website designed in? PHP, .Net, Flash, HTML and Java");
		document.frm.technology.focus();
		return false;
	}
	else if(document.frm.flash_intro.value == "")
	{
		alert("Do you require a flash intro");
		document.frm.flash_intro.focus();
		return false;
	}
	else if(document.frm.additional_infor.value == "")
	{
		alert("Please provide any additional information that may be vital to the design and development of your website");
		document.frm.additional_infor.focus();
		return false;
	}
	else if((document.frm.months[0].checked == "")&&(document.frm.months[1].checked == "")&&
(document.frm.months[2].checked == "")&&(document.frm.months[3].checked == ""))	
	{
		alert("Do you have a specific time frame in mind for the completion of your website or database?");
		document.frm.months[0].focus();
		return false;
	}
	else if(document.frm.budget_mind.value == "")
	{
		alert("Do you have a specific budget in mind that you are trying to work to?");
		document.frm.budget_mind.focus();
		return false;
	}
	else if(document.frm.payment_terms.value == "")
	{
		alert("What payment terms would you prefer: 1- 50% up front 50% payable upon completion, 2- milestones (payment due upon the completion of each mile stone), 3- 3 equal payments");
		document.frm.payment_terms.focus();
		return false;
	}
	else
	{
		return true;
	}
}



function callchk()
{
	var m1 = document.frm;
	var len = m1.elements.length;
	total = 0;
	for (var i=0 ; i < len ; i++)
	{
		var e = m1.elements[i];
		if (e.name=="hope_to_accomplish[]" && e.checked)
		{
			total = total + 1;
			
		}
	}
	
	//alert (total);
	
	if (total<1)
	return false;
	else
	return true;
	
}

function callchk1()
{
	var m1 = document.frm;
	var len = m1.elements.length;
	total = 0;
	for (var i=0 ; i < len ; i++)
	{
		var e = m1.elements[i];
		if (e.name=="communicate[]" && e.checked)
		{
			total = total + 1;
			
		}
	}
	
	//alert (total);
	
	if (total<1)
	return false;
	else
	return true;
	
}


 function checkEmail(xField)
	{
		var check, atPos, dotPos, strLen, cut1, cut2, cut3;
		strLen	=	xField.length;
		atPos	=	xField.indexOf("@");
		var dotpos = new Array();
		dotpos=(xField.split("."));
		var dot_count = strLen-(dotpos[dotpos.length-1].length);	
		cut1	=	xField.slice(0,atPos);
		cut2	=	xField.slice(atPos +1,dot_count-1);
		cut3	=	xField.slice(dot_count ,strLen);
		ix = cut3.indexOf(",");

		check = true;
		
		if ( atPos < 2 && dotPos < 4 )
		{
			check = false;
		}
		else if ( (!isNaN(cut1)) || (!isNaN(cut2)) || (!isNaN(cut3)))
		{
			check = false;
		}
		else if ( (!specialCheck(cut1)) || (!specialCheck(cut2)) || (!specialCheck(cut3))  || ix >= 0)
		{
			check = false;
		}
		else if ( atPos < 1 )
		{
			check = false;
		}
	return check;
	}
<!--End of Email Check-->

<!----Start of Special Check--->
	function specialCheck(xField)
	{
	var strSpecial, check;
		check = true;
		i = xField.length;
		
		for( j =0;j<=i;j++ )
		{
			pos = xField.charAt(j);
			
			if ( pos == "~" || pos == "'" || pos == "!" || pos == "$" )
			{
			check = false;
			}
			else if ( pos == "@" || pos == "#" || pos == "%" || pos == "^")
			{
			check = false;
			}
			else if ( pos == "*" || pos == "{" || pos == "}" || pos == ";")
			{
			check = false;
			}
			else if ( pos == ":" ||  pos == "|" || pos == "<")
			{
			check = false;
			}
		}
	return check;		
	}


function check_number(value)
{
if(!isNaN(value))
{
	//alert("Number Only Allowed")
	
//	document.frm.txtphone.focus();
	return false;
}
}