﻿// JScript 文件
//控制首页各栏目以及顶部“风格设置”，“版式布局”，“栏目管理”，“辅助设置”，“高级设置”的弹出编辑窗口
function ShowIframe(Url,kuan,gao,title,tag) //显示iframe Url 弹出的页面地址，kuan 宽度 gao 高度 title 弹出层标题 tag 用于AJAX更新的标记
{  
    var pop=new Popup({ contentType:1,isReloadOnClose:false,width:kuan,height:gao});
    pop.setContent("contentUrl",Url);
    pop.setContent("title",title);
    pop.build();
    pop.show();
    //alert(document.getElementById("dialogBoxClose").getAttribute("id"));
    //alert(ajaxName);    
    document.getElementById("dialogBoxClose").onclick=function(){ShowA(tag);};//此处的“ShowA()”要根据不同页面来分别调用相应的方法
}

function ShowIframe3(Url,kuan,gao,title,tag) //显示iframe Url 弹出的页面地址，kuan 宽度 gao 高度 title 弹出层标题 tag 用于AJAX更新的标记
{  
    var pop=new Popup({ contentType:1,isReloadOnClose:false,width:kuan,height:gao});
    pop.setContent("contentUrl",Url);
    pop.setContent("title",title);
    pop.build();
    pop.show();
    if(tag=="neiRC")
    {
        document.getElementById("dialogBoxClose").onclick=function(){parent.window.location.href='UseShowDf.aspx'};
        return;
    }
    
    //alert(document.getElementById("dialogBoxClose").getAttribute("id"));
    //alert(ajaxName);  
    var ds= document.getElementById("hidLayOutTag").value;  
    //alert(ds);neiRC
    document.getElementById("dialogBoxClose").onclick=function(){GetMoreById(tag,ds)};
    //此处的“ShowA()”要根据不同页面来分别调用相应的方法
}

function ShowIframe2(Url,kuan,gao,title,tag) //显示iframe Url 弹出的页面地址，kuan 宽度 gao 高度 title 弹出层标题 tag 用于AJAX更新的标记
{  
    var pop=new Popup({ contentType:1,isReloadOnClose:false,width:kuan,height:gao});
    pop.setContent("contentUrl",Url);
    pop.setContent("title",title);
    pop.build();
    pop.show();
    
   
    if(tag.indexOf("UseShow1")!=-1)
    {
        document.getElementById("dialogBoxClose").onclick=function(){parent.window.location.href='UseShowMR.aspx?dtag='+tag.replace("UseShow1","");}
    }
    else if(tag.indexOf("UseShow2")!=-1)
    {
        document.getElementById("dialogBoxClose").onclick=function(){parent.window.location.href='UseShowDf.aspx';}
    }
    //alert(document.getElementById("dialogBoxClose").getAttribute("id"));
    //alert(ajaxName);
    //document.getElementById("dialogBoxClose").onclick=function(){ShowA(tag);};//此处的“ShowA()”要根据不同页面来分别调用相应的方法
}

function ShowIframe4(Url,kuan,gao,title,tag) //显示iframe Url 弹出的页面地址，kuan 宽度 gao 高度 title 弹出层标题 tag 用于AJAX更新的标记
{  
    var pop=new Popup({ contentType:1,isReloadOnClose:false,width:kuan,height:gao});
    pop.setContent("contentUrl",Url);
    pop.setContent("title",title);
    pop.build();
    pop.show();
    //alert(document.getElementById("dialogBoxClose").getAttribute("id"));
    //alert(ajaxName);
    if(tag=='editindextop')
    document.getElementById("dialogBoxClose").onclick=function(){location.href="index.aspx";};//此处的“ShowA()”要根据不同页面来分别调用相应的方法
}

function setDaoHang()
{      
    ShowIframe4("ShowASP/DaoHang/DangType.aspx",'350','230','导航设置','Dao');  
}


function sunHight()
{
     window.parent.document.getElementById("showDiv").style.height ="650px";
}

function index1000(id)
{      
    ShowIframe("ConstructASP/CPList/PicAdd.aspx?c_id="+id,'650','425','单页图文','');  
} 

function wdp()
{
     ShowIframe2("ShowASP/hdp/hdpJAdd.aspx?",'350','230','幻灯片展示','');
}

function index1000not(id)
{
    ShowIframe("ConstructASP/CPList/PicAdd.aspx?c_id="+id,'650','425','单页图文','');
}

function index1002(id)
{
    ShowIframe("ConstructASP/CPList/PicAdd.aspx?type=2&id="+id,'650','425','图文展示','');
}

function index1004()//回复留言，1121修改跳转页面为admin_re.aspx，原为plList.aspx
{
    ShowIframe('ConstructASP/Admin/admin_re.aspx','650','425','回复留言','');
}

function index100156(type,cid)
{
    if(type=="1001")
    {
        ShowIframe3('ConstructASP/News/NewsAdd.aspx?c_id='+ cid,'650','425','添加新闻',cid);
    }
    else if(type=="1005")
    
    {
        ShowIframe3('ConstructASP/EpicAndDown/EpicAndDownAdd.aspx?c_id='+ cid,'650','425','文件下载',cid);
    }
    else if(type=="1006")
    {  
        ShowIframe3('ConstructASP/SAndD/SAndDAdd.aspx?c_id='+ cid,'650','425','添加供求信息',cid);
    }
}


function indexMrakIng()
{
    //alert("222");
    window.parent.ShowIframe2("ShowASP/Marketing/WMarketing.aspx",'650','425','网站营销','');
}


//新闻编辑层
function newsAdd(id)//id：单条新闻编号
{
    if(id<=0)
    {
        //ShowIframe('../../ConstructASP/SAndD/SAndDAdd.aspx','650','425','添加新闻','');
    }
    else
    {
        ShowIframe('ConstructASP/News/NewsAdd.aspx?id='+id,'650','425','编辑新闻','');
    }    
}

//新闻添加
function newsAddT(cid)//cid：栏目编号
{
    if(cid>0)
    {
        ShowIframe("ConstructASP/News/NewsAdd.aspx?c_id="+cid,'650','425','添加新闻','');
    }
}

//单页图文编辑层
function sigEdit(id,cid,title)//id：单条信息编号，cid：栏目编号，title栏目名称
{
    //alert(id,cid,title);
    if(id>0&&cid>0)
    {
        ShowIframe3("ConstructASP/CPList/PicAdd.aspx?type=1&id="+id + "&c_id=" + cid,'650','400',title,cid);
    }
    else if(id<=0&&cid>0)
    {
        ShowIframe3("ConstructASP/CPList/PicAdd.aspx?type=1&c_id=" + cid,'650','400',title,cid);
    }
}

//连接编辑层
function sigEditLink(id,cid,title)//id：单条信息编号，cid：栏目编号，title栏目名称
{

        ShowIframe3("ConstructASP/CPList/PicAddLink.aspx?type=1&id="+id + "&c_id=" + cid,'650','400',title,cid);

}

//产品信息类页面添加层
function proAdd(cid,title)
{
    if(cid>0)
    {
        ShowIframe3("ConstructASP/CPList/PicAdd.aspx?type=2&c_id="+cid,'650','440',title,cid);
    }
}

//图片信息添加层
function honAdd(cid,title)
{
    if(cid>0)
    {
    
            ShowIframe3("ShowASP/Assistant/csUP.aspx?type=3&c_id="+cid+"&title="+title,'500','400',title,cid);
    }
    else
    {
        //window.EditFrame.location.href="../../ConstructASP/CPList/PicAdd.aspx"
    }
}

//供求信息编辑层
function sdAdd(id)//id：单条信息编号
{
    if(id<=0)
    {
        //ShowIframe("../../ConstructASP/SAndD/SAndDAdd.aspx",'650','425','供求信息','');
    }
    else
    {
        ShowIframe3("ConstructASP/SAndD/SAndDAdd.aspx?id="+id,'650','425','供求信息',id);
    }
}

//回复留言编辑层
function messAdd(id)//id：单条信息编号
{
    if(id<=0)
    {
        //ShowIframe("../../ShowASP/Message/Message.aspx",'650','425','回复留言','');
    }
    else
    {
        ShowIframe3("ShowASP/Message/reMessage.aspx?id="+id,'650','425','回复留言',id);
    }
}

//新增文件下载
function downAdd(cid)
{
    if(cid>0)
    {
        ShowIframe3("ConstructASP/EpicAndDown/EpicAndDownAdd.aspx?c_id="+cid,'650','425','文件下载',cid);
    }
}

//编辑文件下载
function downEdit(id)//<A HREF="../../../ShowASP/DownLoad/reDown.aspx">../../../ShowASP/DownLoad/reDown.aspx</A>
{
    if(id>0)
    {
        ShowIframe3("ShowASP/DownLoad/reDown.aspx?id=" + id,'450','150','文件下载',cid);
    }
}

//栏目管理弹出编辑窗口
function showCol(type)
{
    //alert(type);
    window.parent.indexshowCol(type);
       if(document.getElementById("rightMenu")!=null)
        {
              document.getElementById("rightMenu").parentNode.removeChild(document.getElementById("rightMenu"))
        }
}
function indexshowCol(type)
{         
    if(type=='edittop')
    {
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "edittop";
        ShowIframe4("ShowASP/indexAsp/collist.aspx" ,'350','250','栏目编辑','editindextop');
   }
    else if(type=='top')
    {
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "top";

        ShowIframe2("ShowASP/indexAsp/topcolumn.aspx?id=1" ,'350','200','顶部栏目','top');
    }
    else if(type=='center')
    {
        ShowIframe2("ShowASP/indexAsp/midcolumn.aspx" ,'600','240','模块设置','');
    }
    else if(type=='bottom')
    {
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "bot";        

        ShowIframe2("ShowASP/indexAsp/topcolumn.aspx?id=3" ,'350','200','底部栏目','bot');
   }    
}

//更新首页栏目
function updateCol(type)
{
    window.document.getElementById("update").value="true";
    document.form1.submit(); 
    showCol(type);
}

//************
//1220把此段代码从\Construct\ShowASP\indexAsp\js\mentShowDiv.js合并
//************
//新建栏目
function addCol(type)
{
    window.parent.indexaddCol(type);
}
function indexaddCol(type)
{
    if(type=='top')
    {
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "top";
        //alert('111')
        ShowIframe4("ShowASP/indexAsp/addCol.aspx" ,'420','250','栏目新建','editindextop');
    }
    else if(type=='center')
    {
         ShowIframe("ShowASP/indexAsp/midcolumn.aspx" ,'600','240','模块设置','');
    }
    else if(type=='bottom')
    {
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "bot";
        ShowIframe("ShowASP/indexAsp/addBotCol.aspx" ,'350','200','底部栏目','bot');
    }
}

//辅助功能
function four(type)
{
    window.parent.indexfour(type);
}
function indexfour(type)
{
    //弹出窗体
    if(type=='tan')
    {
    //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";  
        }
        window.document.getElementById("assPos").value = "tan";
        ShowIframe("ShowASP/Assistant/openad.aspx" ,'350','200','弹出窗体','tan');
    }
    else if(type=='float')//浮动广告
    {
    //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "float";
        ShowIframe("ShowASP/Assistant/floatad.aspx" ,'350','200','浮动广告','float');

    }
    else if(type=='lc')//两侧广告
    {
    //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "lc";
        ShowIframe("ShowASP/Assistant/coupletAd.html" ,'350','200','两侧广告','lc');
    }
    else if(type=='link')//友情链接
    { 
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "link";
        ShowIframe("ShowASP/Assistant/LinkSet.aspx" ,'350','250','友情链接','link');
    }
    else if(type=='gd')//图片滚动效果
    { 
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "gd";
        ShowIframe("ShowASP/Assistant/piccolumn.aspx" ,'350','550','滚动特效','gd');
    }
    else if(type=='useshow')//图片滚动效果
    { 
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "useshow";
        ShowIframe2("ShowASP/UseShow/UseShowSet.aspx" ,'350','200','人才频道','');
    }
}

//高级设置
function gj(type)
{
       window.parent.indexgj(type);
}
function indexgj(type)
{
    if(type=='logo')//上传logo
    {
        ShowIframe("ShowASP/Assistant/seniorColumn.aspx?type=logo" ,'350','200','Logo设置','logo');
    }
    else if(type=='banner')//上传banner
    {
        ShowIframe("ShowASP/Assistant/seniorColumn.aspx?type=banner" ,'350','200','banner广告','banner');
    }
    else if(type=='sy')//形象首页
    {
        ShowIframe("ShowASP/Assistant/seniorColumn.aspx?type=sy" ,'350','200','形象首页','');
    }
    else if(type=='Info')
    {
         ShowIframe("ShowASP/Assistant/UserInfo.aspx?type=Info" ,'500','300','公司基本信息','Info');
    }
    else if(type=="ban")
    {
         ShowIframe("ShowASP/indexAsp/setBan.aspx" ,'500','300','版权设置','ban');

    }
    else if(type=='hd')
    {
          ShowIframe2("ShowASP/hdp/hdpJAdd.aspx" ,'350','230','幻灯片设置','');
         
    }
    else if(type=='layout')
    {
        if(confirm('确定还原？'))
        {
            HuYu();
            alert("还原成功!");
        }

    }
    else if(type=='qytj')
    {
         ShowIframe("ShowASP/indexAsp/setQytj.aspx" ,'800','500','企业推荐','qitj');

    }
}

//1208增加“添加友情链接”
function linkAdd()
{
    window.location.href="../../ShowASP/Assistant/LinkAdd.aspx";
}

//删除链接信息
function deleteLink(id)
{
    document.getElementById("hID").value = id;
    if (confirm("确认删除该链接吗？")) 
    {
        //当前页面的隐藏域赋值
        document.getElementById("Hidden1").value="delete";
        
        if(document.getElementById("hID") != null)    
        {
            document.getElementById("hID").value=id;
        }
               
        document.form1.submit();
        ShowA("link");
    }
}
    
function indexRow(cid,colname)
{
    if(cid>0)
    {
            ShowIframe3("ShowASP/indexAsp/indexRow.aspx?c_id="+cid,'250','150',colname,cid);
    }
}


//添加更多职位信息
function addUseShowMore(cid)
{
    if(cid>0)
    {
            ShowIframe3("ShowASP/UseShow/UseShowAdd.aspx?uid="+cid,'400','450',"发布职位信息",cid);
    }
}
//内页发布职位
function addUseShowMore2()
{
            ShowIframe3("../../ShowASP/UseShow/UseShowAdd.aspx",'400','450',"发布职位信息",'neiRC');
}

//打开职位管理
function editUswShowDept(did)
{      
    //alert(did);
    ShowIframe2("UseShowEdit.aspx?mtag="+did+"",'400','450','职位信息修改','UseShow1'+did+'');  
}

function editUswShowDept2(did)
{      
    //alert(did);
    ShowIframe2("UseShowEdit.aspx?mtag="+did+"",'400','450','职位信息修改','UseShow2'+did+'');  
}


//1.14
/////////////////////////////
//控制滚动图片功能开启状态
function openGD()
{
    var typevalue = "";
    var b= document.getElementById("openb");
    var chgd = document.getElementById("chGD");
    //var container = document.getElementById("container");
    if (chgd.checked)
    {
        typevalue = "显示";
    } 
    else 
    {        
        typevalue = "隐藏"; 
    }
	
    if(confirm("是否确定修改"))
    {
        //调用后台修改状态的方法，得到状态值
        
        var type = ShowASP_Assistant_piccolumn.ChangeGDType();
        
        
        if(type.value == "显示")
        {
            b.innerHTML="显示";
            chgd.checked = true;
            //container.style.display="block";
            //style="display:block"
        }
        else
        {
            b.innerHTML="隐藏";
            chgd.checked = false;
            //container.style.display="none";
        }
    }
}


function saveColId(id)
{
    document.getElementById("btAllPic").disabled = false;
    document.getElementById("hColId").value += id+",";             
    
}    
 
function allpic()
{
    var c_id = document.getElementById('hColId').value;
}



function addPic()
{
   
    document.getElementById("hAdd").value = "add";   
    document.form1.submit(); 
}


//记录滚动图片信息
function savePicUrl(piclink,title,picurl)
{ 
    var n=(document.getElementById("hPicLink").value.split(piclink)).length-1; 

    if(n<1)
    {
        document.getElementById("hPicLink").value += piclink+"*";
        document.getElementById("hTitle").value += title+",";
        document.getElementById("hPicUrl").value += picurl+"*";
    }

}

function back()
{
    window.location.href="piccolumn.aspx";
}


//打开视频管理页面
function flv()
{      
    ShowIframe2("ShowASP/flv/flvmanage.aspx",'400','470','视频管理','');  
}

//打开会员设置页面
function menstate()
{      
    ShowIframe2("../../Binomial/AssociatorASP/menstate.aspx",'430','280','会员模块','');  
} 

//设置滚动状态
function setGun(id)
{      
    ShowIframe2("ShowASP/indexAsp/SetGun.aspx?cNid="+id+"",'350','200','滚动状态设置','');  
}


function EditCol(id)
{
   if(id==0)
   {
    return;
   }
   window.parent.EditColM("ShowASP/indexAsp/colset.aspx?id="+id,'350','200','栏目编辑');
}

function EditCol2(id,tag)
{
   if(id==0)
   {
    return;
   }
   window.parent.EditColM("ShowASP/indexAsp/colset.aspx?id="+id+"&tag=1",'350','200','人才频道编辑');
}




function EditColM(Url,kuan,gao,title) //显示iframe Url 弹出的页面地址，kuan 宽度 gao 高度 title 弹出层标题 tag 用于AJAX更新的标记
{  
    var pop=new Popup({ contentType:1,isReloadOnClose:false,width:kuan,height:gao});
    pop.setContent("contentUrl",Url);
    pop.setContent("title",title);
    pop.build();
    pop.show();
}


