/**************************************************************************************
*
*   Just a little popup javascript that opens the 
*   window in the center of the page. This allows
*   for easily resizing the window that is used too.
*
*****************************************************/

var winPop = null;
function popup(file, w, h) {

        var winw = (screen.width - w) / 2;
        var wint = ((screen.height - h) / 2) - 28 ;

        if (!winPop || winPop.closed ) {
            winPop = window.open(file,"","width=" + w + ",height=" + h + ",top=" + wint + ",left=" + winw +",toolbar=no,directories=no,menubar=no,status=no,resizable=no,scrollbars=yes")
        }
        else {
            winPop.close()
            winPop = window.open(file,"","width=" + w + ",height=" + h + ",top=" + wint + ",left=" + winw +",toolbar=no,directories=no,menubar=no,status=no,resizable=no,scrollbars=yes")
        }
    }

/****************************************************
*
*   Usage of the popup
*   <a href="javascript:popup('url',height,width)">link</a>
*
***************************************************************************************/

/**************************************************************************************
*
*  This popup opens a new window that you pick the 
*  size, and the upper left corner of when you call
*  the funtion.
*
*****************************************************/

var winpop = null;
function popalt(file, w, h, left, top) {
        
        var wint = top;
        var winw = left;
        
        if (!winPop || winPop.closed ) {
            winPop = window.open(file,"","width=" + w + ",height=" + h + ",top=" + wint + ",left=" + winw +",toolbar=no,directories=no,menubar=no,status=no,resizable=no,scrollbars=no")
        }
        else {
            winPop.close()
            winPop = window.open(file,"","width=" + w + ",height=" + h + ",top=" + wint + ",left=" + winw +",toolbar=no,directories=no,menubar=no,status=no,resizable=no,scrollbars=no")
        }
    }
    
/****************************************************
*
*   Usage of the popup
*   <a href="javascript:pop('url',height,width,top,left)">link</a>
*
***************************************************************************************/