﻿var x = 80,y = 90 
var xin = true, yin = true 
var step = 1 
var delay = 50
var IsStart=1
var initializeValue
var itl;
function initialize()
{
   for(i=1;i<13;i++)
   {
      initializeValue=i;
   }
}
var  $c=function(array){var nArray = [];for (var i=0;i<array.length;i++) nArray.push(array[i]);return nArray;};
Array.prototype.each=function(func){
for(var i=0,l=this.length;i<l;i++) {func(this[i],i);};
};
document .getElementsByClassName=function(cn){
var hasClass=function(w,Name){
var hasClass = false;
w.className.split(' ').each(function(s){
if (s == Name) hasClass = true;
});
return hasClass;
};
var elems =document.getElementsByTagName("*")||document.all;
            var elemList = [];
           $c(elems).each(function(e){
if(hasClass(e,cn)){elemList.push(e);}
		   })
        return $c(elemList);
};
function change_bg(obj){
var a=document.getElementsByClassName("div_dh")[0].getElementsByTagName("a");
for(var i=0;i<a.length;i++){a[i].className="";}
obj.className="current";
}
<!--红色栏目 -->
function switchmodTag_red(modtag,modcontent,modk) { 
for(i=1; i <7; i++) { 
if (i==modk) { 
document.getElementById(modtag+i).className="red_background2";
document.getElementById(modcontent+i).className="slidingList_block";}
else
{
document.getElementById(modtag+i).className="red_background";
document.getElementById(modcontent+i).className="slidingList_none";
} 
}
}
function setUrl(url)
{
   location=url;
}
function LinkUrl(obj)
{
    if(obj.options[obj.selectedIndex].value!=-1)
    openNewWindowByMenuT(obj.options[obj.selectedIndex].value)
}
//弹出全屏窗口
function openNewWindowByMenuT(url){
    window.open(url,"_blank","left=0,top=0,height="+screen.availHeight+",width="+screen.availWidth+",status=yes,resizable=1,scrollbars=yes,toolbar=yes,menubar=yes");
}



function picStartMove(start)
{
    IsStart=start;
    if(IsStart==1)
    {
        if(divPicMove!=null)
        {
            divPicMove.style.display="";
            picMoveStart();  
        }
    }
    else{
    if(divPicMove!=null)
    divPicMove.style.display="none";
    } 
}
//广告漂浮
function picMoveFunction() {
var L=T=0
//var obj=document.getElementById("divPicMove");
var R= document.documentElement.clientWidth-divPicMove.offsetWidth ;
var B = document.documentElement.clientHeight-divPicMove.offsetHeight; 
divPicMove.style.left = x + document.documentElement.scrollLeft ;
divPicMove.style.top = y + document.documentElement.scrollTop ;
x = x + step*(xin?1:-1) 
if (x < L) { xin = true; x = L} 
if (x > R){ xin = false; x = R} 
y = y + step*(yin?1:-1) 
if (y < T) { yin = true; y = T } 
if (y > B) { yin = false; y = B } 
}
 
function picMoveStart()
{
    //var obj=document.getElementById("divPicMove") 
    itl= setInterval("picMoveFunction()", delay) 
    divPicMove.onmouseover=function(){clearInterval(itl)} 
    divPicMove.onmouseout=function(){itl=setInterval("picMoveFunction()", delay)} 
}

function colseMoveDiv(obj)
{
    if(obj!=null)
     obj.style.display="none";
     IsStart=0;
     clearInterval(itl);
}
function Setonmouseover(Navigation)
{
   for(i=0;i<12;i++)
   {  
       if(i==Navigation)
	   { 
         document.getElementById("Navigation"+i).className="current"; 
	   }
	   else
	   { 
	      document.getElementById("Navigation"+i).className=""; 
	   }
   }
} 
function SetItem(count,ItemID)
{
   
   for(i=0;i<count;i++)
   {  
       if(i==ItemID)
	   { 
         document.getElementById("Item"+i).className="list_left_light"; 
	   }
	   else
	   { 
	      document.getElementById("Item"+i).className="list_left_a"; 
	   }
   }
}

function $$(element)
{
    return document.getElementById(element);
}
function show(aa,bb)
{

    for(var i=1;i<12;i++)
    {
       $$("div"+i).style.display="none";
       $$("nav"+i).style.display="none";
    }
	aa.style.display="block";
	bb.style.display="block";
	
}
function getPosition(el) 
{ 
  for(var lx=50,ly=50;el!=null;lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent); 
  return {x:lx,y:ly} 
}

function doClick(itemName)
{
    $.each($("#tab1 ul li span"),function(i){
        if(this.id==itemName)
        {
            this.className="nav_current";
            $("#menu"+(i+1)).get(0).style.display="";
        }
        else
        {
            this.className="nav_link";
            $("#menu"+(i+1)).get(0).style.display="none";
        }
    })
//   document.getElementById(nav).className="nav_current";
//   var j;
//   var id;
//   var e;
//   for(var i=1;i<count;i++)
//   {
//     id ="nav"+i;
//     j = document.getElementById(id);
//     e = document.getElementById("menu"+i);
//     if(id != nav)
//     {
//        j.className="nav_link";
//        e.style.display = "none";
//     }
//     else
//     {
//        e.style.display = ""; 
//      }
//    }
} 

/**
为选中的项增加样式
@author lianghf add by 2009-08-04
*/
function SelectItem(eleName)
{
  //debugger
   var items=$(".left_font_02").children();
   var itemClassName="list_left_light line_blue";
   if(eleName == ""||eleName==null)//如果是第一个，则默认选中第一个
   {
        items.get(0).className=itemClassName;//获得第一个,修改其样式为选中状态
        return;
   }
   else
   {
       $.each(items,function()
       {
            if(this.id==eleName)
            {
                this.className=itemClassName;
            }
            else
            {
                if(this.className!="list_left_top")
                {
                  this.className="list_left_a line_blue";
                }
            }
       });
   }
}

function doZoom(size)
{
    $("#ctl00_cph_context_lblContent").get(0).style.fontSize=size+'px';
}

function change()
{
    $("#td1").get(0).style.backgroundImage="url(../images/web/index_bggs_01-2.jpg)";
    $("#td2").get(0).style.backgroundImage="url(../images/web/index_bggs_02-2.jpg)";
    $("#gsxx").get(0).style.display="none";
    $("#bggss").get(0).style.display="block";
    $("#bggsandgsxx").get(0).href="PublicNotice.aspx?MenuName=PublicNotice&ModeId=3&title=%e9%80%9a%e7%9f%a5%e5%85%ac%e5%91%8a&ItemId=F3123331B35E458DA24AB60F521F87DE&ItemName=%e5%85%ac%e7%a4%ba%e4%bf%a1%e6%81%af&clearpaging=true";
}
function change2()
{
    $("#td1").get(0).style.backgroundImage="url(../images/web/index_bggs_01.jpg)";
    $("#td2").get(0).style.backgroundImage="url(../images/web/index_bggs_02.jpg)";
    $("#gsxx").get(0).style.display="block";
    $("#bggss").get(0).style.display="none";
    $("#bggsandgsxx").get(0).href="BggsList.aspx?MenuName=PublicInformation&ModeId=6&title=%e4%ba%a4%e6%98%93%e4%bf%a1%e6%81%af&ItemId=bggs&ItemName=%e5%8f%98%e6%9b%b4%e5%85%ac%e7%a4%ba&clearpaging=true";
}

function SetHrefForMore()
{
    //var hrefs={}
    //$.each($("#projectList>table"),function(){
        //alert($(this).children.length);
        //alert($("#"+this.id).get(0).innerHTML);
        //alert("#"+this.id);
        //alert(this.id);
        //alert($("#"+this.id tr).length);
        //alert($(this)
        //alert($($(this).get(0)).get(0).innerHTML);
        //alert(this.innerHTML);
        //$($(this).find("tr").get(0)).find("a").get(0).href="PublicInfoList.aspx?MenuName=PublicInformation&ModeId=0&title=%e4%ba%a4%e6%98%93%e4%bf%a1%e6%81%af&ItemId=zbgg&ItemName=%e6%8b%9b%e6%a0%87%e5%85%ac%e5%91%8a&clearpaging=true";
    //})
}



//根据菜单名称获取Url地址
function GetHref(menuName)
{
    switch(menuName.Trim())
    {
       
        case "通知公告":
        return "PublicNotice.aspx?MenuName=PublicNotice&clearpaging=true";
        case "交易信息":
        return "PublicInfoList.aspx?MenuName=PublicInformation&clearpaging=true";
        case "网上办事":
        return "WorkInNet.aspx?MenuName=InternetWork&clearpaging=true";
        case "服务指南":
        return "PublicNotice.aspx?MenuName=PolicyLaw&clearpaging=true"; 
        case "下载专区":
        return "PublicNotice.aspx?MenuName=DownLoadArea&clearpaging=true";
        case "会议信息":
        return "GreetingArrange.aspx?MenuName=PartyCorpsWomanBuild&clearpaging=true";
        case "中心简介":
        return "AboutUs.aspx?MenuName=AboutAs&clearpaging=true";
    }
}

//修改搜索
function changeSearch(el)
{
    switch(el.value)
    {
        case "标题":
        case "信息来源":
        $.each($("#tbSearch tr td"),function(i,n){
            if(i==2||i==3||i==0||i==1)
            {
                $(this).show();
            }
            else
            {
                $(this).hide();
            }
        })
        break;
        case "发布日期":
        $.each($("#tbSearch tr td"),function(i,n){
            if(i==2||i==3)
            {
                $(this).hide();
            }
            else
            {
                $(this).show();
            }
        })
        break;
    }
    $("#tbSearch tr td:eq(8)").show();
}
//修改搜索
function changeSearchStreet(el)
{
    
    switch(el.value)
    {
        case "Gcmc":
        case "Jsdw":
        $.each($("#tbSearch tr td"),function(i,n){
            if(i==2||i==3||i==0||i==1)
            {
                $(this).show();
            }
            else
            {
                $(this).hide();
            }
        })
        break;
        case "Fbrq":
        $.each($("#tbSearch tr td"),function(i,n){
            if(i==2||i==3)
            {
                $(this).hide();
            }
            else
            {
                $(this).show();
            }
        })
        break;
    }
    $("#tbSearch tr td:eq(8)").show();
}





 function checkButton()
{
 var CAKey = GetSignCertificate();      
  if(CAKey!="")
   {
      $("#ctl00_cph_context_Login1_hfCertTitle").get(0).value=CAKey;
       alert(CAKey);
      return true;
   }
   else
  {
  return false;
  }
}




//修改搜索
function changeSearchInfo(el)
{
    switch(el.value)
    {
        case "fbrq":
        $.each($("#tbSearch tr td"),function(i,n){
            if(i==4||i==5)
            {
                $(this).show();
            }
            else if(i==2||i==3)
            {

                $(this).hide();
            }
        })
        break;
        default :
         $.each($("#tbSearch tr td"),function(i,n){
            if(i==2||i==3)
            {
                $(this).show();
            }
            else if(i==4||i==5)
            {

                $(this).hide();
            }
        })
        break;
    }
    $("#tbSearch tr td:eq(6)").show();
}
function chgAuditTable()
{
   if(document.getElementById("ctl00_cph_context_RadioButtonList1_0").checked==true)
   {
      document.getElementById("trLht").style.display="";
   }
   else
   {
     document.getElementById("trLht").style.display="none";
   }
}
function Combo()
{
   var keyValue="";
   keyValue=GetSignCertificate();
   if(keyValue=="")
   {
     alert("请插入CA");
     return false;
   }
//   if($("#ctl00_cph_context_hfMainCa").get(0).value==keyValue)
//   {
//     alert("主体单位不需要插入CA！");
//     return false;
//   }
   $("#ctl00_cph_context_hfCombo").get(0).value=keyValue;
   return true;
}
function ItmeMgr()
{
  var keyValue="";
   keyValue=GetSignCertificate();
   if(keyValue=="")
   {
     alert("请插入CA");
     return false;
   }
   $("#ctl00_cph_context_hfXmjlCa").get(0).value=SZCAOcx.AxGetCertInfo("SN");
   $("#ctl00_cph_context_hfXmjlCaTitle").get(0).value=keyValue
   return true;
}
function openWindow()
{
      openNewWindow(600,500,'../Common/FileUpload.aspx?FileType=Tbbm&gcbh='+$('#ctl00_cph_context_hfguid').get(0).value);
      return false;
}
function openWindowTb()
{
      openNewWindow(600,500,'../Common/FileAddTb.aspx?FileType=Tbbm&gcbh='+$('#ctl00_cph_context_lblGCBH').get(0).innerHTML);
      return false;
}
function IsOver()
{
   return  confirm("您确定完成吗？完成后数据不可更改！");
}
function switchmodTag_red(modtag,modcontent,modk) { 
for(i=1; i <7; i++) { 
if (i==modk) { 
document.getElementById(modtag+i).className="red_background2";
document.getElementById(modcontent+i).className="slidingList_block";}
else
{
document.getElementById(modtag+i).className="red_background";
document.getElementById(modcontent+i).className="slidingList_none";
} 
}
}

function ReinventLogin()
{
  alert("未登录！请登录！");
 window.location.href='index.aspx'
}
function PrintTempPrject()
{
    openModelscrollWindow(800,600,"PrintPrjectTemp.aspx?guid="+document.getElementById("ctl00_cph_context_hfguid").value)
}
//在屏幕中央弹出新窗口
function openNewWindowBy(width,height,url){
    var startW = (screen.availWidth - width)/2;
    var startH = (screen.availHeight - height)/2;
    window.open(url,"_blank","left="+startW+",top="+startH+",height="+height+",width="+width+",status=no,resizable=1,scrollbars=yes,toolbar=no,menubar=no,location=no");
}
