//  OPEN POPUP WINDOW
var popupList = {};
function openSub( winName, url, watch, w, h, scroll ) {

    //  Close other instances of this window.
    if ( popupList[winName] != null && typeof( popupList[winName] ) == "object" && !popupList[winName].closed ) {
        popupList[winName].close();
        popupList[winName] = null;
    }

    //  Setup the new window.
    if(popupList[winName] = window.open( url, winName, "height=" + h + ",width=" + w + ",channelmode=0,dependent=0,directories=0,fullscreen=0,location=1,menubar=1,resizable=1,scrollbars=1" + scroll + ",status=1,toolbar=1","pop" )){

        //  Open the window.
        if ( popupList[winName].opener == null ) {
            popupList[winName].opener = window;
        }
        if ( navigator.appName == 'Netscape' ) {
            popupList[winName].focus;
        }
        if(watch){
        setTimeout('watchWindow("'+winName+'")', 1000);
        }
    }
}
function watchWindow(winName){
    if(!popupList[winName].closed){
    setTimeout('watchWindow("'+winName+'")', 1000);
    }else{
    openSub('newPop','/includes/nl_form.asp', false, '520', '400');
    }
}