

function validate()
{
if(document.form_search_general.cbo_voltage.value=="None" && document.form_search_general.cbo_hp.value=="None" && document.form_search_general.cbo_ref.value=="None" && document.form_search_general.cbo_app.value=="None")
{
alert("Please select atleast  one criteria to search an compressor ");
return false;
}
}
function newcheck(s)
{
if(s==1)
{
	
if(document.form_model.cbo_field.value=="None"){alert("Please select a model to contine further"); return false;}
}
else
{

if(document.form_bom.cbo_field.value=="None"){alert("Please select a bill of material  to contine further"); return false;}

}

}
function add_validate()
{
	if (validateBlank(form1.txt_compressor_model)==0 || validateBlank(form1.txt_bill_of_material)==0 || validateBlank(form1.txt_oil_charge)==0 || !validateSelect(form1.cbo_application) || validateBlank(form1.txt_btuh)==0 || validateBlank(form1.txt_horse_power)==0 || validateBlank(form1.txt_refrigerant)==0 || validateBlank(form1.txt_weight)==0 || validateBlank(form1.txt_rla)==0 ||  validateBlank(form1.txt_lra)==0 || validateBlank(form1.txt_minimum_circuit_ampacity)==0 || validateBlank(form1.txt_maximun_continuous_current)==0 || validateBlank(form1.txt_comp_drawing)==0 || validateBlank(form1.txt_wiring_diagram)==0)
	{
		alert("Please Fill all the Fields marked by *");
		return false;
	}
	else if (validateNumber(form1.txt_oil_charge)==0 || validateNumber(form1.txt_btuh)==0 || validateNumber(form1.txt_rla)==0 || validateNumber(form1.txt_lra)==0 || validateNumber(form1.txt_maximun_continuous_current)==0 )
	{
		alert("Please Enter Numeric value");
		return false;
	}
	else if ((form1.txt_displacement.value!='' && validateNumber(form1.txt_displacement)==0) || (form1.txt_watts_at_rating_point.value!='' && validateNumber(form1.txt_watts_at_rating_point)==0) || (form1.txt_energy_efficiency_rating.value!='' && validateNumber(form1.txt_energy_efficiency_rating)==0))
	{
		alert("Please Enter the Numeric value");
		return false;
	}
	else
		return true;
}

function modify_validate()
{
	 if (form_modify.cbo_model.value=='None')
	 {
		 alert("Please Select the Model Number");
			form_modify.cbo_model.focus();
		 return false;
	 }
	 else if (form_modify1.cbo_bom.value=='None')
	 {
		 alert("Please Select the BOM");
		 form_modify1.cbo_bom.focus();
		 return false;
	 }
	 else if (validateBlank(form1.txt_compressor_model)==0 || validateBlank(form1.txt_bill_of_material)==0 || validateBlank(form1.txt_oil_charge)==0 || !validateSelect(form1.cbo_application) || validateBlank(form1.txt_btuh)==0 || validateBlank(form1.txt_horse_power)==0 || validateBlank(form1.txt_refrigerant)==0 || validateBlank(form1.txt_weight)==0 || validateBlank(form1.txt_rla)==0 ||  validateBlank(form1.txt_lra)==0 || validateBlank(form1.txt_minimum_circuit_ampacity)==0 || validateBlank(form1.txt_maximun_continuous_current)==0 || validateBlank(form1.txt_comp_drawing)==0 || validateBlank(form1.txt_wiring_diagram)==0)
	{
		alert("Please Fill all the Fields marked by *");
		return false;
	}
	else if (validateNumber(form1.txt_oil_charge)==0 || validateNumber(form1.txt_btuh)==0 || validateNumber(form1.txt_rla)==0 || validateNumber(form1.txt_lra)==0 || validateNumber(form1.txt_maximun_continuous_current)==0 )
	{
		alert("Please Enter Numeric value");
		return false;
	}
	else if ((form1.txt_displacement.value!='' && validateNumber(form1.txt_displacement)==0) || (form1.txt_watts_at_rating_point.value!='' && validateNumber(form1.txt_watts_at_rating_point)==0) || (form1.txt_energy_efficiency_rating.value!='' && validateNumber(form1.txt_energy_efficiency_rating)==0))
	{
		alert("Please Enter the Numeric value");
		return false;
	}
	else
	{
		return true;
	}

}


function validateCombo()
{

	if (form_modify.cbo_model.value=='None')
	 {
		 alert("Please Select the Model Number");
			form_modify.cbo_model.focus();
		 return false;
	 }
	 else if (form_modify1.cbo_bom.value=='None')
	 {
		 alert("Please Select the BOM");
		 form_modify1.cbo_bom.focus();
		 return false;
	 }
var b_flag=false;
var browsername=navigator.appName 
if(browsername=="Microsoft Internet Explorer")
{
		b_flag=confirm("Are you sure to Delete Compressor Model.");
		if(b_flag==true)
		{
			return true;
		}
		else
		{
			return false;
		}
}

else 
return true;
}
