	function clearText(thefield) {
	  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
	} 
	function replaceText(thefield) {
	  if (thefield.value=="") { thefield.value = thefield.defaultValue }
	}
	/*
	function MethodEnter(event)
	{
		//alert(event.keyCode);
		try{
			if (event.keyCode == 13 && document.getElementById('txtEmails').value != "" ) 
			{				
				ValidateSendToFriendSmallSignUp();
			}	
			if (event.keyCode == 13){
				event.returnvalue=false;
				event.cancel =true;	
				event.keyCode =0;
			}
		}
		catch(e){
			event.preventDefault();
		}
		
	}
	*/
	function ValidateSendToFriendSmallSignUp()
	{	    
        var email = document.getElementById('txtEmails');
        if (email.value == "" || email.value == "Email Address")      
        {	
			alert('Please enter your email');
			email.focus();
			return false;
        }
        if (ValidateEmails(email.value))
        {
			
			var element = document.getElementById('SendtoFriendSignUp');
			element.value = 'Yes';			
			try
			{
			    AjaxSendToFriend.SendToFriend(element.value, email.value);  
			    alert('Your email was sent to ' + email.value);
              
            }       
	        catch(ex)	        
	        {
	            alert('It happened an error, Please to communicate the administrator');
	        }	        
	        email.value="Email Address";
        }
		return false;
	}
	function ValidateEmails(incomingemails)
	{
		var emailsstring = incomingemails;
		var arraysemails = new Array();
		//arraysemails = emailsstring.split("/(,|;)/");
		arraysemails = emailsstring.split(/(,|;)/);
		//alert(arraysemails.length);
		for (var i = 0; i < arraysemails.length; i++)
		{
			var myEmail = arraysemails[i];
			if(!ValidateEmail(myEmail))
			{
				alert("Please check the emails address1");
				document.getElementById('txtEmails').focus();
				return false;
			}
		}
		return true;
	}
	function ValidateEmail(valor) 
    {
       if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
           return true;
      else
          return false;
    }
