// Set up browser sensing code
var isNew = false;
var isIE4 = false;
var isNS4 = false;
var isOther = false;
var newWin = null;	

// Determine Browser name and version
browser = ( ( navigator.appName ) + ( parseInt( navigator.appVersion ) ) );
// Assign values to our browser flags
// NOTE: When time permits update this script to handle IE5.0 & NS6.0

if( navigator.appCodeName != "Mozilla" )
  {
	isOther = true;
  }
else if( parseInt( navigator.appVersion) >= 5 )
  {
	isNew = true;
  }
else if( browser == "Netscape4" )
  {
	isNS4 = true;
  }
else if( browser == "Microsoft Internet Explorer4" )
  {
	isIE4 = true;
  } 


// general purpose function to launch a new browser window
function launchWindow( url,name )
{
	newWin = window.open( url,name );
}

// Launches a standard application window
function launchAppWindow( url,name,width,height,top,left )
{
var features = "menubar=no,toolbar=no,location=no,resizable=yes,scrollbars=yes,height=" + height + ",width=" + width + ",top=" + top + ",left=" + left + "";
newWin = window.open( url,name,features );
// must return false to keep the onClick event from
// launching multiple windows : current window, onClick window and Href target='_blank' window.
return false;
}
	
// Launches a standard popup window
function launchPopup( url,name,width,height,top,left,scroll,modal,timeout )
{
var scrollable = "no";
if( scroll )
  {
	scrollable = "yes";
  }		

// Handle a modal window
if( modal )
  {
   if ( isIE4 || isNew )
      {
       var features = "resizable:no;scroll:" + scrollable + ";dialogHeight:" + height + "px;dialogWidth:" + width + "px;dialogTop:" + top + "px;dialogLeft:" + left + "px;";
      }  
  newWin = window.showModalDialog( url,name,features );
  // If the dialog was modal return the modal value to the caller
  return newwin;		
  }
else
  {
   var features = "menubar=no,toolbar=no,location=no,resizable=no,scrollbars=" + scrollable + ",height=" + height + ",width=" + width + ",top=" + top + ",left=" + left + "";
  newWin = window.open( url,name,features );
  }

 // Handle the optional timeout parameter
if( timeout )
  {
  if( newWin )
    {
    window.setTimeout( 'newWin.close()',timeout );
    }
  }
}


 