var base="http://www.tsx.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 id="nav" onMouseOver="hide(\'signOnTo\'); show(\'hiddenBox\');" onMouseOut="javascript:show(\'signOnTo\'); hide(\'hiddenBox\');">\n'+
			'<li id="navMarket"><a href="'+base+'/HttpController?GetPage=MDFMarketView&amp;MarketView=MostActive&amp;DetailedView=DetailedPrices&amp;Market=T&amp;Language=en">MARKET ACTIVITY</a>\n'+
				'<ul>\n'+
					'<li><a href="'+base+'/HttpController?GetPage=MDFMarketView&amp;MarketView=MostActive&amp;DetailedView=DetailedPrices&amp;Market=T&amp;Language=en">Current Market</a></li>\n'+
					'<li><a href="'+base+'/HttpController?GetPage=EODMarketView&amp;DetailedView=DetailedPrices&amp;Market=T&amp;MarketView=MostActive&amp;Language=en">Closing Summary</a></li>\n'+
					'<li><a href="'+base+'/HttpController?GetPage=QuotesLookupPage&amp;Language=en">Quotes &amp; Company Information</a></li>\n'+
					'<li><a href="'+base+'/en/market_activity/news_releases.html">News &amp; Updates</a></li>\n'+
					'<li><a href="'+base+'/HttpController?GetPage=MDFIndicesView&SelectedIndex=0000&IndexID=0000&Exchange=T&SelectedTab=QuoteResults&Language=en">Indices &amp; Constituents</a></li>\n'+
					'<li><a href="'+base+'/HttpController?GetPage=StocklistViewPage&amp;Language=en">My Stock List</a></li>\n'+
					'<li><a href="'+base+'/en/market_activity/block_summaries.html">Professional Market Indicators</a></li>\n'+
					'<li><a href="'+base+'/en/listings/sector_profiles/">Sector Profiles</a></li>\n'+
					'<li><a href="'+base+'/en/market_activity/new_listings_tsx_current.html">New Company Listings</a></li>\n'+
					'<li><a href="'+base+'/en/market_activity/resources.html">Resources</a></li>\n'+
					'<li><a href="'+base+'/en/market_activity/market_hours.html">Market Hours &amp; Holidays</a></li>\n'+
					'<li><a href="'+base+'/HttpController?GetPage=CreateTickerForm&amp;Language=en">Stock Ticker</a></li>\n'+
					'<li><a href="http://tsx.ar.wilink.com/asp/A565_search_ENG.asp" target="_blank">Free Annual Report</a></li>\n'+
					'<li><a href="'+base+'/en/market_activity/contact_us.html">Contact Us</a></li>\n'+
					'<li class="information">Get current market, index and company information for Toronto Stock Exchange and TSX Venture Exchange.  Build your own portfolio with My Stock List, and customize our pop-up Java Ticker.</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="'+base+'/en/listings/sector_profiles/index.html">Sector Profiles</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/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/products_services/index.html">Products &amp; Services</a></li>\n'+
					//'<li><a href="#">Sector Profiles</a></li>\n'+
					//'<li><a href="#">Access Vendors</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, Pricing &amp; Agreements</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 TSX 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/market_activity/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 TSX 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.html">Media Kit</a></li>\n'+
					'<li><a href="'+base+'/en/news_events/broadcast_centre/">TSX 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 TSX 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+'/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(){
document.write('<form name="quickQuote" id="quickQuote" action="'+base+'/HttpController?" onsubmit="clearDefault()" method="get">\n'+
			'<div id="getQuote">\n'+
				'<h2>GET QUOTE</h2>\n'+
				'<input type="hidden" value="QuotesLookupPage" name="GetPage"/>\n'+
				'<input type="hidden" value="DetailedPrices" name="DetailedView"/>\n'+
				'<input type="hidden" value="T" name="Market"/>\n'+
				'<input type="hidden" value="en" name="Language"/>\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="'+base+'/en/images/quote_go.gif" alt="Get a Stock Quote" value="GO"/>\n'+
				'</fieldset>\n'+
				'<p><a class="data" href="javascript:openWindow(\''+base+'/HttpController?GetPage=SearchEquitiesQuickViewPage\',620,600);">Symbol Lookup</a></p>\n'+
			'</div>\n'+
			'</form>');
}

function getPortals(){
document.write('<div id="subNavigation" class="portalLinks">' +
				'<div id="subNavigationTop">' +
					'<h2>I AM:</h2>' +
					
					'<ul>' +
						'<li id="individual"><a href="'+base+'/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/interested.html">Interested in Listing</a></li>' +
					'</ul>' +
				'</div>' +
			'</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 src="'+base+'/en/images/wilink_annrep.gif" id="freeAnnRep"/><img src="'+base+'/en/images/wilink_annrep_over.gif" id="freeAnnRepOver" style="display:none;"/></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 TSX.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('<div id="signOnTo"><span  id="hiddenBox" ></span></div>');
}

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.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; TSX Inc. <br />For full optimization and view of this web site, users are recommended to set their screen display at 1024x768 pixels.<br />TSX 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. TSX 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>');
}


function popitup(url) {
	newwindow=window.open(url,'name','height=400,width=600');
	if (window.focus) {newwindow.focus()}
	return false;
}



		function popUp(URL) 
		{
			day = new Date();
			id = day.getTime();
			eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=620,height=477,left = 250,top = 212');");
		}	
