function killErr(){return true;} window.onerror=killErr;

var sec = 1;

var thisNavObj;



function mouseout_x( ae ){   
        var e = window.event || ae;   
        var s = e.toElement || e.relatedTarget;          
        if(document.all){      
            if( !this.contains(s) ){      
                thisNav(thisNavObj);
				thisNavObj = null;
            }      
        }else{      
            var res= this.compareDocumentPosition(s) ;        
            if(!( res == 20 || res == 0) ){         
                thisNav(thisNavObj);
				thisNavObj = null;
            }        
        }     
}   

function mouseout_x2( ae ){   
        var e = window.event || ae;   
        var s = e.toElement || e.relatedTarget;          
        if(document.all){      
            if( !this.contains(s) ){      
                closeQQ();
            }      
        }else{      
            var res= this.compareDocumentPosition(s) ;        
            if(!( res == 20 || res == 0) ){         
                closeQQ();
            }        
        }     
}  




function second(id,obj){
	if(obj)$(".nav_m ul li div").removeClass("navAt");
	if(obj)$(obj).addClass("navAt");
	if(obj)thisNavObj=obj;
	$("#second").html($(id).html());
}
function clearDate(id){
	$(id).html("");
}
function innerNews(id,myid){
	$(".even").removeClass("hov");
	$(myid).addClass("hov");
	$("#news").html($(id).html());
	switch(id){
		case "#news1":
			$("#indexGoUrl").attr("href","/hanguozhuji.html");
			break;
		case "#news2":
			$("#indexGoUrl").attr("href","/zhuji.html");
			break;
		case "#news3":
			$("#indexGoUrl").attr("href","/hanguozhuji.html");
			break;
	}
}

function slideNews(id){
	
	$(".s").stop();
	$(".s").css({ height: 30 });
	$(id).parent().animate({ height: 152 },500);
	
	
}

function count() {
	
	$("#flash2 .s").stop();
	$("#flash2 .s").css({ height: 30 });
	$("#flash2 .s").eq(sec).animate({ height: 152 },500);
	sec++;
	if (sec >= 6) sec = 0;
	
}

function showImg(i){
		$("#img img")
			.eq(i).stop(true,true).fadeIn(1500)
			.parent().siblings().find("img").hide();
		$("#msg li")
			.eq(i).stop(true,true).fadeIn(1500)
			.siblings().hide();
		 $("#btn span")
			.eq(i).addClass("hov")
			.siblings().removeClass("hov");
}
function showTb(href,X,Y){
	var top=Y-50;
	//$("#TB_ajaxContent").load(href);
	//$.get(href, function(data){
  	//	$("#TB_ajaxContent").html(data);
	//});

	//$("#TB_window").css("top",top);
	$("#TB_overlay").show();
	$("#TB_window").show();
	divIframe.location.href=href;
}
function CloseTb(){
	$("#TB_overlay").hide();
	$("#TB_window").hide();
	divIframe.location.href="about:blank";
}

function thisNav(obj){
	var length = $(".nav_m ul li").size();
	if(this_nav<=length){
		$(obj).removeClass("navAt");
		if(this_nav!=1)$(".nav_m ul li").eq(this_nav-1).children().addClass("navAt");
		second('#navh'+this_nav,null);
	}
}
function setNav(){
	var length = $(".nav_m ul li").size();
	if(this_nav<=length){
		if(this_nav!=1)$(".nav_m ul li").eq(this_nav-1).children().addClass("navAt");
		second('#navh'+this_nav,null);
	}
}



function $2(str){
	return document.getElementById(str);
}


function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}



function getTotalHeight(){
	if($.browser.msie){
		return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight : document.body.clientHeight;
	}
	else {
		return self.innerHeight;
	}
}

function $2(str){
	return document.getElementById(str);
}




function openQQ(){
	$2("qqbar").style.display = "none";
	$2("qqcontent").style.display = "block";	
}

function closeQQ(){
	$2("qqbar").style.display = "block";
	$2("qqcontent").style.display = "none";
}
