/**
 * FILE: global_functions.js
 * DESCRIPTION: This file contains global javascript functions for Amateo
 *              Web site.
 * CREATED: 20/09/2001
**/

/**
 * Opens a new window
**/

var curPopupWindow = null;

function openWindow(url, winName, width, height, center) 
{

   var xposition = 90; // Postions the window vertically in px
   var yposition = 90; // Postions the window horizontally in px


   if ((parseInt(navigator.appVersion) >= 4 ) && (center))
   {
       xposition = (screen.width - 800) / 2;
       yposition = (screen.height - 600) / 2;
   }

   // Features to specify for a new window
   args = "width=" + width + ","
   + "height=" + height + ","
   + "location=0,"
   + "menubar=0,"
   + "resizable=1,"
   + "scrollbars=1,"
   + "status=0,"
   + "titlebar=0,"
   + "toolbar=0,"
   + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition;           //IE Only

   // Performs the opening of the window.
   if (curPopupWindow != null) 
   {

   		if (!curPopupWindow.closed) 
        {
            curPopupWindow.close();
        }
        curPopupWindow = null;
    }
    curPopupWindow = window.open(url, winName, args, false);
    curPopupWindow.focus();

}

/**
 * Close tour window and bring up signup screen(s)
**/

function switchWindows(url) 
{
   top.opener.location.href=url;
   top.close();
}

function switchWindowsNoClose(url) 
{
   top.opener.location.href = url;
}

