jQuery(function($){
   $(document).bind('keydown',  {combi:'j', disableInInput: true} , function(){ scrollTop = $(window).scrollTop();
            $('#left .arChive span.date').each(function(i, h2){ 
                h2top = $(h2).offset().top; 
                if (scrollTop < h2top) { 
                    $.scrollTo(h2, 300 );
                    return false; 
                }
            });
            $('#left div.inernalPost p img').each(function(i, h2){ 
                h2top = $(h2).offset().top; 
                if (scrollTop < h2top) { 
                    $.scrollTo(h2, 300 );
                    return false; 
                }
            });
     });	

   $(document).bind('keydown', {combi:'b', disableInInput: true} , function(){ scrollTop = $(window).scrollTop();
            $('#bottomNavButton').each(function(i, h2){ 
                h2top = $(h2).offset().top; 
                if (scrollTop < h2top) { 
                    $.scrollTo(h2, 300 );
                    return false; 
                }
            });
     });	

    $('<div id="nextArrow" class="nextArrow">Next (j)</div>')
	.prependTo("body .ArrowNext")
	.prependTo("body .ArrowNext2 .nextRight")
		$(".nextArrow").click(function(){
            scrollTop = $(window).scrollTop();
            $('#left span.date').each(function(i, h2){
                h2top = $(h2).offset().top; 
                if (scrollTop < h2top) { 
                    $.scrollTo(h2, 300); 
                    return false;
                }
            });
        });
        
		$.fn.reverse = function()
			{
		return this.pushStack(this.get().reverse(), arguments);
			};

    $('<div id="prevArrow" class="prevArrow">Prev (k) / </div>')
	.prependTo("body .ArrowNext")
	.prependTo("body .PrevArrow1")
		$(".prevArrow").click(function(){
            scrollTop = $(window).scrollTop();
            $('#left span.date').reverse().each(function(i, h2){ // loop through article headings
                h2top = $(h2).offset().top; // get article heading top
                if (scrollTop > h2top) { // compare if document is above heading
                    $.scrollTo(h2, 300); // scroll to in .8 of a second
                    return false; // exit function
                }
             });
        });


    $('<div id="topArrow" class="prevArrow">Top (t) / </div>')
	.prependTo("body .PrevArrow1")
		$("#topArrow").click(function(){
            scrollTop = $(window).scrollTop();
            $('#topPart').reverse().each(function(i, h2){ 
                h2top = $(h2).offset().top;
                if (scrollTop > h2top) {
                    $.scrollTo(h2, 300);
                    return false; 
                }
             });
        });


   $(document).bind('keydown',  {combi:'k', disableInInput: true} , function(){ scrollTop = $(window).scrollTop();
            $('#left .arChive span.date').reverse().each(function(i, h2){ 
                h2top = $(h2).offset().top; 
                if (scrollTop > h2top) { 
                    $.scrollTo(h2, 300 );
                    return false; 
                }
            });
            $('#left div.inernalPost p img').reverse().each(function(i, h2){ 
                h2top = $(h2).offset().top; 
                if (scrollTop > h2top) { 
                    $.scrollTo(h2, 300 );
                    return false; 
                }
            });
        });	

   $(document).bind('keydown',  {combi:'t', disableInInput: true} , function(){ scrollTop = $(window).scrollTop();
            $('#topPart').reverse().each(function(i, h2){ 
                h2top = $(h2).offset().top; 
                if (scrollTop > h2top) { 
                    $.scrollTo(h2, 200 );
                    return false; 
                }
            });
        });

	$(document).ready(function($) {
		$('.slide_cont').cycle({ 
		fx:     'scrollHorz', 
		speed:  'fast', 
		timeout: 0,
		next:   '.prev',
		prev:   '.next'
	});
});

});

