function selectTag(showContent,selfObj){
	// 操作标签
	var tag = document.getElementById("menu").getElementsByTagName("li");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.parentNode.className = "selectTag";
	// 操作内容
	for(i=0; j=document.getElementById("tagContent"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";
}

function displaySearch() {
	$('#searchpart').removeClass('none');
}

function hideSearch() {
	$('#searchpart').addClass('none');
}

function homeSlide() {
	$('#swf').nivoSlider({
        effect:'random', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 8, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:8000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:false, // 1,2,3... navigation
        controlNavThumbs:false // Use thumbnails for Control Nav
    });
}

function dropdown() {
	$(".dropdown dt a").click(function() {
		$(".dropdown dd ul").toggle();
	});	
	
	$(".dropdown dd ul li a").click(function() {
		var text = $(this).html();
		$(".dropdown dt a").html(text);
		$(".dropdown dd ul").hide();
	});
	
	$(document).bind('click', function(e) {
		var $clicked = $(e.target);
		if (! $clicked.parents().hasClass("dropdown"))
			$(".dropdown dd ul").hide();
	});
}

function showPopup(pos) {
	switch (pos) {
		case "overlay":
			$("a.iframe").fancybox({
				'padding'			: 0,
				'margin'			: 0,
				'width'				: 610,
				'height'			: 490,
				'popuptype'			: 'overlay',
				'autoScale'     	: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayOpacity'	: 0.5,
				'overlayColor'		: '#000'
			});
			break;
		case "right":
			$("a.iframe").fancybox({
				'padding'			: 0,
				'margin'			: 0,
				'width'				: 684,
				'height'			: 480,
				'autoScale'     	: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayShow'		: false
			});
			break;
	}	
}

function mCustomScrollbars(id){
	$(id).mCustomScrollbar("vertical",400,"easeOutCirc",1.05,"fixed","yes","yes",10); 
}

function mCustomHScrollbars(){
	$("#archives").mCustomScrollbar("horizontal",500,"easeOutCirc",1,"fixed","yes","yes",20);
}

function showSection(id) {
	$('.content').hide();
	$(id).show();
}
