<%@ Register TagPrefix="uc1" TagName="UIFrameLeft" Src="Controls/UIFrameLeft.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UIFrameTop" Src="Controls/UIFrameTop.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UIHead" Src="Controls/UIHead.ascx" %>

<%@ Page CodeBehind="Album_Detail.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.Album_Detail" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">

<script>
function SetScript(info) 
{ 
   document.getElementById('Layer5').innerHTML=info;
   document.getElementById('success').style.display ='';
   window.setTimeout("document.getElementById('success').style.display ='none';",3000);
}
</script>
</HEAD>
<body class=body_1 scroll=no>
	<div id="success" style="MARGIN-TOP:-80px;DISPLAY:none;Z-INDEX:300;LEFT:50%;MARGIN-LEFT:-150px;WIDTH:284px;POSITION:absolute;TOP:50%;HEIGHT:50px">
	<div id="Layer2" style="BORDER-RIGHT:#000000 1px solid;BORDER-TOP:#000000 1px solid;FONT-SIZE:14px;Z-INDEX:300;BORDER-LEFT:#000000 1px solid;WIDTH:270px;BORDER-BOTTOM:#000000 1px solid;POSITION:absolute;HEIGHT:50px;BACKGROUND-COLOR:#ffffae">
		<div id="Layer5" style="PADDING-RIGHT:3px;PADDING-LEFT:3px;PADDING-BOTTOM:0px;LINE-HEIGHT:150%;PADDING-TOP:10px;HEIGHT:30px" align="center">11</div>
	</div>
</div>
<table id=Table1 height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
  <tr>
    <td height=60><uc1:uihead id=UIHead1 runat="server"></uc1:uihead></td></tr>
  <tr>
    <td height=10><uc1:uiframetop id=UIFrameTop1 runat="server"></uc1:uiframetop></td></tr>
  <tr>
    <td>
      <table id=Table2 height="100%" cellSpacing=0 cellPadding=0 width="100%" 
      border=0>
        <tr>
          <td class=frame_left_1 vAlign=top width=193><uc1:uiframeleft id=UIFrameLeft1 runat="server" Current="CreateAlbum"></uc1:uiframeleft></td>
          <td class=frame_body_1 vAlign=top>
            <table cellSpacing=0 cellPadding=0 width="100%" border=0 
            >
              <tr>
                <td class=main_title_1 height=32>
                  <table cellSpacing=2 cellPadding=3 width="100%" border=0 
                  >
                    <tr>
                      <td><IMG src="images/icon_album.gif" align=absMiddle >&nbsp; <asp:label id=lAlbumName Runat="server">创建</asp:label>相册</td>
                      <td width=56><A href="javascript:history.back();" ><IMG src="images/link_back.gif" align=absMiddle ></A></td></tr></table></td></tr>
              <tr>
                <td class=main_content_1 vAlign=top>
                  <form id=Form1 name=Form1 method=post 
                  runat="server">
                  <table cellSpacing=3 cellPadding=0 border=0 
                  >
                    <tr>
                      <td width=80 height=27>&nbsp;名称：</td>
                      <td><span class=pad 
                        ><input name=dirname 
                        type=text class=kuan id=dirname size="30" 
                        runat="server"> 
                      <asp:requiredfieldvalidator id=RequiredFieldValidator1 runat="server" Display="Dynamic" ControlToValidate="dirname" ErrorMessage="请输入名称"></asp:requiredfieldvalidator></span></td></tr>
                    <tr>
                      <td height=27>&nbsp;分类：</td>
                      <td><select id=kind1 
                        onchange=Result(); name=kind1 
                        runat="server"></select> <select id=kind2 name=kind2 
                         runat="server" onChange="javascript:document.all.hidkind.value=document.all.kind2.value;"></select> </td></tr>
                    <TR>
                      <TD height=27><FONT face=宋体>&nbsp;标签：</FONT></TD>
                      <TD><FONT face=宋体><INPUT class=kuan id=tag type=text 
                        name=tag runat="server">&nbsp;<IMG 
                        alt="一般用相片拍摄的时间、 地点、 人物、 事件来作为标签,多个标签使用半角空格分开，以便于其它人索引" 
                        src="Images/wenhao.gif" align=absMiddle><INPUT id=hidtag 
                        type=hidden size=1 name=hidtag 
                    runat="server"></FONT></TD></TR>
                    <tr>
                      <td>&nbsp;简介：</td>
                      <td><span class=pad 
                        ><textarea class=kuan id=note name=note rows=5 cols=50 runat="server"></textarea> 
                        </span></td></tr>
                    <tr>
                      <td>&nbsp;共享设置：</td>
                      <td><input name="share" id="click0" type="radio" value="0" onClick="javascript:document.all.tbfriends.style.display='none';document.all.pass.style.display='none';" runat="server">
                        <label runat="server" for="click0"> 不共享</label>
                        <font color="gray">除自己登录外任何人均不可访问。</font><br>
                        <input name="share" type="radio" id="click1" onClick="javascript:document.all.tbfriends.style.display='none';document.all.pass.style.display='none';" value="1" runat="server">
                        <label runat="server" for="click1"> 对所有人共享</label>
                        <font color="gray">相册将可以被所有用户访问。</font> <br>
                        <input type="radio" name="share" value="2" id="click2" onClick="javascript:document.all.tbfriends.style.display='none';document.all.pass.style.display='none';" runat="server">
                        <label runat="server" for="click2">共享给我的好友</label>
                        <font color="gray">相册将可以被我的好友访问。<br>
                        <input type="radio" name="share" value="3" id="click3" onClick="javascript:document.all.tbfriends.style.display='none';document.all.pass.style.display='';document.all.openpass.focus();" runat="server">
                        </font>
                        <label runat="server" for="click3">凭密码访问</label>
                        <font color="gray">输入正确密码者可以访问。</font><span id=pass>输入密码：
                        <input name="openpass" id="openpass" type="text" size="10" runat="server">
                        </span>
                        <br><input type="radio" name="share" value="4" id="click4" onClick="javascript:document.all.tbfriends.style.display='';document.all.pass.style.display='none';document.all.sharesee.focus();" runat="server">
                        <label for="click4">共享给指定人</label>
                        <font color="gray">将仅可以被下面名单中的用户访问。</font></td>
                    </tr>
                    <tr>
                      <td></td>
                      <td><table id="tbfriends" runat="server">
                        <tr>
                          <td colspan="2"><input name="sharesee" type="text" id="sharesee" size="32" >
                              <input type="button" name="bentry" value="添加至共享名单" id=Button1 onClick="javascript:document.all.person.options[document.all.person.length]=new Option(document.all.sharesee.value,document.all.sharesee.value);" class=button1></td>
                        </tr>
                        <tr>
                          <td><select name="select" size="5" multiple id="person" style="WIDTH:320px" runat="server">
                          </select></td>
                          <td><input type="button" name="bdelete" value="删除" id=Button2 onClick="javascript:document.all.person.options[document.all.person.selectedIndex]=null" class=button1>
                              <br>
                            <br>
                              <input type="button" name="bclear" value="清空" id=Button3 onClick="javascript:document.all.person.length=0" class=button1>
                            <br>                          </td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td>默认排序：</td>
                      <td><select name="order" runat="server" id="order">
                        <option value="" selected>系统自动处理</option>
                        <option value="ID|Desc">按上传日期[最近的]</option>
                        <option value="ID|ASC">按上传日期[最早的]</option>
                        <option value="(Width * Height)|Desc">按图片尺寸[最大的]</option>
                        <option value="(Width * Height)|ASC">按图片尺寸[最小的]</option>
                        <option value="FileSize|Desc">按图片大小[最大的]</option>
                        <option value="FileSize|ASC">按图片大小[最小的]</option>
                        </select></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td><input class=btn id=Submit1 type=button value=" 确 定 " name=bsubmit onClick="listperson();" runat="server" onserverclick="Submit1_ServerClick">
                        <input name="hiddir" type="hidden" id="hiddir" runat="server"><INPUT 
                        id=hidsharesee type=hidden size=1 name=Hidden1 
                        runat="server">
                        <input type="hidden" name="hidkind" id="hidkind" runat="server"></td></tr></table>
                  </form></td></tr>
              <tr>
                <td class=main_title_1 height=32 
              >&nbsp;</td></tr></table></td></tr></table></td></tr></table>
		<script>
function listperson()
{
	document.all.hidsharesee.value="";
	var slt=document.forms[0].elements["person"];
	for(var i=0;i<slt.options.length;i++){
		document.all.hidsharesee.value=document.all.hidsharesee.value+slt.options[i].value+",";
	}
}
function getRbGroupValue(rbGroup)
{
	for(var i=0;i<rbGroup.length;i++)
	{
		if(rbGroup[i].checked)	return rbGroup[i].value;
	}
	return false;
}
if (getRbGroupValue(document.all.share)=="0")
{
	document.all.pass.style.display='none';document.all.tbfriends.style.display='none';
}
else if (getRbGroupValue(document.all.share)=="1")
{
	document.all.pass.style.display='none';document.all.tbfriends.style.display='none';
}
else if (getRbGroupValue(document.all.share)=="2")
{
	document.all.pass.style.display='none';document.all.tbfriends.style.display='none';
}
else if (getRbGroupValue(document.all.share)=="3")
{
	document.all.pass.style.display='';document.all.tbfriends.style.display='none';
}
else if (getRbGroupValue(document.all.share)=="4")
{
	document.all.pass.style.display='none';document.all.tbfriends.style.display='';
}
function Result() 
{ 
    var kind=document.getElementById("kind1");
	if (kind.value=='不指定')
	{
		document.all("kind2").length=0;
　　　　document.all("kind2").options.add(new Option('不指定','不指定'));
	}
	else Typhoto.Album_Detail.GetKind2All(kind.value,get_Result_CallBack);
}

function get_Result_CallBack(response)
{
    if (response.value != null)
    {
        document.all("kind2").length=0;　　　　            
　　　　var ds = response.value;
        if(ds != null && typeof(ds) == "object" && ds.Tables != null)
        {                    
            for(var i=0; i<ds.Tables[0].Rows.length; i++)
　　　　    {
　　　　        var name=ds.Tables[0].Rows[i].rootkind1;
　　　　　　    var id=ds.Tables[0].Rows[i].rootkind3;
　　　　　　    document.all("kind2").options.add(new Option(name,id));
　　　　    }
            if (document.all("kind2").options.length == 0) {
                document.all("kind2").options.add(new Option("不指定", "0"));
                document.all.hidkind.value = document.all.kind1.value;
            }
            else document.all.hidkind.value = document.all.kind2.value;
        }
    }                
    return
}

		</script>
	</body>
</HTML>
