/* UItoTop jQuery Plugin 1.2 | Matt Varone | http://www.mattvarone.com/web-design/uitotop-jquery-plugin */
(function(jQuery){jQuery.fn.UItoTop=function(options){var defaults={text:'To Top',min:200,inDelay:600,outDelay:400,containerID:'toTop',containerHoverID:'toTopHover',scrollSpeed:1000,easingType:'linear'},settings=jQuery.extend(defaults,options),containerIDhash='#'+settings.containerID,containerHoverIDHash='#'+settings.containerHoverID;jQuery('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');jQuery(containerIDhash).hide().on('click.UItoTop',function(){jQuery('html, body').animate({scrollTop:0},settings.scrollSpeed,settings.easingType);jQuery('#'+settings.containerHoverID,this).stop().animate({'opacity':0},settings.inDelay,settings.easingType);return false;}).prepend('<span id="'+settings.containerHoverID+'"></span>').hover(function(){jQuery(containerHoverIDHash,this).stop().animate({'opacity':1},600,'linear');},function(){jQuery(containerHoverIDHash,this).stop().animate({'opacity':0},700,'linear');});jQuery(window).scroll(function(){var sd=jQuery(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){jQuery(containerIDhash).css({'position':'absolute','top':sd+jQuery(window).height()-50});}
if(sd>settings.min)
jQuery(containerIDhash).fadeIn(settings.inDelay);else
jQuery(containerIDhash).fadeOut(settings.Outdelay);});};})(jQuery);