
<%@ Register TagPrefix="uc1" TagName="UIHead" Src="Controls/UIHead.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UIFrameTop" Src="Controls/UIFrameTop.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UIFrameLeft" Src="Controls/UIFrameLeft.ascx" %>
<%@ Page CodeBehind="Search.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.Search" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>

<script src="js/calendar.js" type=text/javascript></script>

<script language=javascript>
   var CalendarWebControl = new atCalendarControl();
		</script>
</HEAD>
<body class=body_1 scroll=no>
<table 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 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"></uc1:uiframeleft></td>
          <td class=frame_body_1 vAlign=top>
            <script language=javascript>
function isnumber(strNumber){	return !isNaN(strNumber - 0);}
function oncheckphoto(){
	if (document.Form1.key.value==""){
		window.alert("请输入关键字");
		document.Form1.key.focus();
		return false;
	}
	if (!isnumber(document.Form1.size1.value)){
		window.alert("文件大小只能为数值。");
		document.Form1.size1.focus();
		return false;
	}
	if (!isnumber(document.Form1.size2.value)){
		window.alert("文件大小只能为数值。");
		document.Form1.size2.focus();
		return false;
	}
	if (!isnumber(document.Form1.width.value)){
		window.alert("文件尺寸只能为数值。");
		document.Form1.width.focus();
		return false;
	}
	if (!isnumber(document.Form1.height.value)){
		window.alert("文件尺寸只能为数值。");
		document.Form1.height.focus();
		return false;
	}
	if ((document.Form1.lasttime1.value!="") && (document.Form1.lasttime2.value!="") && (document.Form1.lasttime1.value)>=(document.Form1.lasttime2.value)){
		window.alert("开始日期不能大于结束日期。");
		return false;
	}
}
function oncheckalbum(){
	if (document.Form1.albumkey.value==""){
		window.alert("请输入关键字");
		document.Form1.albumkey.focus();
		return false;
	}
	if ((document.Form1.lasttime3.value!="") && (document.Form1.lasttime4.value!="") && (document.Form1.lasttime3.value)>=(document.Form1.lasttime4.value)){
		window.alert("开始日期不能大于结束日期。");
		return false;
	}
	return true;
}
function Result() 
{ 
    var kind=document.getElementById("kind1");
    if (kind.value!="全部") Typhoto.Search.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)
        {                 
			document.all("kind2").options.add(new Option("全部","全部"));   
            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));
　　　　    }
        }
    }                
    return
}
function Result1() 
{ 
    var kind=document.getElementById("kind3");
    if (kind.value!="全部") Typhoto.Search.GetKind2All(kind.value,get_Result1_CallBack);
}

function get_Result1_CallBack(response)
{
    if (response.value != null)
    {
        document.all("kind4").length=0;　　　　            
　　　　var ds = response.value;
        if(ds != null && typeof(ds) == "object" && ds.Tables != null)
        {                 
			document.all("kind4").options.add(new Option("全部","全部"));   
            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("kind4").options.add(new Option(name,id));
　　　　    }
        }
    }                
    return
}
</script>
<form id=Form1 name=Form1 method=get runat="server">
            <table cellSpacing=0 cellPadding=0 width="100%" border=0>
              <tr>
                <td class=main_title_1 height=32>
                  <table height="100%" cellSpacing=0 cellPadding=0 width="99%" 
                  border=0>
                    <tr>
                      <td align=left><IMG src="images/icon_search.gif" align=absMiddle >&nbsp; <A class=link_1 href="Album_Photos.aspx" >照片搜索</A></td>
                      <td align=right><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>
                  <div class=main_content_2>
<table cellSpacing=3 cellPadding=0 border=0 
                  >
                    <tr>
                      <td width=80 height=27>关键字：</td>
                      <td><input class=kuan id=key 
                        type=text size=36 name=key 
                        runat="server"> <select class=kuan id=phototype 
                         runat="server"> <option 
                          value=title selected >在标题中搜索</option> <option 
                          value=remark>简介中搜索</option> 
                          <option value=all 
                          >在标题和简介中搜索</option> <option 
                          value=tag 
                      >在标签中搜索</option></select></td></tr>
                    <tr>
                      <td>共享类型：</td>
                      <td><select name="select" id=share1 runat="server">
                        <option selected value="">全部</option>
                        <option value="0">未共享</option>
                        <option value="1">对所有人共享</option>
                        <option value="2">共享给好友</option>
                        <option value="3">凭密码访问</option>
                        <option value="4">共享给指定人</option>
                      </select>
                      </td>
                    </tr>
                    <tr>
                      <td>分类：</td>
                      <td><SELECT class=kuan id=kind1 
                        onchange=Result(); name=kind1 runat="server" 
                        ></SELECT> <SELECT class=kuan 
                        id=kind2 
                        onchange=javascript:document.all.hidkind2.value=this.value; 
                        name=kind2><option value=全部 
                          selected>全部</option></SELECT></td></tr>
                    <tr>
                      <td>文件类型：</td>
                      <td><select class=kuan id=ext 
                        name=ext runat="server"> <option 
                          value="" selected>不限</option> 
                        <option value=jpeg,jpg 
                          >JPEG/JPG</option> <option 
                          value=gif>GIF</option> <option 
                          value=bmp>BMP</option></select>                    </td></tr>
                    <tr>
                      <td>文件大小：</td>
                      <td><input class=kuan id=size1 
                        type=text size=12 name=size1 
                        runat="server">KB - <input class=kuan id=size2 type=text 
                        size=12 name=size2 
                        runat="server">KB <font color=gray 
                        >不填则不限制大小</font></td></tr>
                    <tr>
                      <td>照片尺寸：</td>
                      <td>宽<input class=kuan id=width 
                        type=text size=10 name=width 
                        runat="server">高 <input class=kuan id=height type=text 
                        size=10 name=height runat="server"> 
                        <font color=gray 
                        >不填则不限制尺寸(单位：像素)</font></td></tr>
                    <tr>
                      <td>上传时间：</td>
                      <td><input class=kuan id=lasttime1 
                        onfocus=CalendarWebControl.show(this,this.value); 
                        type=text size=12 name=lasttime1 
                        runat="server"> - <input class=kuan id=lasttime2 
                        onfocus=CalendarWebControl.show(this,this.value); 
                        type=text size=12 name=lasttime2 
                        runat="server"></td></tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td><input class=button1 id=Submit1 onClick="return oncheckphoto();" type=submit value=" 搜 索 " name=bsubmit runat="server" onserverclick="Submit1_ServerClick"><INPUT 
                        id=hidkind2 type=hidden size=1 name=hidkind2 
                        runat="server" 
                  ></td></tr></table>
                  </div></td></tr>
              <tr>
                <td class=main_title_1 height=32>
                  <table height="100%" cellSpacing=0 cellPadding=0 width="99%" 
                  border=0>
                    <tr>
                      <td align=left><IMG src="images/icon_search.gif" align=absMiddle >&nbsp; <A class=link_1 href="Album_List.aspx" >相册搜索</A></td>
                      <td align=right><A href="javascript:history.back();" ></A></td>
                    </tr></table></td></tr>
              <tr>
                <td class=main_content_1 vAlign=top>
                  <div class=main_content_2>
				  <table cellSpacing=3 cellPadding=0 border=0 
                  >
                    <tr>
                      <td width=80 height=27>关键字：</td>
                      <td><input class=kuan id=albumkey 
                        type=text size=36 name=albumkey 
                        runat="server"> <select class=kuan id=albumtype 
                         runat="server"> <option 
                          value=title selected >在标题中搜索</option> <option 
                          value=remark>简介中搜索</option> 
                          <option value=all 
                          >在标题和简介中搜索</option> <option 
                          value=tag 
                        >在标签中搜索</option></select> </td></tr>
                    <tr>
                      <td>共享类型：</td>
                      <td><select name="select2" id=share2 runat="server">
                        <option selected value="">全部</option>
                        <option value="0">未共享</option>
                        <option value="1">对所有人共享</option>
                        <option value="2">共享给好友</option>
                        <option value="3">凭密码访问</option>
                        <option value="4">共享给指定人</option>
                      </select></td>
                    </tr>
                    <tr>
                      <td>分类：</td>
                      <td><SELECT class=kuan id=kind3 
                        onchange=Result1(); name=kind3 runat="server" 
                        ></SELECT> <SELECT class=kuan 
                        id=kind4 
                        onchange=javascript:document.all.hidkind4.value=this.value; 
                        name=kind4><option value=全部 
                          selected>全部</option></SELECT></td></tr>
                    <tr>
                      <td>创建时间：</td>
                      <td><input class=kuan id=lasttime3 
                        onfocus=CalendarWebControl.show(this,this.value); 
                        type=text size=12 name=lasttime3 
                        runat="server"> - <input class=kuan id=lasttime4 
                        onfocus=CalendarWebControl.show(this,this.value); 
                        type=text size=12 name=lasttime4 
                        runat="server"></td></tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td><input class=button1 id=Submit2 onClick="return oncheckalbum();" type=submit value=" 搜 索 " name=bsubmit runat="server" onserverclick="Submit2_ServerClick"><INPUT 
                        id=hidkind4 type=hidden size=1 name=hidkind4 
                        runat="server" 
                  ></td></tr></table>
                  </div></td></tr>
              <tr>
                <td class=main_title_1 height=32 
              ></td></tr></table></form>
<script>
for(var i=0; i<document.Form1.kind1.length; i++)
{
　　var name=document.Form1.kind1.options[i].text;
　　var id=document.Form1.kind1.options[i].value;
　　document.all("kind3").options.add(new Option(name,id));
}
</script></td></tr></table></td></tr></table>
	</body>
</HTML>
