var userstocklist=new Array()
function stockuserdiv()
{
	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;
	document.write ('<table class=a2 width='+assignwidth+' cellspacing=1 cellpadding=3 align=center border=0>');
	document.write ('<tr><td colspan=11 height=25 align=center class=a1>-=> 欢 迎 您 ['+UserName+'] 您 的 持 股 情 况 如 下 <=-</td></tr>');
	document.write ('<tr align=center><td class=a4><b>代码</b></td>');
	document.write ('<td class=a4><b>股票名称</b></td>');
	document.write ('<td class=a4><b>拥有数量</b></td>');
	document.write ('<td class=a4><b>持股成本</b></td>');
	document.write ('<td class=a4><b>当前价</b></td>');
	document.write ('<td class=a4><b>持股价</b></td>');
	document.write ('<td class=a4><b>持股现值</b></td>');
	document.write ('<td class=a4><b>每股盈亏</b></td>');
	document.write ('<td class=a4><b>总盈亏</b></td>');
	document.write ('<td class=a4><b>盈亏率</b></td>');
	document.write ('<td class=a4><b>操作</b></td></tr>');
	if (stockuserdivon)
	{
		if (usercutamelon==1){usercutamelon=true;}
		for (i=0;i<userstocklist.length;i++)
		{
			userstocklist[i]=userstocklist[i].split(",")
			mygupiaonum=(mygupiaonum+userstocklist[i][3]*1)
			mygupiaovalue=(mygupiaovalue+userstocklist[i][3]*userstocklist[i][6])
			mygupiaocost=(mygupiaocost+userstocklist[i][3]*userstocklist[i][5])
			bj=(userstocklist[i][6]-userstocklist[i][5])
			if (bj>0){meigukuisun='<font color=#FF0000>↑'+Formatnumber(''+Compute(bj,2)+'')+'</Font>';color0="#FF0000";}if (bj<0){meigukuisun='<font color=#008800>↓'+Formatnumber(''+userstocklist[i][5]-userstocklist[i][6]+'')+'</Font>';color0="#008800";}if (bj==0){meigukuisun='<font color=#000000>→0.00</Font>';color0="#000000";}
			totalgain=bj*userstocklist[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==userstocklist[i][8])){usercutamelon='<a href="Exsm_Plus_Exchange.asp?action=UserFh&sid='+userstocklist[i][2]+'">分红</a>';}else{usercutamelon='<a title="该股票最大股东['+userstocklist[i][7]+']"><font color="#666666">分红</font></a>';}
			document.write ('<tr align=right><td class=a3 align=center><Font color="olive">'+userstocklist[i][0]+'</Font></td>');
			document.write ('<td class=a3 align=center><a href=Exsm_Plus_DispCompare.asp?sid='+userstocklist[i][2]+' onmouseover="cziemenu(event,\'<div><a href=Exsm_Plus_DispCompare.asp?sid='+userstocklist[i][2]+'>上市资讯</a></div><div><a href=Exsm_Plus_Exchange.asp?sid='+userstocklist[i][2]+'>进行交易</a></div>\',\'\',15)"><Font color='+color0+'>'+userstocklist[i][1]+'</Font></a></td>');
			document.write ('<td class=a3>'+Compute(userstocklist[i][3],0)+'</td>');
			document.write ('<td class=a3>'+Formatnumber(''+Compute(userstocklist[i][5]*userstocklist[i][3],2)+'')+'</td>');
			document.write ('<td class=a3>'+Formatnumber(''+Compute(userstocklist[i][6],2)+'')+'</td>');
			document.write ('<td class=a3>'+Formatnumber(''+Compute(userstocklist[i][5],2)+'')+'</td>');
			document.write ('<td class=a3>'+Formatnumber(''+Compute(userstocklist[i][6]*userstocklist[i][3],2)+'')+'</td>');
			document.write ('<td class=a3>'+meigukuisun+'</td>');
			document.write ('<td class=a3>'+zongkuisun+'</td>');
			document.write ('<td class=a3>'+yingkuilv+'</td>');
			document.write ('<td class=a3 align="center">'+usercutamelon+'</td></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>';
			}
		}
		document.write ('<tr align=right><td class=a4 align=center>总&nbsp;&nbsp;&nbsp;计</td>');
		document.write ('<td class=a4 align=center>-</td>');
		document.write ('<td class=a4>'+mygupiaonum+'</td>');
		document.write ('<td class=a4>'+Formatnumber(''+Compute(mygupiaocost,2)+'')+'</td>');
		document.write ('<td class=a4 align=center>-</td>');
		document.write ('<td class=a4 align=center>-</td>');
		document.write ('<td class=a4>'+Formatnumber(''+Compute(mygupiaovalue,2)+'')+'</td>');
		document.write ('<td class=a4 align=center>-</td>');
		document.write ('<td class=a4>'+ykstr+'</td>');
		document.write ('<td class=a4>'+fudu+'</td>');
		document.write ('<td class=a4 align=center>-</td></tr>');
		document.write ('</table>');
		document.write ('<table width='+assignwidth+' cellspacing=0 cellpadding=1 align=center border=0>');
		document.write ('<tr><td align=left>页次：'+page+' / '+pagecount+'页 每页'+pagesize+'个 共'+recordcount+'个</td>');
		document.write ('<td Align=Right>分页：'+DispPageNum(page,pagecount,'?page=','','"">')+'</td></tr>');
		document.write ('</table>');
	}
	else
	{
		document.write ('<tr align=center><td class=a3 align=center colspan=11>您现在还没有股票。</td></tr>');
		document.write ('</table>');
	}
}
function mymanage_show()
{
	user_info=user_info.split(",")
	if (user_info[5]<0){var user_infoa='1';}else{var user_infoa=user_info[5];}
	if (user_info[6]<0){var user_infob='0';}else{var user_infob=user_info[6];}
	if (user_info[7]<0){var user_infoc='0';}else{var user_infoc=user_info[7];}
	if (user_info[8]<0){var user_infod='0';}else{var user_infod=user_info[8];}
	document.write ('<table class=a2 width='+assignwidth+' cellspacing=1 cellpadding=3 align=center border=0><br>');
	document.write ('<tr><td height=25 align=center class=a1>-=> 资 金 管 理 <=-</td></tr>');
	document.write ('<tr><td align=center valign=center class=a3><br>');
	document.write ('您的论坛帐户中虚拟资金共“<font color="#0000FF">'+Formatnumber(''+Compute(userwealth,2)+'')+'</font>”元，');
	document.write ('股市帐户中虚拟资金共“<font color="#0000FF">'+Formatnumber(''+Compute(usercash,2)+'')+'</font>”元。');
	if (user_info[0]==1)
	{
		document.write ('<br><br><div><form method=POST action="?action=AccountAdopt" name=form1>从股票帐户提款：<input type=text name=money size=10>');
		document.write ('&nbsp;<input type=submit value="取款" name=submit1>&nbsp;取款手续费[<font color=red>'+Formatnumber(''+Compute(user_infob,2)+'')+'%</font>]</form></div>');
	}
	if (user_info[1]==1)
	{
		document.write ('<div><form method=POST action="?action=AccountDeposit" name=form2>存款到股票帐户：<input type=text name=money size=10>');
		document.write ('&nbsp;<input type=submit value="存款" name=submit2>&nbsp;存款手续费[<font color=red>'+Formatnumber(''+Compute(user_infoc,2)+'')+'%</font>]</form></div>');
	}
	if (user_info[4]==1)
	{
		document.write ('<div><form method=POST action="?action=AccountTransfer" name=form3>过户：');
		document.write ('<input type=text name=XianJin size=10>&nbsp;元 给：');
		document.write ('<input type=text name=MingCheng size=10>&nbsp;<input type=submit value="过户" name=submit2>&nbsp;过户手续费[<font color=red>'+Formatnumber(''+Compute(user_infod,2)+'')+'%</font>]</form></div>');
	}
	document.write ('<font color=red>请注意:论坛帐户资金与股市虚拟资金的兑换比例为<b>1:'+Compute(user_infoa,0)+'</b></font><br><br></td></tr>');
	document.write ('</table>');
}
function mymanage_myinfo()
{
	if (ranksecret==0){ranksecreta='checked';ranksecretb='';}else{ranksecreta='';ranksecretb='checked';}
	if (tradesecret==0){tradesecreta='checked';tradesecretb='';}else{tradesecreta='';tradesecretb='checked';}
	if (transfersecret==0){transfersecreta='checked';transfersecretb='';}else{transfersecreta='';transfersecretb='checked';}
	document.write ('<table class=a2 width='+assignwidth+' cellspacing=1 cellpadding=3 align=center border=0>');
	document.write ('<tr><td colspan=2 height=25 align=center class=a1>-=> 帐 户 设 置 <=-</td></tr>');
	document.write ('<form method=post action="?action=SaveMyInfo">');
	document.write ('<tr><td class=a3 width="50%"><u>过户设置</u><br>是否接收其他股民过户</td>');
	document.write ('<td class=a3>&nbsp;<input type=radio name="transfersecret" value=1 '+transfersecretb+'>是&nbsp;<input type=radio name="transfersecret" value=0 '+transfersecreta+'>否</td></tr>');
	document.write ('<tr><td class=a4><u>股市帐户名称保护</u><br>如果可能是否取得经营权，股市首页为不显示您的名称其它页面为星号代替</td>');
	document.write ('<td class=a4>&nbsp;<input type=radio name="ranksecret" value=1 '+ranksecretb+'>是&nbsp;<input type=radio name="ranksecret" value=0 '+ranksecreta+'>否</td></tr>');
	document.write ('<tr><td class=a3><u>交易保密默认设置</u><br>默认交易时是否显示您的名称</td>');
	document.write ('<td class=a3>&nbsp;<input type=radio name="tradesecret" value=1 '+tradesecretb+'>是&nbsp;<input type=radio name="tradesecret" value=0 '+tradesecreta+'>否</td></tr>');
	document.write ('<tr><td colspan=2 class=a4 align="center"><input type=submit name=submit value="提交">&nbsp;&nbsp;<input type=reset name=submit value="重填"></td></tr>');
	document.write ('</form>');
	document.write ('</table>');
}