document.write ('<div class="stocksearch_box" id="stockquoteblock">');
document.write ('<table width="100%">');
document.write ('	<form name="stockquote" action="'+str_BaseHref1+'htm/Stock/Quote1.htm" method="get" target="_blank">');
document.write ('	<tr>');
document.write ('		<td class="content_normal white">輸入股票號碼</td>');
document.write ('		<td align="right"><input name="stockid" type="text" size="3"></td>');
document.write ('		<td align="right"><label><input type="submit" name="Submit" value="查詢"></label></td>');
document.write ('	</tr>');
document.write ('	</form>');
document.write ('</table>');
document.write ('</div>');

// quote history
document.write ('<div id="stockprice1">');
document.write ('</div>');
document.write ('<div class="blue_box_line"><div class="box_blue_bg" id="stockprice2">');
document.write ('</div></div><br>');

var xmlHttp = false;
var token = 0;

try {
	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	try {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e2) {
		xmlHttp = false;
	}
}

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
	xmlHttp = new XMLHttpRequest();
}

function getStockPrice(code) {
	var Url = str_BaseHref1 + "/cfm/Quote9.cfm?code="+code;
	xmlHttp.open("GET", Url, true);
	xmlHttp.setRequestHeader("Content-Type", "text/html;charset=big5");			

	xmlHttp.onreadystatechange = updateStockPrice;
	xmlHttp.send(null);
}

function updateStockPrice(code) {
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
		    var response = xmlHttp.responseText;
//			responselist=response.split(",");
//			figure=responselist[0];
//			token=responselist[1];
			displayHtml = '<div class="box_blue_bg_t">\n';
			displayHtml = displayHtml + '<H3>最近搜尋的股份</H3>\n';
			displayHtml = displayHtml + '</div>\n';
		    if (obj=document.getElementById("stockprice1")) obj.innerHTML = displayHtml;
		    if (obj=document.getElementById("stockprice2")) obj.innerHTML = xmlHttp.responseText;
		}
	}
}

function displayQuoteHistory() {
	var content = '';
	
	yStocksList = getFinanceCookie('yourstockslist');
	if (yStocksList) {
		getStockPrice(yStocksList);
	}
}

displayQuoteHistory();
