$(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);
		}
	});
	
	//slider
	$(window).load(function() {
		$('#fader').nivoSlider({ pauseTime:5000, pauseOnHover:false });
	});	

	//clean up margins
	$('#navbar a').last().css('padding-right', '0px');
	$('#right a').last().css({'padding-bottom' : '0px', 'border-bottom' : '0px', 'margin-bottom' : '0px'});
	$('#inner a').last().css({'padding-bottom' : '0px', 'border-bottom' : '0px', 'margin-bottom' : '0px'});
	
	//home cal
	$('#right a').hover(function(){
		$(this).eq(0).css('color', '#000000').end().css('color', '#000000');
	},function(){
		$(this).eq(0).css('color', '#1a1717').end().css('color', '#352d26');	
	});
	
	//CALENDAR
	$('.cal_btn').bind({
		click: function(){
			if($(this).attr('rel') == undefined){
				window.location = './?page=calendar';			
			}else{
				window.location = './?page=calendar&'+$(this).attr('rel');
			}			
		},
		mouseenter: function(){
			col = $(this).css('color');
			spc = $('span', this).css('color');
			$(this).find('span').css('color', '#082f52').end().css('color', '#000000');
		},
		mouseleave: function(){
			$(this).find('span').css('color', spc).end().css('color', col);
		}
	});

	//PLAYLIST
	$('.playlist li a').click(function(){
		var inner = $(this).html();
		
		if(inner == 'play'){
			$(this).html('playing');
		}else{
			if(inner == 'playing'){
				$(this).html('paused (click to play)');
			}else{
				$(this).html('playing');
			}
		}
	});

	//CALENDAR SHOW
	$('.showDescription').toggle(function(){
		$(this).next().show(1000);
		$(this).css('font-weight', 'bold');
	},function(){
		$(this).next().hide('slow');
		$(this).css('font-weight', 'normal');
	});
	
});
