<%@ Page Language="C#" MasterPageFile="~/home/main.Master" AutoEventWireup="true"
    Codebehind="myImg.aspx.cs" Inherits="ZYDN.Web.home.myImg" Title="无标题页" %>

<%@ MasterType VirtualPath="~/home/main.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">



     <div class="rTop_1">
    </div>
    <div class="rTop_2">
        <div class="topOptionList" style="width: 100%;">
            <div style="width: 5px; float: left;">
            </div>
            <div class="optionCar_1">
                <a href="myFavorite.aspx">我的收藏</a>
            </div>
            <div class="optionCar">
               <a href="myImg.aspx">我上传的图片</a>
            </div>
            <div class="optionCar_1">
             <a href="myUpFile.aspx">我上传的文件</a>
            </div>
        </div>
        <div class="topOptionListBody">
        
        
        


<%--    <div id="R_BGDIV">
        <div id="R_Top">
        </div>--%>
        <div style="width: 690px; overflow:hidden;">
            <form id="form1" runat="server">
                <asp:Repeater ID="myImgList" runat="server">
                    <ItemTemplate>
                        <div class="imgb" id="imgDiv" name="imgDiv" imgid="<%# DataBinder.Eval(Container, "DataItem.id")%>">
                            <div class="imgup">
                                <img height="120" alt="上传日期: <%# DataBinder.Eval(Container,"DataItem.UpDateTime") %>
<%# DataBinder.Eval(Container,"DataItem.fileTitle") %>
点击修改图片说明" src="<%# DataBinder.Eval(Container,"DataItem.FilePath")%>" />
                            </div>
                            <%# DataBinder.Eval(Container, "DataItem.SourceName")%>
                            <br />
                            大小:<%# DataBinder.Eval(Container, "DataItem.FileSize")%>字节
                            <div style="background-color: #efefef; padding: 3px; display:none;top: 0px; left: 0px;" name="imgDiv<%# DataBinder.Eval(Container, "DataItem.id")%>"
                                id="imgDiv<%# DataBinder.Eval(Container, "DataItem.id")%>">
                                <div style="text-align: center;">
                                    标题:<input onblur="isDisplay=1" onfocus="isDisplay=0" onchange="upImgTitle(this)"
                                        imgid="<%# DataBinder.Eval(Container, "DataItem.id")%>" title='标题' isv='1' max="250"
                                        type="text" value='<%# DataBinder.Eval(Container, "DataItem.fileTitle")%>' style="width: 150px;">
                                </div>
                                <div style="text-align: center;">
                                    简介:<textarea onblur="isDisplay=1" onfocus="isDisplay=0" onchange="upImgCBS(this)"
                                        imgid="<%# DataBinder.Eval(Container, "DataItem.id")%>" title='简介' isv='1' max="250"
                                        cols='2' style="width: 150px; height: 60px;"><%# DataBinder.Eval(Container, "DataItem.fileCBS")%></textarea>
                                </div>
                                <div style="text-align: center;">
                                    <input onclick="closIMBDIV(<%# DataBinder.Eval(Container, "DataItem.id")%>)" type="button"
                                        value='关闭' class='inputText' style="height: 18px;" title="关闭时会更新你设置的标题和说明">
                                </div>
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
                <div style="width: 100%; clear: both; height: 5px;">
                </div>
                <asp:Button ID="pageUp" runat="server" Text="上一页" CausesValidation="False" Enabled="False"
                    UseSubmitBehavior="False" />
                <asp:Button ID="pageDown" runat="server" Text="下一页" CausesValidation="False" UseSubmitBehavior="False" />
                <asp:Label ID="pageLabel" runat="server" Text="Label"></asp:Label><asp:Label ID="timerText"
                    runat="server" Text="Label"></asp:Label>
                <font color="#000ff">点击图片, 为图片设置标题和说明, 让你的图片更易于理解.</font>
            </form>
            </div>

    </div>
    </div>
    <div class="rTop_3">
    </div>
      
            <script language="javascript" type="text/javascript">
    
    var thisimgID=0;
    var isDisplay=1;
    
    function loadImgDiv(){
     
       var objs= document.getElementsByName("imgDiv");
       $("h_bodyRight").style.overflow="visible";
      
       for (var x=0;x<objs.length;x++){
//        
           objs[x].onclick=function(){
                if (isDisplay==0){
                    return;
                }
                thisimgID=this.imgid;
                var left=getLeft(this);
//                var top=getTop(this)+Element.getHeight(this)-180;
                var top=getTop(this)+2;
                var obj=$("imgDiv"+this.imgid);
                
                 if (obj.style.display=="none"){
                    //alert(top);
                    obj.style.cssText="filter:Alpha(Opacity=80);background-color:#efefef;padding:3px;width:200px;position:absolute;display:block;top:"+top+";left:"+left+";";
                    obj.style.left=left;
                    obj.style.position="absolute";
                  //  alert(getTop(obj));
                }else{
                    closIMBDIV(this.imgid);
                }
           } 
           
//           objs[x].onmouseout=function(){
//                var left=getLeft(this);
//                var top=getTop(this)+10;
//                var obj=$("imgDiv"+this.imgid);
//                 //  alert(obj);
//                obj.style.cssText="width:200px;position:absolute;display:none;top:"+top+";left:"+left+";";
//           } 
           
             
       }
    }
    
    function closIMBDIV(id)
    { 
    
         var obj=$("imgDiv"+id);
       
        obj.style.display="none";
        //alert(obj.style.cssText);
        isDisplay=0;
        setTimeout("isDisplay=1",500);
        
        
    }
    
    function upImgTitle(obj){
        if (thisimgID==obj.imgid){
            var v=obj.value;
            
            if (v.indexOf(c1)!=-1|v.indexOf(c2)!=-1 | v.indexOf("'") !=-1 ){
                alert("不能填写特殊字符")
                return;
            }
            if (v.length>250){
               alert("长度不能超过250")
                return;
            }
           	var objAjax=new JAjax();
	        var objResponse=new JHttpResponse();
	        objResponse.write("v",v);
	        objResponse.write("id",thisimgID);
	        var out=objAjax.getText("post","../webServer.aspx?type=upIMGTITLE",objResponse,null);
	        if (out=="-1"){
	            alert("图片ID非法");
	        }else if (out!="1"){
	            alert(erStr(out));
	        }

        }
    }
    
    function  upImgCBS(obj){
   
     if (thisimgID==obj.imgid){
            var v=obj.value;
            
            if (v.indexOf(c1)!=-1|v.indexOf(c2)!=-1 | v.indexOf("'") !=-1 ){
                alert("不能填写特殊字符")
                return;
            }
            if (v.length>250){
               alert("长度不能超过250")
                return;
            }

           	var objAjax=new JAjax();
	        var objResponse=new JHttpResponse();
	        objResponse.write("v",v);
	        objResponse.write("id",thisimgID);
	        var out=objAjax.getText("post","../webServer.aspx?type=upIMGCBS",objResponse,null);
	        if (out=="-1"){
	            alert("图片ID非法");
	        }else if (out!="1"){
	            alert(erStr(out));
	        }
        }
    }
    
    
    loadImgDiv();
            </script>

       <%-- </div>--%>
    <%--</div>--%>
    <%--<div id="R_Bottom">
    </div>--%>
</asp:Content>
