function offer_form()
{
	x = document.offerform;
	if(x.fname.value=='')
	{
		alert("Enter your First Name");
		x.fname.focus();
		x.fname.select();
		return false;
	}
	else if(x.fname.value.substring(0, 1)==' ')
	{
		alert("First character of a Name should not be space");
		x.fname.focus();
		x.fname.select();
		return false;
	}
	for (var i = 0; i < x.fname.value.length; i++) 
	{
		var ch = x.fname.value.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ' && ch!='.') 
		{
			alert("\nThe Name field only accepts letters & spaces.\n\nPlease re-enter your Name.");
			x.fname.focus();
			x.fname.select();
			return false;
		}
	}

	if(x.lname.value=='')
	{
		alert("Enter your Last Name");
		x.lname.focus();
		x.lname.select();
		return false;
	}
	else if(x.lname.value.substring(0, 1)==' ')
	{
		alert("First character of a Name should not be space");
		x.lname.focus();
		x.lastname.select();
		return false;
	}
	for (var i = 0; i < x.lname.value.length; i++) 
	{
		var ch = x.lname.value.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ' && ch!='.') 
		{
			alert("\nThe Name field only accepts letters & spaces.\n\nPlease re-enter your Last Name.");
			x.lname.focus();
			x.lname.select();
			return false;
		}
	}


	if(x.email.value=='')
	{
		alert("Enter your EMail I.D");
		x.email.focus();
		x.email.select();
		return false;
	}
	for (var i = 0, count1=0, count2=0; i < x.email.value.length; i++) 
	{
		var ch=x.email.value.substring(i, i + 1);
		if(ch=='@')
		count1++;
		if(ch=='.')
		count2++;
	}
	if((count1!=1)||(count2<1))
	{
		alert("Enter a proper EMail I.D \n\ne.g., username@example.com");
		x.email.focus();
		x.email.select();
		return false;
	} 	
	for(var i=0; i<x.email.value.length; i++) 
	{
		var ch = x.email.value.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != '@' && ch!='.' && ch!='_' && ch!='-' && isNaN(ch)) 
		{
			alert("\nThe EMail I.D field only accepts letters, numbers and -,  _,  .\n\nPlease re-enter your User I.D.");
			x.email.select();
			x.email.focus();
			return false;
		}
	}
	for(i=0; i<x.email.value.length; i++)
	{
		ch = x.email.value.substring(i, i+1);
		if(ch == '@')
		break;
	}
	ch = x.email.value.substring(0, i);
	if (((ch< "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch!='.' && ch!='_' && ch!='-' && isNaN(ch))
	{
		alert("\nThe EMail I.D field only accepts letters, numbers and -,  _,  .\n\nPlease re-enter your E-Email I.D.");
		x.email.select();
		x.email.focus();
		return false;
	}
	for(j=i+1; j<x.email.value.length; j++)
	{
		ch = x.email.value.substring(j, j+1);
		if(ch == '.')
		break;
	}
	ch = x.email.value.substring(i+1, j);
	if ((ch< "a" || "z" < ch) && (ch < "A" || "Z" < ch))
	{
		alert("\nEnter proper EMail I.D");
		x.email.select();
		x.email.focus();
		return false;
	}
	ch = x.email.value.substring(j+1);
	if ((ch< "a" || "z" < ch) && (ch < "A" || "Z" < ch))
	{
		alert("\nEnter proper EMail I.D");
		x.email.select();
		x.email.focus();
		return false;
	}

	if(x.phone)
	{
		if(x.phone.value=='')
		{
			alert("Enter your Telephone Number");
			x.phone.focus();
			x.phone.select();
			return false;
		}
		else if(x.phone.value.substring(0, 1)==' ')
		{
			alert("First character of a Telephone Number should not be space");
			x.phone.focus();
			x.phone.select();
			return false;
		}
	}

	myOption = -1;
	for (i=offerform.historys.length-1; i > -1; i--) 
	{
		if (offerform.historys[i].checked) 
		{
			myOption = i; 
			i = -1;
		}
	}
	if (myOption == -1) 
	{
		alert("Please select your Credit History");
		return false;
	}
}



function contact_form()
{
	x = document.contactform;
	if(x.fname.value=='')
	{
		alert("Enter your First Name");
		x.fname.focus();
		x.fname.select();
		return false;
	}
	else if(x.fname.value.substring(0, 1)==' ')
	{
		alert("First character of a Name should not be space");
		x.fname.focus();
		x.fname.select();
		return false;
	}
	for (var i = 0; i < x.fname.value.length; i++) 
	{
		var ch = x.fname.value.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ' && ch!='.') 
		{
			alert("\nThe Name field only accepts letters & spaces.\n\nPlease re-enter your Name.");
			x.fname.focus();
			x.fname.select();
			return false;
		}
	}

	if(x.phone)
	{
		if(x.phone.value=='')
		{
			alert("Enter your Telephone Number");
			x.phone.focus();
			x.phone.select();
			return false;
		}
		else if(x.phone.value.substring(0, 1)==' ')
		{
			alert("First character of a Telephone Number should not be space");
			x.phone.focus();
			x.phone.select();
			return false;
		}
	}
	


	if(x.email.value=='')
	{
		alert("Enter your EMail I.D");
		x.email.focus();
		x.email.select();
		return false;
	}
	for (var i = 0, count1=0, count2=0; i < x.email.value.length; i++) 
	{
		var ch=x.email.value.substring(i, i + 1);
		if(ch=='@')
		count1++;
		if(ch=='.')
		count2++;
	}
	if((count1!=1)||(count2<1))
	{
		alert("Enter a proper EMail I.D \n\ne.g., username@example.com");
		x.email.focus();
		x.email.select();
		return false;
	} 	
	for(var i=0; i<x.email.value.length; i++) 
	{
		var ch = x.email.value.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != '@' && ch!='.' && ch!='_' && ch!='-' && isNaN(ch)) 
		{
			alert("\nThe EMail I.D field only accepts letters, numbers and -,  _,  .\n\nPlease re-enter your User I.D.");
			x.email.select();
			x.email.focus();
			return false;
		}
	}
	for(i=0; i<x.email.value.length; i++)
	{
		ch = x.email.value.substring(i, i+1);
		if(ch == '@')
		break;
	}
	ch = x.email.value.substring(0, i);
	if (((ch< "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch!='.' && ch!='_' && ch!='-' && isNaN(ch))
	{
		alert("\nThe EMail I.D field only accepts letters, numbers and -,  _,  .\n\nPlease re-enter your E-Email I.D.");
		x.email.select();
		x.email.focus();
		return false;
	}
	for(j=i+1; j<x.email.value.length; j++)
	{
		ch = x.email.value.substring(j, j+1);
		if(ch == '.')
		break;
	}
	ch = x.email.value.substring(i+1, j);
	if ((ch< "a" || "z" < ch) && (ch < "A" || "Z" < ch))
	{
		alert("\nEnter proper EMail I.D");
		x.email.select();
		x.email.focus();
		return false;
	}
	ch = x.email.value.substring(j+1);
	if ((ch< "a" || "z" < ch) && (ch < "A" || "Z" < ch))
	{
		alert("\nEnter proper EMail I.D");
		x.email.select();
		x.email.focus();
		return false;
	}


	if(x.comments.value=='')
	{
		alert("Please Enter your Comments");
		x.comments.focus();
		x.comments.select();
		return false;
	}
	


	
}



