//-------------------------------------------------------------------------
// Script.js
//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
// Function: openNewWindow
//
// Pops up a new browser window containing the definitions page, and scrolls
//     to the correct spot
//-------------------------------------------------------------------------

function openNewWindow(inURL, features, windowSize) {

    // Add check for browser capability
    var old_browser = true;
    if (window.screen != null) old_browser = false;

    if (features == "") {
        features = "toolbar=yes,directories=yes,location=1,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
    }
    
    var name = new Date();
    name = "X" + name.getTime(); 

    var index = 0;
    
    index = name.indexOf('-');

    if(index != -1)
    {
        name = name.substring(0, index + 1) + name.substring(index + 1, name.length);
    }
 
    var height=350;
    var width=500;
    var screenHeight = 480;
    var screenWidth = 640;

   if(windowSize == 'small')
   {
       height = 200;
       width = 250;
   }


    if (window.screen != null)
    {
        screenHeight = window.screen.height;
        screenWidth = window.screen.width;
    }

    if (screenWidth > 640)
    {
        width = width + Math.floor((screenWidth - 640)*.70);
    }

    if(screenHeight > 480)
    {
        height = height + Math.floor((screenHeight - 480)*.70);
    }

    features += ",width=" + width + ",height=" + height;

    var docView = window.open (inURL, name, features);


}

