﻿// JScript File

function StartValidation()
{
    if(Check('d','Labels_SendToFriend'))
    {
        var myConn = new XHConn();

        if (!myConn) alert("XMLHTTP not available. Try a newer/better browser.");

        var fnWhenDone = function (oXML) 
        { 
            HideForm();
            Resize();
            $("Message").innerHTML=  oXML.responseText; 
            
        };

        "<b><center><img alt='Loading' title='Loading' src='App_Themes/en/images/ajax-loader.gif' />Loading...</center><b/>";
        
        myConn.connect("Iframe_Send_To_Friend.aspx?lang=" + strLang, "POST", GetVariables(), fnWhenDone);

    }
}

function GetVariables()
{
    var strVars= "";
    strVars += "FE=" + $("txtFriendEmail").value;
    strVars += "&FN=" + escape($("txtName").value);
    strVars += "&ME=" + $("txtYourEmail").value;
    strVars += "&C=" + $("chkCopy").checked;
    strVars += "&S=" + escape($("txtSubject").value);
    strVars += "&M=" + escape($("txtMessage").value);
    strVars += "&P=" + escape(top.window.location.href);
    return strVars
}

function HideForm()
{
    $('divInput').style.display= 'none';
    $('SendToFriendResult').style.display= 'block';
}

function Resize()
{
    var SendToFriendBlock= top.window.document.getElementById("popupContainer");
   SendToFriendBlock.style.height= "190px";
   SendToFriendBlock.style.width= "440px";
   
   var SendToFriendIframe= top.window.document.getElementById("popupFrame");
   SendToFriendIframe.style.height= "190px";
   SendToFriendIframe.style.width= "430px";
}
