	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 == "Correo")      
        {	
			alert('Por favor ingrese su correo.');
			email.focus();
			return false;
        }
        if (ValidateEmails(email.value))
        {
			
			var element = document.getElementById('SendtoFriendSignUp');
			element.value = 'Yes';			
			try
			{
			    AjaxSendToFriend.SendToFriend(element.value, email.value);  
			    alert('Se ha enviado un correo a ' + email.value);
              
            		}       
	        catch(ex)	        
	        {
	            alert('Ocurrio un error, por favor comuniquese con el administrador.');
	        }	        
	        email.value="Correo";
        }
		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("Verifique su correo electronico");
				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;
    }