function find()
{
var count=0;
var s= "Please fill the following information to find your softner\r\n";
if(document.form1.txt_people.value==""){ count=1; s+="\r\nPeople in household";}
if(document.form1.txt_hardness.value==""){ count=1;s+="\r\nHardness";}
if(document.form1.txt_iron_content.value==""){ count=1; s+="\r\nIron content";}
if(count==1)
{
alert(s);
return false;
}
count=0;
var s= "The following information should be an numeric value\r\n";
if(isNaN(document.form1.txt_people.value))      { count=1; s+="\r\nPeople in household";}
if(isNaN(document.form1.txt_hardness.value))    { count=1;s+="\r\nHardness";}
if(isNaN(document.form1.txt_iron_content.value)){ count=1; s+="\r\nIron content";}
if(count==1)
{
alert(s);
return false;
}

var total_waterusage= 80 * document.form1.txt_people.value;
var actual_ironcontent= document.form1.txt_iron_content.value*5;
var total= (actual_ironcontent+(document.form1.txt_hardness.value*1))*total_waterusage;
var softnerneeded= total*4;
document.form1.result.value=softnerneeded;

}

function newcheck(s)
{
if(s==1)
{
if(document.form_model.Model.value=="None"){alert("Please select a model to continue further"); return false;}
else
	{
document.form_part.Part_no.value="None";
window.open("./tr_watersoftner_display.php?Model="+document.form_model.Model.options[form_model.Model.selectedIndex].value,'CoolProducts','top=200,left=250,directories=no,height=300,location=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=700,maximizable=yes,minimizable=yes,maxheight=200');
		return true;
	}
}
else
{
if(document.form_part.Part_no.value=="None"){alert("Please select a partnumber  to continue further"); return false;}
else
	{
	document.form_model.Model.value="None";	window.open("./tr_watersoftner_display.php?Part_no="+document.form_part.Part_no.options[form_part.Part_no.selectedIndex].value,'CoolProducts','top=200,left=250,directories=no,height=300,location=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=700,maximizable=yes,minimizable=yes,maxheight=200');
		return true;
	}
}

}

function add_validate()
{
	if (validateBlank(form1.txt_model)==0 || validateBlank(form1.txt_partnumber)==0 )
	{
		alert("Please Fill all the Fields marked by *");
		return false;
	}
	else if (validateNumber(form1.txt_partnumber)==0)
	{
		alert("Please Enter Numeric value");
		return false;
	}
	else
		return true;
}
function modify_validate()
{
	if (!validateSelect(form_modify.cbo_model))
	{
		alert("Please Select the Model");
		return false;
	}
	else if (validateBlank(form1.txt_model)==0 || validateBlank(form1.txt_partnumber)==0 )
	{
		alert("Please Fill all the Fields marked by *");
		return false;
	}
	else if (validateNumber(form1.txt_partnumber)==0)
	{
		alert("Please Enter Numeric value");
		return false;
	}
	else
		return true;
}
function validateCombo()
{
if (!validateSelect(form_modify.cbo_model))
	{
		alert("Please Select the Model");
		return false;
	}
var b_flag=false;
var browsername=navigator.appName 
if(browsername=="Microsoft Internet Explorer")
{
		b_flag=confirm("Are you sure to delete this Water Softner Model?");
		if(b_flag==true)
		{
			return true;
		}
		else
		{
			return false;
		}
}

else 
return true;
}
