/*******************************************************************
**--> Intro: For Lizus Customize WordPress Themes
**--> Author: lizus.com@gmail.com
**--> WebSite: http://www.lizus.com
*******************************************************************/

jQuery.noConflict();

jQuery(document).ready(function ()
{
	jQuery('#sidebar h2:first').css({
		'border-top':0
	})
	jQuery('#search .searchbutton').hover(function(){
		jQuery(this).css({
			background:'#FD312F'
		});
	},function(){
		jQuery(this).css({
			background:'#CFCFCF'
		});
	});
});

jQuery(document).ready(function(){
	jQuery('.postH4').hover(function(){
		jQuery(this).addClass('hover');
	},function(){
		jQuery(this).removeClass('hover');
	});
	jQuery('#submit').hover(function(){
		jQuery(this).css({
			background:'#FD312F',
			'border-color':'#FD312F'
		});
	},function(){
		jQuery(this).css({
			background:'#CFCFCF',
			'border-color':'#CFCFCF'
		});
	});
});

jQuery(document).ready(function(){
	jQuery("#show .show_item:first").addClass('current');
	jQuery(".current").css("opacity","1.0");
	var int=setInterval( "slideSwitch()", 4000 ); 
	jQuery('#show .show_item').hover(function(){
		jQuery(this).children('.detail:first').show();
		int=clearInterval(int);
		//jQuery('#show .show_item').stop(true);
	},function(){
		jQuery(this).children('.detail:first').hide();
		int=setInterval( "slideSwitch()", 4000 );
	});
});

function slideSwitch() {
	var $current = jQuery("#show .show_item.current");
	// 判断div.current个数为0的时候 $current的取值
	if ( $current.length == 0 ) $current = jQuery("#show .show_item:last");
	
	// 判断div.current存在时则匹配$current.next(),否则转到第一个div
	var $next =  $current.next().length ? $current.next() : jQuery("#show .show_item:first");
	$current.addClass('prev');
	
	$next.css({opacity: 0.0}).addClass("current").animate({opacity: 1.0}, 1000, function() {
			//因为原理是层叠,删除类,让z-index的值只放在轮转到的div.current,从而最前端显示
			$current.removeClass("current prev");
		});
}

jQuery(document).ready(function(){
	jQuery('.widget_categories a').each(function(){
		var text=jQuery(this).parent().text();
		jQuery(this).html(text);
		jQuery(this).parent().html(jQuery(this));
	})
});