function createXml(str){ 
	if(document.all){ 
　　var xmlDom=new ActiveXObject("Microsoft.XMLDOM");
　　xmlDom.loadXML(str);
　　return xmlDom;
　　}else{
　　return new DOMParser().parseFromString(str, "text/xml");
	}
}
function GetFinancePrice(){
$.ajax({
	type: "GET",
	url: "../GetXml.php",
	global: false,
	data: "n="+Math.random(),
	error:function(){$("#GoldLoading").html('<img src=../images/warn.gif> Load failure!');setTimeout('GetFinancePrice()',10000);},
	success: function(ReturnHTML){
	var xmlDOM = createXml(ReturnHTML);
	var updates = xmlDOM.documentElement; 
	var record = updates.getElementsByTagName('record');
	for (var i=0;i<record.length;i++) 
	{
		instrumentID=record[i].getAttribute("instrumentid");
		net=record[i].getAttribute("net");
		high=record[i].getAttribute("high");
		low=record[i].getAttribute("low");
		bid=record[i].getAttribute("bid");
		ask=record[i].getAttribute("ask");
		var row=window.document.getElementById(instrumentID);
		var ls_t=document.getElementById("Price");
		maxcell=ls_t.rows[0].cells.length;
		MyRows=ls_t.rows[i+1];
		if(MyRows.cells[2].innerHTML!=null&&MyRows.cells[2].innerHTML.length>3){
		OldPrice=MyRows.cells[2].innerHTML;
		var NewPrice=bid;
		var img="../images/none.gif";
		if(OldPrice==NewPrice){
		color="#ffffff";
		backgroundcolor="";
		img="../images/none.gif";
		}else if(OldPrice<NewPrice){
		color="#4ce51d";
		img="../images/up.gif";
		backgroundcolor="#333";
		}else if(OldPrice>NewPrice){
		color="#fa3434";
		img="../images/down.gif";
		backgroundcolor="#ccc";
		}
		var FOREX="FOREX_"+(i+1);
		$("#"+FOREX).attr({src: img});
		MyRows.cells[2].style.color=color;
		MyRows.cells[3].style.color=color;
		MyRows.cells[2].style.backgroundColor=backgroundcolor;
		MyRows.cells[3].style.backgroundColor=backgroundcolor;
		MyRows.cells[6].style.backgroundColor=backgroundcolor;
		MyRows.cells[6].style.color=color;
		MyRows.cells[2].style.fontWeight="bold";
		MyRows.cells[3].style.fontWeight="bold";
		}
		MyRows.cells[2].innerHTML = bid;
		MyRows.cells[3].innerHTML = bid.substring(0,(bid.length-ask.length))+ask;
		MyRows.cells[4].innerHTML = low;
		MyRows.cells[5].innerHTML = high;
		MyRows.cells[6].innerHTML = net;
	}
	$("#GoldLoading").html('<img src=../images/loadingGold.gif>');
	setTimeout('GetFinancePrice()',4000);
	}
	});
}