/*!
 * QQ客服插件
 * www.JSPGen.com
 * @revise 1.0
 */
;(function($){$.fn.customer=function(options){var jspath=document.scripts;jspath=jspath[jspath.length-1].src.substring(0,jspath[jspath.length-1].src.lastIndexOf('/')+1);grapes.load([jspath+'images/customer.css']);var settings={float:'left',minStatus:false,skin:'gray',durationTime:1000}
settings=$.extend(settings,options);this.each(function(){var $this=$(this),closeBtn=$this.find('.close_btn'),show_btn=$this.find('.show_btn'),sideContent=$this.find('.side_content'),sideList=$this.find('.side_list');var defaultTop=$this.offset().top;$this.css(settings.float,0);if(settings.minStatus){$(".show_btn").css("float",settings.float);sideContent.css('width',0);show_btn.css('width',25);}
if(settings.skin)$this.addClass('side_'+settings.skin);$(window).bind("scroll",function(){var offsetTop=defaultTop+$(window).scrollTop()+"px";$this.animate({top:offsetTop},{duration:settings.durationTime,queue:false});});closeBtn.bind("click",function(){sideContent.animate({width:'0'},"fast");show_btn.stop(true,true).delay(300).animate({width:'25px'},"fast");});show_btn.click(function(){$(this).animate({width:'0'},"fast");sideContent.stop(true,true).delay(200).animate({width:'154px'},"fast");});});};})(jQuery);