function scrollable(started){
		// $('body').css('overflow', 'hidden');
	// alert($("#hscroll").offset().top);
	// 		alert($("body").height());
	if($(window).height()>=605){

		height = $(window).height()-$("#hscroll").offset().top;
		$("body").css('overflow', 'hidden');
		$('#hscroll').height(
			height
		).width(
			$(window).width()-40
		).css(
			"overflow", "auto"
		).jScrollHorizontalPane({scrollbarHeight:20, scrollbarMargin:10, showArrows:true, reset:true, resize:true});
        
		if(document.all){
			adjustment=20;
		}else{
			adjustment = 40;
		}
		$(".jScrollPaneTrack").css('position', 'absolute').css('top',height-adjustment);
		$(".jScrollArrowLeft, .jScrollArrowRight").css('top', height-adjustment);
		//blocker
		$("#blocker_scroll").css('top', $(window).height()-10);
        // $("#message").text(height);
	}else{
		//alert($(window).height());
	}

}
var hoverScrollTimer;
var hoverScrollInterval = 300;
function hoverScroll(dir){
    
    $("#hscroll")[0].scrollBy(30*dir);
}
jQuery(function()
{			//
    $(document.body).append("<div style='position:absolute;top:0;left;0;z-index:100' id='message'></div>");
    $("#test").click(function(){
        document.location = document.location.href+"?nofade=1";
        
        return false;
    })
	scrollable(false);
});
if(navigator.appVersion.indexOf('AppleWebKit')!=-1){
    // alert("Apple web kit?")
	$(window).load(function(){
	    
        // scrollable(false);
	})
}
var resize_interval = 0;
var new_width = 0;

function checkResize(){
//scrollable(false);
    // $("#message").text($(window).width()+"=="+new_width);
    if($(window).width()==new_width){
        // alert("Sized");
        clearInterval(resize_interval);
        resize_interval = 0;
        document.location = document.location.href.substring(0, document.location.href.indexOf("?"))+"?nofade=1";
        // $("#message").text("CLEARED");
    }else{
        
        // $("#message").text($(window).width()+"=="+new_width);
    }
    new_width = $(window).width();
}
var counter = 0;
$(window).resize(function(){
    if(resize_interval==0){
        new_width = $(window).width();
        counter++;
        $("#message").text(counter);
        resize_interval = setInterval("checkResize()", 200);
    }
   
    
})