﻿// Disable right mouse click Script
// By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
// For full source code, visit http://www.dynamicdrive.com
var message = "Sorry, right-click is disabled.\nImages and text copyrighted!";

function clickIE4() {
    if (event.button == 2) {
        alert(message);
        return false;
    }
}

function clickNS4(e) {
    if (document.layers || document.getElementById && !document.all) {
        if (e.which == 2 || e.which == 3) {
            alert(message);
            return false;
        }
    }
}

if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = clickNS4;
}
else if (document.all && !document.getElementById) {
    document.onmousedown = clickIE4;
}

document.oncontextmenu = new Function("alert(message);return false")

sfHover = function() {
    var sfEls = document.getElementById("TopNavigation").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=430,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=430,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=760,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;
}