function startUpScript() {
  try {
    spawnWindow()
  }
  catch(e) { }
  finally { }
}

function spawnWindow() {
  try {
    var oNewWindow

    switch(spawnPage) {
    case 'METALSINSIDER':
      oNewWindow = window.open('http://www.metalsinsider.com/sempra/index.pdf', 'MetalsInsider')
      break
    case 'NEWS':
      // If NEWS is chosen, check the spawnPageQuerystring for a news story id
      // If such an idea exists in the string, take the user to the specific story
      // If there isn't a storyid, just take the user to the main news page
      if (spawnNewsStoryID != "")
        oNewWindow = window.open('LiveNews/iStory.asp?iNewsSourceID=2&iNewsStoryID=' + spawnNewsStoryID, 'SOLeNewsWindow')
      else
        oNewWindow = window.open('LiveNews/News.asp', 'SOLeNewsWindow')
      break
    case 'LIVE TRADING':
      oNewWindow = window.open('Trading/Main.asp', 'SOLeLiveTrading', 'menubar=no, resizable=yes')
      break
    case 'OFFLINE ORDERS':
      oNewWindow = window.open('Online/SMOL_Frames.htm', 'SOLeOfflineOrders', 'menubar=no, resizable=yes')
      break
    case 'RESTING ORDERS':
      // The window is not named here so that if an error or a time-out occurs and the user is redirected back to the
      // logon screen, it will open the reports in a new window again.
      // If the window is named, then the same window is used to open the reports as was originally used, but the code
      // after this block causes the home page to replace the reports.
      oNewWindow = window.open('RestingOrdersPassthru.asp')
      break
    case 'PRICES OVERVIEW':
      oNewWindow = window.open('Online/Prices_Frames.htm', 'SOLePricesOverview', 'menubar=no, resizable=yes')
      break
    case 'WORLDWIDE':
      oNewWindow = window.open('WorldWide.asp', 'SOLeWorldWide')
      break
    case 'CMS':
      oNewWindow = window.open('CMS/CMS_ManageDocuments.asp', 'SOLeCMS', 'menubar=no, resizable=yes')
      break
    case 'REGISTRATIONS':
      oNewWindow = window.open('Online/RegistrationScreen.asp', 'SOLeRegistration')
      break
    case 'SOLE ENQUIRY SUITE':
      // The window is not named here so that if an error or a time-out occurs and the user is redirected back to the
      // logon screen, it will open the reports in a new window again.
      // If the window is named, then the same window is used to open the reports as was originally used, but the code
      // after this block causes the home page to replace the reports.
      oNewWindow = window.open('AccountEnquiryPassthru.asp')
      break
    case 'TRADING GUIDE':
      oNewWindow = window.open('TradingGuideNewWindow.asp', 'SOLeTradingGuide', 'width=740, height=470, menubar=no, resizable=yes')
      break
    case 'PLASMA':
      location.href = 'Trading/PlasmaBlack.asp'
      break
    case 'MARKET COMMENTARY':
      // Always want to use HTTP here as the page contains embedded objects and we don't want a security warning
      oNewWindow = window.open('http://' + location.hostname + '/CommentaryPlayer.asp', 'MarketCommentary', 'width=786, height=223, menubar=no, resizable=yes')
      break
    }

    if (oNewWindow == null) {
      // Stay on this page and adjust your pop-up blocker
    }
    else {
      try {
        oNewWindow.focus()
      }
      catch(e) { }
      finally { }

      location.href = 'Home.asp'
    }
  }
  catch(e) { }
  finally { }
}