$(document).ready(function(){
	//INPUT ELEMENTS	
		//remove styles from hidden inputs
		$('input[type=hidden]').each(function(){$(this).css('display', 'none');});
		
		//change color unless typed in	
		$(':input').focus(function(){
			if($(this).val() == $(this).attr('rel')){
				$(this).fadeTo(500, 0.5);
				$(this).keydown(function(){
					if($(this).val() == $(this).attr('rel')){					
						$(this).val('');
						$(this).fadeTo(500, 1.0);
					}
				});
			}
		}).blur(function(){
			if($(this).val() == '' || $(this).val() == $(this).attr('rel')){
				var atty = $(this).attr('rel');
				$(this).val(atty).fadeTo(500, 1.0);
			}
		});
		
		//CHECKBOX
		$('input[type=checkbox]').each(function(){
			$(this).css({'display' : 'inline', 'width' : 'auto', 'padding' : '0px', 'margin-right' : '5px'});
		});
	//INPUT ELEMENTS
	
	//FIND LOGO
	$('#logo').css('cursor', 'pointer').bind({
		click: function(){
			window.location = './?page=home';	
		}
	});
	
	$('#footLogo').css('cursor', 'pointer').bind({
		click: function(){
			window.location = './?page=home';	
		},
		mouseenter: function(){
			$(this).fadeTo(500, 0.5);
		},
		mouseleave: function(){
			$(this).fadeTo(500, 1.0);
		}
	});
	
	//margins
	$('#navbar a').last().css('padding-right', '0px');
	$('#footContent').find('a:eq(4)').css('padding-right', '0px').end().find('a:eq(5)').css('padding-right', '0px');
	
	//calendar overs
		$('.calButton').hover(function(){
			$(':nth-child(1)', this).css({'background-color' : '#000000', 'color' : '#ffffff'}).end().find(':nth-child(2)').css('color', '#000000');
		},function(){
			$(':nth-child(1)', this).css({'background-color' : '#735613', 'color' : '#ffffff'}).end().find(':nth-child(2)').css('color', '#989898');
		}).click(function(){
			goTo = $(this).attr('rel');
			if(goTo == undefined){
				window.location = './?page=calendar';
			}else{
				window.location = goTo;			
			}
		});
	//calendar overs
	
	//line height
		lH = $('#left').height();
		rH = $('#right').height();
		if(lH >= rH){
			$('#mid').css('height', lH+'px');
		}else{
			$('#mid').css('height', rH+'px');		
		}
	//line height	
	
	//CALENDAR SHOW
	$('.showDescription').toggle(function(){
		$(this).next().show(1000);
		$(this).css('font-weight', 'bold');
	},function(){
		$(this).next().hide('slow');
		$(this).css('font-weight', 'normal');
	});
});
