// JavaScript Document

var new_scroll_height=0;
var start_scroll_height=0;
$(document).ready(function() {	
	start_scroll_height=$(window).height()-45;	
	$('.scroll-pane').css('height',start_scroll_height+'px');	
	
	$('.scroll-pane').jScrollPane({
		showArrows: true,
		verticalDragMinHeight		: 0,
		verticalDragMaxHeight		: 337
	});
	
		if( $('.scroll-pane .jspVerticalBar').is(':visible') ) 
		{
			$("#content_form").css("padding-right",'25px');
			$("#footer").css({"padding-right":'25px', 'width':'913px'});
			
			if (typeof home_flag == "undefined")
			{
				$(".jspVerticalBar").css('z-index','21');	
			}
		}
		else {
			$("#content_form").css("padding-right",'0px');
			$("#footer").css({"padding-right":'0', 'width':'936px'});
		}
			
	
});



$(window).resize(function () {	
	new_scroll_height=$(window).height()-45;	
	
	$('.scroll-pane').css('height',new_scroll_height+'px');	
	$('.scroll-pane').jScrollPane({
		showArrows: true,
		verticalDragMinHeight		: 0,
		verticalDragMaxHeight		: 337
	});
	
	if( $('.scroll-pane .jspVerticalBar').is(':visible') ) 
	{
		$("#content_form").css("padding-right",'25px');
	}
	else 
	{
		$("#content_form").css("padding-right",'0px');
	}
	
	
	if( $("#flip").val() == 'open')
	{
		$(".jspVerticalBar").css('z-index','19');	
	}
	else{
	
		$(".jspVerticalBar").css('z-index','21');	
	}
});


