$(document).ready(function(){	
	$(document).pngFix(); 
	$('.learnFooter').hover(function() {$('.learnFooter h3').addClass('footerSelected');}, function() {$('.learnFooter h3').removeClass('footerSelected');});
	$('.liveFooter').hover(function() {$('.liveFooter h3').addClass('footerSelected');}, function() {$('.liveFooter h3').removeClass('footerSelected');});
	$('.exploreFooter').hover(function() {$('.exploreFooter h3').addClass('footerSelected');}, function() {$('.exploreFooter h3').removeClass('footerSelected');});
	$('.applyFooter').hover(function() {$('.applyFooter h3').addClass('footerSelected');}, function() {$('.applyFooter h3').removeClass('footerSelected');});
	$('.giveFooter').hover(function() {$('.giveFooter h3').addClass('footerSelected');}, function() {$('.giveFooter h3').removeClass('footerSelected');});
	$('.newsFooter').hover(function() {$('.newsFooter h3').addClass('footerSelected');}, function() {$('.newsFooter h3').removeClass('footerSelected');});
	$('.homeLinks ul li a.homeProspective').hover(function() {$('.mainWhiteBar .homeButtons a.homeProspective').addClass('homeButtonSelected');}, function() {$('.mainWhiteBar .homeButtons a.homeProspective').removeClass('homeButtonSelected');});
	$('.homeLinks ul li a.homeCurrent').hover(function() {$('.mainWhiteBar .homeButtons a.homeCurrent').addClass('homeButtonSelected');}, function() {$('.mainWhiteBar .homeButtons a.homeCurrent').removeClass('homeButtonSelected');});
	$('.homeLinks ul li a.homeFaculty').hover(function() {$('.mainWhiteBar .homeButtons a.homeFaculty').addClass('homeButtonSelected');}, function() {$('.mainWhiteBar .homeButtons a.homeFaculty').removeClass('homeButtonSelected');});
	$('.homeLinks ul li a.homeAlumni').hover(function() {$('.mainWhiteBar .homeButtons a.homeAlumni').addClass('homeButtonSelected');}, function() {$('.mainWhiteBar .homeButtons a.homeAlumni').removeClass('homeButtonSelected');});
	$('.homeLinks ul li a.homeParents').hover(function() {$('.mainWhiteBar .homeButtons a.homeParents').addClass('homeButtonSelected');}, function() {$('.mainWhiteBar .homeButtons a.homeParents').removeClass('homeButtonSelected');});
	//$(".newsSlider").jCarouselLite({btnNext: ".next",btnPrev: ".prev",visible: 3,vertical: true});
	$('.clearField').focus(function() {$(this).val("");});
	
	$('.expandListItem h5').click(function () {
		$(this).toggleClass('expandSelected');
		$(this).next('div.expandListItemContent').slideToggle();
	});
	
	$('.footerBorder h4.expandFooterList').click(function () {
		$(this).toggleClass('expandSelected');
		$(this).next('div.expandFooterListContent').slideToggle();
	});

$('#tabsPanel #tabNav').find('a').bind('click', function(event){
			event.preventDefault(); //stop the link from going to href
			selectNav(this);
	});

	$('#tabsPanel .tabContent').hide();
	$('#tabsPanel .tabContent:first').show();
	$('.facultyStaffBookmark').jFav();
});
	
function getContributionImgSrc(obj){
	if(obj.length > 0){
		tmpObj=obj.split('src="');
		if(tmpObj.length > 0){
			tmpObj1=tmpObj[1].split('"');
			return tmpObj1[0];
		}else{return '';}
	}else{return '';}
}

function selectNav(e) {
  $(e).parents('ul:first').find('a').removeClass('selected').end().end().addClass('selected');
	$('#tabsPanel .tabContent').hide();
	var linkHashId = e.hash.substr(1);
	$('#tabsPanel').removeClass().addClass(linkHashId);
	$('#' + linkHashId).show();
}	
function getUrlVars(){
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for(var i = 0; i < hashes.length; i++){
		hash = hashes[i].split('=');
		vars.push(hash[0]);
		vars[hash[0]] = hash[1];
	}
	return vars;
}
