var simpleBrowser = ($.browser.msie && $.browser.version < 7);

// set Flash display params / attributes
var flashDefaultParams = {
play:				true,
loop:				true,
menu:				true,
quality:			'high',
wmode:				'window',
bgcolor:			'#469AD4',
allowFullScreen:	'true',
allowScriptAccess:	'sameDomain',
pluginspage:		'http://www.macromedia.com/go/getflashplayer',
devicefont:			false,
salign:				'',
flashvars:			""
}

function forceHeights(aniTime){ // called once on document ready and once on body load
	if (aniTime == undefined)
		aniTime = 300;
	if ($('.forceParentHeight').length > 0){
		$('.forceParentHeight').each(function(){
			$(this).animate({
				minHeight:		parseInt($(this).parent().height())-parseInt($(this).css('paddingTop'))-parseInt($(this).css('paddingBottom'))-parseInt($(this).css('borderTopWidth'))-parseInt($(this).css('borderBottomWidth'))
			},aniTime);
			if (simpleBrowser)
				$(this).css({height: $(this).css('minHeight')});
		});
	}
	
	if ($('.forceParentAbsoluteHeight').length > 0){
		$('.forceParentAbsoluteHeight').each(function(){
			$(this).animate({
				height:		parseInt($(this).parent().height())-parseInt($(this).css('paddingTop'))-parseInt($(this).css('paddingBottom'))-parseInt($(this).css('borderTopWidth'))-parseInt($(this).css('borderBottomWidth'))
			},aniTime);
			if (simpleBrowser)
				$(this).css({height: $(this).css('minHeight')});
		});
	}
	
	if ($('.forceBasicParentHeight').length > 0){
		$('.forceBasicParentHeight').each(function(){
			$(this).animate({
				minHeight:		parseInt($(this).parent().height())
			},aniTime);
			if (simpleBrowser)
				$(this).css({height: $(this).css('minHeight')});
		});
	}
	
	if ($('.internalForceInfoBoxHeight').length > 0){
		$('.internalForceInfoBoxHeight').each(function(){
			var maxHeight = 0;
			var children = $(this).find('.infoBox');
			if (children.length == 0)
				return;
			children.each(function(){
				if ($(this).height() > maxHeight){
					maxHeight = parseInt($(this).height());
					if (simpleBrowser)
						$(this).css({height: $(this).css('minHeight')});
				}
			});
			if (maxHeight != 0){
				children.animate({
					minHeight:		maxHeight+'px'
				}, aniTime);
				if (simpleBrowser)
					$(this).css({height: $(this).css('minHeight')});
			}
		});
	}
}

$(document).ready(function(){
	forceHeights(0);
	$('#footerLinks a').hover(function(){
		if ($(this).parent().hasClass('selected'))
			return;
		$(this).parent().addClass('hover');
		var img = $(this).find('img');
		if (img.length > 0){
			img.attr('src',img.attr('src').replace('_unselected','_selected'));
		}
	},function(){
		if ($(this).parent().hasClass('selected'))
			return;
		$(this).parent().removeClass('hover');
		var img = $(this).find('img');
		if (img.length > 0){
			img.attr('src',img.attr('src').replace('_selected','_unselected'));
		}
	});
});