/*版权所有(c)2010-2020上海中信信息发展股份有限公司*/
if (typeof CESEvent=="undefined") {
	var CESEvent = {
		addEventListener : function(obj,type,fun){	
			if (obj.addEventListener) {
				obj.addEventListener(type, fun, false);
			} else if (obj.attachEvent) {//ie				
				 if (fun.refFun != null) {
				   alert('error!');
				   return;
				 }

				 fun.refFun = function(e){fun.call(obj,e);};
				 obj.attachEvent("on" + type, fun.refFun);
			} else {
				obj["on" + type] = fun;
			}
		},
		removeEventListener : function(obj,type,fun){
			if (obj.removeEventListener) {
				obj.removeEventListener(type, fun, false);
			} else if (obj.detachEvent) {//ie
				if(fun.refFun != null){
					obj.detachEvent("on" + type, fun.refFun);
					fun.refFun = null;
				}else{
					obj.detachEvent("on" + type, fun);
				}
			} else { 
				obj["on" + type] = null;
			}			
		},
		getEvent : function(e){
			return window.event ? window.event : e;
		}
	};
};

function $() { 
  var element = arguments[0]; 
  if (typeof element == 'string'){
      element = document.getElementById(element);
  }
  
  return element;
}

function $W() {
	document.write(arguments[0]);
}

if (typeof SpecialNavigation=="undefined") {
	(function () {
		if(typeof this["SpecialNavigation"]=="undefined"){
			this.SpecialNavigation = {};
		}
		SpecialNavigation.isIE = (navigator.userAgent.toLowerCase().indexOf("msie") != -1);
		SpecialNavigation.id = 'spNav';
		SpecialNavigation.btnNames = {TOPBtn:'已跳转到顶部',HIDBtn:'跳过工具条',FSZOBtn:'文字放大',FSZIBtn:'文字缩小',HCTABtn:'高对比度',FZXBtn:'辅助线',GRAYBtn:'界面灰度',ZOBtn:'界面放大',ZIBtn:'界面缩小'};
		SpecialNavigation.btnKeys = {FSZOBtn:49,FSZIBtn:50,HCTABtn:51,FZXBtn:52,GRAYBtn:53,ZOBtn:54,ZIBtn:55,SwitchKey:74};
		SpecialNavigation.elements = ['div','li','ul','span',"td","tr","a"]; 
		SpecialNavigation.useDefinedKey = [];   
		SpecialNavigation.scrollHight=0;
		SpecialNavigation.height=0;
		SpecialNavigation.pos={x:0,y:0};
		SpecialNavigation.zoom=1;
		SpecialNavigation.fontSize=16;
		SpecialNavigation.maxFS=24;
		SpecialNavigation.minFS=16;

		SpecialNavigation.setHotKey = function (key,fun) {
			this.useDefinedKey[this.useDefinedKey.length] = {key:key,fun:fun};
		};

		SpecialNavigation.createNav = function () {
			$W("<div id='"+this.id+"'><ul><li>");
			$W("<a id='spNavTOPBtn' tabindex='-1' href='#spNavTOPBtn' style='width:0; height:0; overflow:hidden;font-size:0;line-height:0;position:absolute;z-index:-10;border:none;color:#FFF'>"+this.btnNames.TOPBtn+"</a>");
			$W("<button id='"+this.id+"HIDBtn' tabindex='0' onClick='SpecialNavigation.setFocusToMain();' title='"+this.btnNames.HIDBtn+"'><font>"+this.btnNames.HIDBtn+"</font></button>");
			$W("<button id='"+this.id+"FSZOBtn'  onClick='SpecialNavigation.changeFontSize(1);' title='"+this.btnNames.FSZOBtn+"'><font>"+this.btnNames.FSZOBtn+"</font></button>");
			$W("<button id='"+this.id+"FSZIBtn'  onClick='SpecialNavigation.changeFontSize(-1);' title='"+this.btnNames.FSZIBtn+"'><font>"+this.btnNames.FSZIBtn+"</font></button>");
			$W("<button id='"+this.id+"HCTABtn'  onClick='SpecialNavigation.switchContrast();' title='"+this.btnNames.HCTABtn+"'><font>"+this.btnNames.HCTABtn+"</font></button>");
			$W("<button id='"+this.id+"FZXBtn'  onClick='SpecialNavigation.switchFZX();' title='"+this.btnNames.FZXBtn+"'><font>"+this.btnNames.FZXBtn+"</font></button>");

			$W("<span></span>");

			if (this.isIE) {
				$W("<button id='"+this.id+"GRAYBtn'  onClick='SpecialNavigation.switchGray();'  title='"+this.btnNames.GRAYBtn+"'><font>"+this.btnNames.GRAYBtn+"</font></button></a>");
				$W("<button id='"+this.id+"ZOBtn'  onClick='SpecialNavigation.changeZoomSize(arguments[0],0.2);' onKeyPress='SpecialNavigation.changeZoom(0.2);' title='"+this.btnNames.ZOBtn+"'><font>"+this.btnNames.ZOBtn+"</font></button>");
				$W("<button id='"+this.id+"ZIBtn'  onClick='SpecialNavigation.changeZoomSize(arguments[0],-0.2);' onKeyPress='SpecialNavigation.changeZoom(-0.2);' title='"+this.btnNames.ZIBtn+"'><font>"+this.btnNames.ZIBtn+"</font></button>");
			}

			$W("</li></ul></div>");
		};

		SpecialNavigation.create = function () {
			$W("<div class='"+this.id+"'>");
			$W("<table id='"+this.id+"TB' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td align='center'>");
			this.createNav();
			$W("</td></tr></table>");
			this.createFZX();
			$W("</div>");
		};

		SpecialNavigation.createFZX = function () {
			$W("<div id='"+this.id+"FZXH'></div>");
			$W("<div id='"+this.id+"FZXV'></div>");
		};

		SpecialNavigation.load = function() {
			SpecialNavigation.fixNav();
		};

		SpecialNavigation.setFocusToMain = function() {
			document.getElementById("main").focus();
			index_tab_ctrlz = 2;
		};


		SpecialNavigation.keyDown = function(e) {
			try {
				var key = e.keyCode ? e.keyCode : (e.which ? e.which : e.charCode);
				if (e.altKey||e.shiftKey) {
					if (e.ctrlKey||e.altKey) {
						switch (key) {
							case SpecialNavigation.btnKeys.FSZOBtn:
								//$(SpecialNavigation.id+"FSZOBtn").focus();
								break;
							case SpecialNavigation.btnKeys.FSZIBtn:
								//$(SpecialNavigation.id+"FSZIBtn").focus();
								break;
							case SpecialNavigation.btnKeys.HCTABtn:
								//$(SpecialNavigation.id+"HCTABtn").focus();
								break;
							case SpecialNavigation.btnKeys.FZXBtn:
								//$(SpecialNavigation.id+"FZXBtn").focus();
								break;
							case SpecialNavigation.btnKeys.GRAYBtn:
								//$(SpecialNavigation.id+"GRAYBtn").focus();
								break;
							case SpecialNavigation.btnKeys.ZOBtn:
								//$(SpecialNavigation.id+"ZOBtn").focus();
								break;
							case SpecialNavigation.btnKeys.ZIBtn:
								//$(SpecialNavigation.id+"ZIBtn").focus();
								break;
							case SpecialNavigation.btnKeys.SwitchKey:
								SpecialNavigation.showOrHiddenNav();
								break;
							default :
								
								break;
						}
					}
				}
				if (SpecialNavigation.useDefinedKey != null && SpecialNavigation.useDefinedKey.length > 0) {
					for (var i=0; i<SpecialNavigation.useDefinedKey.length; i++) {
						if (SpecialNavigation.useDefinedKey[i].key == key) {
							SpecialNavigation.useDefinedKey[i].fun(e);
						}
					}
				}
			} catch (e) {};
		};

		SpecialNavigation.showOrHiddenNav = function () {
			 var navObj = $(this.id);
			 var n = document.getElementById("nav");
			 var toolbar = document.getElementById("toolbar");
			 if(navObj.style.visibility == '' || navObj.style.visibility == 'hidden') {
				navObj.style.visibility = "visible";
				n.style.display = "block";
				$(this.id+'TB').style.height=15+"px";
				if(toolbar!=null){
					toolbar.innerHTML="关闭辅助工具条";
				}
				//写cookie
				var exp = new Date();    
				exp.setTime (exp.getTime() + 30*24*60*60*1000);   
				document.cookie = "status=open;" + "path=/;expires=" + exp.toGMTString();  
				//提示打开工具条
				if(document.getElementById("opened")!=null){
					document.getElementById("opened").focus();
				}
			 } else {
				navObj.style.visibility = "hidden";
				n.style.display = "none";
				$(this.id+'TB').style.height=0+"px";
				if(toolbar!=null){
					toolbar.innerHTML="打开辅助工具条";
				}
				// reset value of cookie
				//写cookie
				var exp = new Date();    
				exp.setTime (exp.getTime() + 30*24*60*60*1000);   
				document.cookie = "status=close;" + "path=/;expires=" + exp.toGMTString(); 
				//提示关闭工具条
				if(document.getElementById("closed")!=null){
					document.getElementById("closed").focus();
				}
			 }
		};

		SpecialNavigation.scroll = function() {
			SpecialNavigation.fixNav();
			$(SpecialNavigation.id).style.top=document.documentElement.scrollTop;
		};

		SpecialNavigation.resize = function() {
			SpecialNavigation.fixNav();
		};

		SpecialNavigation.fixNav = function() {
			var divHeight=document.documentElement.scrollTop-this.scrollHight;
			var navObj = $(this.id);
			navObj.style.top = divHeight+this.height+"px";
			if(parseInt(navObj.style.top)<0){
				navObj.style.top=document.documentElement.scrollTop*this.zoom;
			}
			if(parseInt(navObj.style.width)==100){
				navObj.style.top=document.documentElement.scrollTop;
			}
		};

		SpecialNavigation.init = function() {
			//页面加载时,先隐藏所有的层
			hiddenDiv();
			var st =getcookie("status");
			if(st=="open"){
				SpecialNavigation.showOrHiddenNav();
			}
			var toolbar = document.getElementById("toolbar");
			var navObj = document.getElementById("spNav");
			if(toolbar!=null){
				if(navObj.style.visibility == "visible"){
					toolbar.innerHTML="关闭辅助工具条";
				}
				if(navObj.style.visibility == "hidden" || navObj.style.visibility == ""  || navObj.style.visibility == null){
					toolbar.innerHTML="打开辅助工具条";
				}
			}
			if(document.getElementById("ctrlz")!=null){
				document.getElementById("main").focus();
			}
			CESEvent.addEventListener(window,'scroll',SpecialNavigation.scroll);
			CESEvent.addEventListener(document.body,'load',SpecialNavigation.load);
			CESEvent.addEventListener(document.body,'keydown',SpecialNavigation.keyDown);
			CESEvent.addEventListener(document.body,'resize',SpecialNavigation.resize);
		};

		SpecialNavigation.changeFontSize = function (offset) {
			this.fontSize += offset;
			if (this.fontSize>this.maxFS) {
				this.fontSize = this.maxFS;
			}
			if (this.fontSize<this.minFS) {
				this.fontSize = this.minFS;
			}
			document.body.style.fontSize = this.fontSize+'px';

			for (var i=0; i<this.elements.length; i++) {
				var eles = document.body.getElementsByTagName(this.elements[i]);
				if (eles != null && eles.length > 0) {
					for (var j=0; j<eles.length; j++) {
						eles[j].style.fontSize = this.fontSize+'px';
					}
				}
			}
		};

		SpecialNavigation.switchContrast = function () {
			if(document.body.style.background=='#000000') {
				document.body.style.background="";
				document.body.style.color="";
			} else {
				document.body.style.background='#000000';
				document.body.style.color='#FFFFFF';
			}
		};

		SpecialNavigation.switchFZX = function () {
			var hLine = $(this.id+'FZXH');
			var vLine = $(this.id+'FZXV');

			if (hLine.style.display=='' || hLine.style.display=='none') {                     
				hLine.style.display='block';
				vLine.style.display='block';
				CESEvent.addEventListener(document,'mousemove',SpecialNavigation.mouseMove);
			} else {
				hLine.style.display='none';
				vLine.style.display='none';
				CESEvent.removeEventListener(document,'mousemove',SpecialNavigation.mouseMove);
			}
		};

		SpecialNavigation.switchGray = function () {
			if (document.body.className=='spNavGray') {
				document.body.className='';
				document.body.style.filter='';
			} else {
				document.body.className='spNavGray';
				document.body.style.filter='progid:DXImageTransform.Microsoft.BasicImage(GrayScale=1)';
			}
		};

		SpecialNavigation.changeZoomSize = function (e,offset) {
			var navObj = $(this.id);
			e=CESEvent.getEvent(e);
			this.zoom=this.zoom+offset;
			if(this.zoom>2){
				document.body.style.zoom=2;
				this.zoom=2;
			}
			if (this.zoom<=2 && this.zoom>=1){
				document.body.style.zoom=this.zoom;
			}
			if(this.zoom<1){
				document.body.style.zoom=1;
				this.zoom=1;
			}
			navObj.style.zoom=1;
			$(this.id+'TB').style.width=998+"px";

			if(parseInt(navObj.style.top)<=0) {
				this.pos.x=e.clientX-navObj.offsetLeft;
				this.pos.y=e.clientY-navObj.offsetTop;
				navObj.style.left=e.clientX-this.pos.x+"px";
				navObj.style.top=e.clientY-this.pos.y+"px";

				if((e.clientY-this.pos.y)>0){
					navObj.style.width=100+'px';
					navObj.style.backgroundColor="#639BCE";
					navObj.style.height="300px";
				} else {
					navObj.style.width=100+'%';
					navObj.style.top=0+'px';
					navObj.style.left=0+'px';
					navObj.style.backgroundColor="";
					navObj.style.height="";
				}

				if((e.clientX-this.pos.x)<0){
					navObj.style.left=0+'px';
				}

				this.height=e.clientY-this.pos.y;
				this.scrollHight=document.documentElement.scrollTop;
			}
		};

		SpecialNavigation.changeZoom = function (offset) {
			this.zoom=this.zoom+offset;
			if (this.height<0) {
				this.height = 0;
			}
			if (this.zoom<=2 && this.zoom>=1){
				document.body.style.zoom=this.zoom;
			}else{
				document.body.style.zoom=1;
			}
			
			$(this.id).style.zoom=1;
		};

		SpecialNavigation.mouseMove = function (e) {
			e=CESEvent.getEvent(e);
			$(SpecialNavigation.id+'FZXH').style.top=e.clientY+10+document.documentElement.scrollTop+"px";
			$(SpecialNavigation.id+'FZXV').style.height=document.documentElement.scrollHeight;
			$(SpecialNavigation.id+'FZXH').style.width=document.documentElement.scrollWidth;
			$(SpecialNavigation.id+'FZXV').style.left=e.clientX+10+document.documentElement.scrollLeft+"px";
		};

		SpecialNavigation.blurObj = function (obj) {
			try {
				obj.onblur();
			} catch (e) {};
		};

		SpecialNavigation.create();
		CESEvent.addEventListener(window,'load',SpecialNavigation.init);
	})();
};

//无障碍中让层获得焦点
var index_tab = 0; //切换时的索引//首页栏目切换z
var index_tab_ctrlz = 0;
SpecialNavigation.setHotKey(90,copytab);
function copytab(e) {
	var version = parseFloat(navigator.appVersion.split("MSIE")[1]);
	//定位到不同的层
	//ie7以上时正向切换
	if (!e.shiftKey) {
		if (e.ctrlKey) {
			//if(version>6){
				if(document.getElementById("ctrlz")==null){
					index_tab++;
					tabDiv(index_tab);
				}else{
					opentoolbar();
					index_tab_ctrlz++; 
					tabDivCtrlZ(index_tab_ctrlz);
				}
			//}
		}
	}
	//ie6时正向切换
	if (!e.shiftKey) {
		if(e.altKey){
			if(version==6){
				if(document.getElementById("ctrlz")==null){
					index_tab++;
					tabDiv(index_tab);
				}else{
					opentoolbar();
					index_tab_ctrlz++; 
					tabDivCtrlZ(index_tab_ctrlz);
				}
			}
		}
	}
	//ie7以上时反向切换
	//if(version>6 && e.ctrlKey && e.shiftKey){
 	if(e.ctrlKey && e.shiftKey){
		if(document.getElementById("ctrlz")==null){
			index_tab--;
			tabDiv(index_tab);
		}else{
			opentoolbar();
			index_tab_ctrlz--; 
			tabDivCtrlZ(index_tab_ctrlz);
		}
		
	}
	//ie6时反向切换
	if(version==6 && e.altKey && e.shiftKey){
		if(document.getElementById("ctrlz")==null){
			index_tab--;
			tabDiv(index_tab);
		}else{
			opentoolbar();
			index_tab_ctrlz--; 
			tabDivCtrlZ(index_tab_ctrlz);
		}
	}
}

function tabDiv(index_tab_temp){
	switch (index_tab_temp) {
			case 1:
				setFocus("tpxw");
				break;
			case 2:
				setFocus("sfxzyw");
				break;
			case 3:
				setFocus("wsbs");
				break;
			case 4:
				setFocus("tzgg");
				break;
			case 5:
				setFocus("zxgkxx");
				break;
			case 6:
				setFocus("wsfw");
				break;
			case 7:
				setFocus("cxfw");
				break;
			case 8:
				setFocus("hdjl");
				break;
			case 9:
				setFocus("sfxzztc");
				break;
			case 10:
				setFocus("sfxzyws");
				break;
			case 11:
				setFocus("dzxx");
				break;
			case 12:
				setFocus("fwtj");
				break;
			default :
				if(index_tab>12){//开始正向新一轮切换
					index_tab=1;
					setFocus("tpxw");
				}
				if(index_tab<=0){ //开始反向新一轮切换
					index_tab = 12;
					setFocus("fwtj");
				}
				break;
		}
}

function tabDivCtrlZ(index_tab_temp){
	switch (index_tab_temp) {
			case 1:
				setFocus("spNavTOPBtn");
				break;
			case 2:
				setFocus("main");
				break;
			case 3:
				setFocus("content");
				break;
			default :
				if(index_tab_ctrlz>3){//开始正向新一轮切换
					index_tab_ctrlz=1;
					setFocus("spNavTOPBtn");
				}
				if(index_tab_ctrlz<=0){ //开始反向新一轮切换
					index_tab_ctrlz = 3;
					setFocus("content");
				}
				break;
		}
}

SpecialNavigation.setHotKey(77,main);//司法行政要闻,快捷键是m
function main(e) {
		setFocus("main");
		index_tab_ctrlz = 2;
		index_tab = 2;
}

SpecialNavigation.setHotKey(76,left);//左栏,快捷键是l
function left(e) {
	if (e.altKey || e.shiftKey) {
		if(e.altKey || e.ctrlKey){
			if(e.altKey || e.ctrlKey || e.shiftKey){
				setFocus("left");
			}
		}
	}
}

SpecialNavigation.setHotKey(67,content);//右栏,快捷键是c
function content(e) {
	if (e.altKey || e.shiftKey) {
		if(e.altKey || e.ctrlKey){
			if(e.altKey || e.ctrlKey || e.shiftKey){
				setFocus("content");
			}
		}
	}
}

SpecialNavigation.setHotKey(75,spNavTOPBtn);//top,快捷键是k
function spNavTOPBtn(e) {
	if (e.altKey || e.shiftKey) {
		if(e.altKey || e.ctrlKey){
			if(e.altKey || e.ctrlKey || e.shiftKey){
				opentoolbar();
			}
		}
	}
}

//控制工具条的打开和关闭
function ctrltoolbar(){
	var toolbar = document.getElementById("toolbar");
	var navObj = document.getElementById("spNav");
	if(toolbar!=null){
		if(navObj.style.visibility == "visible"){
			toolbar.innerHTML="打开辅助工具条";
		}
		if(navObj.style.visibility == "hidden" || navObj.style.visibility == ""  || navObj.style.visibility == null){
			toolbar.innerHTML="关闭辅助工具条";
		}
		SpecialNavigation.showOrHiddenNav();
	}
}

function opentoolbar(){//仅仅只打开工具条
	var n = document.getElementById("nav");
	if(n!=null){
		if(n.style.display!='block') {
			n.style.display="block";
			var navObj = document.getElementById("spNav");
			navObj.style.visibility = "visible";
		}
	}
	//写cookie
	var exp = new Date();    
	exp.setTime (exp.getTime() + 30*24*60*60*1000);   
	document.cookie = "status=open;" + "path=/;expires=" + exp.toGMTString();  
	//提示打开工具条
	if(document.getElementById("opened")!=null){
		document.getElementById("opened").focus();
	}
	document.getElementById("spNavTOPBtn").focus();	
}

function setFocus(obj){
	document.getElementById(obj).focus();
}

//无障碍隐藏层
function hiddenDiv(){
	var clname=document.getElementsByTagName("div");
	for(b=0;b<clname.length;b++){
		if(clname[b].className=="index_div"){
			clname[b].style.height=0+"px";
			if(clname[b].getElementsByTagName("a").length>0){
				clname[b].getElementsByTagName("a")[0].style.height=0+"px";
				clname[b].getElementsByTagName("a")[0].style.lineHeight=0+"px";
				clname[b].getElementsByTagName("a")[0].style.fontSize=0+"px";
				clname[b].getElementsByTagName("a")[0].style.color="#FFF";
			}
		}
	}

}

//getcookie
function getcookie(name) { 
  var mycookie = document.cookie;
  var start1 = mycookie.indexOf(name + "="); 
  if (start1== -1){
	return null;
  }else { 
	  start=mycookie.indexOf("=",start1)+1;  
	  var end = mycookie.indexOf(";",start); 
	  if (end==-1) { 
		end=mycookie.length;
	  } 
	  var value=unescape(mycookie.substring(start,end)); 
	  if (value==null) {
		 return null;
	   }else {
		 return value;
	  } 
  } 
} 


function zoombig(){
	var wzatool = document.getElementById("wzatool");
	wzatool.style.border="1px solid red";
	wzatool.style.fontSize="24px";
	wzatool.style.lineHeight="26px";
	//wzatool.style.position="absolute";
	wzatool.style.width="120px";
	wzatool.style.height="26px";
	wzatool.style.zIndex="10";
	wzatool.style.display="block";
	wzatool.style.marginTop="0px";
	wzatool.style.marginleft="-1px";
	wzatool.style.backgroundColor="#FFF";
}

function zoomsmall(){
		var wzatool = document.getElementById("wzatool");
		wzatool.style.border="";
		wzatool.style.fontSize=document.body.style.fontSize;
		wzatool.style.lineHeight="";
		wzatool.style.position="";
		wzatool.style.width="";
		wzatool.style.height="";
		wzatool.style.zIndex="";
		wzatool.style.display="";
		wzatool.style.backgroundColor="";
		wzatool.style.marginTop="";
		wzatool.style.marginleft="";		
}