//使代码永不报错
//function killErrors() {
	//return true;
//}
//window.onerror = killErrors;

//显示首页颜色CSS切换
function showIndexChangeColor(){
	var url = window.location.href;
	var k = 0;
	while(url.indexOf('/') > -1){
		url = url.replace('/','');
		k++;
	}
	if(k <= 3){
		document.getElementById('ccGreen').style.display='';
		document.getElementById('ccBlue').style.display='';
		document.getElementById('ccRed').style.display='';
	}
}

//定位导航栏到当前频道
function changeNavToCurrent(){
	var url = window.location.href;
	var URL = url.split('/');
	var str = URL[3];
	if(str == '' || str.indexOf('index') > -1){
		showDiv('pm',1,6);
	}else if(str == 'zjyc'){
		showDiv('pm',2,6);
	}else if(str == 'xwzx'){
		showDiv('pm',3,6);
	}else if(str == 'xxgk'){
		showDiv('pm',4,6);
	}
}

//导航切换1
function showDiv(obj,num,len)
{
 for(var id = 1;id<=len;id++)
 {
  var ss=obj+id;
  var snav =obj+"nav"+id;
  if(id==num){
	try{document.getElementById(ss).style.display="block"}catch(e){};
	try{document.getElementById(snav).className="active"}catch(e){};
  }else{
	try{document.getElementById(ss).style.display="none"}catch(e){};
	try{document.getElementById(snav).className=""}catch(e){};
  }
 }
}

//导航切换2
function showDivv(objv,numv,lenv)
{
 for(var id = 1;id<=lenv;id++)
 {
  var ssv=objv+id;
  var snavv =objv+"nav"+id;
  if(id==numv){
	try{document.getElementById(ssv).style.display="block"}catch(e){};
	try{document.getElementById(snavv).className="active"}catch(e){};
  }else{
	try{document.getElementById(ssv).style.display="none"}catch(e){};
	try{document.getElementById(snavv).className="normal"}catch(e){};
  }
 }
}

function showDivc(objv,numv,lenv)
{
 for(var id = 1;id<=lenv;id++)
 {
  var ssv=objv+id;
  var snavv =objv+"nav"+id;
  if(id==numv){
	try{document.getElementById(ssv).style.display="block"}catch(e){};
  }else{
	try{document.getElementById(ssv).style.display="none"}catch(e){};
  }
 }
}

