var bc_WebSite = 'futures';

if (typeof(bc_BaseURL) == 'undefined') {
	var bc_BaseURL = '/home.asp';
	bc_WebSite = 'securities';
}

var BaseURL = 'http://sites.barchart.com/pl/man';
var query_string = (new String(document.location.search)).substring(1);
var mydomain = document.domain.split('.');
var page='';sym='';mode='';small='';temp='';
var pairs=query_string.split('&');
var screenSize=screen.width;
if(screenSize==800) { small = 1; }
else                { small = 0; }

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] == 'view')
    page = ary[1];
  else if (ary[0] == 'action')
    page = ary[1];
  else if (ary[0] == 'fake')
    temp = ary[1];
}


function doQuickX(f) {
	f.sym.value = f.sym.value.replace(' ', '');
	if (f.sym.value.length == 0) {
		alert('Please enter a symbol.');
		return false;
	}

	var what = f.what.options[f.what.selectedIndex].value;

	var u = '/support/quotes.cfm?sym=' + f.sym.value + '&page=' + what;
	document.location = u;

	return false;
}



if ((mydomain[1] == 'mansecuritiesinc') || (mydomain[1] == 'mfgsecurities') || (mydomain[1] == 'mansecurities') || (mydomain[1] == 'mfglobalsecurities') || (mydomain[1] == 'manbrokerage') || (mydomain[1] == 'manbrokers') || (mydomain[1] == 'barchart')) {
  document.write('<scr' + 'ipt language="javascript" src="');
  if (page == 'quote')          document.write('http://quotes-cust.barchart.com/pl/eman/quote.htx?' + query_string);
  else if (page == 'chart')     document.write(BaseURL + '/chart.htx?' + query_string);
  else if (page == 'profile')   document.write(BaseURL + '/profile.htx?' + query_string);
  else if (page == 'exprt')     document.write('http://quotes-cust.barchart.com/pl/eman/texpert.htx?' + query_string);
  else if (page == 'tech')      document.write('http://quotes-cust.barchart.com/pl/eman/techrept.htx?' + query_string);
  else if (page == 'cquotes')  {
		if (bc_WebSite == 'securities') {
			if (temp == 'on') {
				document.write(BaseURL + '/cquotes_equities.htx?' + query_string);
				window.open('http://sites.barchart.com/pl/man/minicb.htx');
			}
			else
				document.write(BaseURL + '/cquotes_equities.htx?' + query_string);
		}
		else {
			document.write(BaseURL + '/cquotes_futures.htx?' + query_string)
		}

  }
  else if (page == 'ccharts')   document.write(BaseURL + '/temp.htx?header=1');
  else if (page == 'cchart')    document.write('http://charts.barchart.com/emanchart.htx?' + query_string);
  else if (page == 'prhist')    document.write(BaseURL + '/prhistory.htx?' + query_string);
  else if (page == 'prdetails') document.write(BaseURL + '/prdetails.htx?' + query_string);
  else if (page == 'mgfs')      document.write(BaseURL + '/mgfs.htx?' + query_string);
  else if (page == 'first')     document.write(BaseURL + '/portfolio.htx?' + query_string);
  else if ((page == 'portfolio') || (page == 'quotescreen') || (page == 'edit') || (page == 'more') || (page == 'opinions')) {
    document.write(BaseURL + '/portfolio.htx?' + query_string);
  }
  else if (page == 'maint')     document.write(BaseURL + '/portfolio.htx?' + query_string);
  else if (page == 'indices')   document.write(BaseURL + '/indices.htx');
  else if (page == 'dow')       document.write(BaseURL + '/dow.htx');
  else if (page == 'dowcomp')   document.write(BaseURL + '/dowcomp.htx');
  else if (page == 'dowtrans')  document.write(BaseURL + '/dowtrans.htx');
  else if (page == 'dowutil')   document.write(BaseURL + '/dowutil.htx');
  else if (page == 'nasdaq100') document.write(BaseURL + '/nasdaq100.htx');
  else if (page == 'fe50')      document.write(BaseURL + '/fe50.htx');
  else if (page == 'sp100')     document.write(BaseURL + '/sp100.htx');
  else if (page == 'sp400')     document.write(BaseURL + '/sp400.htx?' + query_string);
  else if (page == 'sp500')     document.write(BaseURL + '/sp500.htx?' + query_string);
  else if (page == 'high')      document.write(BaseURL + '/high.htx?' + query_string);
  else if (page == 'low')       document.write(BaseURL + '/low.htx?' + query_string);
  else if (page == 'nysehigh')  document.write(BaseURL + '/nysehigh.htx?' + query_string);
  else if (page == 'nasdhigh')  document.write(BaseURL + '/nasdhigh.htx?' + query_string);
  else if (page == 'amexhigh')  document.write(BaseURL + '/amexhigh.htx?' + query_string);
  else if (page == 'otchigh')   document.write(BaseURL + '/otchigh.htx?' + query_string);
  else if (page == 'nyselow')   document.write(BaseURL + '/nyselow.htx?' + query_string);
  else if (page == 'nasdlow')   document.write(BaseURL + '/nasdlow.htx?' + query_string);
  else if (page == 'amexlow')   document.write(BaseURL + '/amexlow.htx?' + query_string);
  else if (page == 'otclow')    document.write(BaseURL + '/otclow.htx?' + query_string);
  else if (page == 'vleaders')  document.write(BaseURL + '/vleaders.htx');
  else if (page == 'nysevl')    document.write(BaseURL + '/nysevl.htx');
  else if (page == 'nasdvl')    document.write(BaseURL + '/nasdvl.htx');
  else if (page == 'amexvl')    document.write(BaseURL + '/amexvl.htx');
  else if (page == 'smalvl')    document.write(BaseURL + '/smalvl.htx');
  else if (page == 'largvl')    document.write(BaseURL + '/largvl.htx');
  else if (page == 'otcvl')     document.write(BaseURL + '/otcvl.htx');
  else if (page == 'padvance')  document.write(BaseURL + '/padvance.htx');
  else if (page == 'nysepa')    document.write(BaseURL + '/nysepa.htx');
  else if (page == 'nasdpa')    document.write(BaseURL + '/nasdpa.htx');
  else if (page == 'amexpa')    document.write(BaseURL + '/amexpa.htx');
  else if (page == 'ext1pa')    document.write(BaseURL + '/ext1pa.htx');
  else if (page == 'ext2pa')    document.write(BaseURL + '/ext2pa.htx');
  else if (page == 'ext3pa')    document.write(BaseURL + '/ext3pa.htx');
  else if (page == 'ext4pa')    document.write(BaseURL + '/ext4pa.htx');
  else if (page == 'ext5pa')    document.write(BaseURL + '/ext5pa.htx');
  else if (page == 'otcpa')     document.write(BaseURL + '/otcpa.htx');
  else if (page == 'pdecline')  document.write(BaseURL + '/pdecline.htx');
  else if (page == 'nysepd')    document.write(BaseURL + '/nysepd.htx');
  else if (page == 'nasdpd')    document.write(BaseURL + '/nasdpd.htx');
  else if (page == 'amexpd')    document.write(BaseURL + '/amexpd.htx');
  else if (page == 'ext1pd')    document.write(BaseURL + '/ext1pd.htx');
  else if (page == 'ext2pd')    document.write(BaseURL + '/ext2pd.htx');
  else if (page == 'ext3pd')    document.write(BaseURL + '/ext3pd.htx');
  else if (page == 'ext4pd')    document.write(BaseURL + '/ext4pd.htx');
  else if (page == 'ext5pd')    document.write(BaseURL + '/ext5pd.htx');
  else if (page == 'otcpd')     document.write(BaseURL + '/otcpd.htx');
  else if (page == 'cadvance')  document.write(BaseURL + '/cadvance.htx');
  else if (page == 'nyseca')    document.write(BaseURL + '/nyseca.htx');
  else if (page == 'nasdca')    document.write(BaseURL + '/nasdca.htx');
  else if (page == 'amexca')    document.write(BaseURL + '/amexca.htx');
  else if (page == 'ext1ca')    document.write(BaseURL + '/ext1ca.htx');
  else if (page == 'ext2ca')    document.write(BaseURL + '/ext2ca.htx');
  else if (page == 'ext3ca')    document.write(BaseURL + '/ext3ca.htx');
  else if (page == 'ext4ca')    document.write(BaseURL + '/ext4ca.htx');
  else if (page == 'ext5ca')    document.write(BaseURL + '/ext5ca.htx');
  else if (page == 'otcca')     document.write(BaseURL + '/otcca.htx');
  else if (page == 'cdecline')  document.write(BaseURL + '/cdecline.htx');
  else if (page == 'nysecd')    document.write(BaseURL + '/nysecd.htx');
  else if (page == 'nasdcd')    document.write(BaseURL + '/nasdcd.htx');
  else if (page == 'amexcd')    document.write(BaseURL + '/amexcd.htx');
  else if (page == 'ext1cd')    document.write(BaseURL + '/ext1cd.htx');
  else if (page == 'ext2cd')    document.write(BaseURL + '/ext2cd.htx');
  else if (page == 'ext3cd')    document.write(BaseURL + '/ext3cd.htx');
  else if (page == 'ext4cd')    document.write(BaseURL + '/ext4cd.htx');
  else if (page == 'ext5cd')    document.write(BaseURL + '/ext5cd.htx');
  else if (page == 'otccd')     document.write(BaseURL + '/otccd.htx');
  else if (page == 'whotupd')   document.write(BaseURL + '/whotupd.htx?' + query_string);
  else if (page == 'whotupw')   document.write(BaseURL + '/whotupw.htx?' + query_string);
  else if (page == 'whotupm')   document.write(BaseURL + '/whotupm.htx?' + query_string);
  else if (page == 'whotupdn')  document.write(BaseURL + '/whotupdn.htx?' + query_string);
  else if (page == 'whotupwn')  document.write(BaseURL + '/whotupwn.htx?' + query_string);
  else if (page == 'whotupmn')  document.write(BaseURL + '/whotupmn.htx?' + query_string);
  else if (page == 'whotupdq')  document.write(BaseURL + '/whotupdq.htx?' + query_string);
  else if (page == 'whotupwq')  document.write(BaseURL + '/whotupwq.htx?' + query_string);
  else if (page == 'whotupmq')  document.write(BaseURL + '/whotupmq.htx?' + query_string);
  else if (page == 'whotupda')  document.write(BaseURL + '/whotupda.htx?' + query_string);
  else if (page == 'whotupwa')  document.write(BaseURL + '/whotupwa.htx?' + query_string);
  else if (page == 'whotupma')  document.write(BaseURL + '/whotupma.htx?' + query_string);
  else if (page == 'whotupdo')  document.write(BaseURL + '/whotupdo.htx?' + query_string);
  else if (page == 'whotupwo')  document.write(BaseURL + '/whotupwo.htx?' + query_string);
  else if (page == 'whotupmo')  document.write(BaseURL + '/whotupmo.htx?' + query_string);
  else if (page == 'whotdnd')   document.write(BaseURL + '/whotdnd.htx?' + query_string);
  else if (page == 'whotdnw')   document.write(BaseURL + '/whotdnw.htx?' + query_string);
  else if (page == 'whotdnm')   document.write(BaseURL + '/whotdnm.htx?' + query_string);
  else if (page == 'whotdndn')  document.write(BaseURL + '/whotdndn.htx?' + query_string);
  else if (page == 'whotdnwn')  document.write(BaseURL + '/whotdnwn.htx?' + query_string);
  else if (page == 'whotdnmn')  document.write(BaseURL + '/whotdnmn.htx?' + query_string);
  else if (page == 'whotdndq')  document.write(BaseURL + '/whotdndq.htx?' + query_string);
  else if (page == 'whotdnwq')  document.write(BaseURL + '/whotdnwq.htx?' + query_string);
  else if (page == 'whotdnmq')  document.write(BaseURL + '/whotdnmq.htx?' + query_string);
  else if (page == 'whotdnda')  document.write(BaseURL + '/whotdnda.htx?' + query_string);
  else if (page == 'whotdnwa')  document.write(BaseURL + '/whotdnwa.htx?' + query_string);
  else if (page == 'whotdnma')  document.write(BaseURL + '/whotdnma.htx?' + query_string);
  else if (page == 'whotdndo')  document.write(BaseURL + '/whotdndo.htx?' + query_string);
  else if (page == 'whotdnwo')  document.write(BaseURL + '/whotdnwo.htx?' + query_string);
  else if (page == 'whotdnmo')  document.write(BaseURL + '/whotdnmo.htx?' + query_string);
  else if (page == 'fundhigh')  document.write(BaseURL + '/fundhigh.htx?' + query_string);
  else if (page == 'fundlow')   document.write(BaseURL + '/fundlow.htx?' + query_string);
  else if (page == 'funds')     document.write(BaseURL + '/funds.htx?' + query_string);
  else if (page == 'fundc')     document.write(BaseURL + '/fundc.htx?' + query_string);
  else if (page == 'fundp')     document.write(BaseURL + '/fundp.htx?' + query_string);
  else if (page == 'fundv')     document.write(BaseURL + '/fundv.htx?' + query_string);
  else if (page == 'fundw')     document.write(BaseURL + '/fundw.htx?' + query_string);
  else if (page == 'fundx')     document.write(BaseURL + '/fundx.htx?' + query_string);
  else if (page == 'fundy')     document.write(BaseURL + '/fundy.htx?' + query_string);
  else if (page == 'fundz')     document.write(BaseURL + '/fundz.htx?' + query_string);
  else if (page == 'whotupdx')  document.write(BaseURL + '/whotupdx.htx?' + query_string);
  else if (page == 'whotupwx')  document.write(BaseURL + '/whotupwx.htx?' + query_string);
  else if (page == 'whotupmx')  document.write(BaseURL + '/whotupmx.htx?' + query_string);
  else if (page == 'whotdndx')  document.write(BaseURL + '/whotdndx.htx?' + query_string);
  else if (page == 'whotdnwx')  document.write(BaseURL + '/whotdnwx.htx?' + query_string);
  else if (page == 'whotdnmx')  document.write(BaseURL + '/whotdnmx.htx?' + query_string);
  else if (page == 'sectors')   document.write(BaseURL + '/sectors.htx?' + query_string);
  else if (page == 'support')   document.write(BaseURL + '/support/default.htx');
  else if (page == 'screen')    document.write(BaseURL + '/support/support.htx?what=screen');
  else if (page == 'learning')  document.write(BaseURL + '/support/learning.htx?' + query_string);
  else if (page == 'faq')       document.write(BaseURL + '/support/faq.htx');
  else if (page == 'custom')    document.write(BaseURL + '/support/custom.htx');
  else if (page == 'sectorss')  document.write(BaseURL + '/support/sectors.htx');
  else if (page == 'fundss')    document.write(BaseURL + '/support/funds.htx');
  else if (page == 'markets')   document.write(BaseURL + '/support/markets.htx');
  else if (page == 'agreement') document.write(BaseURL + '/agreement.htx');
  else if (page == 'lookup')    document.write(BaseURL + '/lookup.htx?' + query_string);
  else if (page == 'momentum')  document.write(BaseURL + '/momentum.htx?' + query_string);
	else {
		if (bc_WebSite == 'securities')
			document.write(BaseURL + '/default_equities.htx?' + query_string);
		else
			document.write(BaseURL + '/default_futures.htx?' + query_string);
	}

	document.write('"></scr' + 'ipt>\n');
}
else if((mydomain[1] == 'manfutures') || (mydomain[1] == 'bandrstaging') || (mydomain[1] == 'mfglobalfutures') || (mydomain[1] == 'mfglobalmarketmonitor') || (mydomain[1] == 'mfglobalprofutures') || (mydomain[1] == 'mfglobal') || (mydomain[1] == 'directfills') || (mydomain[1] == 'advantagetraders') || (mydomain[1] == 'foxinvestments') || (mydomain[1] == 'oio') || (mydomain[1] == 'manfinancial') || (mydomain[1] == '5perside') || (mydomain[1] == 'barchart')) {
	var nodisc = false;

	document.write('<scr' + 'ipt language="javascript" type="text/javascript" src="');

	if (page == 'quote') {
		document.write('http://man.barchart.com/pl/man/quote.htx?' + query_string);
	}
	else if (page == 'quote2') {
		document.write('http://quotes-cust.barchart.com/pl/man/quote.htx?' + query_string);
	}
	else if (page == 'myquote') {
		document.write('http://man.barchart.com/pl/man/myquote.htx?' + query_string);
	}
	else if (page == 'chart') {
		document.write('http://customer1.barchart.com/cgi-bin/mri/manchart.htx?data=a&' + query_string);
		nodisc = true;
	}
	else if (page == 'chart2') {
		document.write('http://man.barchart.com/pl/man/chart.asp?' + query_string);
	}
	else if (page == 'cspread') {
		document.write('http://customer1.barchart.com/cgi-bin/mri/manspread.htx?' + query_string);
	}
	else if (page == 'optqte') {
		document.write('http://man.barchart.com/pl/man/optqte.htx?' + query_string);
	}
	else if (page == 'mktday') {
		document.write('http://man.barchart.com/pl/man/mktday.htx?' + query_string);
	}
	else if (page == 'mktnight') {
		document.write('http://man.barchart.com/pl/man/mktnight.htx?' + query_string);
	}
	else if (page == 'profile') {
		document.write('http://man.barchart.com/pl/man/profile.htx?sym=' + sym);
	}
	else if (page == 'ccharts') {
		document.write('http://man.barchart.com/pl/man/ccharts.htx?' + query_string);
	}
	else if (page == 'cquotes') {
		document.write('http://man.barchart.com/pl/man/cquotes_futures.htx?' + query_string);
	}
	else if (page == 'cquotes2') {
		document.write('http://man.barchart.com/pl/man/cquotes2.htx?' + query_string);
	}
	else if (page == 'techrept') {
		document.write('http://quotes-cust.barchart.com/pl/man/techrept.htx?' + query_string);
	}
	else if (page == 'lookup') {
		document.write('http://man.barchart.com/pl/man/lookup.htx?' + query_string);
	}
	else if (page == 'ascii') {
		document.write('http://man.barchart.com/pl/man/calendar.htx?view=ascii');
	}
	else if (page == 'endd') {
		document.write('http://man.barchart.com/pl/man/calendar.htx');
	}
	else if (page == 'agreement') {
		document.write('http://content.barchart.com/shared/agreement.php');
	}
	else if (page == 'ddfplus') {
		document.write('http://man.barchart.com/pl/man/ddfplus.htx?' + query_string);
	}
	else if (page == 'kbroj') {
		document.write('http://man.barchart.com/pl/man/data.htx?' + query_string);
	}
  else if (page == 'update'){
    document.write('http://man.barchart.com/pl/man/cquotes.htx?' + query_string);
  }
  else if (page == 'first') {
    document.write('http://man.barchart.com/pl/man/portfolio.asp?' + query_string);
  }
  else if ((page == 'quotescreen') || (page == 'portfolio') || (page == 'edit') || (page == 'more') || (page == 'opinions')) {
    document.write('http://man.barchart.com/pl/man/portfolio.asp?' + query_string);
  }
  else if (page == 'maint') {
    document.write('http://man.barchart.com/pl/man/portfolio.asp?' + query_string);
  }
  else if (page == 'portfolio') {
    document.write('http://man.barchart.com/pl/man/portfolio.asp');
  }
  else if (page == 'realtime') {
    document.write('http://realtime.barchart.com/cobrand/include.htx?code=man&width=400&height=500');
  }
  else if (page == '???rtqb') {
    document.write('http://man.barchart.com/pl/man/rt/quoteboard.htx');
  }
  else if (page == '???rtmd') {
    document.write('http://man.barchart.com/pl/man/rt/book.htx?sym=' + sym);
  }
	else {
		document.write('http://man.barchart.com/pl/man/default_futures.htx?' + query_string);
	}
	document.write('"></scr' + 'ipt>\n');


	if (!nodisc) {
		document.write('<script type="text/javascript" language="javascript" src="http://content.barchart.com/shared/disclaimer.php"></script>');
	}
}
else {
	document.write("<CENTER><p>&nbsp;<p>YOU ARE NOT AUTHORIZED TO VIEW INFORMATION PROVIDED BY <a href=\"http://www.barchart.com\">Barchart.com</a></CENTER>\n");
}
