jQuery.noConflict();
jQuery(document).ready(function() { 
	jQuery('.demo').hide(); // this is for demo purposes only. you can disregard this line.	
	//jQuery('#breaking-wrapper').hide(); // enable this line to hide the breaking panel by default.	
		// SUPERFISH
	jQuery('#page-menu ul').superfish({
		hoverClass:  'over', 						// the class applied to hovered list items 
		delay:       400,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       150,                          // faster animation speed 
		autoArrows:  true,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 
	}); 
	
	//toggle functions
	jQuery('.toggle-content').hide();
		//switch plus with minus image
	jQuery("h4.toggle").toggle(function(){
		jQuery(this).addClass("active");
		}, function () {
		jQuery(this).removeClass("active");
	});			
	//slide up and down on click
	jQuery("h4.toggle").click(function(){
		jQuery(this).next(".toggle-content").slideToggle();
	});
	
	jQuery('#small-menu ul').superfish({
		hoverClass:  'over', 						// the class applied to hovered list items 
		delay:       400,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       150,                          // faster animation speed 
		autoArrows:  true,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 
	}); 
	
	jQuery('#main-menu ul').superfish({
		hoverClass:  'over', 						// the class applied to hovered list items 
		delay:       400,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       150,                          // faster animation speed 
		autoArrows:  true,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 
	}); 
			
	jQuery('#post-1').click(function() { 
		jQuery('#slider1').cycle(0); 
		return false; 
	});
	jQuery('#post-2').click(function() { 
		jQuery('#slider1').cycle(1); 
		return false; 
	});
	jQuery('#post-3').click(function() { 
		jQuery('#slider1').cycle(2); 
		return false; 
	});
	jQuery('#post-4').click(function() { 
		jQuery('#slider1').cycle(3); 
		return false; 
	});
	jQuery('#post-5').click(function() { 
		jQuery('#slider1').cycle(4); 
		return false; 
	});
	jQuery('#post-6').click(function() { 
		jQuery('#slider1').cycle(5); 
		return false; 
	});
	
	//jQuery tabs
	jQuery('#tabbed-posts > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-archives > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-product-reviews > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-movie-reviews > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-music-reviews > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-game-reviews > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-book-reviews > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-latest-reviews > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('#tabbed-highest-rated-reviews > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	jQuery('.tabs-shortcode > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle', duration: 100 } });
	
	if(!jQuery.browser.msie){button_hover_shortcode();}
	
	//colorbox
	jQuery('.review .article-image a').colorbox({transition:'fade', speed:300});
	jQuery('.single-post .content .article-image a').colorbox({transition:'fade', speed:300});
	jQuery('.colorbox').colorbox({transition:'fade', speed:300});
	jQuery('.colorboxiframe').colorbox({transition:'fade', speed:300, iframe:true, innerWidth:640, innerHeight:390});
});

//BRIGHTEN AND DARKEN IMAGE HOVERS (OR ANY OTHER ELEMENT)
jQuery(function() {
	// BRIGHTEN
	// OPACITY OF BUTTON SET TO 75%
	jQuery(".brighten").css("opacity","0.75");			
	// ON MOUSE OVER
	jQuery(".brighten").hover(function () {											  
		// SET OPACITY TO 100%
		jQuery(this).stop().animate({
		opacity: 1.0
		}, 70);
	},			
	// ON MOUSE OUT
	function () {				
		// SET OPACITY BACK TO 75%
		jQuery(this).stop().animate({
		opacity: 0.75
		}, 700);
	});
	
	// DARKEN
	// ON MOUSE OVER
	jQuery("[rel=zoom] img,.darken img").hover(function () {											  
		// SET OPACITY TO 100%
		jQuery(this).stop().animate({
		opacity: .28
		}, 150);
	},			
	// ON MOUSE OUT
	function () {				
		// SET OPACITY BACK TO 75%
		jQuery(this).stop().animate({
		opacity: 1.0
		}, 600);
	});
});



// 为文章图片增加边框div
jQuery(function(){
jQuery("[rel=zoom]").wrap("<div class='wrapcss'></div>");
})



//toggle the breaking panel
function showbreaking() {
	jQuery('#breaking-wrapper').animate({				 
		 height: 'toggle'				 
		}, 200, 'linear' );			
}

//toggle the demo settings - you can disregard this, it is only used for the Continuum demo
function showdemo() {
	jQuery('.demo').animate({				 
		 height: 'toggle'				 
		}, 200, 'linear' );			
}

//font replacement
Cufon.replace('.post-content h1, .post-content h3', {fontFamily: 'LiHei Pro'});
Cufon.replace('.gentesque, .post-content h2, .post-content h4, .category-link a, .demo-wrapper .header', {fontFamily: 'LiHei Pro'});


//button hovers
function button_hover_shortcode(){
	jQuery('.button_link,button[type=submit],button,input[type=submit],input[type=button],input[type=reset]').hover(
		function() {
				jQuery(this).stop().animate({opacity:0.85},150);
			},
			function() {
				jQuery(this).stop().animate({opacity:1},150);
		});
}






// 两侧对联广告-----开始

(function($) { 
    $.fn.jFloat = function(o) {
    
        o = $.extend({
            top:80,  //广告距页面顶部距离
            left:10,//广告左侧距离
            right:10,//广告右侧距离
            width:100,  //广告容器的宽度
            height:360, //广告容器的高度
            minScreenW:1200,//出现广告的最小屏幕宽度，当屏幕分辨率小于此，将不出现对联广告
            position:"left", //对联广告的位置left-在左侧出现,right-在右侧出现
            allowClose:true //是否允许关闭 
        }, o || {});
		var h=o.height;
      var showAd=true;
      var fDiv=$(this);
      if(o.minScreenW>=$(window).width()){
          fDiv.hide();
          showAd=false;
       }
       else{
		   fDiv.css("display","block")
           var closeHtml='<div align="right" style="margin-top:5px;color:#555; z-index:2000;font-size:12px;cursor:pointer;" class="closeFloat">关闭</div>';
           switch(o.position){
               case "left":
                    if(o.allowClose){
                       fDiv.append(closeHtml);//在广告底部插入关闭按钮；如果需要改到顶部显示，修改为：fDiv.prepend(closeHtml);
					   $(".closeFloat",fDiv).click(function(){$(this).hide();fDiv.hide();showAd=false;})
					   h+=20;
					}
                    fDiv.css({position:"absolute",left:o.left+"px",top:o.top+"px",width:o.width+"px",height:h+"px",overflow:"hidden"});
                    break;
               case "right":
                    if(o.allowClose){
                       fDiv.append(closeHtml);//在广告底部插入关闭按钮；如果需要改到顶部显示，修改为：fDiv.prepend(closeHtml);
					   $(".closeFloat",fDiv).click(function(){$(this).hide();fDiv.hide();showAd=false;})
					   h+=20;
					}
                    fDiv.css({position:"absolute",left:"auto",right:o.right+"px",top:o.top+"px",width:o.width+"px",height:h+"px",overflow:"hidden"});
                    break;
            };
        };
        function ylFloat(){
            if(!showAd){return}
            var windowTop=$(window).scrollTop();
            if(fDiv.css("display")!="none")
                $(fDiv).stop().animate({'top':o.top+windowTop+'px'},200); 
        };

      $(window).scroll(ylFloat) ;
      $(document).ready(ylFloat);     
       
    }; 
})(jQuery);

// 两侧对联广告-----结束

