//
	function ValidateText(txt,len,str)
	{
		if(txt.value.length < len)
		{
			if(str!=null)
				alert(str);
			txt.focus();
			return false;
		}
		else
		{
			return true;
		}
	}
//
	function ValidateEmail(txt,str)
	{
		if(!ValidateText(txt,5,null))
		{
			if(str!=null)
				alert(str);
			txt.focus();
			return false;
		}
		/*
		var re=new RegExp("/S+[@]/S+[.]/S+","gi");
		if(re!=null)
		{
			if(re.test(txt.value))
			{
				return true;
			}
			else
			{
				if(str!=null)
					alert(str);
				txt.focus();
				return false;
			}
		}
		else
		*/
		{
			var index=txt.value.indexOf('@');
			if(index==-1 || index==txt.length-1)
			{
				if(str!=null)
					alert(str);
				txt.focus();
				return false;
			}
			else
			{
				var text=txt.value.substr(index);
				index=text.indexOf('.');
				if(index==-1 || index==text.length-1)
				{
					if(str!=null)
						alert(str);
					txt.focus();
					return false;
				}
				else
				{
					return true;
				}
			}
		}
		return false;
	}
//
	function Validate(form)
	{
		var lblInfo;
		var lblError1;
		var lblError2;
		var lblSending;

		try
		{
			lblInfo=document.getElementById("lblInfo");
			lblError1=document.getElementById("lblError1");
			lblError2=document.getElementById("lblError2");
			lblSending=document.getElementById("lblSending");
			//window.alert("11 "+"a"+lblInfo+"b"+lblError1+"c"+lblError2+"d"+lblSending);
		}
		catch(e)
		{
			window.alert("12 "+e);
			window.alert("12 "+"a"+lblInfo+"b"+lblError1+"c"+lblError2+"d"+lblSending);
			lblInfo.style.display="";
			return false;
		}

		try
		{
			lblInfo.style.display="";
			lblError1.style.display="none";
			lblError2.style.display="none";
			lblSending.style.display="none";
			form.style.cursor="auto";

			if(ValidateText(form.Name,1,null))
			{
				if(ValidateText(form.Email,1,null))
				{
					if(ValidateEmail(form.Email,null))
					{
						lblInfo.style.display="none";
						lblSending.style.display="";
						form.style.cursor="wait";
						return true;
					}
					else
					{
						lblInfo.style.display="none";
						lblError2.style.display="";
						return false;
					}
				}
				if(ValidateText(form.Phone,1,null))
				{
					lblInfo.style.display="none";
					lblSending.style.display="";
					form.style.cursor="wait";
					return true;
				}
			}
			lblInfo.style.display="none";
			lblError1.style.display="";
		}
		catch(e)
		{
			window.alert("2 "+e);
			lblInfo.style.display="";
			return false;
		}
		return false;
	}
//
	function ReturnNone(chk,obj)
	{
		if(chk.checked)
		{
			obj.disabled=true;
			//obj.style.display="none";
			obj.style.background="gray";
		}
		else
		{
			obj.disabled=false;
			//obj.style.display="";
			obj.style.background="#FFFFFF";
		}
	}
//
	function SetSrc(obj,str)
	{
		if(obj)
		{
			obj.src = 'gxf/send_'+str+'.gif';
		}
	}
//
