/*  
	Description: Scripts for BlackShieldPS.com
	Version: 1.0
	Author: Jonathan Gallivan
	Author URI: http://JonathanGallivan.com
	Date created: Jan 21, 2009
	Date modified: Jan 21, 2009
*/

// FUNCTION: initialise(): initialises site functions
function initialise(pageName) {
	// Set-up navigation roll-overs
	$(function () {
		if ($.browser.msie && $.browser.version < 7) return;
		$('#tabs li')
		.removeClass('highlight')
		.find('a')
		.append('<span class="hover" />').each(function () {
			var $span = $('> span.hover', this).css('opacity', 0);
			$(this).hover(function () {
				// On hover
				$span.stop().fadeTo(225, 1);
			}, function () {
				// Off hover
				$span.stop().fadeTo(225, 0);
			});
		});
		$('#logo li')
		.removeClass('highlight')
		.find('a')
		.append('<span class="hover" />').each(function () {
			var $span = $('> span.hover', this).css('opacity', 0);
			$(this).hover(function () {
				// On hover
				$span.stop().fadeTo(225, 1);
			}, function () {
				// Off hover
				$span.stop().fadeTo(225, 0);
			});
		});
	});
	checkContentHeight();
}

// FUNCTION: checkContentHeight(): checks the size of the content area and adjusts height
function checkContentHeight() {
	var viewportHeight;
	var browserType;
	if (typeof window.innerWidth != 'undefined') {
		browserType = "1";
		viewportHeight = window.innerHeight
	} else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		viewportHeight = document.documentElement.clientHeight;
		browserType = "2";
	} else {
		browserType = "3";
	}
	if (document.getElementById('content').scrollHeight < (viewportHeight-250)) {
		document.getElementById('content').style.height = viewportHeight - 250 + "px";
	}
}

