/***********************************************************************************************************/		
/* Created/Modifed Date       Author            Comments ***************************************************/
/* 10/16/2007               Muni mahimaluru   As part of the clean up new contactinvestor.js file created***/
/***********************************************************************************************************/
		
		//Added by Harish
		//Function to clear all the values.
		function Clearvalues()
		{
				document.Form1.reset() ;
				return false ;
		}

		
		function ValidateForm(event, obj, objID)
		{
			var sId;
			var ctl;
		
			sId = obj.id;
			sId = sId.replace(objID, "txtFirstName")
			ctl = document.getElementById(sId);
			if (ctl)
			{
				while (ctl.value.search(/^\s+/) >= 0)		
					ctl.value = ctl.value.replace(/^\s+/, "");
				while (ctl.value.search(/\s+$/) >= 0)		
					ctl.value = ctl.value.replace(/\s+$/, "");	
				if (ctl.value == "")
				{
					alert("Please enter your First Name.");
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}
			}
			sId = obj.id;
			sId = sId.replace(objID, "txtLastName")
			ctl = document.getElementById(sId);
			if (ctl)
			{
				while (ctl.value.search(/^\s+/) >= 0)		
					ctl.value = ctl.value.replace(/^\s+/, "");
				while (ctl.value.search(/\s+$/) >= 0)		
					ctl.value = ctl.value.replace(/\s+$/, "");	
				if (ctl.value == "")
				{
					alert("Please enter your Last Name.");
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}
			}			
			sId = obj.id;
			sId = sId.replace(objID, "ddlCountry")
			ctl = document.getElementById(sId);
			if (ctl)
			{
				if (ctl.options[ctl.selectedIndex].value != '2')
				{
					sId = obj.id;
					sId = sId.replace(objID, "txtDayPhone")
					ctl = document.getElementById(sId);
					if (ctl)
					{
while (ctl.value.search(/^\s+/) >= 0)		
	ctl.value = ctl.value.replace(/^\s+/, "");
while (ctl.value.search(/\s+$/) >= 0)		
	ctl.value = ctl.value.replace(/\s+$/, "");	
if ((ctl.value != "") && (!ctl.value.match(regPhone)))
{
	alert("Please enter your 10 digit phone number, starting with the area code.");
	event.cancelBubble = true;
	event.returnValue = false;
	ctl.focus();
	return false;
}
sHome = ctl.value;
					}
					sId = obj.id;
					sId = sId.replace(objID, "txtFax")
					ctl = document.getElementById(sId);
					if (ctl)
					{
while (ctl.value.search(/^\s+/) >= 0)		
	ctl.value = ctl.value.replace(/^\s+/, "");
while (ctl.value.search(/\s+$/) >= 0)		
	ctl.value = ctl.value.replace(/\s+$/, "");	
if ((ctl.value != "") && (!ctl.value.match(regPhone)))
{
	alert("Please enter your 10 digit fax number, starting with the area code.");
	event.cancelBubble = true;
	event.returnValue = false;
	ctl.focus();
	return false;
}
sHome = ctl.value;
					}
					sId = obj.id;
					sId = sId.replace(objID, "txtZip")
					ctl = document.getElementById(sId);
					if (ctl)
					{
while (ctl.value.search(/^\s+/) >= 0)		
	ctl.value = ctl.value.replace(/^\s+/, "");
while (ctl.value.search(/\s+$/) >= 0)		
	ctl.value = ctl.value.replace(/\s+$/, "");	
if ((ctl.value != "") && (!ctl.value.match(regZip)))
{
	alert("Please enter a valid Zip Code.");
	event.cancelBubble = true;
	event.returnValue = false;
	ctl.focus();
	return false;
}
					}
				}
			}		
			sId = obj.id;
			sId = sId.replace(objID, "txtEmail")
			ctl = document.getElementById(sId);
			if (ctl)
			{
				while (ctl.value.search(/^\s+/) >= 0)		
					ctl.value = ctl.value.replace(/^\s+/, "");
				while (ctl.value.search(/\s+$/) >= 0)		
					ctl.value = ctl.value.replace(/\s+$/, "");	
				if (ctl.value == "")
				{
					alert("Please enter Your Email Address.");
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}
				if (!ctl.value.match(regEmail))
				{
					alert('Please enter a valid Email Address.');
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}		
			}
			sId = obj.id;
			sId = sId.replace(objID, "txtComments")
			ctl = document.getElementById(sId);
			if (ctl)
			{
				while (ctl.value.search(/^\s+/) >= 0)		
					ctl.value = ctl.value.replace(/^\s+/, "");
				while (ctl.value.search(/\s+$/) >= 0)		
					ctl.value = ctl.value.replace(/\s+$/, "");	
				if (ctl.value == "")
				{
					alert("Please enter tell us what information can we help you with.");
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}
			}
			return true;
        }  
		