// JavaScript Document

$(document).ready(function(){
	// Added by Travis Redline on 10/01/09.
	$("#standings").click(function(){
		window.parent.location = "http://www.mcall.com/sports/varsity/standings/";						
	});
	
	$("#search").click(function(){
		window.parent.location = "http://www.mcall.com/sports/highschool/schedulesscores/";						
	});
	
	$("#scores").click(function(){
		window.parent.location = "http://www.mcall.com/sports/highschool/schedulesscores/";						
	});
	
	//SlideDown
	$("#upcoming").toggle(function(){
		$("#scores").animate({
			marginTop: "80px"				 
		});
		
		$("#upcoming").css("background", "url('images/16-arrow-up.png') top right no-repeat");
		
		
		$.ajax({
		   type: "POST",
		   url: "process/ajax_get_new.php",
		   success: function(msg){
			   $("#upcoming_content").html(msg + "<br /><a href='' id='view_more'>view more schedules</a>");
			   $("#view_more").click( function() {
			   		window.parent.location = "http://www.mcall.com/sports/highschool/schedulesscores/";				   
			   });
		   }
		 });
		
		$("#upcoming_content").fadeIn();
		
	}, function(){
		
		$("#upcoming").css("background", "url('images/16-arrow-down.png') top right no-repeat");
		
		$("#scores").animate({
			marginTop: "0px"				 
		});
		
		$("#upcoming_content").fadeOut();
		
		
	});							  
	
});
