﻿sfHover = function () {
    var sfEls = document.getElementById("TopNav").getElementsByTagName("li");
    for (var i = 0; i < sfEls.length; i++) {
        sfEls[i].onmouseover = function () {
            this.className += " sfhover";
        }

        sfEls[i].onmouseout = function () {
            this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function ValidateTypeAll(SenderCtrl, ListCtrl) {
    if (SenderCtrl.value == 'All')
        document.getElementById(ListCtrl).value = 'All';
}

function EmailFriend(PropertyId) {
    windowDoPop = window.open('EmailFriend.aspx?PropertyId=' + PropertyId, 'doPop', 'width=560,height=415,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no');
    windowDoPop.focus();
}

function SmsEmailAgent(AgentId, WebRef, PropertyId) {
    windowDoPop = window.open('SmsEmailAgent.aspx?AgentId=' + AgentId + '&WebRef=' + WebRef + '&PropertyId=' + PropertyId, 'doPop', 'width=560,height=415,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no');
    windowDoPop.focus();
}

function PrintElement(objElement) {
    var prtContent = document.getElementById(objElement);
    var WinPrint = window.open('', '', 'top=0,left=0,width=780,height=500,scrollbars=no,toolbar=no,status=no');

    WinPrint.document.write(prtContent.innerHTML);
    WinPrint.document.close();
    WinPrint.focus();
    if (WinPrint.print() != null)
        WinPrint.close();
    if (!window.closed)
        WinPrint.close();
}

function Calculator(Calculators) {
    var CalculatorWindow

    CalculatorWindow = window.open(Calculators, "Standard_Bank_Calculators", "width=720,height=530,scrollbars=yes");
    CalculatorWindow.focus();
    return false;
}

function ExchangeRates(ERates) {
    var ExchangeWindow

    ExchangeWindow = window.open(ERates, "Exchange_Rates", "width=580,height=500,scrollbars=yes");
    ExchangeWindow.focus();
    return false;
}
