<%@ Page Language="C#" Buffer="false" AutoEventWireup="true" CodeFile="SetTheme.aspx.cs" Inherits="Admin_SetTheme" %>
<%@ Import Namespace="Spaces" %>


<html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="myHtml">
<head>
<title><%=Globals.Text["SelectTemplate_Title"]%></title>
<link href="Admin.css" rel="stylesheet" type="text/css">
    <link rel="StyleSheet" href="<%=Globals.ApplicationPath %>/Include/base.css">
    <script src="<%=Globals.ApplicationPath %>/Include/js/base.js" type="text/javascript"></script>
    <script src="<%=Globals.ApplicationPath %>/Include/js/dialog.js" type="text/javascript"></script>
    <script src="<%=Globals.ScriptPath %>/ThemeData.js"></script>
</head>
<body>
<table  cellspacing="0" cellpadding="0" width="640"
        align="center" border="0">
  <tbody>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><table cellspacing="0" cellpadding="0" width="100%" border="0">
          <tbody>
            <tr>
              <td width="3" height="3"><img height="3" src="img/O_angle_up_left.gif" width="3" /></td>
              <td width="100%" bgcolor="#acd373"></td>
              <td width="3"><img height="3" src="img/O_angle_up_right.gif" width="3" /></td>
            </tr>
          </tbody>
        </table></td>
    </tr>
    <tr>
      <td bgcolor="#acd373" height=30>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffffff"><B><%=Globals.Text["SelectTemplate_SetStyle"]%></B></font> </td>
    </tr>
    <tr>
      <td class="form_border"><table cellspacing="0" cellpadding="0" width="100%" border="0">
          <tbody>
            <tr>
              <td width="20">&nbsp;</td>
              <td>&nbsp;</td>
              <td width="20">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><table   cellspacing="0" cellpadding="0" width="100%"
                                        border="0">
                  <tbody>
                    <tr>
                      <td align="right"></td>
                    </tr>
                    <tr>
                      <td><fieldset>
                        <legend>&nbsp;<span class="STYLE4"><%=Globals.Text["SetTheme_ChoiceInterface"]%></span>&nbsp;</legend>
                        <div align="right"> <%=Globals.Text["SetTheme_SaveInterface"]%><br />
                          <br />
                        </div>
                        </fieldset></td>
                    </tr>
                    <tr>
                      <td height="5"><table><tr>
                                                <td style="display:none"><a href="selectTemplate.aspx"><%=Globals.Text["SetTheme_SetTemp"]%></a></td>
                                                <td><a href="setTheme.aspx"><%=Globals.Text["SetTheme_SetInterface"]%></a></td>
                                                </tr></table></td>
                    </tr>
                    <tr>
                      <td><table width="100%"  border="0" cellspacing="0" cellpadding="3"   bgcolor="#FFFFFF">
                          <tr>
                            <td height="26" colspan="2" bgcolor="#669900"><span class="STYLE1"> &nbsp;<span class="STYLE3"><%=Globals.Text["SetTheme_InterfaceCategory"]%></span></span></td>
                          </tr>
                        </table>
                 
                        <div id ="themeClass"></div>
                    
                        </td>
                    </tr>
                  </tbody>
                </table></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#009900">
                  <tr>
                    <td height="20" bgcolor="#acd373">&nbsp;<%=Globals.Text["SetTheme_ClearTitle"]%></td>
                  </tr>
                  <tr>
                    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                        <tr>
                          <td>        <form name="themeForm" id="themeForm" action="SetTheme.aspx" method="post"><div id="ThemesBucket" style="overflow: auto; overflow-x: hidden; overflow-y:auto;
                                                               width: 100%; height: 370px; border: solid 1px #669900;"></div>
                          </form> 
                        </tr>
                      </table></td>
                  </tr>
                </table>              </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td align="right">
                  </td>
              <td>&nbsp;</td>
            </tr>
          </tbody>
        </table></td>
    </tr>
    <tr>
      <td align="center" bgcolor="#e3f0d0" height="30">&nbsp;&nbsp; </td>
    </tr>
 
  </tbody>
</table>
<img id="hideImg" width="0" height="0" />
<script>
var defClassName='合成图画';
function $(s){return document.getElementById(s);}
 function initShow(dcn)
 {

 var str='<table width="100%" border="0" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF">\r\n<tr>';
var style='';
  for(var i=0;i<Themes.length;i++)
  {	
    if(dcn==Themes[i].ClassName)
    style='bgcolor="#ACD373"';
     else
     style='bgcolor="#EEF5E2"';
  str+='<td '+style+' width="20%"><a style="cursor:hand" href="javascript:void(0);" onclick="selClass('+i+')"  info="'+Themes[i].ClassName+'">'+Themes[i].ClassName+'</a></td>';
   if(i!=0&&(i+1)%5==0)
   {
     str+='</tr>\r\n<tr>';
    }
    
  }
  str+='</tr></table>';
  $("themeClass").innerHTML=str;
 }
 selClass(2);
 function selClass(vi)
 {
 var v=Themes[vi].ClassName;
 initShow(v);
 //alert(v.info);
 var curr=-1;
 if(v==null)
 curr=9;
   else{
	for(var i=0; i<Themes.length;i++) //获取当前选择索引
	{
	  if(Themes[i].ClassName==v)
	  curr=i;
	}}
	var items=Themes[curr].Items;
	var str='';
	var imgstr='<tr>';
	var namestr='<tr>';
	str='<table width="100%" border="0" cellspacing="0" cellpadding="2">';
    
	for(var j=0;j<items.length;j++)
	{ 
	 $img=new Image();
	    $img.src=items[j].Image;
	    
	  imgstr+='<td><img  id="themeImg'+j+'" src="'+items[j].Image+'" width="60" height="60" style="border:1px solid #cccccc" /></td>';
	  namestr+='<td><span class="STYLE1"><input type="radio" name="radioSetectTheme" value="'+items[j].Name+'" onclick="selectTheme(this)" /><label for="pSummary">'+getstr(items[j].Title,8)+'</label></span></td>';
	  if(j!=0&&(j+1)%4==0)
	  {
	  imgstr+='</tr>\r\n<tr>';
	  namestr+='</tr>\r\n<tr>';
	  str+=imgstr+namestr;
	  imgstr='';
	  namestr='';
	  }
	 
	}
	imgstr+='</tr>';
	namestr+='</tr>';
	str+=imgstr+namestr;
	$("ThemesBucket").innerHTML=str+'</table>';
	 
 }
 function getstr(v,l)
 {
  if(v.length>l)
   {
    return v.substring(0,l)+'..';
   }
   return v;
 }
 function selectTheme(v)
 {
var f=$("themeForm");
f.target = "iframe_data";
f.submit();
 }
 function initPage()
 {
  for(var i=0;i<Themes.length;i++)
  {	
    var items=Themes[i].Items;
    for(var v=0;v<items.length;v++)
    {
       var img=new Image(60,60);
	   img.src=items[v].Image; 
    }
  }
  initShow(defClassName);
 }
 AddObjEvent(this,'load',initPage);
</script>

  <iframe name="iframe_data" id="iframe_data" style="display:none" ></iframe>
</body>
</html>
