/*-----------------------
* jQuery Plugin: Scroll to Top
* by Craig Wilson, Ph.Creative http://www.ph-creative.com
* 
* Copyright (c) 2009 Ph.Creative Ltd.
* Licensed under the MIT License http://www.opensource.org/licenses/mit-license.php
*
* Description: Adds an unobtrusive "Scroll to Top" link to your page with smooth scrolling.
* For usage instructions and version updates to go http://blog.ph-creative.com/post/jquery-plugin-scroll-to-top-v3.aspx
* 
* Version: 3.0, 29/10/2009
-----------------------*/
jQuery(function(){jQuery.fn.scrollToTop=function(options){if(options.speed){var speed=options.speed;}else{var speed="slow";}if(options.ease){var ease=options.ease;}else{var ease="jswing";}if(options.start){var start=options.start;}else{var start="0";}var scrollDiv=jQuery(this);jQuery(this).hide().removeAttr("href");if(jQuery(window).scrollTop()>start){jQuery(this).fadeIn("slow");}jQuery(window).scroll(function(){if(jQuery(window).scrollTop()>start){jQuery(scrollDiv).fadeIn("slow");}else{jQuery(scrollDiv).fadeOut("slow");}});jQuery(this).click(function(event){jQuery("html, body").animate({scrollTop:"0px"},speed,ease);});}});