var base="http://www.tmx.com"


function getGlobalNav(){
document.write('<ul id="globalNavigation">'+'\n'+
' <li><a href="'+base+'/en/index.html">Home</a> |</li>'+'\n'+
'<li><a href="'+base+'/en/about_tsx/contact_us.html">Contact Us</a> |</li>'+'\n'+
'<li><a href="'+base+'/en/about_tsx/part_members/index.html">Participating Organization Directory</a> |</li>'+'\n'+
'<li><a href="'+base+'/HttpController?GetPage=ListedCompaniesViewPage&Language=en&Market=T">Listed Company Directory</a> |</li>'+'\n'+
'<li><a href="'+base+'/en/sitemap.html">Site Map</a> |</li>'+'\n'+
'<li>');

// Language Toggle
// Home page is special case.
var switchURL;


if( document.location.pathname == "/index.html" )
{
	switchURL = "/fr/index.html";
}
else
{
	switchURL = new String( document.URL );

	if( switchURL.match( /\/en\// ))
	{
		// Switch and replace for static pages
		switchURL = switchURL.replace("/en/", "/fr/");
	}
	else if( switchURL.match( /\/query.html\?/ ))
	{
        	switchURL = switchURL.replace( "style=TsxEnglish", "style=TsxFrench" );
        	switchURL = switchURL.replace( "la=en", "la=fr" );
        	switchURL = switchURL.replace( "col=tsxen", "col=tsxfr" );
	}
	else if( switchURL.match( /\/HttpController\?/ ))
	{
		if( switchURL.match( "Language=en" ))
		{
			// Search and replace for the language in the get URL to switch for dynamic pages
			switchURL = switchURL.replace("Language=en", "Language=fr");
		}
		else
		{
			switchURL += "&Language=fr";
		}

                // Search and replace for the SaveView in the get URL to fix Remedy ticket # 141265
		if( switchURL.match( "SaveView=true" ))
		{
			switchURL = switchURL.replace("SaveView=true", "SaveView=false");
		}

		// Search and replace special language-specific file names
		// Go from EN to FR.
		if( switchURL.match( "GetPage=EventBookingFormOk" ))
		{
			switchURL = switchURL.replace("EventBookingFormOk", "EventBookingFormOkFR");
		}
		else if( switchURL.match( "GetPage=EventBookingForm" ))
		{
			switchURL = switchURL.replace("EventBookingForm", "EventBookingFormFR");
		}
		else if( switchURL.match( "GetPage=questions" ))
		{
			switchURL = switchURL.replace("questions", "questionsFR");
		}
		else if( switchURL.match( "GetPage=TSXVentureLogoFormOk" ))
		{
			switchURL = switchURL.replace("TSXVentureLogoFormOk", "TSXVentureLogoFormOkFR");
		}
		else if( switchURL.match( "GetPage=TSXVentureLogoForm" ))
		{
			switchURL = switchURL.replace("TSXVentureLogoForm", "TSXVentureLogoFormFR");
		}
		else if( switchURL.match( "GetPage=TradingCanadianForm" ))
		{
			switchURL = switchURL.replace("TradingCanadianForm", "TradingCanadianFormFR");
		}
		else if( switchURL.match( "GetPage=TradingCanadianForm" ))
		{
			switchURL = switchURL.replace("TradingCanadianForm", "TradingCanadianFormFR");
		}
	}
	else
	{
		switchURL = "/fr/index.html";
	}
}


document.write('<a href="' + switchURL + '" >');

document.write('<span lang="fr-ca">Fran&ccedil;ais</span></a></li>'+'\n'+

' </ul>'+'\n\n'+
'<div id="login"><a href="'+base+'/en/login.html">LOGIN</a></div>');
}

function getMainNav(){
document.write('<ul>\n'+
			'<li id="navMarket"><a href="http://www.tmxmoney.com/en/index.html">TSX MARKET ACTIVITY</a>\n'+
				'<ul>\n'+
					'<li><a href="http://cxa.marketwatch.com/TSX/en/Market/marketactivitycan.aspx">TSX Market Activity</a></li>\n'+
					'<li><a href="http://cxa.marketwatch.com/tsx/en/market/marketactivityus.aspx">US Market Activity</a></li>\n'+
					'<li><a href="http://cxa.marketwatch.com/tsx/en/market/getquote.aspx">Quotes &amp; Charts</a></li>\n'+
					'<li><a href="http://www.tmxmoney.com/en/news/index.html">News</a></li>\n'+
					'<li><a href="http://www.tmxmoney.com/en/research/index.html">Research &amp; Tools</a></li>\n'+
					'<li><a href="http://www.tmxmoney.com/en/sector_profiles/index.html">Sectors &amp; ETFs</a></li>\n'+
					'<li><a href="http://www.tmxmoney.com/en/features/zoomer/index.html">Zoomer Life</a></li>\n'+
					'<li class="information" style="background-color:#fff;">These links will take you to TMXmoney.com, TMX Group\'s North American financial markets website.<br /><a style="margin-left:18px;" href="http://www.tmxmoney.com/en/index.html"><img src="/en/images/logos/TMXmoney-100px.gif"></a></li>\n'+
				'</ul>\n'+
			'</li>\n'+
			'<li id="navListings"><a href="'+base+'/en/listings/index.html">LISTINGS</a>\n'+
				'<ul>\n'+
					'<li><a href="'+base+'/en/listings/listing_with_us/index.html">Listing With Us</a></li>\n'+
					'<li><a href="http://www.tmxmoney.com/en/sector_profiles/index.html">Sectors &amp; ETFs</a></li>\n'+
					'<li><a href="'+base+'/en/listings/products_services/index.html">Products &amp; Services</a></li>\n'+
					'<li><a href="'+base+'/en/listings/tsx_issuer_resources/index.html">TSX Issuer Resources</a></li>\n'+
					'<li><a href="'+base+'/en/listings/venture_issuer_resources/index.html">TSX Venture Issuer Resources</a></li>\n'+
					'<li><a href="'+base+'/en/listings/learning/index.html">TMX Learning Academy</a></li>\n'+
					'<li><a href="'+base+'/en/listings/contact.html">Contact Us</a></li>\n'+
					'<li class="information">Information for companies listed on Toronto Stock Exchange and TSX Venture Exchange, as well as for companies considering going public and listing on our exchanges.</li>\n'+
				'</ul>\n'+
			'</li>\n'+
			'<li id="navTrading"><a href="'+base+'/en/trading/index.html">TRADING</a>\n'+
				'<ul>\n'+
					'<li><a href="'+base+'/en/trading/tsxquantum/index.html">TSX Quantum</a></li>\n'+
					'<li><a href="'+base+'/en/trading/tsxinfinity/index.html">TSX Infinity</a></li>\n'+
					'<li><a href="'+base+'/en/trading/order_routing/index.html">TMX Smart Order Routing</a></li>'+
					'<li><a href="'+base+'/en/trading/products_services/index.html">Products &amp; Services</a></li>\n'+
					'<li><a href="'+base+'/en/trading/order_types/">Order Types</a></li>\n'+
					'<li><a href="'+base+'/en/trading/fee_schedule/">Fee Schedule</a></li>\n'+
					'<li><a href="'+base+'/en/trading/rules_regulations/index.html">Trading Rules &amp; Regulations</a></li>\n'+
					'<li><a href="'+base+'/en/trading/participating/index.html">Notices to Participating Organizations</a></li>\n'+
					'<li><a href="'+base+'/en/trading/becoming_a_po/index.html">Becoming a Participating Organization</a></li>\n'+
					'<li><a href="'+base+'/en/trading/contact_us/index.html">Contact Us</a></li>\n'+
					'<li class="information">Information for market professionals on the Canadian capital markets, trading products, trading rules and regulations, and customer service.</li>\n'+
				'</ul>\n'+
			'</li>\n'+
			'<li id="navData"><a href="'+base+'/en/data/">DATA</a>\n'+
				'<ul>\n'+
					'<li><a href="'+base+'/en/data/products_services/index.html">Products &amp; Services</a></li>\n'+
					'<li><a href="'+base+'/en/data/how_to_access_data/index.html">How to Access Data</a></li>\n'+
					'<li><a href="'+base+'/en/data/product_sheets/index.html">Product Sheets &amp; Pricing</a></li>\n'+
					'<li><a href="'+base+'/en/data/contact_us.html">Contact Us</a></li>\n'+
					'<li class="information">Information on our complete range of real-time and historical data products and services to meet the varied needs of the global financial marketplace.</li>\n'+
				'</ul>\n'+
			'</li>\n'+
			'<li id="navAbout"><a href="'+base+'/en/about_tsx/">ABOUT TMX GROUP</a>\n'+
				'<ul>\n'+
					//'<li><a href="'+base+'/en/about_tsx/corporate_information/index.html">Corporate Information</a></li>\n'+
					'<li><a href="'+base+'/HttpController?GetPage=ListedCompaniesViewPage&Language=en&Market=T">Listed Company Directory</a></li>\n'+
					'<li><a href="'+base+'/en/about_tsx/part_members/index.html">Participating Organizations and Members</a></li>\n'+
					//'<li><a href="'+base+'/en/about_tsx/newsletters.html">TSXtra Newsletter</a></li>\n'+
					'<li><a href="'+base+'/en/about_tsx/market_hours.html">Market Hours &amp; Holidays</a></li>\n'+
					'<li><a href="'+base+'/en/about_tsx/careers/index.html">Careers</a></li>\n'+
					'<li><a href="'+base+'/en/about_tsx/contact_us.html">Contact Us</a></li>\n'+
					'<li class="information">Information on TMX Group, its history, management, career opportunities, and more.</li>\n'+
				'</ul>\n'+
			'</li>\n'+
			'<li id="navNews"><a href="'+base+'/en/news_events/">NEWS &amp; EVENTS</a>\n'+
				'<ul>\n'+
					'<li><a href="'+base+'/en/news_events/current_news/">Current News</a></li>\n'+
					'<li><a href="'+base+'/en/news_events/news_archives/">News Archives</a></li>\n'+
					'<li><a href="'+base+'/en/news_events/events/index.html">Events</a></li>\n'+
					'<li><a href="'+base+'/en/news_events/speeches/">Speeches</a></li>\n'+
					'<li><a href="'+base+'/en/news_events/media_kit/">Media Kit</a></li>\n'+
					'<li><a href="'+base+'/en/news_events/broadcast_centre/">TMX Broadcast Centre</a></li>\n'+
					'<li><a href="'+base+'/en/news_events/contact_us.html">Contact Us</a></li>\n'+
					'<li class="information">TSX Group news releases, media kits, speeches, and upcoming events of interest. Also provides information on the TMX Broadcast Centre, bringing media and business together at the heart of the Canadian capital markets.</li>\n'+
				'</ul>\n'+
			'</li>\n'+
			'<li id="navInvestor"><a href="'+base+'/en/investor_relations/index.html">INVESTOR RELATIONS</a>\n'+
			'<ul>\n'+
				'<li><a href="'+base+'/en/investor_relations/corporate_info/index.html">Corporate Information</a></li>\n'+
				'<li><a href="'+base+'/en/investor_relations/financials/index.html">Financials</a></li>\n'+
				'<li><a href="'+base+'/HttpController?GetPage=ShareInfoPage&amp;Language=en&amp;SelectedSymbol=X&Market=T">Share Information</a></li>\n'+
				'<li><a href="'+base+'/en/investor_relations/faq/index.html">Frequently Asked Questions</a></li>\n'+
				'<li><a href="'+base+'/en/investor_relations/disclaimer.html">Forward-Looking Information</a></li>\n'+
				'<li><a href="'+base+'/HttpController?GetPage=IRForm&amp;Language=en">Contact Us</a></li>\n'+
				'<li class="information">Corporate and financial information for TSX Group shareholders and those considering investing in X.</li>\n'+
			'</ul>\n'+
			'</li>\n'+
		'</ul>');
}

function getQuote(){
	//http://cxa.marketwatch.com/tsx/en/market/quote.aspx?symbol=x
document.write('<form name="quickQuote" id="quickQuote" action="" onSubmit="return false;" method="get">\n'+
			'<div id="getQuote">\n'+
				'<h2>GET QUOTE</h2>\n'+
				'<fieldset>\n'+
					'<legend>Get Quote</legend>\n'+
					'<input onfocus="clearDefault()" onblur="targetfield=\'QuoteSymbol_1\'" maxLength="15" value="Enter Symbol" name="QuoteSymbol_1" id="QuoteSymbol_1"/>&#160;<input type="image" id="quickQuoteSubmit" src="/en/images/quote_go.gif" alt="Get a Stock Quote" value="GO" onClick="javascript:prepare_submit();" />\n'+
				'</fieldset>\n'+
				'<p><a class="data" href="javascript:openWindow(\'/HttpController?GetPage=SearchEquitiesQuickViewPage\',620,600);">Symbol Lookup</a></p>\n'+
			'</div>\n'+
			'</form>');
}

function prepare_submit() {

	var symbols = document.quickQuote.QuoteSymbol_1.value;
	if (symbols.indexOf(",") != -1) {
		symbols = symbols.substr(0,symbols.indexOf(","));
	}
	var newURL = "http://cxa.marketwatch.com/tsx/en/market/quote.aspx?symbol=" + symbols;
	window.location.href = newURL;
}

function commacheck() {
	var symbols = document.quickQuote.symbol.value;
	if (symbols.indexOf(",") != -1) {
		symbols = symbols.substr(0,symbols.indexOf(","));
	}
	document.quickQuote.symbol.value = symbols;
}

function getPortals(){
document.write('<div id="subNavigation" class="portalLinks">' +
				'<div id="subNavigationTop">' +
					'<h2>I AM:</h2>' +

					'<ul>' +
						'<li id="individual"><a href="http://www.tmxmoney.com/en/individual.html">An Individual Investor</a></li>' +
						'<li id="marketPro"><a href="'+base+'/en/market_pro.html">A Market Professional</a></li>' +
						'<li id="listedPro"><a href="'+base+'/en/listed.html">A Listed Company</a></li>' +
						'<li id="interested"><a href="'+base+'/en/listings/listing_with_us/index.html">Interested in Listing</a></li>' +
					'</ul>' +
				'</div>' +
			'</div>'+
			'<div>' +
			'<a href="'+base+'/en/trading/order_routing/index.html" alt="TSX Smart Order Routing"/><img style="display:block" src="/en/images/smart_order_logo.gif"/></a>' +
			'</div>' +
			'<div id="annRepWrapper">' +
				'<div id="annRep">' +
				'<a href="http://tsx.ar.wilink.com/asp/A565_search_ENG.asp" alt="Free Annual Reports" onmouseover="show(\'freeAnnRepOver\');hide(\'freeAnnRep\');" onmouseout="show(\'freeAnnRep\');hide(\'freeAnnRepOver\');" target="_blank"><img style="display:block" src="'+base+'/en/images/wilink_annrep.gif" id="freeAnnRep"/><img style="display:none;" src="'+base+'/en/images/wilink_annrep_over.gif" id="freeAnnRepOver"/></a>' +
				'</div>'+
			'</div>');
}

function getSearch(){
document.write('<form name="searchForm" id="searchForm" action="http://search.tsx.com/query.html" method="get">\n'+
			'<div id="searchTSX">\n'+
				'<h2>SEARCH TMX.COM:</h2>\n'+
				'<input type="hidden" value="TsxEnglish" name="style"/>\n'+
				'<input type="hidden" value="en" name="la"/>\n'+
				'<input type="hidden" value="tsxen" name="col"/>\n'+
				'<fieldset>\n'+
					'<legend>Search TSX</legend>\n'+
					'<input type="text" id="qt" name="qt"/>&#160;<input src="'+base+'/en/images/search_go.gif" name="searchSubmit" id="searchSubmit" type="image" value="GO"/>\n'+
				'</fieldset>\n'+
				'<p><a href="http://search.tsx.com/query.html?ql=a&qt=&charset=iso-8859-1&la=en&style=TsxEnglish&col=tsxen">Advanced Search</a></p>\n'+
			'</div>\n'+
			'</form>')
}

function getSignOnTo(){
document.write('<form id="signOnForm">\n'+
'<div class="sidebar1BoxWrapper">\n'+
'<div id="signOnTo">\n'+
	'<h2>LOGIN TO:</h2>\n'+
	'<label for="stockList">Choose a site:</label>\n'+
	'<select id="signOnSelect" name="signOnSelect">\n'+
		'<option value="http://custom.marketwatch.com/custom/tsx/en/portfolio/login.asp">My Portfolio</option>\n'+
		'<option value="https://secure.tsx.com/IRWeb/IRWebHttpController?SaveView=true&GetPage=LoginPage">TSXconnect</option>\n'+
		'<option value="http://tradingdata.tsx.com/">Historical Data Access (HDA)</option>\n'+
		'<option value="https://secure.tsx.com/">TSX SecureFile</option>\n'+
		'<option value="http://www.tsxdatalinx.com/">TSXdatalinx.com</option>\n'+
	'</select>\n'+
	'<a href="javascript: signOnGo();"><img src="'+base+'/en/images/search_go.gif" alt="GO"></a>\n'+
'</div>\n'+
'<img src="/en/images/loginBoxHidden.gif" id="hiddenBox" style="display:none;">\n'+
'</div>\n'+
'</form>');
}

function getAnnualReport(){
document.write('<div class="sidebar1AdWrapper">\n'+
				'<div id="annualReport">\n'+
					'<h2>TSX GROUP ANNUAL REPORT 2006</h2>\n'+
					'<a href="http://www.tsx-group.ca/AnnualReport06/EN/index.html" target="new" alt=" ">DOWNLOAD</a>\n'+
				'</div>\n'+
			'</div>');
}

function getFooter(){
document.write('<div id="footer">\n'+
		'<ul>\n'+
			'<li><a href="'+base+'/en/about_tsx/contact_us.html">Contact Us</a> |</li>\n'+
			'<li><a href="'+base+'/en/sitemap.html">Site Map</a> |</li>\n'+
			'<li><a href="'+base+'/en/about_tsx/careers/">Careers</a> |</li>\n'+
			'<li><a href="'+base+'/en/advertise/index.html">Advertise</a> |</li>\n'+
			'<li><a href="'+base+'/en/tos.html">Terms of Use</a> |</li>\n'+
			'<li><a href="'+base+'/en/priv_policy.html">Privacy Policy</a></li>\n'+
		'</ul>\n'+
	'</div>');
}

function getDisclaimer(){
document.write('<p id="disclaimer">&copy; TMX Group Inc. <br />For full optimization and view of this web site, users are recommended to set their screen display at 1024x768 pixels.<br />TMX Group Inc. and its affiliates do not endorse or recommend any securities issued by any companies identified on, or linked through, this site. Please seek professional advice to evaluate specific securities or other content on this site. Links to third party sites are for informational purposes only and not for trading purposes. TMX Group Inc. and its affiliates have not prepared, reviewed or updated any content on third party sites and assume no responsibility for the information posted on them.</p>');

document.write("<img id='img1' height='1' width='1'>");document.getElementById("img1").src="http://beacon.securestudies.com/scripts/beacon.dll?C1=2&C2=3005671&C3=3005671&C4=www.tmx.com &C5=&C6=&C7=" + escape(window.location.href) + "&C8=" + escape(document.title) + "&C9=" + escape(document.referrer) + "&rn=" + Math.floor(Math.random()*99999999);

}

