if(!qmjs) var qmjs = {};
if(!qmjs.WatchList) qmjs.WatchList = {

	ETP_URL : "http://www.quotemedia.com/results.php",
	ETE_URL : "http://www.quotemedia.com/results.php",
	delayed : '<div class="footer">(Delayed 20 minutes)</div>',
	appendModule : function(HTML){
		document.getElementById('WatchList').innerHTML = this.parseHTML(HTML+this.delayed);
	},
	parseHTML : function(HTML){
		var r = [new RegExp('style=\".*?\"', 'img'), new RegExp('&nbsp;', 'img'), new RegExp('(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)', 'img'), new RegExp('openDetail_[0-9]{0,4}', 'img'), new RegExp('id="qm_last_[0-9]{0,4}">', 'img'), new RegExp('id="qm_change_[0-9]{0,4}">', 'img')]
		var w = ["", "", "", "qmjs.WatchList.openDetail", 'class="qmmt-last">$', 'class="qmmt-change">$'];
		for(var i = 0; i < r.length; i++){
			HTML = HTML.replace(r[i], w[i]);
		}
		HTML = HTML.replace('tr class="qmmt_main"', 'tr class="first qmmt_main"');
		return(HTML);
	},
	openDetail : function(symbol){
		symbol = symbol.toUpperCase();
		var targetURL = this[""+(symbol.toUpperCase())+"_URL"];
		window.location = ("http://app.quotemedia.com/quotetools/clientForward?targetURL="+targetURL+"&symbol="+symbol+"&action=showDetailedQuote");
	}

};