<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="facelist.aspx.cs" EnableViewState="false" Inherits="ZYDN.Web.webUser.facelist" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>头像列表</title>
    <style type="text/css">
    .tdclass{text-align:center;border:solid 3px #FFFFFF;height:120px;vertical-align:bottom;}
    .topclass{vertical-align:top;border:solid 1px #898c95;height:100px;}
    .btnclass{vertical-align:bottom;padding-top:3px;padding-bottom:2px;}
    .divclass{border:solid 1px #898c95;padding:5px;height:125px;background-color:#EFEFEF;}
    .btclass{text-align:left;padding:5px;}
    body{margin-left:0px; margin-top:0px;}
    .oushutd{border-bottom:1px #cccccc solid;font-size:13px;text-align:left;color:#01439a;line-height:20px;background-color:#F0F5FB;padding-left:10px;padding-right:5px;}
    </style>
    <script language="javascript" type="text/javascript" src="../system/JS/JFramework.js"></script>
    <script language="javascript" type="text/javascript" src="../system/JS/Sys.js"></script>
    <script language="javascript" type="text/javascript">
    //读取头像信息
    function readFace(){
              var objAjax=new JAjax();
              var out=objAjax.getText("post","facelist.aspx?type=read","",null);
              var str="";
              if(out=="0"||out==""||out==null)
              { 
                str+="<table style='border:solid 1px #cccccc; width:600px; height:575px;' cellpadding='0' cellspacing='0'><tr><td class='oushutd'>当前有0个头像供你选择</td><tr><tr><td style='color:red;vertical-align:top;font-size:13px;padding:5px;height:535px;'>当前没有可供选择的头像<span style='cursor:hand;color:blue;' onclick='window.close();' title='关闭'>关闭</span></td></tr></table>"; 
              }
              else
              {
                var outsplit=out.split(c1);
               
                for(var i=0;i<outsplit.length-1;i++)
                    {
                        if(parseInt(i)>0)
                        {
                              if(parseInt(i)%5==0)
                              {
                                 str+="</tr><tr><td class=\"tdclass\"><div class='divclass' onmouseleave='leave(this)' onmouseover='over(this)'><div class='topclass'><div style=\"height:100px; width:100px;\"><img src=\""+outsplit[i]+"\" onload=\"setImgWH(this)\" /></div></div><div class='btnclass'><input id='"+outsplit[i]+"' onclick='sel(this)' type='button' value='选择' title='选择'/></div></div></td>";
                              }
                              else
                              {
                                 str+="<td class=\"tdclass\"><div class='divclass' onmouseleave='leave(this)' onmouseover='over(this)'><div class='topclass'><div style=\"height:100px; width:100px;\"><img src=\""+outsplit[i]+"\" onload=\"setImgWH(this)\" /></div></div><div class='btnclass'><input id='"+outsplit[i]+"' onclick='sel(this)' type='button' value='选择' title='选择'/></div></div></td>";
                              }
                         }
                         else
                         {
                             str+="<table style='border:solid 1px #cccccc' cellpadding='0' cellspacing='0'><tr><td class='oushutd' colspan='5'>当前有"+(outsplit.length-1)+"个头像供你选择</td><tr><tr><td class=\"tdclass\"><div class='divclass' onmouseleave='leave(this)' onmouseover='over(this)'><div class='topclass'><div style=\"height:100px; width:100px;\"><img  src=\""+outsplit[i]+"\" onload=\"setImgWH(this)\" /></div></div><div class='btnclass'><input type='button' id='"+outsplit[i]+"' onclick='sel(this)' style='cursor:hand;' value='选择' title='选择'/></div></div></td>";
                         }
                }
          }
           $("showMagList").innerHTML=str; 
    }
    function leave(obj){
      obj.style.backgroundColor="#EFEFEF";
    }
    function over(obj){
      obj.style.backgroundColor="#DFDFFF";
    }
    function sel(obj){
       window.returnValue=obj.id;
       window.close();
       }
    </script>
</head>
<body onload="readFace()">
    <form id="form1" runat="server">
    <div>
    <div id="showMagList" style=" width:620px; height:575px; overflow-y:scroll;"></div>
    </div>
    </form>
</body>
</html>