 
// this function changes content in the window that opened it
// be very careful that you don't accidently change the content in the tools 
// window when creating sub-subwindows (i.e., subwindows created by tools)
function changeContent(url) {

    var contentWin = null;
    
    // check to see if opener window exists and that it is not named "tools"
    // if it is not tools, you should have a direct link to the main window
    if (opener != null && opener.name != "tools") {
        contentWin = opener;
    }
    else {
        // check to see if the opener.opener window is still open 
        // (i.e., if you open a subwindow with tools, you need to access the 
        // tools' window's opener)
        if (opener.opener != null) {   
            contentWin = opener.opener;
        }
    }

    // double check contentWin name is not null and then change location and focus
    if (!contentWin.closed) { 
        contentWin.location.href = url;
       // contentWin.focus();
    }
    else {
        newWin = window.open(url,"");
        newWin.focus();
    }
}

 
 
 // remoteWin: framename
// vars defining name of remote windows

var regWin    = null;
 
// define general parameters for all windows
var genParams = "toolbar=no;location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
var toolParams = "toolbar=no;location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";

// define 1  layout possible -- can have more vars
var popReg = ",width=585,height=500";
var popSelfHelp = ",width=900,height=600";

// this function actually opens the window
// remoteWin = the object name of the window (toolsWin)
// params 	= things in addition to genparams - specific window size, (popReg)
// winName 	= frame name , (toolsWin)
// winUrl 	= name and path of html page, ('ama_053002.cfm')

function openWin(remoteWin, params, winName, winUrl) {
if (winUrl == 'register3_popup.cfm') {
    var winParams  = toolParams + params;
}
else {
    var winParams  = genParams + params;
}

    if (!remoteWin || remoteWin.closed) {

        // Define the size of your remote window in pixels with "width" and "height." 
        remoteWin = window.open(winUrl,winName,winParams);
		
        
		// Put the full url of your remote document where you see "URL".
        remoteWin.location.href = winUrl;

        if (remoteWin.opener == null) { 
            remoteWin.opener      = window; 
            remoteWin.opener.name = remoteWin;
        }
        else {
            remoteWin.focus()
        }
    }
}
// -->