var pageLang="en";
var serverInfo="http://www.invescoaim.com";

// JavaScript Document
function showWidget(widgetName) {
	var widgets=new Array("quotes","companyProfile","interactiveCharting","SECFilings");
	for (i=0; i<widgets.length; i++) {
		if (widgetName==widgets[i]) {
			parent.document.getElementById(widgets[i]).style.display="block";
		}
		else {
			parent.document.getElementById(widgets[i]).style.display="none";
		}
	}
}

//function to read from querystring using javascript
function getQuerystring(key, default_)
{
  if (default_==null) default_="";
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
} 

//potential querystring variables
var symb = getQuerystring('symb');
var storyId = getQuerystring('storyId');
var quoteChart = getQuerystring('quoteChart');
var exch = getQuerystring('exch');
var field = getQuerystring('field');
var comp = getQuerystring('comp');

//goes to company research tab
var quoteAction = serverInfo + "/portal/site/aim/template.DETAIL/menuitem.d8cc3569dbec11cc3e566943acd8fba0/?contentGuid=256a056f47631210VgnVCM1000000a67bf0aRCRD";

//goes to watchlist tab
var watchListAction = serverInfo + "/portal/site/aim/template.DETAIL/menuitem.d8cc3569dbec11cc3e566943acd8fba0/?contentGuid=574178c540961210VgnVCM1000000a67bf0aRCRD";

//goes to news tab
var newsAction = serverInfo + "/portal/site/aim/template.DETAIL/menuitem.d8cc3569dbec11cc3e566943acd8fba0/?contentGuid=f26178c540961210VgnVCM1000000a67bf0aRCRD";

//goes to overview tab
var summaryAction = serverInfo + "/portal/site/aim/template.DETAIL/menuitem.d8cc3569dbec11cc3e566943acd8fba0/?contentGuid=d149baf055461210VgnVCM1000000a67bf0aRCRD";

var customWatchList = "http://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-indexes.aspx?lang=" + pageLang; // + "&action=" + quoteAction;

var newsFullStoryArticle = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-NewsStory.aspx?lang=" + pageLang + "&storyId=" + storyId + "&action=" + newsAction + "&only=article";
var newsFullStoryHeadlines = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-NewsStory.aspx?lang=" + pageLang + "&action=" + newsAction + "&only=headline&symb=" + symb;
var stockQuoteLookup = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-SymbolEntry.aspx?lang=" + pageLang + "&action=" + quoteAction;
var companyQuote = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-companyquote.aspx?lang=" + pageLang + "&symb=" + symb;
var newsHeadlines = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-CompanyHeadlines.aspx?lang=" + pageLang + "&action=" + newsAction + "&symb=" + symb + "&count=9&notitle=1";
var companyProfileChart = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-CompanyProfile.aspx?lang=" + pageLang + "&symb=" + symb;
var profitManageValuationRelated = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-Companysidebar.aspx?lang=" + pageLang + "&symb=" + symb + "&action=" + quoteAction;
var interactiveCharter = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-interactivechart.aspx?lang=" + pageLang + "&symb=" + symb + "&comp=" + comp;
var secFilings = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-SECFilings.aspx?lang=" + pageLang + "&symb=" + symb;
var quoteBanner = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-quotebanner.aspx?lang=" + pageLang + "&symb=" + symb + "&action=" + quoteAction;
var watchlist = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-Watchlist.aspx?lang=" + pageLang + "&quote=" + quoteAction + "&chart=" + quoteAction + "&quoteChart=1";
var mostActives = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-MostActives.aspx?lang=" + pageLang + "&action=" + summaryAction + "&quote=" + quoteAction + "&exch=" + exch + "&field=" + field;
var miniWatchlist = "https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-miniwatchlist.aspx?lang=" + pageLang +"&edit=" + watchListAction + "&quote=" + quoteAction;

var indexChart="https://custom.marketwatch.com/CUSTOM/INVESCO-COM/jsinc-indexchart.asp";
//Use the following for indexChart when rolling to Prod
//https://custom.marketwatch.com/custom/invesco-com/jsinc-indexchart.asp
//Old URL var indexChart="https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-indexchart.aspx?lang=" + pageLang;

var verifySymbol="https://djcs.marketwatch.com/cxb/Invescoaim/Content/jsinc-VerifySymbol.aspx?symb=" + symb;

/*
var newsFullStoryArticle = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-NewsStory.aspx?lang=" + pageLang + "&storyId=" + storyId + "&action=" + newsAction + "&only=article";
var newsFullStoryHeadlines = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-NewsStory.aspx?lang=" + pageLang + "&action=" + newsAction + "&only=headline&symb=" + symb;
var stockQuoteLookup = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-SymbolEntry.aspx?lang=" + pageLang + "&action=" + quoteAction;
var companyQuote = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-companyquote.aspx?lang=" + pageLang + "&symb=" + symb;
var newsHeadlines = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-CompanyHeadlines.aspx?lang=" + pageLang + "&action=" + newsAction + "&symb=" + symb + "&count=9&notitle=1";
var companyProfileChart = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-CompanyProfile.aspx?lang=" + pageLang + "&symb=" + symb;
var profitManageValuationRelated = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-Companysidebar.aspx?lang=" + pageLang + "&symb=" + symb + "&action=" + quoteAction;
var interactiveCharter = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-interactivechart.aspx?lang=" + pageLang + "&symb=" + symb + "&comp=" + comp;
var secFilings = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-SECFilings.aspx?lang=" + pageLang + "&symb=" + symb;
var quoteBanner = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-quotebanner.aspx?lang=" + pageLang + "&symb=" + symb + "&action=" + quoteAction;
var watchlist = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-Watchlist.aspx?lang=" + pageLang + "&quote=" + quoteAction + "&chart=" + quoteAction + "&quoteChart=1";
var mostActives = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-MostActives.aspx?lang=" + pageLang + "&action=" + summaryAction + "&quote=" + quoteAction + "&exch=" + exch + "&field=" + field;
var miniWatchlist = "https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-miniwatchlist.aspx?lang=" + pageLang +"&edit=" + watchListAction + "&quote=" + quoteAction;
var indexChart="https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-indexchart.aspx?lang=" + pageLang;
var verifySymbol="https://djcs.marketwatch.com/cxb/InvescoTrimark/Content/jsinc-VerifySymbol.aspx?symb=" + symb;
*/