var pricepictime;
var closepricepic;

function OpenClewDown(){
	var tmpPopPic = document.getElementById('divClewDownload');
	
	var popCtrl = document.getElementById('crowtarget');
	var oTmp = popCtrl;
	var x = oTmp.offsetLeft;
	var y = oTmp.offsetTop;
	while(oTmp.offsetParent) {
		oTmp = oTmp.offsetParent;
		x += oTmp.offsetLeft;
		y += oTmp.offsetTop;
	}
	with (tmpPopPic.style) {left = x+popCtrl.offsetWidth-20; top = y-5; visibility = 'visible'; }
	tmpPopPic.style.width = 29 + 'px';
	tmpPopPic.style.height = 23 + 'px';
	//tmpPopPic.style.background="0 url('/softimg/hot.png') no-repeat";
	tmpPopPic.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='/softimg/hot.png')";
}

function OpenPricePic(curid){
	var tmpPopPic = document.getElementById('divPricePic');
	tmpPopPic.innerHTML = "<div style=\"clear:both; background:url(/softimg/poppic.gif) repeat-x; width:100%; height:26px;\"><span id=\"PricePicName\" style=\"float:left; width:70% !important; width:80%; text-align:left; font-size:12px; font-weight:bold; color:#FFFFFF; padding-top:4px; padding-left:5px; line-height:22px;\">报价</span><div style=\"float:right; width:20%; padding-top:4px; padding-right:5px;\"><img src=\"/softimg/bt_close.gif\" width=\"17\" height=\"17\" onClick=\"closePricePic();\"></div></div><div style=\"clear:both; background-color:#FFFFFF; text-align:center;\"><img src=\"/softimg/gif-0537.gif\" border=\"0\" id=\"id_newsimg\" name=\"id_newsimg\"></div>";
				  	
	var objbut = document.getElementById("id_newsimg");
	switch(curid)
	{
		case 0:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/645302.jpg";
			document.getElementById('PricePicName').innerHTML = "欧元/美元--淘金网";
			break;
		}
		case 1:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/640302.jpg";
			document.getElementById('PricePicName').innerHTML = "美元/日元--淘金网";
			break;
		}
		case 2:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/641302.jpg";
			document.getElementById('PricePicName').innerHTML = "美元/瑞郎--淘金网";
			break;
		}
		case 3:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/642302.jpg";
			document.getElementById('PricePicName').innerHTML = "英镑/美元--淘金网";
			break;
		}
		case 4:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/651302.jpg";
			document.getElementById('PricePicName').innerHTML = "澳元/美元--淘金网";
			break;
		}
		case 5:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/652302.jpg";
			document.getElementById('PricePicName').innerHTML = "美元/加元--淘金网";
			break;
		}
		case 6:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/2134313.jpg";
			document.getElementById('PricePicName').innerHTML = "美元/人民币--淘金网";
			break;
		}
		case 7:
		{
			objbut.src = "http://excel.gti.cn:8080/chartimg/service/temp/index_000001.jpg";
			document.getElementById('PricePicName').innerHTML = "上证指数--淘金网";
			break;
		}
		case 8:
		{
			objbut.src = "http://excel.gti.cn:8080/chartimg/service/temp/index_399001.jpg";
			document.getElementById('PricePicName').innerHTML = "深证指数--淘金网";
			break;
		}
		case 9:
		{
			objbut.src = "http://excel.gti.cn:8080/chartimg/service/temp/index_000300.jpg";
			document.getElementById('PricePicName').innerHTML = "沪深300--淘金网";
			break;
		}
		case 10:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/502301.jpg";
			document.getElementById('PricePicName').innerHTML = "道琼工业--淘金网";
			break;
		}
		case 11:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/495301.jpg";
			document.getElementById('PricePicName').innerHTML = "恒生指数--淘金网";
			break;
		}
		case 12:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/509301.jpg";
			document.getElementById('PricePicName').innerHTML = "日经指数--淘金网";
			break;
		}
		case 13:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/496301.jpg";
			document.getElementById('PricePicName').innerHTML = "纳斯达克--淘金网";
			break;
		}
		case 14:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/504302.jpg";
			document.getElementById('PricePicName').innerHTML = "美元指数--淘金网";
			break;
		}
		case 15:
		{
			objbut.src = "http://www.kitco.cn/cn/live_charts/t24_au_ch_usoz.gif";
			document.getElementById('PricePicName').innerHTML = "黄金现货--淘金网";
			break;
		}
		case 16:
		{
			objbut.src = "http://www.kitco.cn/cn/metals/platinum/t24_pt_cny_gram_180x114.gif";
			document.getElementById('PricePicName').innerHTML = "铂金现货--淘金网";
			break;
		}
		case 17:
		{
			objbut.src = "http://www.kitco.cn/cn/metals/palladium/t24_pd_cny_gram_180x114.gif";
			document.getElementById('PricePicName').innerHTML = "钯金现货--淘金网";
			break;
		}
		case 18:
		{
			objbut.src = "http://www.kitco.cn/cn/live_charts/t24_ag_cn.gif";
			document.getElementById('PricePicName').innerHTML = "白银现货--淘金网";
			break;
		}
		case 19:
		{
			objbut.src = "http://www.kitco.cn/cn/live_charts/t24_crude_cn180x120.gif";
			document.getElementById('PricePicName').innerHTML = "NYMEX原油--淘金网";
			break;
		}
		case 20:
		{
			objbut.src = "http://www.e9e.cn/gif_allone_m5/2135302.jpg";
			document.getElementById('PricePicName').innerHTML = "人民币金--淘金网";
			break;
		}
		case 21:
		{
			objbut.src = "http://www.kitco.cn/cn/past_charts/au0030_cn.gif";
			document.getElementById('PricePicName').innerHTML = "黄金当月--淘金网";
			break;
		}
		case 22:
		{
			objbut.src = "http://www.kitco.cn/cn/past_charts/au0365_cn.gif";
			document.getElementById('PricePicName').innerHTML = "黄金一年--淘金网";
			break;
		}
	}
	tmpPopPic.style.visibility = 'visible';
	tmpPopPic.style.top = 580 + 'px';
	tmpPopPic.style.right = 412 + 'px';
	tmpPopPic.style.border = 'solid 1px #CACACA';
	tmpPopPic.style.width = 150 + 'px';
	tmpPopPic.style.height = 16 + 'px';
	
	clearInterval(pricepictime);
	pricepictime = setInterval("autosize();",45);
}

function autosize(){
	if(document.getElementById("id_newsimg").width > 50)
	{
		clearInterval(pricepictime);
		document.getElementById('divPricePic').style.width = document.getElementById("id_newsimg").offsetWidth + 'px';
		document.getElementById('divPricePic').style.height = document.getElementById("id_newsimg").offsetHeight + 26 + 'px';
		
		clearTimeout(closepricepic);
		closepricepic=window.setTimeout("closePricePic();",30000);
	}
}

function change_image(url){
var image_o = document.getElementById('image_object');
image_o.src="http://www.51qh.com/stockstar/xtdy.asp?id="+url;
}

function closePricePic(){
	document.getElementById('divPricePic').style.visibility="hidden";
	clearTimeout(closepricepic);
}
