var myMooFlowPage = {
	start: function(){
		var mf = new MooFlow($('MooFlow'), {
			startIndex: 5,
			bgColor: 'transparent',
			heightRatio: .33,
			factor: 100,
			offsetY: -150,
			reflection: 0.3,
			useSlider: true,
			useAutoPlay: true,
			interval: 2500,
			useCaption: false,
			useResize: false,
			useWindowResize: true,
			useMouseWheel: true,
			useKeyInput: true,
			'onClickView': function (obj) {
				document.location = obj.href;	
			}
		});
	}
};

window.addEvent('load', myMooFlowPage.start);

var topnum = 1;
var downnum = 1;
jQuery(document).ready(function() {
	jQuery("#footer_Blogs, #footer_Resources, #footer_Education, #footer_Downloads").css("display", "none");
	jQuery("#topmenu").jqDock({size: 48});

	// Top toggle thingly
	jQuery("#contentdown_" + topnum).show();	
	jQuery("#contentup_" + downnum).show();	
	
	jQuery(".topnav").click(function () {
		id = jQuery(this).attr("id");
		id = id.split("_")[1];
		toptoggle(id);
	});
	
	jQuery(".bottomnav").click(function () {
		id = jQuery(this).attr("id");
		id = id.split("_")[1];
		bottomtoggle(id);
	});
	
	jQuery(".header_click").click(function () {
		jQuery("#banner").toggle();
		
		size = jQuery("body").css("padding-top");
		if (size == '128px') 
		{
			movebodyup();
			//setTimeout("movebodyup()", 9000); 
		} else
		{
			movebodydown();
			//setTimeout("movebodydown()", 9000); 
		}
	});
	
	jQuery(".footer_click").click(function () {
		jQuery("#fadefooter").toggle();
		
		size = jQuery("body").css("padding-bottom");
		if (size == '66px') 
		{
			setTimeout("bmovebodyup()", 10); 
		} else
		{
			setTimeout("bmovebodydown()", 10); 
		}
	});

	jQuery(".button").click(function () {
		jQuery("#footer_Pages, #footer_Blogs, #footer_Resources, #footer_Education, #footer_Downloads").css("display", "none");
		Id = jQuery(this).text();
		Id = "#footer_" + Id;
		//jQuery("#footer").css("height", "200px");	
		jQuery(Id).fadeIn();
	});

});


function bmovebodydown ()
{
	jQuery("body").css("padding-bottom", "66px");
	jQuery("#footer").css("height", "66px");	
}

function bmovebodyup ()
{
	jQuery("body").css("padding-bottom", "200px");
	
	if(jQuery.browser.safari)
	{
		jQuery("#footer").css("height", "185px");	
	} else
	{
		jQuery("#footer").css("height", "200px");	
	}
}

function movebodydown ()
{
	jQuery("body").css("padding-top", "128px");
	jQuery("#header").css("height", "128px");	
}

function movebodyup ()
{
	jQuery("body").css("padding-top", "30px");
	jQuery("#header").css("height", "30px");	
}

function bottomtoggle (num)
{
	jQuery(".hide2").hide();
	jQuery("#contentup_" + num).fadeIn("slow");
	topnum = num;
}

function toptoggle (num)
{
	jQuery(".hide1").hide();
	jQuery("#contentdown_" + num).fadeIn("slow");
	topnum = num;
}

// Popup window code
function newPopup(url) 
{
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
