// BECP Resource Center Window Javascript

// Author: Geoffrey Elliott





// captureClick :: calls newWindow, and returns false so that the href in the link doesn't activate.

//                 When this is used with a certain anchor format we can have nice sized javascript windows,

//                 or normal new windows if Javascript is turned off



function captureClick(url) {

    newWindow(url);

    return false;

}





// newWindow :: creates a new window pointing to a given URL.  The window has the features we want.



function newWindow(url) {

    var nw=window.open(url, "emslWindow", "scrollbars,toolbar,menubar,location,status,resizable,width=550,height=450");



    if(parseInt(navigator.appVersion) >= 4) {

        var nwLeft = (screen.availWidth - 550) / 2;

        var nwTop = (screen.availHeight - 450) / 2;



        if(parseInt(navigator.appVersion) > 4) {

            moveWindow(nw, nwLeft, nwTop);

        }

    }

    nw.focus();

}





//  moveWindow :: given a window object, moves the window to the given coordinates

//                This generates errors in IE4 and Netscape 4; they don't like the exception handling.

//                But it's necessary to support newer browsers, so we leave it in.



function moveWindow(newWindow, windowLeft, windowTop) {

    try {

        newWindow.moveTo(windowLeft, windowTop);

    }

    catch (e) {

        //alert("Exception Caught!");

    }

}













//makeVisible::hides/displays a div on MouseOver or onclick



function makeVisible (id, visibility) {

document.getElementById(id).style.display = visibility;

}