/*FUNCTIONS<<<<<<<<<<<<<<<<<<<<<<<<*/
	
	function openPopup(){
		$('.popup').show();
		//$('.popup').dropShadow({blur:4, left:4, top:5});		
	}
	
	function closePopup(th){
		$('.popup').remove();
	}
	

$(document).ready(function() { 

/*HOMEPAGE WAYS TO GET INVOLVED SLIDER*/
	waysInvolved = $('#ways-to-get-involved li a');
	waysDescr	= $('#ways-to-get-involved p');
	waysInvolved.eq(0).css(
	{
		borderTopLeftRadius: 12, 
		borderTopRightRadius: 0, 
		borderBottomLeftRadius: 12, 
		borderBottomRightRadius: 0 
	});	
	waysInvolved.eq(4).css(
	{
		borderTopLeftRadius: 0, 
		borderTopRightRadius: 12, 
		borderBottomLeftRadius: 0, 
		borderBottomRightRadius: 12 
	});
	
	waysInvolved.mouseenter(function(){
		$this = $(this);
		pos = waysInvolved.index($this);
		$('#ways-to-get-involved li a.active').removeClass('active');
		$('#ways-to-get-involved .downarrow').remove();
		$this.addClass('active').after('<img class="downarrow" src="/_images/downarrow.gif" />');
		waysDescr.hide();
		waysDescr.eq(pos).show();
		
	});


	/*Popup donate box on load if url has #donate*/
		var hash = window.location.hash;
		if(hash.substring(1)=='donate'){
			$('body').append('<div class="popup"><a class="close" href="#"><span class="hide">Close</span></a><div class="popup_content"></div></div>');
			openPopup();
			$('.popup .popup_content').load('http://takeabreakfromcancer.org/_includes/donate.asp');
		}

	$('a.nominate').mouseenter( function() {
		$(this).animate({height: '160px'});
		$(this).parent().animate({height: '106px'});
	});
	
	$('li.nominate_dropdown').mouseleave( function() {
		$(this).animate({height: '22px'}, 200);
		$('a.nominate').animate({height: '16px'}, 200);
	});
	
	$('li.select a').click( function() {
		var id = this.name;
		$('.' + id).show().siblings().hide();
		$('li.select').removeClass('about_active').addClass('about_inactive');
		$(this).parent().addClass('about_active').removeClass('about_inactive');
	}); 
	
	$('img#staff_image').hover( function() {
		$(this).attr('src', '_images/staff_over.jpg');
	}, function() {
		$(this).attr('src', '_images/staff.jpg');
	});
	
	$('ul#leadership_links li a').click( function() {
		var id = this.name;
		$('#'+id).show().siblings().hide();
	}); 
	
	if ($.browser.msie && $.browser.version <= 8) {
		$('#header_text a').css('font-family', 'font-family:LeagueGothicRegular, sans-serif');
	};
	
	if ($.browser.msie && $.browser.version >= 8) {
		$('img#boat').css('top', '-33px');
		$('input#your_name').css('margin-top', '13px');
		$('input#hello_post').css('top', '15px');
	};
	
	if ($.browser.msie && $.browser.version <= 7) {
		$('#profile #main_left h2').css('width', '100%');
		$('#profile #main_left hr').css('width', '100%');
	};

	/*Popup*/	
	$('a.pop, a.get_involved').click(function(){
		$('body').append('<div class="popup"><a class="close" href="#"><span class="hide">Close</span></a><div class="popup_content"></div></div>');
		var popContents = $(this).attr('href');
		openPopup();
		$('.popup .popup_content').load(popContents, function() {
			//clearLabel();
		});
		return false;
	});
	
		$('#travel_sponsors li:nth-child(4)').css('margin-right', '0');
	
	$('.popup a.close').live('click', function(){
		closePopup(this);
		return false;		
	});
});


