﻿// JScript File




//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="Function Disabled!";

///////////////////////////////////
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")
document.oncontextmenu = new Function("return false");


function open_window(url) {
    var leftposition;
    var topposition;
    var initwidth = 75;
    var initheight = 50;
    var width = 750;
    var height = 500;
    var speed = 50;  //Higher = slower
    var widthrate = width / speed;
    var heightrate = height / speed;

    leftposition = (screen.width - width) - 10;
    //topposition = (screen.height - height) - 100;
    topposition = 0;

    var specs = "toolbar=no, location=no, directories=no, status=no, menubar=no,  resizable=yes, copyhistory=no, titlebar=no,  ";
    specs = specs + ", left=" + leftposition;
    specs = specs + ",top=" + topposition;

    if (window.resizeTo && navigator.userAgent.indexOf("Opera") == -1) {
        specs += ",width=" + initwidth +", height=" + initheight ;
        specs+=",scrollbars=yes"
        
        var newwindow = window.open(url, "", specs);
        var sizeheight = initheight;
        for (sizewidth = initwidth; sizewidth < width; sizewidth += widthrate) {
            sizeheight += heightrate;
            newwindow.resizeTo(sizewidth, sizeheight);
        }
    }
    else {
        specs = specs + ",scrollbar=yes ,width=" + width + ", height=" + height;

        window.open(url, "", specs);
    }

}


function scrollwindowto(passingdiv) {
    var toppos = passingdiv.offsetTop;

    var thewindow = passingdiv.document.parentWindow;
    thewindow.scrollTo(0, toppos);
}



