$(document).ready(function(){
	$('#slide').innerfade({
		speed: 1500,
		timeout: 4000,
		type: 'sequence',
		containerheight: '75px',
		containerwidth: '371px'
	});

	//INPUT ELEMENTS	
		var st = '#4c4c4c';
		var en = '#9a9a9a';
		
		$('input[type=hidden]').each(function(){
			$(this).css('display', 'none');
		});
			
		$(':input').focus(function(){
			if($(this).val() == $(this).attr('rel')){
				$(this).css('color', en);
				$(this).keydown(function(){
					if($(this).val() == $(this).attr('rel')){					
						$(this).val('');
						$(this).css('color', st);
					}
				});
			}
		}).blur(function(){
			if($(this).val() == '' || $(this).val() == $(this).attr('rel')){
				var atty = $(this).attr('rel');
				$(this).val(atty).css('color', st);
			}
		});
		
		//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';	
		},
		mouseenter: function(){
			$(this).fadeTo(500, 0.5);
		},
		mouseleave: function(){
			$(this).fadeTo(500, 1.0);
		}
	});
	
	$('#foot_logo').css('cursor', 'pointer').bind({
		click: function(){
			window.location = './?page=home';	
		},
		mouseenter: function(){
			$(this).fadeTo(500, 0.5);
		},
		mouseleave: function(){
			$(this).fadeTo(500, 1.0);
		}
	});
	
	//FINDING NAV STUFF
	$('#navbar a').each(function(initIndex){
		if($(this).attr('rel') == 'true'){
			$(this).children().attr('src', 'images/navbar/'+$(this).children().attr('alt')+'_alt.png')
		}else{
			$(this).bind({
				mouseenter: function(){
					$(this).children().attr('src', 'images/navbar/'+$(this).children().attr('alt')+'_alt.png')
				},
				mouseleave: function(){
					$(this).children().attr('src', 'images/navbar/'+$(this).children().attr('alt')+'.png')				
				}
			});
		}
	});
	
	//CLEANING UP MARGINS AND JUNK
	$('#foot_nav a:last').css('padding-right', '0px');
	$('#foot_right a:last').css('padding-right', '0px');
	
	//PLAYLIST
	$('.playlist li a').click(function(){
		var thi = $(this);
		$('.playlist li a').each(function(go){
			$(this).css('text-decoration', 'none');
		});
		if($(thi).attr('play') == ''){
			$(thi).attr('play', 'playing');
		}else{
			if($(thi).attr('play') == 'playing'){
				$(thi).css('text-decoration', 'blink');
				$(thi).attr('play', 'paused');
			}else{
				$(thi).css('text-decoration', 'none');
				$(thi).attr('play', 'playing');			
			}
		}			
	});	
	
	//COLORBOX
	$("a[rel='example1']").colorbox();
	
	//SHOWHIDDEN
	$('.payPal').next().css('display', 'none').prev().toggle(function(){
		$(this).next().slideDown('slow');
	},function(){
		$(this).next().slideUp('fast');	
	});
});
