//Site code/functionality that'll start up when ready


//Adjusts the height of the schedule/roster box ont he sport page
function adjustScheduleHeight() {
	$('#roster,#schedule').height($('#mid_mid').height()-135);
}

//Adjusts the internal paddings of the sports page buttons
function adjustSportsButtons() {
	var txt = '';
	$('#mid_mid .activity').each(function() {
		var pad = Math.floor((60 - parseInt($('.buttonText',this).height())) / 2);
		$(this).css('padding-top',pad + 'px');
		$(this).css('height',42+(20-pad));
	});
}

//Opens up the next week
var currWeek = 0;
function nextWeek() {
	currWeek++;
	if ( currWeek >= $('#week').children().length ) {
		currWeek = 0;
	}
	showWeek(currWeek);
}

//Opens up a lunch menu tab
function showWeek(i) {
	//Close all tabs
	currWeek = i;  //Reverse set it
	
	$('#week li').each(function() {
		$(this).removeClass('menu_week_sel');
		
	});
	
	//Mark this week
	$('#week li:eq(' + i + ')').addClass('menu_week_sel');
	
	//Open/close divs
	$('.menucont').hide();
	
	$('#menucont_' + i).show();
}

//Change what div shows on the dept contact page
function changeDept(i) {
 	$('.depts').hide();
 	$('#section_' + i).show();
}

//Changes the news/bulletin pageinator page
function changePage(url) {
	window.location=url;
}

function goto(url) { 
  window.open(url,'mywindow','')
}


//Dropdown menu thingy-magig
function pke() {
 if(document.getElementById(arguments[0])) {
	 if(arguments.length > 1) {
		 document.getElementById(arguments[0]).style.display = arguments[1];

		 return;
	 }
	 else return true;
 }
 else return false;
}


	


