var moduleURL = "http://gumshoe.qm.verticalreachmedia.com/module.html";
/* moduleURL is the URL of the page hosted by Zacks that contains the multi-channel module.  The multi-channel module uncludes the Market Summary, Market Movers, Rates, Currencies and more */

var watchlistURL = "http://gumshoe.qm.verticalreachmedia.com/watchlist.html";
/* watchlistURL is the URL of the page hosted by Zacks that contains the editable watchlist */  	

var localWatchlistURL = "http://gumshoe.qm.verticalreachmedia.com/localWatchlist.html";
/* watchlistURL is the URL of the page hosted by Zacks that contains the local watchlist */  	

var etfsURL = "http://gumshoe.qm.verticalreachmedia.com/etfs.html";
/* watchlistURL is the URL of the page hosted by Zacks that contains the ETF tool */  	

var fundsURL = "http://gumshoe.qm.verticalreachmedia.com/funds.html";
/* fundsURL is the URL of the page hosted by Zacks that contains the funds tool */  	

var webPortfolioURL = "http://gumshoe.qm.verticalreachmedia.com/webPortfolio.html";
/* webPortfolioURL is the URL of the page hosted by Zacks that contains the web portfolio signup */  	

var symbol, targetPage = null;
/* Start of code to retrieve symbol from URL string */
var qs = window.location.href;
if(qs.indexOf("?")!=-1)
{
	qs = qs.substr(qs.indexOf("?")+1);
	if (qs.indexOf("&")!=-1) {
		qs=qs.split("&");
	} else {
		qs = {0:qs};
	}
	
	for(var i in qs) {
		if(qs[i].toString().match("qm_symbol")) 
		{
			symbol = qs[i].split("=")[1];
		}
		if(qs[i].toString().match("qm_target_page")) 
		{
			targetPage = qs[i].split("=")[1];
		}
	}
}
	
if(symbol == null)
{
	symbol = "DELL";
}

symbol = symbol.toUpperCase();
/* End of code to retrieve symbol from URL string */

if(targetPage == null)
{
	targetPage = "DetailedQuote";
}

var moduleForwardURL = "http://app.quotemedia.com/quotetools/clientForward?targetsym=qm_symbol&amp;symbol=" + symbol + "&amp;targetURL=" + moduleURL + "&amp;action=show";

var iframeURL = false;

if(targetPage == "Watchlist")
{
	iframeURL = watchlistURL;
}
else if(targetPage == "LocalWatchlist")
{
	iframeURL = localWatchlistURL;
}
else if(targetPage == "ETFs")
{
	iframeURL = etfsURL;
}		
else if(targetPage == "Funds")
{
	iframeURL = fundsURL;
}		
else if(targetPage == "WebPortfolio")
{
	iframeURL = webPortfolioURL;
}
else
{
	iframeURL = moduleForwardURL + targetPage;	
}

/* Start of iFrame Code */
document.write('<iframe name="content" width="950" height="1400" scrolling="auto" src="' + iframeURL + '"></iframe>');
/* End of iFrame Code */
