// Browser Window Size and Position
// copyright Stephen Chapman, 3rd Jan 2005, 8th Dec 2005
// you may copy these functions but please keep the copyright notice as well
function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;} function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;} function posRight() {return posLeft()+pageWidth();} function posBottom() {return posTop()+pageHeight();} newHeight = (pageHeight());

if (document.images) {
     button1 = new Image
     button2 = new Image
     button3 = new Image
     button4 = new Image
     button5 = new Image
     button6 = new Image
     button7 = new Image
     button8 = new Image
     button9 = new Image
     button10 = new Image
     button11 = new Image
     button12 = new Image

     button1.src = '/img/nav.cy.l.gif'
     button2.src = '/img/nav.cy.h.gif'
     button3.src = '/img/nav.ny.l.gif'
     button4.src = '/img/nav.ny.h.gif'
     button5.src = '/img/nav.bro.l.gif'
     button6.src = '/img/nav.bro.h.gif'
     button7.src = '/img/nav.acc.l.gif'
     button8.src = '/img/nav.acc.h.gif'
     button9.src = '/img/nav.serv.l.gif'
     button10.src = '/img/nav.serv.h.gif'
     button11.src = '/img/nav.cw.l.gif'
     button12.src = '/img/nav.cw.h.gif'
 }

var scrollableMinHeight = 0;
$(function()
{
	$("body").css( "overflow", "auto" );
	
	$("#scrollable, .scrollable").height( "auto" );
	scrollableMinHeight = $("#scrollable, .scrollable").height() + 35;
	var scrollableOffset = $("#scrollable, .scrollable").offset();
	
	$(window).resize(function()
	{
		if( $(window).height() > scrollableMinHeight + scrollableOffset.top + 35 )
		$("#scrollable, .scrollable").height(  ( $(window).height() - scrollableOffset.top - 35 ) + "px" );
	});
	$(window).resize();
	$('#scrollable, .scrollable').wrapAll('<div class="scrollableWrapper" />');
	
});


	// 
	// var scrollableMinHeight = 0;
	// $(function()
	// {
	// 	$("body").css( "overflow", "auto" );
	// 
	// 	$("#scrollable").height( "auto !important" );
	// 	scrollableMinHeight = $("#scrollable, .scrollable").innerHeight() + 35;
	// 	var scrollableOffset = $("#scrollable, .scrollable").offset();
	// 	//alert(scrollableMinHeight)
	// 	$(window).resize(function()
	// 	{
	// 		//$("#scrollable, .scrollable").height($(window).height() - scrollableOffset.top - 35);
	// 		if( $(window).height() > scrollableMinHeight + scrollableOffset.top + 35 )
	// 		$("#scrollable, .scrollable").css( "height",  ( $(window).height() - scrollableOffset.top - 35 ) + "px" );
	// 	});
	// 	$(window).resize();
	// });
