    function ValidateSendToFriendForm()
    {
        senderName2 = $("senderName");
        reciverName2 = $("reciverName");
        reciverMail2 = $("reciverMail");
        
        senderValid = senderName2.value.replace(" ", "") != "";
        reciverValid = reciverName2.value.replace(" ", "") != "";
        mailValid = reciverMail2.value.replace(" ", "") != "";
        
        $("senderError").style.display = senderValid ? "none" : "block";
        $("reciverError").style.display = reciverValid ? "none" : "block";
        $("mailError").style.display = mailValid ? "none" : "block";
        
        return senderValid && reciverValid && mailValid;
    }
    
    function SubmitSendToFriendForm()
    {
        if(ValidateSendToFriendForm())
        {
            $("sendFriendForm").style.display = 'none';
            $("friendsendingstatus").style.display = 'block';
            messageValue = document.getElementById("message").value.replace("\n\r", "<br />");
            while(messageValue.indexOf("\n") >= 0)
            {
                messageValue = messageValue.replace("\n", "<br />");
            }
            var url = 'biri-arkadasina-gonder-mail.aspx?sender=' + document.getElementById("senderName").value + 
                    '&reciver=' + document.getElementById("reciverName").value + 
                    '&message=' + escape(messageValue) +
                    '&mail=' + document.getElementById("reciverMail").value;
            new Ajax.Request(url,
              {
                method:'get',
                onSuccess: function(transport){
                 $("friendsendingstatus").style.display = 'none';
                 $("friendsent").style.display = 'block';
                }, onFailure: function(){
                 $("friendsendingstatus").style.display = 'none';
                 $("erroroccured").style.display = 'block'; }
              });
        }
        return false;
    }