function validateForm(){
        from =  window.document.fromcontactus.senderemail.value
        to =  window.document.fromcontactus.friendsemail.value
        body =  document.getElementById('emailtext').innerHTML
        window.document.fromcontactus.body.value = body
        if (body == ''){
            alert('Please enter message')
            return (false);
        } 
        if (!isEmailAddress(from)){
            alert('Please enter your email address in the form: emailid@domain.com')
            return (false);
        }
        if (!isMultipleEmailAddress(to)){
            alert('Please enter your friend\'s email address in the form: emailid@domain.com')
            return (false);
        }  
    }
    
    function isMultipleEmailAddress(email){
        var email_array=email.split(",");
        var index=0;
        while (index < email_array.length)
        {
            if(!isEmailAddress(email_array[index])){
                return (false);
            }
            index+=1;
        }
        return (true);
    }

    
    function isEmailAddress(email)
        {
        if (email == "" || email.indexOf ('@', 0) == -1 || email.indexOf ('.', 0) == -1)
        {
            return (false);
        }
        else
            return (true);
        }
