 if((document.location.hostname == 'man.barchart.com')  ||
    (document.location.hostname == 'www.manfutures.com')  ||
    (document.location.hostname == 'www.mfglobalbrokerage.com')  ||
    (document.location.hostname == 'www.xglobalfutures.com')  ||
    (document.location.hostname == 'www.barchart.com')) {

    var page = '';
    var sym = '';
    var code = '';
    var mode = '';

    var query_string = (new String(document.location.search)).substring(1);
    var pairs = query_string.split('&');

    for (var i = 0; i < pairs.length; i++) {
      var ary = pairs[i].split('=');
      if (ary[0] == 'page')      {  page = ary[1]; }
      else if (ary[0] == 'sym')  {  sym = ary[1];  }
      else if (ary[0] == 'code') {  code = ary[1]; }
      else if (ary[0] == 'mode') {  mode = ary[1]; }
    }

    if (page == '') {
      document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="http://man.barchart.com/pl/man/ib/_mktcom.htx?' + query_string + '"></SCR' + 'IPT>\n');
    }
    else if (page == 'quote') {
       document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="http://man.barchart.com/pl/man/ib/_quote.htx?sym=' + sym + '&code=' + code + '&mode=' + mode + '"></SCR' + 'IPT>\n');
    }
    else if (page == 'quote2') {
       document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="http://quotes-cust.barchart.com/pl/man/ib/quote.htx?sym=' + sym + '"></SCR' + 'IPT>\n');
    }
    else if (page == 'profile') {
       document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="http://man.barchart.com/pl/man/ib/_profile.htx?sym=' + sym + '&code=' + code + '&mode=' + mode + '"></SCR' + 'IPT>\n');
    }
    else if (page == 'options') {
//      document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="http://man.barchart.com/pl/man/ib/_optqte.htx?sym=' + sym + '&code=' + code + '&mode=' + mode + '"></SCR' + 'IPT>\n');
      document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="http://man.barchart.com/pl/man/ib/_optqte.htx?' + query_string + '"></SCR' + 'IPT>\n');
    }
    else if (page == 'agreement') {
      document.write('<SCR' + 'IPT LANGUAGE="JavaScript" SRC="http://man.barchart.com/pl/man/ib/_agreement.htx?sym=' + sym + '&code=' + code + '&mode=' + mode + '"></SCR' + 'IPT>\n');
    }
  }
  else {
    document.location = 'http://man.barchart.com/pl/man/ib/unauth.html';
  }
