var t = 0;
var scrolldelay;
function up()
{
    if(document.getElementById("contents"))
    {
        t += 100;
    
        with(document.getElementById("contents"))
        {
            if (offsetHeight > 285)
            {
                if (t > 0)
                t = 0;
        
                if(style)
                {
                    style.top = t + "px";
                }
                else
                {
                    setAttribute("style", "top: " + t + "px");
                }
            }
        }
    }
}

function down()
{
    if(document.getElementById("contents"))
    {
        t -= 100;
    
        with(document.getElementById("contents"))
        {
            if (offsetHeight > 285)
            {
                if(t < -clientHeight)
                t = -clientHeight;
        
                if(style)
                style.top = t + "px";
                else
                setAttribute("style", "top: " + t + "px");
            }
        }
    }
}

(function($) {
	$(document).ready(function() {
		$("a[href^='#']").bind("click", function(e) {
			var href 	= $(this).attr('href').replace('#', '');
			var offset 	= $("a[name='" + href + "']").offset();
			$('#contents').css('top','-' + offset.top + 'px');
			return false;
		});
	});
})(jQuery);

function stop()
{
    clearTimeout(scrolldelay);
}