/****************************************************************************************************/
/* Date created    Author           Comments ********************************************************/
/****************************************************************************************************/
/* 12/17/2007      Harish S. Ram  This file is created for EmailFriend.aspx*/
/****************************************************************************************************/

		function ValidateForm(event, obj, objID)
		{
			var sId;
			var ctl;
			sId = obj.id;
			sId = sId.replace(objID, "txtTo")
			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 To Email Address.");
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}
				if (!ctl.value.match(regEmail))
				{
					alert('Please enter a valid To Email Address.');
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}		
			}
			
			
			sId = obj.id;
			sId = sId.replace(objID, "txtFrom")
			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 From Email Address.");
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}
				if (!ctl.value.match(regEmail))
				{
					alert('Please enter a valid From Email Address.');
					event.cancelBubble = true;
					event.returnValue = false;
					ctl.focus();
					return false;
				}		
			}
		}