//preload images
var imgDir="/images/";

if (document.images) { 
	var imgObjs=[];
	var iurls=new Array("nav/aboutOver.gif","nav/exploreOver.gif","nav/helpOver.gif","nav/whatWeDoOver.gif"); 
	for(var i=0; i<iurls.length; i++) { 
		imgObjs[i]=new Image(); imgObjs[i].src = imgDir+iurls[i];
	}
}
function showNewsPromoTab(p_tabId){
	var tabNames = new Array("news", "speeches");
	$("#newsPromoMask").animate({ scrollTop: 0 }, "fast")
	for (i=0; i<tabNames.length; ++i) {
		var tab = $("#" + tabNames[i]+"Tab");
		var content = $("#" + tabNames[i]+"Content");
		tab.removeClass("on");
		tab.addClass(p_tabId == tabNames[i] ? "on" : "");
		content.css('display', p_tabId == tabNames[i] ? "block" : "none");
	}
	sizeMaskedContent(p_tabId)
	return false;
}
function sizeMaskedContent(p_id){
	if(p_id == undefined) p_id="news";
	$("#newsPromoContentHolder").css('height',$("#" + p_id + "Content").height());
	return false;
}
function swapImg(p_id,p_src){
	$("#" + p_id).attr('src', imgDir+p_src);
	return false;
}
function closeEmailForm(){ $('#emailForm').fadeOut("normal"); }
function openEmailForm(){ $('#emailForm').fadeIn("normal"); }
function printPage(){ window.print(); }

function resizeFlash(target, height, width){
	$('#'+target).css('height',height);
	$('#'+target).css('width',width);
}

$(document).ready(function(){
	sizeMaskedContent("news");
});
var popwin;
