$(document).ready(function() {
	
	var mouseover_tid = [];
	var mouseout_tid = [];

	$('div.nav-bar > ul > li').each(function(index){
		$(this).hover(
			// 取消淡出菜单的线程, 延时淡入菜单
			function(){
				$(this).addClass("hover");
				var _self = this;
				clearTimeout(mouseout_tid[index]);
				//mouseover_tid[index] = setTimeout(function() {
				//	jQuery(_self).find('ul:eq(0)').show();
				//}, 0);
			},
 
			// 取消淡入菜单的线程, 延时淡出菜单
			function(){
				$(this).removeClass("hover");
				var _self = this;
				clearTimeout(mouseover_tid[index]);
				
				//mouseout_tid[index] = setTimeout(function() {
				//	jQuery(_self).find('ul:eq(0)').hide();
				//}, 400);

			}
 
		);
	});
	
    Shadowbox.init();
	 $('.map').each(function() {
        var url = $(this).attr("href");
    });

	$("#tabs").tabs();
	$("#imgshow").tabs();
	

	// toggle
	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").show(); 
	$(".sidetools .toggle_container").hide();	
	$(".infolist .toggle_container").hide();

	//Switch the "Open" and "Close" state per click
	$(".trigger").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});

	//Slide up and down on click
	$(".trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("slow,");
	});
	
	//Easy Slider
	$("#slider").easySlider({
		auto: true,
		continuous: true
	});
	$("div.slideshow").hover(function(){    
        $(this).addClass("hover");    
    }, function(){    
        $(this).removeClass("hover");    
    });
	
	
	//img gallery
	$("#pikame").PikaChoose();
	
	var sheight= $('div.sideshow').height();
	$("div.homepage-main").height(sheight + 750);
	
	
	//highlight hotpanel
	/*
	$("DIV.content-page DIV.hotpannel DIV.imgshow UL LI").bind({
	  click: function(){
	    $("DIV.content-page DIV.hotpannel DIV.imgshow UL LI").append('text')
	    
	  }
	});
	*/
	
	
		
});



