$(window).load(function(){
	if ( $(".col2b:first").height() > $(".col2a:first").height() )
	{
		$(".col2a:first").height( $(".col2b:first").height() );
	}
	if ( $(".col2a:first").height() > $(".col2b:first").height() )
	{
		$(".col2b:first").height( $(".col2a:first").height() );
	}
});

$(document).ready(function() {
	if($("#googleMap").length > 0)
	{	
		initialize();
	}
	
	$(document).pngFix(); /* PNG FIX for IE6*/ 

	$("#weather .tomorrow").click(function(){
		$('#today').css("display","none");
		$('#tomorrow').css("display","block");
		return false;
		
	});
	
	$("#weather .today").click(function(){
		$('#today').css("display","block");
		$('#tomorrow').css("display","none");
		return false;
	});
	
	//$("a").click(function(){return false;});

	if($(window).width() < 1024)
	{
		$(".fades").css("display","none");
	}
	
	initMenu();
	
	$("#sortby").OnChange 
	
	$(function() {
		$("#tabs").tabs();
	});

	//$("#calendar").tablesorter({cssAsc: "headerSortUp", cssDesc: "headerSortDown", cancelSelection: "true", headers: { 4: {sorter: false}}}); 
	
	$(".rss-popup a").hover(function() {
		$(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow");
		}, function() {
		$(this).next("em").animate({opacity: "hide", top: "-70"}, "fast");
	});
	
	$(".area").hover(function() {
		$(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow");
		}, function() {
		$(this).next("em").animate({opacity: "hide", top: "-70"}, "fast");
	});
	
	$('#topButton').click(function(){
		$('html, body').animate({scrollTop:0}, 'slow'); /* Scroll TOP button only */
	});
	
	$('#1link').click(function(){
		$('#mapImage span p').html("Track Highlight");
		$('#mapImage #1').fadeIn();
		$('#mapImage #2').fadeOut();
		$('#googleMap').fadeOut();
		return false;
	});
	
	$('#2link').click(function(){
		$('#mapImage span p').html("Aerial Photo");
		$('#mapImage #1').fadeOut();
		$('#mapImage #2').fadeIn();
		$('#googleMap').fadeOut();
		return false;
	});
	
	$('#3link').click(function(){
		$('#mapImage span p').html("Google Map");
		$('#mapImage #1').fadeOut();
		$('#mapImage #2').fadeOut();
		$('#googleMap').fadeIn();
		return false;
	});

	
	function ticker()
	{
		
		$('.newsticker ul').append('<li>'+$('.newsticker ul li:first').html()+'</li>');
		$('.newsticker ul li:first').remove();

		
	
		
		
	}
	interval = setInterval(ticker, 5000);
	
	$('.thumbnail a').hover(
			function()
			{
				$(this).parent().css("background-image", "url(/images/thumbBGHover.gif)");
			},
			
			function()
			{
				$(this).parent().css("background-image", "url(/images/thumbBG.gif)");
			}
			
	); 
	
	$('.thumb').error(function() {
		$(this).parent().remove();
	});

	
	
});
