/*Modified code from Steven Estrella's Web Wizard's Guide to Javascript */
/* Original Site Design and Programing: Nathan Sutton 10/29/02 */

var myWindow = null;
function openWin(url,targetname,W,H,L,T,thefeatures) {
    var params = "";
    var nofeatures = "toolbar=0,location=0,directories=0,status=0,";
    nofeatures += "menubar=0,scrollbars=0,resizable=0,copyhistory=0";
    var basicfeatures = "scrollbars=0,resizable=1,menubar=0 ";
    var morefeatures = "toolbar=1,location=1,directories=1,";
	morefeatures += "status=1,copyhistory=1";
    var dimensions = "width=" + W + ",height=" + H;
    /* Callout: The placement variable contains values for left/top and screenX/screenY. Use both to ensure compatibility with all browsers. */
    var placement = "left="  + L + ",top=" + T;
    placement += ",screenX="  + L + ",screenY=" + T;
    
    /* Callout: The switch control structure makes decisions that depend on the value of a variable. In this case the value of the parameter variable thefeatures determines the value of the variable params. */
    switch (thefeatures){
        case "none":
            params += nofeatures;
            break;
        case "basic":
            params += basicfeatures;
            break;
        case "full":
            params += basicfeatures + "," + morefeatures;
            break;
        default:
            params += thefeatures;
    }
    /* Adds the dimensions and placement info to the params variable. */
    params += "," + dimensions + "," + placement;
    /* The window.open()method  creates myWindow. */
    myWindow = window.open(url,targetname,params);
	
	/*10/29/02- use focus tag to make sure window is in front */
	myWindow.focus();

}

function closeWin(){
    if (myWindow != null){
        myWindow.close();
        myWindow = null;    
    }
}

 /* Extra Open Page Function */

function open_popup(page) {
    window_handle = window.open(page,'popupWindowName');
    window_handle.focus();
    return false;
}

