jQuery(document).ready(function(){
						   
	jQuery('#index_good1').cycle({ fx:    'shuffle', delay: -4000,timeout:8000,random:0}); 
	jQuery('#index_good2_l').cycle({ fx:    'fade', delay: -4000,timeout:8000,random:0}); 
	jQuery('#index_good2_r').cycle({ fx:    'fade', delay: -4000,timeout:8000,random:0}); 
	jQuery('#index_good3').cycle({ fx:    'fade', delay: -4000,timeout:8000,random:0}); 
	jQuery('#index_good4').cycle({ fx:    'fade', delay: -4000,timeout:8000,random:0}); 

});


 var t = n = count = 0;   
   jQuery(function(){   
       count = jQuery("#play_list a").size();   
       jQuery("#play_list a:not(:first-child)").hide();   
       jQuery("#play_info").html(jQuery("#play_list a:first-child").find("img").attr('alt'));   
       jQuery("#play_text li:first-child").css({"background":"#f39",'color':'#fff'});   
       jQuery("#play_info").click(function(){window.open(jQuery("#play_list a:first-child").attr('href'), "_blank")});   
       jQuery("#play_text li").click(function() {
           var i = jQuery(this).text() - 1;   
           n = i;   
           if (i >= count) return;   
           jQuery("#play_info").html(jQuery("#play_list a").eq(i).find("img").attr('alt'));   
           jQuery("#play_info").unbind().click(function(){window.open(jQuery("#play_list a").eq(i).attr('href'), "_blank")})   
           jQuery("#play_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);   
           jQuery(this).css({"background":"#f39",'color':'#fff'}).siblings().css({"background":"#fff",'color':'#666'});   
       });   
       t = setInterval("showAuto()", 6000);   
       jQuery("#play").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 6000);});   
   })   
     
   function showAuto()   
   {   
       n = n >= (count - 1) ? 0 : n + 1;   
       jQuery("#play_text li").eq(n).trigger('click');   
   }   
   

//积分兑换JS
jQuery(function(){
var defaultOpts = { interval: 3000, fadeInTime: 150, fadeOutTime: 150 };
var _titles = jQuery(".convert .convert_sml a");
var _bodies = jQuery(".convert .convert_big a");
var _count = _titles.length;
var _actrent = 0;
var _intervalID = null;
var stop = function() { window.clearInterval(_intervalID); };
var convert = function(opts) {
	if (opts) {
		_actrent = opts.actrent || 0;
	} else {
		_actrent = (_actrent >= (_count - 1)) ? 0 : (++_actrent);
	};
	_bodies.filter(":visible").fadeOut(defaultOpts.fadeOutTime, function() {
		_bodies.eq(_actrent).fadeIn(defaultOpts.fadeInTime);
		_bodies.removeClass("act").eq(_actrent).addClass("act");
	});
	_titles.removeClass("act").eq(_actrent).addClass("act");
};
var go = function() {
	stop();
	_intervalID = window.setInterval(function() { convert(); }, defaultOpts.interval);
}; 
var itemMouseOver = function(target, items) {
	stop();
	var i = jQuery.inArray(target, items);
	convert({ actrent: i });
}; 
_titles.hover(function() { if(jQuery(this).attr('class')!='act'){itemMouseOver(this, _titles); }else{stop();}}, go);
_bodies.hover(stop, go);
go();
})

//TAB JS
jQuery(function() { 
        jQuery(".change_tit > ul > li > a > strong").mouseover(function(e) { 
                if (e.target == this) { 
                        var tabs = jQuery(this).parent().parent().parent().children("li"); 
                        var panels = jQuery(this).parent().parent().parent().parent().parent().children(".change_con"); 
                        var index = jQuery.inArray(this, jQuery(this).parent().parent().parent().find("strong")); 
                        if (panels.eq(index)[0]) { 
                                tabs.removeClass("change_act") 
                                	.eq(index).addClass("change_act"); 
                                panels.addClass("none") 
                                     .eq(index).removeClass("none"); 
                        } 
                } 
        }); 
}); 

//lazyload
jQuery(function(){jQuery("img").lazyload({ 
							   threshold:200,						   
							    placeholder:"/smedia/nwed/images/public/grey.gif",
							   effect:"fadeIn" 							   
							   });});
