/* Scripts for Website */
/* Dependencies: jQuery 1.4.x */




/* **************************** */
/* Pre-document.ready functions */
/* **************************** */
	// Functions that must run BEFORE document.ready functions



/* ************************ */
/* Document.Ready functions */
/* ************************ */
//do stuff when DOM is ready
$(document).ready(function() {

	/* *********************** */
	/* Hacks for IE6 and below */
	/* *********************** */
	if ($.browser.msie && $.browser.version < 7 )  { 
		//attach a class to the BODY
		$('body').addClass('ieOld');
	}


	/* ****************** */
	/* INIT for all pages */
	/* ****************** */

	// Any INIT functions for all pages
	
	setPageHeight();
	$(window).resize(function() {
		setPageHeight();
	});

	
	

	/* ******************* */
	/* INIT for HOME pages */
	/* ******************* */
	if ($("body#home").length) {
		// Any home-page specific INIT functions
		
	}

	
	

	/* *********************** */
	/* INIT for INTERIOR pages */
	/* *********************** */
	if ($("body#int").length) {
		// Any home-page specific INIT functions
		
	}
	
	
	
	
	
	/* ****************************** */
	/* Add'l document.ready functions */
	/* ****************************** */
	
		// add'l document.ready functions

});

/* *************** */
/* Add'l Functions */
/* *************** */


function popVid(URL,w,h) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+"');");
}




function setPageHeight() {
	// reset pageHeight
	$('#bodyWrap').height('auto');
	$('#footer').css('clear','');
	
	// set minimum Page Height, based on viewport height
	var viewH = window.innerHeight ? window.innerHeight : $(window).height(); //innerHeight is for Opera browsers
	//var headerH = $('#header').outerHeight();
	//var footerH = $('#footer').outerHeight();
	var headerH = 121;
	var footerH = 197;
	var contentH = viewH - (headerH + footerH);
	
	//$.log($('#content').height());
	//$.log(contentH);	
	
	//$('#content').css('min-height', contentH);
	if (parseFloat($('#bodyWrap').height()) < contentH ) {
		$('#bodyWrap').css('height', contentH);
	}
	
	$('#footer').css('clear','both'); /* this just forces older browsers to re-evaluate the positioning of the footer, which wasn't readjusting in older IE browsers after the content area was expanded. */
}






/* ***************** */
/* Utility Functions */
/* ***************** */


/* Console Logging for debugging help
 * ==================================
 * 	USE:  
 * 		jQuery.log('my message') or $.log('my message') 
 */
;jQuery.log = function(message) {
  try {
     console.debug(message);
  } catch(e) {
	  try {
		console.log(message);
	  } catch(e) {
		alert(message);
	  }
  }
};





/* ******************* */
/* 3rd Party Functions */
/*      (plug-ins)     */
/* ******************* */










