/*========================================
  Powered By ：Exsm V 1.7.0
  Web : http://www.czie.com
========================================*/
var color;
var StockList=new Array()
var StockDiv=parent.document.getElementById("stockdiv")
function ex_stock_show()
{
	var stockhead='<table class=a2 width='+assignwidth+' cellspacing=1 cellpadding=3 align=center border=0>';
	stockhead+='<tr><td align=center height=25 class=a1>正在读取数据，请稍侯……</td></tr>';
	stockhead+='</table>';
	StockDiv.innerHTML=stockhead;
}
function ex_stock_div()
{
	var urlname='Exsm_Plus_StockDiv.asp?page='+page+'&action=';
	var ex_st='<table class=a2 width='+assignwidth+' cellspacing=1 cellpadding=3 align=center border=0>';
	ex_st+='<tr align=center height=25 class=a1><td><a href="#TopEx">代码</a></td><td><a href="Exsm_Plus_StockDiv.asp?action=Sid" target="hiddendialogue">股票名称</a></td><td><a href="Exsm_Plus_StockDiv.asp?action=Sid" target="hiddendialogue">经营者</a></td><td><a href="'+urlname+'ClosingPrice" target="hiddendialogue">昨收盘</a>'+SortClosingPrice+'</a></td><td><a href="'+urlname+'TradePrice" target="hiddendialogue">当前价</a>'+SortTradePrice+'</td>';
	ex_st+='<td><a href="'+urlname+'HeaveChangeA" target="hiddendialogue">涨跌</a>'+SortHeaveChangeA+'</td><td><a href="'+urlname+'HeaveChangeB" target="hiddendialogue">涨幅</a>'+SortHeaveChangeB+'</td><td><a href="'+urlname+'TodayBuyNumber" target="hiddendialogue">买入</a>'+SortTodayBuyNumber+'</td><td><a href="'+urlname+'TodaySellNumber" target="hiddendialogue">卖出</a>'+SortTodaySellNumber+'</td><td><a href="'+urlname+'TodayPermitTradeSum" target="hiddendialogue">今可交易</a>'+SortTodayPermitTradeSum+'</td><td><a href="'+urlname+'TodayTradeNum" target="hiddendialogue">今成交</a>'+SortTodayTradeNum+'</td><td><a href="'+urlname+'LockStock" target="hiddendialogue">状态</a>'+SortLockStock+'</td></tr>';
	if (stockdivon)
	{
		for (i=0;i<StockList.length;i++)
		{
			StockList[i]=StockList[i].split(",")
			if (StockList[i][3]==""){var management="-";}else{var management="<a href=Exsm_Plus_Dispu.asp?Uid="+StockList[i][4]+">"+StockList[i][3]+"</a>";}
			if (Compute(StockList[i][6],2)<1)
			{
				color0="navy";
				color1="navy";
			}
			else
			{
				if (Compute(StockList[i][6],2)==Compute(StockList[i][5],2))
				{
					color0="#000000";
					color1="#000000";
				}
				else
				{
					if (Compute(StockList[i][6],2)<Compute(StockList[i][5],2))
					{
						color0="#FF0000";
						color1="#008800";
					}
					else
					{
						if (Compute(StockList[i][6],2)>Compute(StockList[i][5],2))
						{
							color0="#008800";
							color1="#FF0000";
						}
					}
				}
			}
			var zangdierange=Compute((StockList[i][5]-StockList[i][6])/StockList[i][6],4);
			if (StockList[i][6]<trade_stop)
			{
				zangdierange="<b>停牌</b>";
			}
			else
			{
				if (zangdierange>=trade_upstop)
				{
					zangdierange="<b>涨停</b>";
				}
				else
				{
					if (zangdierange<=trade_dostop)
					{
						zangdierange="<b>跌停</b>";
					}
					else
					{
						if (zangdierange==0)
						{
							zangdierange="0.00%";
						}
						else
						{
							zangdierange=Formatnumber(''+Compute(zangdierange*100,2)+'')+'%';
						}
					}
				}
			}
			if (StockList[i][11]==0){if (StockList[i][9]<=0){var todaypermittradesum="-";}else{var todaypermittradesum=Compute(StockList[i][9],0);}if (StockList[i][10]<=0){var todayadtradesum="-";}else{var todayadtradesum=Compute(StockList[i][10],0);}color2="#008800";var lockstock="开盘";}else{var todaypermittradesum="-";var todayadtradesum="-";color2="#FF0000";var lockstock="封盘";}
			ex_st+='<tr align="center"><td class=a3><Font color="olive">'+StockList[i][0]+'</Font></td>';
			ex_st+='<td class=a3><a href=Exsm_Plus_DispCompare.asp?sid='+StockList[i][2]+' onmouseover="cziemenu(event,\'<div><a href=Exsm_Plus_DispCompare.asp?sid='+StockList[i][2]+'>上市资讯</a></div><div><a href=Exsm_Plus_Exchange.asp?sid='+StockList[i][2]+'>进行交易</a></div>\',\'\',15)"><Font color='+color0+'>'+StockList[i][1]+'</Font></a></td>';
			ex_st+='<td class=a3>'+management+'</td>';
			ex_st+='<td class=a3><Font color='+color1+'>'+Formatnumber(''+Compute(StockList[i][6],2)+'')+'</Font></td>';
			ex_st+='<td class=a3><Font color='+color0+'>'+Formatnumber(''+Compute(StockList[i][5],2)+'')+'</Font></td>';
			ex_st+='<td class=a3><Font color='+color0+'>'+Formatnumber(''+Compute(StockList[i][5]-StockList[i][6],2)+'')+'</Font></td>';
			ex_st+='<td class=a3><Font color='+color0+'>'+zangdierange+'</Font></td>';
			ex_st+='<td class=a3>'+StockList[i][7]+'</td>';
			ex_st+='<td class=a3>'+StockList[i][8]+'</td>';
			ex_st+='<td class=a3><Font color='+color0+'>'+todaypermittradesum+'</Font></td>';
			ex_st+='<td class=a3>'+todayadtradesum+'</td>';
			ex_st+='<td class=a3><Font color='+color2+'>'+lockstock+'</Font></td></tr>';
		}
		ex_st+='</table>';
		ex_st+='<table width='+assignwidth+' cellspacing=0 cellpadding=1 align=center border=0>';
		ex_st+='<tr><td align=left>页次：'+page+' / '+pagecount+'页 每页'+pagesize+'个 共'+recordcount+'个</td>';
		ex_st+='<td Align=Right><form method="post" action="Exsm_Plus_StockDiv.asp?action='+IndicationEx+'&StockUserDiv=0&HighLow='+highlow+'" target="hiddendialogue">分页：'+DispPageNum(page,pagecount,'Exsm_Plus_StockDiv.asp?action='+IndicationEx+'&StockUserDiv=0&page=','&HighLow='+highlow+'','hiddendialogue');+'';
		ex_st+='&nbsp;转到第:<input name=Page size=1 value='+(page+1)+'>页&nbsp;<input type="submit" value="Go" name="submit"></td></form></tr>';
		ex_st+='</table>';
	}
	else
	{
		ex_st+='<tr align=center><td class=a3 align=center colspan=12><a href=""Exsm_Plus_Admin_Gupiao.asp?action=NewStock""><font color=red>数据库中没有股票数据！请点击这里到后台添加股票数据。</font></a></td></tr>';
		ex_st+='</table>';
	}
	StockDiv.innerHTML=ex_st;
}
var StockUserList=new Array()
var userstockshow=parent.document.getElementById("stockuserdiv")
function ex_user_stock_show()
{
	var stockhead='<br><table class=a2 width='+assignwidth+' cellspacing=1 cellpadding=3 align=center border=0>';
	stockhead+='<tr><td align=center height=25 class=a1>正在读取数据，请稍侯……</td></tr>';
	stockhead+='</table>';
	userstockshow.innerHTML=stockhead;
}
function ex_user_stock_div()
{
	var MyGupiaoNum=0;
	var MyGupiaoValue=0;
	var MyGupiaoCost=0;
	var bj=0;
	var TotalGain=0;
	var GranRate=0;
	var MeiGuKuiSun=0;
	var ZongKuiSun=0;
	var YingKuiLv=0;
	var YKStr=0;
	var TotalGranRate=0;
	var FuDu=0;
	var u_st='<br><table class=a2 width='+assignwidth+' cellspacing=1 cellpadding=3 align=center border=0>';
	u_st+='<tr><td colspan=11 height=25 align=center class=a1>-=> 欢 迎 您 ['+username+'] 您 的 持 股 情 况 如 下 <=-</td></tr>';
	u_st+='<tr align=center><td class=a4><b>代码</b></td><td class=a4><b>股票名称</b></td><td class=a4><b>拥有数量</b></td><td class=a4><b>持股成本</b></td><td class=a4><b>当前价</b></td><td class=a4><b>持股价</b></td><td class=a4><b>持股现值</b></td><td class=a4><b>每股盈亏</b></td><td class=a4><b>总盈亏</b></td><td class=a4><b>盈亏率</b></td><td class=a4><b>操作</b></td></tr>';
	if (stockuserdivon)
	{
		if (usercutamelon==1){usercutamelon=true;}
		for (i=0;i<StockUserList.length;i++)
		{
			StockUserList[i]=StockUserList[i].split(",")
			MyGupiaoNum=(MyGupiaoNum+StockUserList[i][3]*1)
			MyGupiaoValue=(MyGupiaoValue+StockUserList[i][3]*StockUserList[i][6])
			MyGupiaoCost=(MyGupiaoCost+StockUserList[i][3]*StockUserList[i][5])
			bj=(StockUserList[i][6]-StockUserList[i][5])
			if (bj>0){MeiGuKuiSun='<font color=#FF0000>↑'+Formatnumber(''+Compute(bj,2)+'')+'</Font>';color0="#FF0000";}if (bj<0){MeiGuKuiSun='<font color=#008800>↓'+Formatnumber(''+StockUserList[i][5]-StockUserList[i][6]+'')+'</Font>';color0="#008800";}if (bj==0){MeiGuKuiSun='<font color=#000000>→0.00</Font>';color0="#000000";}
			TotalGain=bj*StockUserList[i][3]
			GranRate=TotalGain*100/MyGupiaoCost
			if (TotalGain>0)
			{
				ZongKuiSun='<font color=#FF0000>↑'+Formatnumber(''+Compute(TotalGain,2)+'')+'</Font>';
				YingKuiLv='<font color=#FF0000>↑'+Formatnumber(''+Compute(GranRate,2)+'')+'%</Font>';
			}
			else
			{
				if (TotalGain<0)
				{
					ZongKuiSun='<Font color=#008800>↓'+Formatnumber(''+Compute(-TotalGain,2)+'')+'</Font>';
					YingKuiLv='<font color=#008800>↓'+Formatnumber(''+Compute(-GranRate,2)+'')+'%</Font>';
				}
				else
				{
					ZongKuiSun='<font color=#000000>→0.00</Font>';
					YingKuiLv='<font color=#000000>→0.00%</Font>';
				}
			}
			if (MyGupiaoValue-MyGupiaoCost>0)
			{
				YKStr='<font Color=red>↑'+Formatnumber(''+Compute(MyGupiaoValue-MyGupiaoCost,2)+'')+'</Font>';
			}
			else
			{
				if (MyGupiaoValue-MyGupiaoCost<0)
				{
					YKStr='<font color=#008800>↓'+Formatnumber(''+Compute(MyGupiaoCost-MyGupiaoValue,2)+'')+'</Font>';
				}
				else
				{
					YKStr='<font color=#000000>→0.00</Font>';
				}
			}
			if (MyGupiaoCost==0)
			{
				TotalGranRate=0;
			}
			else
			{
				TotalGranRate=(MyGupiaoValue-MyGupiaoCost)*100/MyGupiaoCost
			}
			if ((usercutamelon) && (userid==StockUserList[i][8])){usercutamelon='<a href="Exsm_Plus_Exchange.asp?action=UserFh&sid='+StockUserList[i][2]+'">分红</a>';}else{usercutamelon='<a title="该股票最大股东['+StockUserList[i][7]+']"><font color="#666666">分红</font></a>';}
			u_st+='<tr align=right>';
			u_st+='<td class=a3 align=center><Font color="olive">'+StockUserList[i][0]+'</Font></td>';
			u_st+='<td class=a3 align=center><a href=Exsm_Plus_DispCompare.asp?sid='+StockUserList[i][2]+' onmouseover="cziemenu(event,\'<div><a href=Exsm_Plus_DispCompare.asp?sid='+StockUserList[i][2]+'>上市资讯</a></div><div><a href=Exsm_Plus_Exchange.asp?sid='+StockUserList[i][2]+'>进行交易</a></div>\',\'\',15)"><Font color='+color0+'>'+StockUserList[i][1]+'</Font></a></td>';
			u_st+='<td class=a3>'+Compute(StockUserList[i][3],0)+'</td>';
			u_st+='<td class=a3>'+Formatnumber(''+Compute(StockUserList[i][5]*StockUserList[i][3],2)+'')+'</td>';
			u_st+='<td class=a3>'+Formatnumber(''+Compute(StockUserList[i][6],2)+'')+'</td>';
			u_st+='<td class=a3>'+Formatnumber(''+Compute(StockUserList[i][5],2)+'')+'</td>';
			u_st+='<td class=a3>'+Formatnumber(''+Compute(StockUserList[i][6]*StockUserList[i][3],2)+'')+'</td>';
			u_st+='<td class=a3>'+MeiGuKuiSun+'</td>';
			u_st+='<td class=a3>'+ZongKuiSun+'</td>';
			u_st+='<td class=a3>'+YingKuiLv+'</td>';
			u_st+='<td class=a3 align="center">'+usercutamelon+'</td>';
			u_st+='</tr>';
		}
		if (TotalGranRate>0)
		{
			FuDu='<font color=#FF0000>↑'+Formatnumber(''+Compute(TotalGranRate,2)+'')+'%</Font>';
		}
		else
		{
			if (TotalGranRate<0)
			{
				FuDu='<font color=#008800>↓'+Formatnumber(''+Compute(-TotalGranRate,2)+'')+'%</Font>';
			}
			else
			{
				FuDu='<font color=#000000>→0.00%</Font>';
			}
		}
		u_st+='<tr align=right><td class=a4 align=center>总&nbsp;&nbsp;&nbsp;计</td>';
		u_st+='<td class=a4 align=center>-</td>';
		u_st+='<td class=a4>'+MyGupiaoNum+'</td>';
		u_st+='<td class=a4>'+Formatnumber(''+Compute(MyGupiaoCost,2)+'')+'</td>';
		u_st+='<td class=a4 align=center>-</td>';
		u_st+='<td class=a4 align=center>-</td>';
		u_st+='<td class=a4>'+Formatnumber(''+Compute(MyGupiaoValue,2)+'')+'</td>';
		u_st+='<td class=a4 align=center>-</td>';
		u_st+='<td class=a4>'+YKStr+'</td>';
		u_st+='<td class=a4>'+FuDu+'</td>';
		u_st+='<td class=a4 align=center>-</td></tr>';
		u_st+='</table>';
		u_st+='<table width='+assignwidth+' cellspacing=0 cellpadding=1 align=center border=0>';
		u_st+='<tr><td align=left>页次：'+page+' / '+pagecount+'页 每页'+pagesize+'个 共'+recordcount+'个</td>';
		u_st+='<td Align=Right>分页：'+DispPageNum(page,pagecount,'Exsm_Plus_StockDiv.asp?StockUserDiv=1&page=','','hiddendialogue');+'</td></tr>';
		u_st+='</table>';
	}
	else
	{
		u_st+='<tr align=center><td class=a3 align=center colspan=11>您现在还没有股票请点击上方屏幕中股票名称购买</td></tr>';
		u_st+='</table>';
	}
	userstockshow.innerHTML=u_st;
}
function CzStatus()
{
	if (!document.images)
		return
	if (ExReload==1)
	{
		window.location.reload()
	}
	else
	{
		ExReload-=1
		setTimeout("CzStatus()",1000)
	}
}
function ColExp()
{
	var cziexpi;
	if (cziedxp>0){cziexpi='↑';}
	if (cziedxp<0){cziexpi='↓';}
	if (cziedxp==0){cziexpi='→';}
	window.status='今日股市行情:成交总额:"￥'+Formatnumber(''+Compute(BargainMoney,2)+'')+'"元,成交笔数:"'+BargainNum+'"笔,综合指数:"'+cziexpi+Formatnumber(''+Compute(cziedxp,2)+'')+'%".'
}