// JavaScript Document
function add_website_enquiry(frm)
{
	customer_name=frm.customer_name.value;
	customer_address=frm.customer_address.value;
	customer_email=frm.customer_email.value;
	customer_phone_number=frm.customer_phone_number.value;
	
	
	website_customer=frm.website_customer.value;
	website_products_type=frm.website_products_type.value;
	website_color_combination=frm.website_color_combination.value;
	website_home_page_style=frm.website_home_page_style.value;
	website_page_title=frm.website_page_title.value;
	website_page_description=frm.website_page_description.value;
	website_host_space=frm.website_host_space.value;
	random_string=frm.random_string.value;
	match_string=frm.match_string.value;
	error=false;
	errormsg="Following error occure while processing this query !!";
	if(customer_name=="")
	{
		error=true;
		errormsg+="\n\tEmpty customer name.....";
	}
	if(customer_email.indexOf("@")==-1 || customer_email.indexOf(".")==-1 || customer_email.length<6)
	{
			error=true;
			errormsg+="\n\tIn-currect email address.....";
	}
	if(customer_phone_number=="")
	{
		error=true;
		errormsg+="\n\tEmpty your phone No......";
	}
	if(customer_address=="")
	{
		error=true;
		errormsg+="\n\tEmpty your Address.....";
	}
	if(website_customer=="0")
	{
		error=true;
		errormsg+="\n\tSelect any customer type.....";
	}
	if(website_products_type=="0")
	{
		error=true;
		errormsg+="\n\tSelect any products type.....";
	}
	if(website_color_combination=="")
	{
		error=true;
		errormsg+="\n\tEmpty site color combination.....";
	}
	if(website_home_page_style=="0")
	{
		error=true;
		errormsg+="\n\tEmpty site home page style.....";
	}
	if(website_page_title=="")
	{
		error=true;
		errormsg+="\n\tEmpty site  page title.....";
	}
	if(website_page_description=="")
	{
		error=true;
		errormsg+="\n\tEmpty site  page description.....";
	}
	if(match_string!=random_string)
	{
		errormsg+="\n\tGiven String does not match..."
		error=true
	}
	
	if(error)
	{
		alert(errormsg);
		return false;
	}
}


function random_string()
{
	var text_small = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
	var text_big = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
	var text_no = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
	var text_symbol = new Array("#", "@", "%", "#");
	
	var text_small_length = text_small.length;
	var rnd_small = Math.round((text_small_length-1)*Math.random());
	var txt_small=text_small[rnd_small];
	
	var text_big_length = text_big.length;
	var rnd_big = Math.round((text_big_length-1)*Math.random());
	var txt_big=text_big[rnd_big];
	
	var text_no_length = text_no.length;
	var rnd_no = Math.round((text_no_length-1)*Math.random());
	var txt_no=text_no[rnd_no];
	
	var text_symbol_length = text_symbol.length;
	var rnd_symbol = Math.round((text_symbol_length-1)*Math.random());
	var txt_symbol=text_symbol[rnd_symbol];
	
	var round_no=Math.round(Math.random(-10)*100);
	
	var random_number=txt_small+txt_big+round_no+txt_symbol+txt_no;
	
	document.write('<input name="random_string" type="text" size="7" maxlength="8" class="random_string_box" value="'+random_number+'" readonly="True">');
}



function debug(frm)
{
	customer_name=frm.customer_name.value;
	if(frm.website_host_space[0].checked)
	{
		alert("Yes");
		return false;
	}
	if(frm.website_host_space[1].checked)
	{
		alert("Not");
		return false;
	}
}
