/* scrollto-top: (http://theo-nash.com/wp-content/plugins/scrollto-top/js/scrollto-top-js.php) */
jQuery(document).ready(function($) {
   var isTransitioned = true;
   var transparent = 0;
   var translucent = 0.3;
   var opaque = 1;
   $("body").prepend('<a id="top"></a>\n<a href="#top" id="gototop" class="gototop">Top of page</a>');
   $("#gototop").fadeTo(0,translucent).mouseover(function() {
      if(isTransitioned) {
         $(this).fadeTo("slow",opaque);
      }
   }).mouseout(function() {
      if(isTransitioned) {
         $(this).fadeTo("slow",translucent);
      }
   }).click(function() {
      $.scrollTo(0,500);
            return false;
   });
   function stt_fade() {
      if(isTransitioned) {
         isTransitioned = false;
         if(1000 < $(document).scrollTop()) {
            $("#gototop").show().fadeTo("slow",translucent,function() {
               isTransitioned = true;
            });
         } else {
            $("#gototop").fadeTo("slow",transparent,function() {
               isTransitioned = true;
               $(this).hide();
            });
         }
      }
   }
});
