// JavaScript Document
//////////CONTACT FORM/////////////////////////
  $(document).ready(function() {
		
		
		function contactfadein(){
		$('#contact_form').fadeIn(400);	
	}

	function contactfadeout(){
		$('#blackout').fadeOut(150);	
	}
	
		$('a.mission').click(function(e){
     e.preventDefault();
		//$('#contact_form').fadeIn();	
		$('#blackout').fadeIn(350, contactfadein);
								});
	
		$('a.contact_close').click(function(e){
     e.preventDefault();
		$('#contact_form').fadeOut(250, contactfadeout);	
	//	$('#contact_form2').fadeOut(250, contactfadeout);
	//	$('#blackout').fadeOut();
								});
		$('#contact_form a.response_close').click(function(e){
     e.preventDefault();
		$('#contact_form').fadeOut();						
								});
		
		function eventfadein(){
		$('#cover').fadeIn('fast');
	}
		
		$('a.eventpopup').click(function(e){
				 e.preventDefault();
					
			
				var $load = $(this).attr('href');
				
				$('.popupEvent').load('eventpop.php?id='+ $load, eventfadein());
					
									 });



    $('.bottom_button.run').mouseover(function(e){
				 e.preventDefault();
				$('a.bottom_button.run').html('Running Late');
				
									 });

    $('.bottom_button.run').mouseout(function(e){
				 e.preventDefault();
				$('a.bottom_button.run').html('runner<i>profile</i>');
				
									 });
	
	    $('.bottom_button.jog').mouseover(function(e){
				 e.preventDefault();
				$('a.bottom_button.jog').html('Running Late');
				
									 });

    $('.bottom_button.jog').mouseout(function(e){
				 e.preventDefault();
				$('a.bottom_button.jog').html('jog<i>log</i>');
				
									 });
	
		
	    $('a.sneakerbox').mouseover(function(e){
				 e.preventDefault();
				$('a.sneakerbox').html('<img src="images/sneakerboxnotyet.jpg" width="60" height="55" alt="sneakerbox"  border="0" />');
				
									 });

    $('a.sneakerbox').mouseout(function(e){
				 e.preventDefault();
				$('a.sneakerbox').html('<img src="images/sneakerbox.jpg" width="60" height="55" alt="sneakerbox"  border="0" />');
				
									 });
	
	    $('a.tipjar').click(function(e){
				 e.preventDefault();
					
				$('#tipcover').fadeIn('fast');
				var $load = $(this).attr('href');
				
				$('.TipJarBox').load('tipjar.php?id='+ $load);
									 });

	
	

		
			$('a.month').live('click', function(e){
				 e.preventDefault();
				$('.month').removeClass('selected');
				$(this).addClass('selected');
				var $month = $(this).attr('href');
				var  $year = $('.year.selected').attr('href');
				$('#scroll_holder').load('includes/homescroll.php?month='+ $month +'&year=' + $year);
				
								   
								   });
		
			
		$('a.year').live('click', function(e){
				 e.preventDefault();
				$('.year').removeClass('selected');
				$(this).addClass('selected');
				var $year = $(this).attr('href');
				var $month = $('.month.selected').attr('href');
				
				$('#scroll_holder').load('includes/homescroll.php'+ $year);
				$('.monthnavhold').load('includes/monthnav.php'+ $year);
				
								   
								   });

	
		$('.scrollpane').jScrollPane(
								 {
									showArrows:true,
									verticalGutter: 15
								 });

		
		$('.corerunners').click(function(e){
					 e.preventDefault();
					 $(this).addClass('selected');
					 $('.ogrunners').removeClass('selected');
						var $type = $(this).attr('href');
						$('#runner_scroll_holder').load('includes/runnerscroll.php?type='+ $type);
										 });
		
			$('.ogrunners').click(function(e){
					 e.preventDefault();
					 $(this).addClass('selected');
					 $('.corerunners').removeClass('selected');
						var $type = $(this).attr('href');
						$('#runner_scroll_holder').load('includes/runnerscroll.php?type='+ $type);				 
										 });
		
		
		 
//	 $('a.newtip').live('click',function(e){
//				 e.preventDefault();
//				 var $toload = $(this).attr('href');
//				$('#tipcover').load('tipjar.php?id='+ $toload);
//				 
//								 });
	 
		
		
		});
