(function($){
var DSWGuajian = {
	createNew : function() {
		var GJ = {};
		GJ.step = 0;	/*状态，0=原始不动， 1=扭头伸出手机， 2=跳出来指向*/
		GJ.clicked = false;
		GJ.gifSrc = ['http://share.gzdsw.com/upload/201409/09/dedb_ccbc.gif', 'http://share.gzdsw.com/upload/201409/09/b590_ed2e.gif', 'http://share.gzdsw.com/upload/201409/09/108c_77c0.gif', 'http://share.gzdsw.com/upload/201409/09/4158_a8ac.png'];
		GJ.gifWidth = [67, 86, 113, 118];
		GJ.gifHeight = [81, 118, 150, 271];
		GJ.position = [{left:0, top:430}, {left:0, top:430}, {left:0, top:430}, {left:140, top:-220}];
		
		GJ.init = function(){
			//cookies中是否有 dswguajian_donotrepeat
			var hasDonotRepeat = ggetcookie('dswguajian_donotrepeat');
			if(hasDonotRepeat == 'true') return false;
		
			var styleHtml = '<style>';
			styleHtml += 	'	#dswguajian_panel{position: fixed;left:'+GJ.position[0].left+'px;top:'+GJ.position[0].top+'px;}';
			styleHtml += 	'	#dswguajian_panel .prblock{position: relative;display:block;}';
			styleHtml += 	'	#dswguajian_panel .prblock .donotrepeat{width:12px;height:12px;display:block;overflow:hidden;position: absolute;top:-22px;left:55px;background:url(http://static.gzdsw.com/public/images/common/close_1.gif) no-repeat;cursor:pointer;}';
			styleHtml += 	'	#dswguajian_panel .prblock .ewm{width:'+GJ.gifWidth[3]+'px;height:'+GJ.gifHeight[3]+'px;position:relative;display:none;background:url('+GJ.gifSrc[3]+') no-repeat;left:'+GJ.position[3].left+'px;top:'+GJ.position[3].top+'px;}';
			styleHtml += 	'	#dswguajian_panel .prblock .ewm .close{position: absolute;right:0;top:0;width:20px;height:20px;display:block;overflow:hidden;text-indent:-9999px;cursor:pointer;}';
			styleHtml += 	'	#dswguajian_panel .prblock .ewm a.urlopen{position: absolute;right:8px;top:65px;width:105px;height:205px;display:block;text-indent:-9999px;}';
			styleHtml += 	'</style>';			
			jQuery('head').append(styleHtml);
		
			var divHtml = 	'<div id="dswguajian_panel">';
			divHtml +=		'	<div class="prblock">';
			divHtml +=		'		<span class="donotrepeat" title="一天内不再显示"></span>';
			divHtml +=		'		<img src="" />';
			divHtml +=		'		<div class="ewm">';
			divHtml +=		'			<span class="close"></span>';
			divHtml +=		'			<a href="http://share.gzdsw.com/index.php?r=ads/click&q=RVJMTE47RlJJS0Y7R1JGR0U7SFJ2XWdFeFmEi2FHRotugoGIb2hKg3qCZ495jkp%2Fd0dFOkhZCWI3NjRkYTg1YmIzMDNjNmJkNDA3MDUwZDI2ZDZiZjll" target="_blank" class="urlopen" target="_blank">http://mobile.gzdsw.com</a>';
			divHtml +=		'		</div>';
			divHtml +=		'	</div>';
			divHtml +=		'</div>';			
			jQuery('body').append(divHtml);			
			
			GJ.bindEvent();
			GJ.changeGif(0);
		}
		
		GJ.bindEvent = function() {
			jQuery(document).on('mouseover', '#dswguajian_panel .prblock img', function(){
				if(!GJ.clicked) GJ.changeGif(1);
			});
			jQuery(document).on('mouseout', '#dswguajian_panel .prblock img', function(){
				if(!GJ.clicked) GJ.changeGif(0);
			});
			jQuery(document).on('click', '#dswguajian_panel .prblock img', function(){
				if(!GJ.clicked) GJ.changeGif(2);
				GJ.clicked = true;
				jQuery('#dswguajian_panel .prblock .donotrepeat').hide();
			});
			jQuery(document).on('click', '#dswguajian_panel .prblock .ewm .close', function(){
				GJ.clicked = false;
				GJ.changeGif(0);
				jQuery('#dswguajian_panel .prblock .donotrepeat').show();
			});
			jQuery(document).on('click', '#dswguajian_panel .prblock .donotrepeat', function(){
				gsetcookie('dswguajian_donotrepeat', 'true', 86400);
				jQuery('#dswguajian_panel').remove();
			});
		}
		
		GJ.changeGif = function(step) {
			GJ.step = step;
			jQuery('#dswguajian_panel .prblock img').attr('src', GJ.gifSrc[step]);
			jQuery('#dswguajian_panel .prblock img').css({width:GJ.gifWidth[step], height:GJ.gifHeight[step]});
			if(step == 0) {
				jQuery('#dswguajian_panel .prblock .ewm').hide();
			} else if(step == 1) {
				jQuery('#dswguajian_panel .prblock .ewm').hide();
			} else if(step == 2) {
				/*按下跳出小人后*/
				setTimeout(function(){
					jQuery('#dswguajian_panel .prblock .ewm').show();
				}, 1300);
			}
		}
		
		return GJ;
	}
	
};

jQuery(function(){
	var gj_1 = DSWGuajian.createNew();
	gj_1.init();
});
})(jQuery);
        shareRolling();
        if(jQuery('.share-full').size() > 0){
            var imgDom = jQuery('.share-full .share-full-small img').get(0);
            imgDom.onload  = function() {
                toggleFull(this);
            }
        }
		jQuery(document).ready(function(){
			showButtomFixAd();
			if(jQuery('.share-full').size() > 0) setTimeout(showScreenCenterFixAd, 10000);
			else showScreenCenterFixAd();
            jQuery('.fix-bottom-ad').each(function(){
                if(!jQuery(this).html()) jQuery(this).removeClass('fix-bottom-ad');
            });
		});