// JavaScript Document

function ValidateForm()
{
    var companyname = document.projectform.txtcompanyname;
    var name = document.projectform.txtname;
	var email = document.projectform.txtemail;
	var compadd = document.projectform.txtcompanyaddress;
	var city = document.projectform.txtcity;
	var state = document.projectform.txtstate;
	var zip = document.projectform.txtzip;
	var country = document.projectform.txtcountry;
	var phone = document.projectform.txtphone;
	var application = document.projectform.txtapplication;
	var appdesc = document.projectform.txtappdesc;

	//validation of txtcompanyname
    if (companyname.value == "")
    {
        window.alert("Company Name can not be blank!");
        companyname.focus();
        return false;
    }
	
	//validation of txtname
    if (name.value == "")
    {
        window.alert("Name can not be blank!");
        name.focus();
        return false;
    }
	
	//validation of txtemail
	if (email.value == "")
    {
        window.alert("E-mail address can not be blank!");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
	
	//validation of txtcompanyaddress
    if (compadd.value == "")
    {
        window.alert("Company Address can not be blank!");
       	compadd.focus();
        return false;
    }
	
	//validation of txtcity
    if (city.value == "")
    {
        window.alert("City can not be blank!");
       	city.focus();
        return false;
    }
	
	//validation of txtstate
    if (state.value == "")
    {
        window.alert("State can not be blank!");
       	state.focus();
        return false;
    }

	//validation of txtzip
    if (zip.value == "")
    {
        window.alert("Zip code can not be blank!");
       	zip.focus();
        return false;
    }
	
	//validation of txtzip
    if (country.selectedIndex < 1)
    {
        alert("Country can not be blank!");
        country.focus();
        return false;
    }

	//validation of txtphone
	if (phone.value == "")
    {
        window.alert("Phone Number can not be blank!");
       	phone.focus();
        return false;
    }

	//validation of txtapplication
	if (application.value == "")
    {
        window.alert("Application can not be blank!");
       	application.focus();
        return false;
    }

	//validation of txtmodeldesc
	if (appdesc.value == "")
    {
        window.alert("Application Description can not be blank!");
       	appdesc.focus();
        return false;
    }


	var total=""
	for(var i=0; i < document.projectform.txtfirmservices.length; i++)
	{
	if(document.projectform.txtfirmservices[i].checked)
	total +=document.projectform.txtfirmservices[i].value + " , " 
	}
	document.projectform.txtservices.value = total;

}


