      (function(jq) {
         jq.autoScroll = function(ops) {
         ops = ops || {};
         ops.styleClass = ops.styleClass || 'scroll-to-top-button';
         var t = jq('<div class="'+ops.styleClass+'"></div>'),
            d = jq(ops.target || document);
         jq(ops.container || 'body').append(t);

         t.css({
            opacity: 0,
            position: 'absolute',
            top: 0,
            right: 0
         }).click(function() {
            jq('html,body').animate({
               scrollTop: 0
            }, ops.scrollDuration || 1000);
         });

         $(window).scroll(function(){
            var sv = d.scrollTop();
            if (sv < 10) {
               t.clearQueue().fadeOut(ops.hideDuration || 200);
               return;
            }

            t.css('display', '').clearQueue().animate({
               top: sv,
               opacity: 0.8
            }, ops.showDuration || 500);
         });
      };
   })(jQuery);

   $(document).ready(function(){
      $.autoScroll({
         scrollDuration: 1000,
         showDuration: 600,
         hideDuration: 300
      });
   });
   
/*
function show_full(id) {
    ShowLoading('');
	$(function () {
		$.ajax({
			type: "POST",
			url: dle_root + "engine/ajax/show.full.php",
			data: "id=" + id,
			dataType: "xml",
			success: function (xml) {

				jQuery(xml).find('site').each(
				function () {
					title = jQuery(this).find('title').text(),
					desc = jQuery(this).find('des').text();
					rate = jQuery(this).find('rate').text();
					$('body').append("<div id=\"show_full\" style=\"overflow: auto;width:80%;\"></div>");
					$('#show_full').html(desc);
					$('#show_full').dialog({
						zIndex: 900,
						width: $(window).width() * 0.5, // 50% عرض پنجره
						height: $(window).height() * 0.9, // 90% طول پنجره
						buttons: [{
							text: "بستن",
							click: function () {
								$(this).dialog("close");
							}
						}],
						close: function (event, ui) {
							$('#show_full').remove();
						},
						title: title,
						autoOpen: true
					});

					$('.ui-dialog-buttonset').html('<p align="left" dir="ltr">' + rate + '</p>');

				});

			}

		});
	});
    HideLoading('');
}
*/
