﻿// JScript 文件


//单页图文编辑层
function sigEdit(id,cid,f_id,title)//id：单条信息编号，cid：栏目编号，title栏目名称
{ 
    var diag = new Dialog();
    diag.Width = 650;
    diag.Height = 400;
    diag.Title = title;
    if(f_id==1008)
    {
        diag.CancelEvent = function(){ShowNewsList();diag.close();};
        diag.URL = "../../ConstructASP/CPList/PicAddLink.aspx?type=1&id=" + id + "&c_id=" + cid;
//        ShowIframe("../../ConstructASP/CPList/PicAddLink.aspx?type=1&id="+id + "&c_id=" + cid,'650','400',title,cid);
    }
    else
    {
        if(id>0&&cid>0)
        {
            diag.CancelEvent = function(){ShowSin(); diag.close();};
            diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=1&id=" + id + "&c_id=" + cid;
//            ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=1&id="+id + "&c_id=" + cid,'650','400',title,'sig');
        }
        else if(id<=0&&cid>0)
        {
            diag.CancelEvent = function(){ShowSin(); diag.close();};
            diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=1&c_id=" + cid;
//            ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=1&c_id=" + cid,'650','400',title,'sig');
        }
        else
        {
            //ShowIframe("../../ConstructASP/CPList/PicAdd.aspx",'650','425','单页图文','');
        }
    }
    diag.show();
}

//新闻添加层
function newsAdd(cid,pageindex)//cid栏目编号
{
    if(cid >0)
    {
	    var diag = new Dialog();
	    diag.Width = 650;
	    diag.Height = 415;
	    diag.Title = "添加新闻";
        diag.CancelEvent = function(){AllListShow(cid,pageindex); diag.close();};
	    diag.URL = "../../ConstructASP/News/NewsAdd.aspx?c_id=" + cid;
	    diag.show();
//        ShowIframe("../../ConstructASP/News/NewsAdd.aspx?c_id="+cid,'650','415','添加新闻','newslist');
    }
}

//新闻添加层
function newsAdd2(cid,pageindex,yid)//cid栏目编号
{
    if(cid >0)
    {
	    var diag = new Dialog();
	    diag.Width = 650;
	    diag.Height = 415;
	    diag.Title = "添加新闻";
        diag.CancelEvent = function(){AllListShow(yid,pageindex); diag.close();};
	    diag.URL = "../../ConstructASP/News/NewsAdd.aspx?c_id=" + cid;
	    diag.show();
//        ShowIframe("../../ConstructASP/News/NewsAdd.aspx?c_id="+cid,'650','415','添加新闻','newslist');
    }
}


//会员登陆
function loginContent()
{
    var diag = new Dialog();
    diag.Width = 300;
    diag.Height = 180;
    diag.Title = "会员登陆";
    diag.URL = "loginContent.aspx";
    diag.show(); 
//    window.parent.EditColM("ShowASP/UseDefine/SetDefine.aspx",'350','200','订制模块管理')
}


function scriptPage(fid,cm,cid,pageindex)
{
//alert(fid+"|"+cm+"|"+cid);
    var diag = new Dialog();
    diag.Width = 275;
    diag.Height = 170;
    diag.Title = "修改分页显示条数";
    if(fid ==1001) //新闻类
    {
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
	    diag.URL = "../../ShowASP/script/scriptPage.aspx?fid=" + fid+"&cid="+cid+"";
//        ShowIframe("../../ShowASP/script/scriptPage.aspx?fid="+fid,'275','170','修改分页显示条数','newslist');
    }
    else if(fid==1002&&cm==1) //产品列表
    {
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
	    diag.URL = "../../ShowASP/script/scriptPage.aspx?fid=" + fid + "&cm=1&cid="+cid+"";
//        ShowIframe("../../ShowASP/script/scriptPage.aspx?fid="+fid+"&cm=1",'275','170','修改分页显示条数','pro');
    }
    else if(fid==1000) //单页图文
    {
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
	    diag.URL = "../../ShowASP/script/scriptPage.aspx?fid=" + fid + "&cm=0&cid="+cid+"";
//        ShowIframe("../../ShowASP/script/scriptPage.aspx?fid="+fid+"&cm=1",'275','170','修改分页显示条数','pro');
    }
    else if(fid==1002&&cm==2) //产品图片
    {
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
	    diag.URL = "../../ShowASP/script/scriptPage.aspx?fid=" + fid + "&cm=2&cid="+cid+"";
//        ShowIframe("../../ShowASP/script/scriptPage.aspx?fid="+fid+"&cm=2",'275','170','修改分页显示条数','hon');
    }
    else if(fid==1004) //留言
    {
        diag.CancelEvent = function(){ShowMess();diag.close();};
	    diag.URL = "../../ShowASP/script/scriptPage.aspx?fid=" + fid;
//        ShowIframe("../../ShowASP/script/scriptPage.aspx?fid="+fid,'275','170','修改分页显示条数','mess');      
    }
    else if(fid==1005) //下载
    {
        diag.CancelEvent = function(){showDown();diag.close();};
	    diag.URL = "../../ShowASP/script/scriptPage.aspx?fid=" + fid+"&cid="+cid+"";
//       ShowIframe("../../ShowASP/script/scriptPage.aspx?fid="+fid,'275','170','修改分页显示条数','down');        
    }
    else if(fid==10006) //人才
    {
        diag.CancelEvent = function(){parent.window.location.href='UseShowDf.aspx';};
	    diag.URL = "../../ShowASP/script/scriptPage.aspx?fid=" + fid+"&cid="+cid+"";
//        ShowIframe("../../ShowASP/script/scriptPage.aspx?fid="+fid,'275','170','修改分页显示条数','useshow');     
    }
    diag.show();
}
function newsEdit(id,cid,pageindex)//id：单条新闻编号，cid栏目编号
{
    if(id> 0 && cid >0)
    {
        if(document.getElementById("hID") != null)
        {
            document.getElementById("hID").value=id;
        }
        if(document.getElementById("hidId") != null)
        {
            document.getElementById("hidId").value=id;
        }
	    var diag = new Dialog();
	    diag.Width = 650;
	    diag.Height = 415;
	    diag.Title = "编辑新闻";
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
	    diag.URL = "../../ConstructASP/News/NewsAdd.aspx?id=" + id + "&c_id=" + cid;
	    diag.show();
//        ShowIframe("../../ConstructASP/News/NewsAdd.aspx?id="+id+"&c_id="+cid,'650','415','编辑新闻','newsedit');
    }
}

//新闻内容页添加新闻
function newsAddT(cid,title)//cid：栏目编号
{
    var diag = new Dialog();
    diag.Width = 650;
    diag.Height = 415;
    diag.Title = title;
    diag.CancelEvent = function(){ToNewsList();diag.close();};
    diag.URL = "../../ConstructASP/News/NewsAdd.aspx?c_id=" + cid;
    diag.show();
//    ShowIframe("../../ConstructASP/News/NewsAdd.aspx?c_id="+cid,'650','415',title,'newsinfoadd');
}

//新闻详细页编辑
function newsInfoEdit(id,cid)//id：单条新闻编号，cid栏目编号
{
    if(id> 0 && cid >0)
    {
        if(document.getElementById("hID") != null)
        {
            document.getElementById("hID").value=id;
        }
        if(document.getElementById("hidId") != null)
        {
            document.getElementById("hidId").value=id;
        }
        var diag = new Dialog();
        diag.Width = 650;
        diag.Height = 415;
        diag.Title = "编辑新闻";
        diag.CancelEvent = function(){ShowNewsInfo();diag.close();};
        diag.URL = "../../ConstructASP/News/NewsAdd.aspx?id=" + id + "&c_id=" +cid;
        diag.show();
//        ShowIframe("../../ConstructASP/News/NewsAdd.aspx?id="+id+"&c_id="+cid,'650','415','编辑新闻','newsinfo');
    }
}

//图片信息编辑层
function honEdit(id,cid,pageindex)
{
    var diag = new Dialog();
    diag.Width = 500;
    diag.Height = 200;
    diag.Title = "图片信息";
    if(id>0&&cid>0)
    {

        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
        diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=3&id=" + id  + "&c_id=" + cid;
//            ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=3&id="+id + "&c_id=" + cid,'500','200','图片信息','hon');
    }
    else if(id<=0&&cid>0)
    {
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
        diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=3&id=" + id;
//            ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=3&id="+id,'500','200','图片信息','hon');
    }
    else
    {
        //window.EditFrame.location.href="../../ConstructASP/CPList/PicAdd.aspx"
    }
    diag.show();
}
//图片信息添加层
function honAdd(cid,title,pageindex)
{
    if(cid>0)
    {
        var diag = new Dialog();
        diag.Width = 500;
        diag.Height = 400;
        diag.Title = title;
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
        diag.URL = "../../ShowASP/Assistant/csUP.aspx?type=3&c_id=" + cid + "&title=" + title;
        diag.show();
//      ShowIframe("../../ShowASP/Assistant/csUP.aspx?type=3&c_id="+cid+"&title="+title,'500','400',title,'hon');
    }
    else
    {
        //window.EditFrame.location.href="../../ConstructASP/CPList/PicAdd.aspx"
    }
}
//图片信息添加层
function honAdd2(cid,title,pageindex,yid)
{
    if(cid>0)
    {
        var diag = new Dialog();
        diag.Width = 500;
        diag.Height = 400;
        diag.Title = title;
        diag.CancelEvent = function(){AllListShow(yid,pageindex);diag.close();};
        diag.URL = "../../ShowASP/Assistant/csUP.aspx?type=3&c_id=" + cid + "&title=" + title;
        diag.show();
//      ShowIframe("../../ShowASP/Assistant/csUP.aspx?type=3&c_id="+cid+"&title="+title,'500','400',title,'hon');
    }
    else
    {
        //window.EditFrame.location.href="../../ConstructASP/CPList/PicAdd.aspx"
    }
}


//产品信息类页面添加层
function proAdd(cid,pageindex)
{
    var diag = new Dialog();
    diag.Width = 650;
    diag.Height = 440;
    diag.Title = "产品信息";
    diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
    diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=2&c_id=" + cid;
    diag.show();
//    ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=2&c_id="+cid,'650','440','产品信息','pro');
}

//产品信息类页面添加层
function proAdd2(cid,pageindex,yid)
{
    var diag = new Dialog();
    diag.Width = 650;
    diag.Height = 440;
    diag.Title = "产品信息";
    diag.CancelEvent = function(){AllListShow(yid,pageindex);diag.close();};
    diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=2&c_id=" + cid;
    diag.show();
//    ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=2&c_id="+cid,'650','440','产品信息','pro');
}

//产品列表页编辑层
function proEdit(id,cid,pageindex)//id：单条信息编号，cid：栏目编号
{
    if(id<=0 || cid<=0)
    {
        //ShowIframe("../../ConstructASP/CPList/PicAdd.aspx",'650','425','产品信息','');
    }
    else
    {
        var diag = new Dialog();
        diag.Width = 650;
        diag.Height = 440;
        diag.Title = "产品信息";
        diag.CancelEvent = function(){AllListShow(cid,pageindex);diag.close();};
        diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=2&id=" + id + "&c_id=" + cid;
        diag.show();
//        ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=2&id="+id + "&c_id=" + cid,'650','440','产品信息','pro');
    }
}

//产品信息页编辑层
function proInfoEdit(id,cid)//id：单条信息编号，cid：栏目编号
{
    if(id<=0 || cid<=0)
    {
        //ShowIframe("../../ConstructASP/CPList/PicAdd.aspx",'650','425','产品信息','');
    }
    else
    {
        var diag = new Dialog();
        diag.Width = 650;
        diag.Height = 440;
        diag.Title = "产品信息";
        diag.CancelEvent = function(){ShowBle();diag.close();};
        diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=2&id=" + id + "&c_id=" + cid;
        diag.show();
//        ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=2&id="+id + "&c_id=" + cid,'650','440','产品信息','ble');
    }
}

//产品信息页添加层
function proInfoAdd(cid)//id：单条信息编号，cid：栏目编号
{
    if(cid>0)
    {
        var diag = new Dialog();
        diag.Width = 650;
        diag.Height = 440;
        diag.Title = "产品信息";
        diag.CancelEvent = function(){ToProList();diag.close();};
        diag.URL = "../../ConstructASP/CPList/PicAdd.aspx?type=2&c_id=" + cid;
        diag.show();
//        ShowIframe("../../ConstructASP/CPList/PicAdd.aspx?type=2&c_id=" + cid,'650','440','产品信息','bleadd');
    }
}


//回复留言编辑层
function messAdd(id)//id：单条信息编号
{
    if(id>0)
    {
        var diag = new Dialog();
        diag.Width = 430;
        diag.Height = 200;
        diag.Title = "回复留言";
        diag.CancelEvent = function(){location.reload();};
        diag.URL = "../../ShowASP/Message/reMessage.aspx?id=" + id;
        diag.show();
//        ShowIframe("../../ShowASP/Message/reMessage.aspx?id="+id,'430','200','回复留言','mess');
    }
    else
    {
        //ShowIframe("../../ShowASP/Message/Message.aspx",'650','425','回复留言','mess');
    }
}

//新增文件下载
function downAdd(cid)
{
    var diag = new Dialog();
    diag.Width = 650;
    diag.Height = 425;
    diag.Title = "文件下载";
    diag.CancelEvent = function(){showDown();diag.close();};
    diag.URL = "../../ConstructASP/EpicAndDown/EpicAndDownAdd.aspx?c_id=" + cid;
    diag.show();
//    ShowIframe("../../ConstructASP/EpicAndDown/EpicAndDownAdd.aspx?c_id="+cid,'650','425','文件下载','down');
}

//编辑文件下载
function downEdit(id)//
{
    var diag = new Dialog();
    diag.Width = 430;
    diag.Height = 200;
    diag.Title = "文件下载";
    diag.CancelEvent = function(){showDown();diag.close();};
    diag.URL = "../../ShowASP/DownLoad/reDown.aspx?id=" + id;
    diag.show();
//    ShowIframe("../../ShowASP/DownLoad/reDown.aspx?id=" + id,'430','200','文件下载','down');
}


//onclick="ShowIframe('../../ConstructASP/News/NewsAdd.aspx','650','425','添加新闻',document.getElementById('assPos').value)">
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);
    
    //此次的“Show***()”在“JS\base4.js”中,要根据不同页面来分别调用相应的方法，
    if(tag == "sig")//“单页图文”类信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowSin();};
    }    
    if(tag == "newslist")//“新闻列表”类信息newsedit
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowNewsList();};
    }
    if(tag == "newsedit")//“新闻列表”页面编辑单条信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowNewsList();};
    }
    if(tag == "newsinfo")//“新闻内容”页编辑信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowNewsInfo();};
    }
    if(tag == "newsinfoadd")//“新闻内容”页添加信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){ToNewsList();};//添加后回到列表页
    }
    if(tag == "pro")//“产品列表”类信息ToProList
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowPro();};
    }
    if(tag == "ble")//“产品内容”类信息bleadd
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowBle();};
    }
    if(tag == "bleadd")//“产品内容”类信息页添加后跳转列表页
    {
        document.getElementById("dialogBoxClose").onclick=function(){ToProList();};//添加后回到列表页
    }
    if(tag == "hon")//“图片信息”类信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowHon();};
    }
    if(tag == "mess")//“访客留言”类信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowMess();};
    }
    if(tag == "down")//“文件下载”类信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){showDown();};
    }
    if(tag == "sdlist")//“供求列表”类信息
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowSDList();};
    }
    if(tag == "sdinfo")//“供求内容”类信息sdinfoadd
    {
        document.getElementById("dialogBoxClose").onclick=function(){ShowSDInfo();};
    }
    if(tag == "sdinfoadd")//“供求内容”页面添加信息后跳转到列表页
    {
        document.getElementById("dialogBoxClose").onclick=function(){ToSDList();};//添加后回到列表页
    }
    //ShowSDInfo
    if(tag == "leftcol")//定制左侧栏目
    {
        document.getElementById("dialogBoxClose").onclick=function(){AjaxLeftDing("pleftcol");};
    }
    if(tag == "pleftcol")//定制左侧栏目
    {
        document.getElementById("dialogBoxClose").onclick=function(){LeftCol(tag);};
    }
    if(tag=="leftShow")
    {
        //alert("assss");
        document.getElementById("dialogBoxClose").onclick=function(){LeftShow(tag);};
    }
    if(tag=="useshow")
    {
        //alert("assss");
        document.getElementById("dialogBoxClose").onclick=function(){parent.window.location.href='UseShowDf.aspx';};
    }
}
function ShowIframeLeftDing(Url,kuan,gao,title,tag,tag2) //显示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();
    document.getElementById("dialogBoxClose").onclick=function(){AjaxLeftDing(tag,tag2)};
}


function ShowIframeLeftDing2(Url,kuan,gao,title,tag,tag2) //显示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();
    document.getElementById("dialogBoxClose").onclick=function(){AjaxLeftDing2(tag,tag2)};
}



//删除单条记录
function deleteById(id,cid,tag)
{
    if(confirm("确认删除该记录吗？"))
    {
        //当前页面的隐藏域赋值
        if(tag == "expic")
        {
            document.getElementById("Hidden1").value="deleteinfo";
            
            if(document.getElementById("hExId") != null)
            {
                document.getElementById("hExId").value=id;
            }
            
            //页面上“信息编号隐藏域”赋值
            if(document.getElementById("hID") != null)
            {
                document.getElementById("hID").value=cid;
            }
            if(document.getElementById("hidId") != null)
            {
                document.getElementById("hidId").value=cid;
            } 
            
            document.form1.submit();
            
            ShowExPic();
           
        }
        else
        {
            document.getElementById("Hidden1").value="delete";
        
            //页面上“信息编号隐藏域”赋值
            if(document.getElementById("hID") != null)
            {
                document.getElementById("hID").value=id;
            }
            if(document.getElementById("hidId") != null)
            {
                document.getElementById("hidId").value=id;
            }
            
            document.form1.submit();
            
            //alert('删除成功！');
            //删除完成后执行Ajax方法更新页面
            //此次的“Show***()”在“JS\base4.js”中要根据不同页面来分别调用相应的方法，
            if(tag == "sig")//“单页图文”类信息
            {
                ShowSin();
            }    
            if(tag == "newslist")//“新闻列表”类信息newsedit
            {
                ShowNewsList();
            }
            if(tag == "newsedit")//“新闻列表”页面编辑单条信息
            {
                ShowNewsList();
            }
            if(tag == "newsinfo")//“新闻内容”类信息
            {
                //ShowNewsInfo();           
                
                window.location.href="News.aspx?c_id=" + cid;//删除后回到列表页
            }
            if(tag == "pro")//“产品列表”类信息
            {
                ShowPro();
            }
            if(tag == "ble")//“产品内容”类信息
            {
               //ShowBle();
               window.location.href="Product.aspx?c_id=" + cid;
            }
            
            if(tag == "hon")//“图片信息”类信息
            {
                ShowHon();
            }
            if(tag == "mess")//“访客留言”类信息
            {
                ShowMess();
            }
            if(tag == "down")//“文件下载”类信息
            {
                showDown();
            }
        }
    }
}

/////////////////////////////
//控制评论功能开启状态
function opencommentbox(col)
{
    var cid = document.getElementById("hidC_id").value;
    var id = document.getElementById("hidId").value;
    var flag=document.getElementById("opencom");
    var com=document.getElementById("comment");
    var b=document.getElementById("openb");
    var typevalue = "";
    if (flag.checked)
    {
    
        typevalue = "开启";

//		    com.style.display="none";
//		    b.innerHTML="开启评论";
    } 
    else 
    {        
        typevalue = "关闭"; 
//		    com.style.display="";
//		    b.innerHTML="关闭评论";
    }
	
    if(confirm("是否确定修改"))
    {
        //调用后台修改评论状态的方法，得到状态值
        if(col == "news")//新闻类页面
        {
            var type = ShowASP_News_NewInfo.ChangeCommType(typevalue,cid,id);
        }
        else if(col == "pro")//产品类页面
        {
        
            var type = ShowASP_Product_ProductShow.ChangeCommType(typevalue,cid,id);
            
        }
        else if(col == "sad")//供求类页面
        {
            var type = ShowASP_SAndD_SaDshow.ChangeCommType(typevalue,cid,id);
        }
        if(type.value == "开启")
        {
            b.innerHTML="关闭评论";
            flag.checked = true;
            com.style.display="block";
            //style="display:block"
        }
        else
        {
            b.innerHTML="开启评论";
            flag.checked = false;
            com.style.display="none";
        }
    }
}


function showLeftCol2(tag,nid)
{
    var diag = new Dialog();
    diag.Width = 400;
    diag.Height = 320;
    diag.Title = "定制侧边栏目";
    diag.CancelEvent = function(){AjaxLeftDing(tag,nid);diag.close();};
    diag.URL = "../../ShowASP/indexAsp/leftSidebar.aspx?tag=" + tag+"&nid=" + nid;
    diag.show();
//      ShowIframeLeftDing("../../ShowASP/indexAsp/leftSidebar.aspx?tag="+tag+"&nid="+nid+"" ,'400','320','定制侧边栏目',tag,nid);
}


//定制左侧栏目
//栏目管理内页弹出编辑窗口
function showLeftCol(type)
{
    
    if(type=='leftcol') 
    {
        //清空隐藏域的值，并根据不同的操作赋值
        if(window.document.getElementById("assPos").value != "")
        {
            window.document.getElementById("assPos").value = "";            
        }
        window.document.getElementById("assPos").value = "leftcol";  
        
        //取得当前页面的infoid或cid
        var infoid = window.document.getElementById("hidId");
        var cid = window.document.getElementById("hidC_id");
        
        var diag = new Dialog();
        diag.Width = 360;
        diag.Height = 255;
        diag.Title = "定制侧边栏目";
        
        if(cid != null && infoid != null)
        {
            diag.CancelEvent = function(){AjaxLeftDing("pleftcol");diag.close();};
            diag.URL = "../../ShowASP/indexAsp/leftcolumn.aspx?c_id=" + cid.value +"&infoid=" + infoid.value;
//            ShowIframe("../../ShowASP/indexAsp/leftcolumn.aspx?c_id="+ cid.value +"&infoid="+ infoid.value ,'360','255','定制侧边栏目','leftcol');
        }
        else if(cid != null  && infoid == null)
        {
            //信息列表页面
            diag.CancelEvent = function(){AjaxLeftDing("pleftcol");diag.close();};
            diag.URL = "../../ShowASP/indexAsp/leftcolumn.aspx?c_id=" + cid.value;
//            ShowIframe("../../ShowASP/indexAsp/leftcolumn.aspx?c_id="+ cid.value ,'360','255','定制侧边栏目','leftcol');
        }
        diag.show();
    }
    else if(type=='pleftcol') 
    {
        //清空隐藏域的值，并根据不同的操作赋值
        if(parent.window.document.getElementById("assPos").value != "")
        {
            parent.window.document.getElementById("assPos").value = "";            
        }
        parent.window.document.getElementById("assPos").value = "pleftcol";  
        
        //取得当前页面的infoid或cid
        var infoid = parent.window.document.getElementById("hidId");
        var cid = parent.window.document.getElementById("hidC_id");
        
        var diag = new Dialog();
        diag.Width = 360;
        diag.Height = 255;
        diag.Title = "定制侧边栏目";    
        if(cid != null && infoid != null)
        {
            //单条信息页面
            diag.CancelEvent = function(){LeftCol("pleftcol");diag.close();};
            diag.URL = "../../ShowASP/indexAsp/leftcolumn.aspx?c_id=" + cid.value +"&infoid=" + infoid.value;
//            ShowIframe("../../ShowASP/indexAsp/leftcolumn.aspx?c_id="+ cid.value +"&infoid="+ infoid.value ,'360','255','定制侧边栏目','pleftcol');
        }
        else if(cid != null  && infoid == null)
        {
            //信息列表页面
            diag.CancelEvent = function(){LeftCol("pleftcol");diag.close();};
            diag.URL = "../../ShowASP/indexAsp/leftcolumn.aspx?c_id=" + cid.value;
//            ShowIframe("../../ShowASP/indexAsp/leftcolumn.aspx?c_id="+ cid.value ,'360','255','定制侧边栏目','pleftcol');
        }
        diag.show();
    }else if(type='leftShow')
    {
        var diag = new Dialog();
        diag.Width = 350;
        diag.Height = 235;
        diag.Title = "订制侧边栏目导航"; 
        diag.CancelEvent = function(){LeftShow("leftShow");diag.close();};
        diag.URL = "../../ShowASP/indexAsp/leftCol.aspx";
        diag.show();
//        ShowIframe("../../ShowASP/indexAsp/leftCol.aspx" ,'350','220','订制侧边栏目导航','leftShow');
    }
}

//定制侧边栏目
//判断栏目选中状态
function saveColId(id)
{
    var leftID = document.getElementById("hColId");
   
    var ch = document.getElementById("rd" + id);
    
    if(ch.checked==false)//某个按钮取消选中
    {
        leftID.value=leftID.value.replace(id+",","");//从编号隐藏域中清除   
        
        if(leftID.value == "" || leftID.value == ",")
        {
            document.getElementById("btSave").disabled=true;//保存按钮不可用   
            document.getElementById("btCanel").disabled=true;//删除按钮不可用   
        } 
        else
        {
            var lID=leftID.value.substring(0,leftID.value.length-1).split(',');
            
            if(lID.length >3)//记录栏目编号,最多3个栏目
            {         
                document.getElementById("btSave").disabled=true;//保存按钮不可用   
            }
            else//
            {   
                document.getElementById("btSave").disabled=false;//保存按钮可用            
            }
        }  
    }
    else//某个按钮选中
    {    
        
        var lID=leftID.value.substring(0,leftID.value.length-1).split(',');
        if(lID.length >=3)//记录栏目编号,最多3个栏目
        {
           
            //提示
            alert("最多定制三个侧边栏目！");
            ch.checked=false;
            //document.getElementById("btSave").disabled=true;//保存按钮不可用   
        }
        else//
        {   
            leftID.value += id+",";//记录选中栏目编号
            document.getElementById("btSave").disabled=false;//保存按钮可用
           
        }        
    } 
    // alert(leftID.value);
} 

//添加侧边栏目
function addLeftCol()
{
    var leftID = document.getElementById("hColId");
            
    var lID=leftID.value.substring(0,leftID.value.length-1).split(',');
    
    if(lID.length < 4)//记录栏目编号,最多3个栏目
    {         
        if(confirm("确认操作吗？"))
        {
            var hadd = document.getElementById("hAdd");
            if(hadd != null)
            {
                hadd.value = "add";
            }
            document.form1.submit();
            hadd.value = "";

            LeftCol("pleftcol");
            alert('操作成功！'); 

            window.location.href= document.URL;//"../../ShowASP/indexAsp/leftcolumn.aspx";//完成后回原页面
        }
    }
    else
    {
        alert("最多定制三个侧边栏目！");
        document.getElementById("btSave").disabled=true;//保存按钮不可用   
    }
}

//删除侧边栏目
function delLeftCol()
{
    if(confirm("确认操作吗？"))
    {
        var hadd = document.getElementById("hAdd");
        if(hadd != null)
        {
            hadd.value = "del";
        }
        document.form1.submit();
        hadd.value = "";

        LeftCol("pleftcol");
        alert('操作成功！'); 

         window.location.href= document.URL;//"../../ShowASP/indexAsp/leftcolumn.aspx";//完成后回原页面
    }
}

function updateShowCount(id)
{
    var diag = new Dialog();
    diag.Width = 250;
    diag.Height = 180;
    diag.Title = "侧边栏目信息显示数量"; 
    diag.CancelEvent = function(){LeftCol("pleftcol");diag.close();};
    diag.URL = "../../ShowASP/script/leftcol_showcount.aspx?id=" + id;
    diag.show();
//    ShowIframe("../../ShowASP/script/leftcol_showcount.aspx?id="+id,'250','180','侧边栏目信息显示数量','pleftcol');
    //alert('操作成功！'); 
    //<a href="../../ShowASP/script/leftcol_showcount.aspx">../../ShowASP/script/leftcol_showcount.aspx</a>
}


function updateShowCount2(leftDingId,cid)
{
    var diag = new Dialog();
    diag.Width = 250;
    diag.Height = 180;
    diag.Title = "侧边栏目信息显示数量"; 
    diag.CancelEvent = function(){AjaxLeftDing2(leftDingId,cid);diag.close();};
    diag.URL = "../../ShowASP/script/leftDingCount.aspx?leftDingId=" + leftDingId + "&cid=" + cid;
    diag.show();
//    ShowIframeLeftDing2("../../ShowASP/script/leftDingCount.aspx?leftDingId="+leftDingId+"&cid="+cid+"",'250','180','侧边栏目信息显示数量',leftDingId,cid);
    //alert('操作成功！'); 
    //<a href="../../ShowASP/script/leftcol_showcount.aspx">../../ShowASP/script/leftcol_showcount.aspx</a>
}



//内页侧边栏目的全站搜索
function leftSearch()
{
    var keyword;
    var col;
    
    keyword = document.getElementById("txtKey").value;
    col = document.getElementById("sCol").options[document.getElementById("sCol").selectedIndex].value;
    
    location.href="../../ShowASP/ForumASP/search.aspx?col="+col+"&keyword="+escape(keyword)+"";
}

function addUseShowMore2()
{
    var diag = new Dialog();
    diag.Width = 400;
    diag.Height = 450;
    diag.Title = "发布职位信息";
    diag.CancelEvent = function(){parent.window.location.href='UseShowDf.aspx';diag.close()}
    diag.URL = "../../ShowASP/UseShow/UseShowAdd.aspx";
    diag.show();
//    ShowIframe3("../../ShowASP/UseShow/UseShowAdd.aspx",'400','450',"发布职位信息",'neiRC');
}

function editUswShowDept2(did)
{      
    //alert(did);
    var diag = new Dialog();
    diag.Width = 400;
    diag.Height = 450;
    diag.Title = "职位信息修改";
    diag.CancelEvent = function(){parent.window.location.href='UseShowDf.aspx'; diag.close()}
    diag.URL = "UseShowEdit.aspx?mtag=" + did;
    diag.show();
//    ShowIframe2("UseShowEdit.aspx?mtag="+did+"",'400','450','职位信息修改','UseShow2'+did+'');  
}

function diagAlert(txt){
	var diag = new Dialog();
	diag.AutoClose = 3;
	diag.ShowCloseButton = false;
	diag.URL = "javascript:void(document.write(" + txt + "))";
	diag.show();
}


function addOtherCol(id){
    var diag = new Dialog();
    diag.Width = 400;
    diag.Height = 450;
    diag.Title = "引用子内容";
    diag.URL = "../../ShowASP/indexAsp/addOtherCol.aspx?c_id="+id+"";
    diag.show();
}
