function flashload(id,container)
{
	var so = new SWFObject("chart/chart.swf", "chart", "100%", "100%", "9", "#FFFFFF");
	var newdate=new Date();
	newtime=newdate.getTime();
	so.addVariable("data", "/calendar/data/max_1_"+id+".php?time="+newtime);
	so.addParam("allowScriptAccess", "sameDomain");
	so.addParam("wmode", "transparent");
	so.write(container);
}
function writeflash(url,container,width,height)
{
	var so = new SWFObject("chart/chart.swf", "chart", width, height, "9", "#FFFFFF");
	var newdate=new Date();
	newtime=newdate.getTime();
	so.addVariable("data", url+"?time="+newtime);
	so.addParam("allowScriptAccess", "sameDomain");
	so.addParam("wmode", "transparent");
	so.write(container);
}


function update_gold()
{
	setTimeout("update_gold()",2000); 
	var rel='';
	var url='/get_gold_price.php';
	var myAjax = new Ajax.Request(url,{parameters: rel,onComplete: function(xmlhttp) {CallBack_update_gold(xmlhttp);}});
	myAjax=null;
	CollectGarbage();	

}
function CallBack_update_gold(xmlhttp)
{
	var result=xmlhttp.responseText
	var price=result.evalJSON(); 
	if($F("gold_price_h")-parseFloat(price["gold_close"])>0)
	{
		$("gold_price").innerHTML="伦敦金：<strong>"+parseFloat(price["gold_close"]).toFixed(getcode_bit("GOLD"))+"</strong>美元/盎司"+"<image src='images/yx.png'/>";	
		$("gold_cn_price").innerHTML="国内金：<strong>"+parseFloat(price["gold_cn_close"]).toFixed(getcode_bit("GOLD"))+"元/克"+"<image src='images/yx.png'/>";	
	}
	if($F("gold_price_h")-parseFloat(price["gold_close"])<0)
	{
		$("gold_price").innerHTML="伦敦金：<strong>"+parseFloat(price["gold_close"]).toFixed(getcode_bit("GOLD"))+"</strong>美元/盎司"+"<image src='images/ys.png'/>";	
		$("gold_cn_price").innerHTML="国内金：<strong>"+parseFloat(price["gold_cn_close"]).toFixed(getcode_bit("GOLD"))+"</strong>元/克"+"<image src='images/ys.png'/>";	
	}
	if($F("gold_price_h")-parseFloat(price["gold_close"])==0)
	{
		$("gold_price").innerHTML="伦敦金：<strong>"+parseFloat(price["gold_close"]).toFixed(getcode_bit("GOLD"))+"</strong>美元/盎司"+"<image src='images/yz.png'/>";	
		$("gold_cn_price").innerHTML="国内金：<strong>"+parseFloat(price["gold_cn_close"]).toFixed(getcode_bit("GOLD"))+"</strong>元/克"+"<image src='images/yz.png'/>";	
	}
	$("gold_price_h").value=parseFloat(price["gold_close"]);		
	
}
function get_key_event(country,container)
{
	$("calendar_diagram"+container).src='calendar_diagram.php?curr='+country;
	$("key_event"+container).src='all_key_event.php?curr='+country;
}
function update_news()
{
	setTimeout("update_news()",30000); 
	var rel='';
	var url='get_all_news.php';
	var myAjax = new Ajax.Request(url,{parameters: rel,onComplete: function(xmlhttp) {CallBack_update_news(xmlhttp);}});
	myAjax=null;
	CollectGarbage();	

}
function CallBack_update_news(xmlhttp)
{
	var result=xmlhttp.responseText;
	$("news_all").innerHTML=result;
}