function doVerifyCode(frmID,elementID,Values,EmailDisplay)	{
	if($(elementID).value==''){
		$(elementID).className='txtred';
		if(EmailDisplay=='quotesimple_verificationcodehiddenvalue'){
			$(Values).innerHTML='<font color="#ffffff">verification code required </font>';
		}else{
			$(Values).innerHTML='<font color="#ff0000">verification code required </font>';
		}
	}else{
		$(Values).innerHTML='<span><img src="imgs/loading.gif" border="0" /></span>';
		var success = function(t){ VerifycodeSucess(t, Values,elementID,EmailDisplay);}
		var failure = function(t){ editFailed(t, Values,Display);}
		var pars = 'ajaxaction=CheckVerifyCode&VerifyCode='+document.getElementById(elementID).value;
		var url     =  'ajax/quoteajax.php';
		var myAjax  = new Ajax.Request(url, {method:'post',postBody:pars, onSuccess:success, onFailure:failure});
	}
}
function VerifycodeSucess(t, Values,elementID,EmailDisplay){
	var checkresult = t.responseText;
	document.getElementById(EmailDisplay).value= t.responseText;
	if(EmailDisplay=='quotesimple_verificationcodehiddenvalue'){
		if(checkresult==0){
			document.getElementById(Values).innerHTML = '<font color="#ffffff">verification code mismatch </font>';
		}else
			document.getElementById(Values).innerHTML = '<font color="#ffffff">Correct</font>';
	}else{
		if(checkresult==0){
			document.getElementById(Values).innerHTML = '<font color="#ff0000">verification code mismatch </font>';
		}else
			document.getElementById(Values).innerHTML = '<font color="#119911">Correct</font>';
	}
}
function getQuoteSubServices(elementID,Values,Display)	{
		var success = function(t){ getQuoteSubCategoryServices(t, Values,elementID,Display);}
		var failure = function(t){ editFailed(t, Values,Display);}
		var pars    = 'ajaxaction=getSubCategory&quote=yes&maincategoryId='+document.getElementById(elementID).value;
		var url     =  'ajax/quoteajax.php';
		var myAjax  = new Ajax.Request(url, {method:'post',postBody:pars, onSuccess:success, onFailure:failure});
}
function getQuoteSubCategoryServices(t, Values,elementID,Display){
	var checkresult = t.responseText;
	document.getElementById(Display).innerHTML= t.responseText;
}
function doValidateQuote(obj){
	var NoError = true;
	if(!doCheckFormField(document.getElementById('quote_ProjectName'),"TextBox",'Text','Yes','project name'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ProjectType'),"TextBox",'Select','Yes','project type'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ProjectBudget'),"TextBox",'Select','Yes','project budget'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_EstimatedWebPages'),"TextBox",'Select','Yes','web pages'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ProjectTimeFrame'),"TextBox",'Select','Yes','time frame'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ServicesRequired'),"TextBox",'Select','Yes','services'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ProjectDescription'),"TextBox",'Text','Yes','project description'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ClientName'),"TextBox",'Text','Yes','client name'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ClientEmail'),"TextBox",'Email','Yes','client email'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ClientCountry'),"TextBox",'Select','Yes','country'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ClientState'),"TextBox",'Select','Yes','state'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ClientCity'),"TextBox",'Text','Yes','city'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_ClientPhoneNumber'),"TextBox",'Phone','Yes','phone number'))NoError = false;
	if(!doCheckFormField(document.getElementById('quote_VerificationCode'),"TextBox",'Text','Yes','verification code'))NoError = false;
/*	if(!doCheckFormField(document.getElementById('quote_agree'),"CheckBox",'','Yes','terms of use'))NoError = false;
	
	if(document.getElementById('quote_emailhiddenvalue').value ==1){
		 if(document.getElementById('quote_ClientEmail').value !=""){
			 document.getElementById('quote_ClientEmail_imgError').innerHTML='<font color="#ffffff" style="font-weight:bold; font-size:10px">'+" email address exists"+'<font>';
			 NoError = false;}
	}*/
	if(document.getElementById('quote_verificationcodehiddenvalue').value == 0){
	 	if(document.getElementById('quote_VerificationCode').value !=""){
		 	$('quote_VerificationCode_imgError').innerHTML='<font color="#ff0000" style="font-weight:bold; font-size:10px">'+" verification code mismatch."+'<font>';
			NoError = false;}
	}
	if (document.getElementById('quote_ProjectFile').value != "")
	{
		var files = document.getElementById('quote_ProjectFile').value.split(".")
		if(files.length == 0 || (files[files.length-1].toLowerCase() != "doc" && files[files.length-1].toLowerCase() != "xls" && files[files.length-1].toLowerCase() != "zip" && files[files.length-1].toLowerCase() != "pdf" && files[files.length-1].toLowerCase() != "docx"))
		{
			alert("you should upload only .doc , .xls , .zip , .pdf , .docx file");return false;}
	}

	if(!checkDescriptionLimit(document.getElementById('quote_ProjectDescription'))) {NoError = false;}
		
	if(NoError)
		document.requestquote.submit();
}
function doValidateSimpleQuote(obj){
	var NoError = true;
	if(!doCheckwhiteFormField(document.getElementById('quotesimple_name'),"TextBox",'Text','Yes','client name'))NoError = false;
	if(!doCheckwhiteFormField(document.getElementById('quotesimple_email'),"TextBox",'Email','Yes','client email'))NoError = false;
	if(!doCheckwhiteFormField(document.getElementById('quotesimple_country'),"TextBox",'Text','Yes','country'))NoError = false;
	if(!doCheckwhiteFormField(document.getElementById('quotesimple_description'),"TextBox",'Text','Yes','project description'))NoError = false;
	if(!doCheckwhiteFormField(document.getElementById('quotesimple_verificationcode'),"TextBox",'Text','Yes','verification code'))NoError = false;

	/*if(document.getElementById('quotesimple_emailhiddenexistvalue').value ==1){
		 if(document.getElementById('quotesimple_email').value !=""){
			 document.getElementById('quotesimple_email_imgError').innerHTML='<font color="#ffffff" style="font-weight:bold; font-size:10px">'+" email address exists"+'<font>';
			 NoError = false;}
	}*/
	if(document.getElementById('quotesimple_verificationcodehiddenvalue').value == 0){
	 	if(document.getElementById('quotesimple_verificationcode').value !=""){
		 	$('quotesimple_verificationcode_imgError').innerHTML='<font color="#ffffff" style="font-weight:bold; font-size:10px">'+" verification code mismatch."+'<font>';
			NoError = false;}
	}
	if (document.getElementById('quotesimple_ProjectFile').value != "")
	{
		var files = document.getElementById('quotesimple_ProjectFile').value.split(".")
		if(files.length == 0 || (files[files.length-1].toLowerCase() != "doc" && files[files.length-1].toLowerCase() != "xls" && files[files.length-1].toLowerCase() != "zip" && files[files.length-1].toLowerCase() != "pdf" && files[files.length-1].toLowerCase() != "docx"))
		{
			alert("you should upload only .doc , .xls , .zip , .pdf , .docx file");return false;}
	}
	
	if(!checkDescriptionLimit(document.getElementById('quotesimple_description'))) {NoError = false;}
	
	if(NoError)
		document.simplequoteregistration.submit();
}
function doValidateCompanyQuote(obj){
	var NoError = true;
	if(!doCheckFormField(document.getElementById('companyquote_ProjectName'),"TextBox",'Text','Yes','project name'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ProjectType'),"TextBox",'Select','Yes','project type'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ProjectBudget'),"TextBox",'Select','Yes','project budget'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_EstimatedWebPages'),"TextBox",'Select','Yes','web pages'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ProjectTimeFrame'),"TextBox",'Select','Yes','time frame'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ProjectDescription'),"TextBox",'Text','Yes','project description'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ClientName'),"TextBox",'Text','Yes','client name'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ClientEmail'),"TextBox",'Email','Yes','client email'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ClientCountry'),"TextBox",'Select','Yes','country'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ClientState'),"TextBox",'Select','Yes','state'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ClientCity'),"TextBox",'Text','Yes','city'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_ClientPhoneNumber'),"TextBox",'Phone','Yes','phone number'))NoError = false;
	if(!doCheckFormField(document.getElementById('companyquote_VerificationCode'),"TextBox",'Text','Yes','verification code'))NoError = false;
	<!--if(!doCheckFormField(document.getElementById('companyquote_agree'),"CheckBox",'','Yes','terms of use'))NoError = false;-->
	
	if(document.getElementById('companyquote_verificationcodehiddenvalue').value == 0){
	 	if(document.getElementById('companyquote_VerificationCode').value !=""){
		 	$('companyquote_VerificationCode_imgError').innerHTML='<font color="#ff0000" style="font-weight:bold; font-size:10px">'+" verification code mismatch."+'<font>';
			NoError = false;}
	}
	if (document.getElementById('companyquote_ProjectFile').value != "")
	{
		var files = document.getElementById('companyquote_ProjectFile').value.split(".")
		if(files.length == 0 || (files[files.length-1].toLowerCase() != "doc" && files[files.length-1].toLowerCase() != "xls" && files[files.length-1].toLowerCase() != "zip" && files[files.length-1].toLowerCase() != "pdf" && files[files.length-1].toLowerCase() != "docx"))
		{
			alert("you should upload only .doc , .xls , .zip , .pdf , .docx file");return false;}
	}

	if(!checkDescriptionLimit(document.getElementById('companyquote_ProjectDescription'))) {NoError = false;}

	if(NoError)
		document.requestquotecompany.submit();
}