//
// Version 1.0
//

// Global variable for handle to popup window.
var popUpWin = null;

//------------------------------------------------------------------------------
//
// Function to open a popup window, given the page. The size and other
// attributes for the spawned window are set in the function
//
// args: thePage - url of page to be opened in popup window
//
// rtns: none
//
//------------------------------------------------------------------------------
function openPopup(thePage)
{
   if( popUpWin == null || popUpWin.closed )
   {
      var winOptions = "resizable=yes,toolbar=no,scrollbars=yes,statusbar=no,menubar=no,width=400,height=450";
      popUpWin = window.open(thePage,"thePopUp",winOptions);
   }

   if( popUpWin.open )
   {
      popUpWin.location.href=thePage;
      popUpWin.focus();
   }
}

//------------------------------------------------------------------------------
//
// Function to close a popup window.
//
// args: none
//
// rtns: none
//
//------------------------------------------------------------------------------
function closePopup()
{
   if( popUpWin != null && !popUpWin.closed )
   {
      popUpWin.close();
   }
}

//------------------------------------------------------------------------------
//
// Function to close a popup window.
//
// args: none
//
// rtns: none
//
//------------------------------------------------------------------------------
function doSubmit()
{
   var currAction = document.forms['autoform_0'].action;
   var assessor = document.forms['autoform_0'].ASSESSOR_ID.options[document.forms['autoform_0'].ASSESSOR_ID.selectedIndex].value;
   var newAction = "/"+assessor+(assessor==""?"":"/")+currAction.substr((currAction.lastIndexOf("/")+1));
   document.forms['autoform_0'].action = newAction;

   document.forms['autoform_0'].submit();
}
