// JQUERY CUSTOM COMMANDS
$(function() {
	
	// FORMS - focus and blur
	$('.input input').focus(function() {
		$(this).select().parent().addClass('focus');
	});
	$('.input input').blur(function() {
		$(this).parent().removeClass('focus');
	});
	// FORMS - clicking on hint
	$('.input .hint').click(function() {
		$(this).parent().addClass('focus').find('input').select();
	});
	// FORMS - Empty filled fields on blur
	$('.input input').each(function() {
		$(this).blur(function() {
			$(this).parent().removeClass('focus');
			if ($(this).val() != "") {
				$(this).parent().addClass('filled');
			} else {
				$(this).parent().removeClass('filled');
			};
		});
	});
	// FORMS - Empty filled fields on load
	$('.input input').each(function() {
		if ($(this).val() != "") {
			$(this).parent().addClass('filled');
		} else {
			$(this).parent().removeClass('filled');
		};
	});

	
	// STYLING
	
	// Make columns as high as content
	var contentHeight = $('#content').height();
	$('#main.duoCols').css({ minHeight: contentHeight });
	
	// mainMenu
	$('#mainMenu li').hover(function() {
		$(this).addClass('hover'); // add hover classes
	}, function() {
		$(this).removeClass('hover');
	});
	
	// lister
	$("tbody tr:odd").addClass('odd'); $("tbody tr:even").addClass('even'); 
	$("tbody tr:first").addClass('first'); $("tbody tr:last").addClass('last');
	$('tbody tr').hover(function() {
	    $(this).addClass('hover');
	}, function() {
	    $(this).removeClass('hover');
	});
	
	// Colorbox
	$("div.gallery a").colorbox({maxWidth:'90%', maxHeight:'90%', rel:'group1'});

   
});

