$(document).ready(function(){
	//INPUT ELEMENTS	
		var st = '#263035';
		var en = '#636a6e';
		var fn = '#999da0';
		
		$('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', fn);
			}
		});
		
		//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);
		}
	});
	
	//GET BUTTONS HEIGHT
	var b1 = $('#content').height();
	var b1p1 = parseFloat($('#content').css('padding-top'));
	var b1p2 = parseFloat($('#content').css('padding-bottom'));
	var b2 = $('#right').height();
	var b2p1 = parseFloat($('#right').css('padding-top'));
	var b2p2 = parseFloat($('#right').css('padding-bottom'));

	var b1 = b1+b1p1+b1p2;
	var b2 = b2+b2p1+b2p2;
	var b2p = b2+40;

	if(b1 >= b2){
		$('#line').css('height', b1+'px');
	}else{
		$('#content').css('height', b2+'px');
		$('#line').css('height', b2p+'px');
	}
	
	
	//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);
		}
	});

	//CALENDAR SHOW
	$('.showDescription').toggle(function(){
		$(this).next().show(1000);
		$(this).css('font-weight', 'bold');
	},function(){
		$(this).next().hide('slow');
		$(this).css('font-weight', 'normal');
	});
	
/*
	//PRELOAD IMAGES
	(function($){
		var cache = [];
		// Arguments are image paths relative to the current page.
		$.preLoadImages = function() {
			var args_len = arguments.length;
			for (var i = args_len; i--;) {
				var cacheImage = document.createElement('img');
				cacheImage.src = arguments[i];
				cache.push(cacheImage);
			}
		}
	})(jQuery)
	
	$.preLoadImages('images/navbar/home_alt.png', 'images/navbar/about_alt.png', 'images/navbar/portfolio_alt.png', 'images/navbar/contact_alt.png');
*/
});
