function ignoreError() {
  return true;
}

window.onerror = ignoreError;

function updateStockQuote(bType,hr,mn){
	var xmlHttp;
	var SQxml;
	var rootpath;
	if (host.toLowerCase().indexOf('mmbeta')!=-1)
		rootpath = "http://" + host + "/dfg/preview/";
	else if (host.toLowerCase().indexOf('mmtest')!=-1)
		rootpath = "http://" + host + "/dfg/";
	else
		rootpath = "http://" + host + "/";
	var url=rootpath + "stockScrape.asp"
	//var url="stockScrape.asp"
	//alert(url);
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e){
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				alert("We cannot capture the DLLR Stock Quote with your current browser version.");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
			SQxml=xmlHttp.responseText;
			var strOutput = ""
			var googleUp=false
			
			var arrQuote = SQxml.split("|");
			if (!arrQuote || arrQuote[1]=="site down") googleUp=false
			else googleUp=true
			
				if (googleUp){
						
					sp = arrQuote[1];
					if (sp.length==0) sp="---";
					
					dc = arrQuote[2];
					if (dc.length==0) dc="---"
					
					pc = arrQuote[3];
					if (pc.length==0) pc="---"
					
					if ((dc.indexOf("-") != -1) && (dc != "---")){
						arrowImg = "down";
						arrowCls = "minus";
					} else {
						arrowImg = "up";
						arrowCls = "plus";	
					}
				}
				if (bType != "m"){
					if (googleUp){
						strOutput += "DLLR&nbsp;(<img src=_images/global/nasdaq_sm.png align=absmiddle style=padding-top:3px>)&nbsp;$" + sp + "</td><td align=right valign=top style=padding-right:6px; nowrap>";
						if (((hr == 7) && (mn >= 30) || (hr >= 8)) && (hr < 14)) {
							strOutput += "&nbsp;&nbsp;<img src=_images/global/arrow_" + arrowImg + ".gif width=7 height=8 align=bottom style=margin-right:2px;margin-top:3px>&nbsp;<span id=variance>" + dc.replace(/\D/,"") + "&nbsp;" + pc + "</span>";	
						} else {
							strOutput += "&nbsp;<em>Market Closed</em>";
						}
					} else {
						strOutput += "<span style=font-size:10px>The stock quoting system is currently down. <em>We will re-try within 15 seconds.</em></span>"
					}
				} else {
					if (googleUp){
						strOutput += "$" + sp + "&nbsp;</td>"
						if (((hr == 7) && (mn >= 30) || (hr >= 8)) && (hr < 14)) {
							strOutput += "<td align=right><img src=_images/arrow_" + arrowImg + ".gif width=7 height=8 align=bottom style=margin-right:2px;margin-top:3px><span id=variance>" + dc.replace(/\D/,"") + "</span><img src=_images/spacer.gif width=5 height=24 align=absmiddle></td>"
						} else {
							strOutput += "<td align=right class=text>&nbsp;Mkt Clsd<img src=_images/spacer.gif width=5 height=24 align=absmiddle></td>"
						}
					} else {
						strOutput += "<span style=font-size:9px>Quote error</span>"
					}
				}
				if (strOutput.length > 0){
					//alert(strOutput);
					document.getElementById("stockquote").style.verticalAlign = "top";
					document.getElementById("stockquote").innerHTML = strOutput;
					if (document.getElementById("variance")) document.getElementById("variance").className = arrowCls;
					document.getElementById("stockquote").className = (bType == 'd') ? "stockquote" : "text";
				}
		}
	}
	
	//if (((hr == 7) && (mn >= 30) || (hr >= 8)) && (hr < 14)) {
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	//}
	setTimeout("updateStockQuote('" + bType + "','" + hr + "','" + mn + "')",15000);
}