jQuery.fn.jcScrollTop=function(e){e=jQuery.extend({duration:1e3,scroleActivateAt:200,scrollElementId:"jcScrollTop",easingType:"easeOutElastic",position:"center",scrollText:"Scroll to top",backgroundColor:"#c00",foreColor:"#FFF",fontFamily:"calibri",fontSize:"15px",fontWeight:"bold",textPadding:"5px",containerWidth:"120px",zIndex:"1",containerBorder:"2px solid #960404",borderRadius:"10px 10px 0px 0px",callback:function(){}},e);jQuery("body").append("<div id='"+e.scrollElementId+"' style='z-index: "+e.zIndex+";background:"+e.backgroundColor+";border:"+e.containerBorder+";border-radius:"+e.borderRadius+";position:fixed;bottom:-2px;width:"+e.containerWidth+";font-weight:"+e.fontWeight+";color:"+e.foreColor+";text-align:center;font-family:"+e.fontFamily+";font-size:"+e.fontSize+";cursor:pointer;padding:"+e.textPadding+"'>"+e.scrollText+"</div>");var t=this;var n=function(){var n=Math.max(0,(jQuery(window).width()-(parseInt(e.textPadding.replace("px",""))+t.width()))/2+jQuery(window).scrollLeft()-parseInt(e.containerWidth.replace("px",""))/2)-parseInt(e.textPadding.replace("px",""))+"px";if(e.position=="left")jQuery("#"+e.scrollElementId).css("left","10px");else if(e.position=="center"){jQuery("#"+e.scrollElementId).css("left",n)}else jQuery("#"+e.scrollElementId).css("right","10px")};n();jQuery("#"+e.scrollElementId).hide().click(function(){jQuery("html,body").animate({scrollTop:0},e.duration,e.easingType,function(){e.callback()})});jQuery(window).resize(function(){setTimeout(function(){n()},150)});jQuery(window).scroll(function(){var t=jQuery(window).scrollTop();if(t>e.scroleActivateAt){jQuery("#"+e.scrollElementId).show("slow")}else{jQuery("#"+e.scrollElementId).hide("slow")}})}