// JavaScript Document

function myfocus1()//for quatation.html
{
	document.f1.rname.focus();
}

//**************************************************************************

function validation1()//validation for quatation.html
{
fwsr1()
	if(document.f1.rname.value=="")//contact person
	{
	alert("Please enter your name")
	document.f1.rname.focus()
	document.f1.rname.select()
	return;
	}
	
	if(document.f1.remail.value=="")//Email
	{
	alert("Please enter your Email address")
	document.f1.remail.focus()
	document.f1.remail.select()
	return;
	}
	
	if (document.f1.rphone.value=="")//Phone
	{
	alert("Please enter your Contact Number")
	document.f1.rphone.focus()
	document.f1.rphone.select()
	return;
	}

	if(document.f1.req.value=="")//Requirement
	{
	alert("Please select your request")
	document.f1.req.focus()
	document.f1.req.select()
	return;
	}

	//checking 
	if(isNaN(document.f1.rname.value)==false)
	{
	alert("Name must be in text")
	document.f1.rname.focus()
	document.f1.rname.select()
	return;
	}

	e=document.f1.remail.value
	if ((e.indexOf("@",0)==-1)||(e.indexOf(".",0)==-1)||(e.indexOf(" ",0)!=-1))
	{
	alert("Enter correct e-mail address")
	document.f1.remail.focus()
	document.f1.remail.select()
	return;
	}
	
}


//*****************************************************************************************
function fwsr1()//Space remover function for quatation.html
{
// Space remover from contact person name
str1=document.f1.rname.value
if(str1.charAt(0) == (" ") )
  {  str1 = str1.substring(1);
document.f1.rname.value=str1
fwsr1()
}

// Space remover from comapny name
str2=document.f1.cname.value
if(str2.charAt(0) == (" ") )
  {  str2 = str2.substring(1);
document.f1.cname.value=str2
fwsr1()
}

// Space remover from phone
str3=document.f1.rphone.value
if(str3.charAt(0) == (" ") )
  {  str3= str3.substring(1);
document.f1.rphone.value=str3
fwsr1()
}


// Space remover from description of request
str4=document.f1.rdesc.value
if(str4.charAt(0) == (" ") )
  {  str4= str4.substring(1);
document.f1.rdesc.value=str4
fwsr1()
}
}

//********************************************************
function mysubmit1()//for quatation.html
{
document.f1.submit();
}


//********************************************************
function myfocus2()//for contact.html
{
	document.frmEnquiry.Company.focus();
}

//********************************************************
function validation2()//validation for contact.html
{
fwsr2()

	if(document.frmEnquiry.Name.value=="")//contact person
	{
	alert("Please enter your full name")
	document.frmEnquiry.Name.focus()
	document.frmEnquiry.Name.select()
	return;
	}
	
	if(document.frmEnquiry.Address.value=="")//Address
	{
	alert("Please enter your address")
	document.frmEnquiry.Address.focus()
	document.frmEnquiry.Address.select()
	return;
	}
	
	if(document.frmEnquiry.Zip.value=="")//PIN
	{
	alert("Please enter ZIP/ PIN")
	document.frmEnquiry.Zip.focus()
	document.frmEnquiry.Zip.select()
	return;
	}
	
	if(document.frmEnquiry.Phone.value=="")//Phone
	{
	alert("Please enter your Phone Number")
	document.frmEnquiry.Phone.focus()
	document.frmEnquiry.Phone.select()
	return;
	}
	if(document.frmEnquiry.email.value=="")//Phone
	{
	alert("Please enter your E-mail address")
	document.frmEnquiry.email.focus()
	document.frmEnquiry.email.select()
	return;
	}
	
//radio button validation of contact.html i.e. interest
// set var radio_choice to false

var radio_choice = false;
// Loop from zero to the one minus the number of radio button selections
for (counter = 0; counter < frmEnquiry.Category.length; counter++)
{
// If a radio button has been selected it will return true
// (If not it will return false)
if (frmEnquiry.Category[counter].checked)
radio_choice = true; 
}

if (!radio_choice)
{
// If there were no selections made display an alert box 
alert("Please select your interest")
document.frmEnquiry.Category[0].focus();
return (false);
}
//End of radio button validation

	if(document.frmEnquiry.co_Product.value=="")//service/business type
	{
	alert("Please enter your service/business type")
	document.frmEnquiry.co_Product.focus()
	document.frmEnquiry.co_Product.select()
	return;
	}
	
	if(document.frmEnquiry.Message.value=="")//Query
	{
	alert("Please enter your query")
	document.frmEnquiry.Message.focus()
	document.frmEnquiry.Message.select()
	return;
	}

//checking 
	if(isNaN(document.frmEnquiry.Name.value)==false)
	{
	alert("Name must be in text")
	document.frmEnquiry.Name.focus()
	document.frmEnquiry.Name.select()
	return;
	}
	if(isNaN(document.frmEnquiry.Zip.value)==true)
	{
	alert("ZIP/ PIN must be in digit")
	document.frmEnquiry.Zip.focus()
	document.frmEnquiry.Zip.select()
	return;
	}
	//email check
	e=document.frmEnquiry.email.value
	if ((e.indexOf("@",0)==-1)||(e.indexOf(".",0)==-1)||(e.indexOf(" ",0)!=-1))
	{
	alert("Enter correct e-mail address")
	document.frmEnquiry.email.focus()
	document.frmEnquiry.email.select()
	return;
	}

}

//**********************************************
function fwsr2()//Space remover function for contact.html
{
str1=document.frmEnquiry.Company.value
if(str1.charAt(0) == (" ") )
{  str1 = str1.substring(1);
document.frmEnquiry.Company.value=str1
fwsr2()
}

str2=document.frmEnquiry.Name.value
if(str2.charAt(0) == (" ") )
{  str2 = str2.substring(1);
document.frmEnquiry.Name.value=str2
fwsr2()
}

str3=document.frmEnquiry.Address.value
if(str3.charAt(0) == (" ") )
{  str3 = str3.substring(1);
document.frmEnquiry.Address.value=str3
fwsr2()
}

str4=document.frmEnquiry.Country.value
if(str4.charAt(0) == (" ") )
{  str4 = str4.substring(1);
document.frmEnquiry.Country.value=str4
fwsr2()
}

str5=document.frmEnquiry.Zip.value
if(str5.charAt(0) == (" ") )
{  str5 = str5.substring(1);
document.frmEnquiry.Zip.value=str5
fwsr2()
}

str6=document.frmEnquiry.Phone.value
if(str6.charAt(0) == (" ") )
{  str6 = str6.substring(1);
document.frmEnquiry.Phone.value=str6
fwsr2()
}

str7=document.frmEnquiry.Mobile.value
if(str7.charAt(0) == (" ") )
{  str7 = str7.substring(1);
document.frmEnquiry.Mobile.value=str7
fwsr2()
}

str8=document.frmEnquiry.Fax.value
if(str8.charAt(0) == (" ") )
{  str8 = str8.substring(1);
document.frmEnquiry.Fax.value=str8
fwsr2()
}

str9=document.frmEnquiry.co_Product.value
if(str9.charAt(0) == (" ") )
{  str9 = str9.substring(1);
document.frmEnquiry.co_Product.value=str9
fwsr2()
}

str10=document.frmEnquiry.Specifications.value
if(str10.charAt(0) == (" ") )
{  str10 = str10.substring(1);
document.frmEnquiry.Specifications.value=str10
fwsr2()
}

str11=document.frmEnquiry.Message.value
if(str11.charAt(0) == (" ") )
{  str11 = str11.substring(1);
document.frmEnquiry.Message.value=str11
fwsr2()
}
}

//**************************************************
function mysubmit2()//for contact.html
{
document.frmEnquiry.submit();
}
//**************************************************