// 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');
		};
	});

	// mainMenu
	$('#mainMenu > ul > li:first').addClass('first');
	//$('#mainMenu li.current_page_item, #mainMenu li.current_page_parent, #mainMenu li.current_page_ancestor').prev().addClass('beforeActive');
	
	// Ringband 1/1
	ringband();
	$('#content').resize(function() {
		ringband();
	});
	
   
});

// Ringband 2/2
function ringband() {
	var contentHeight = $('#content').height();
	var ringsHeight = (Math.floor((contentHeight + 130) / 28) * 28);
	$('#siderings').css('height', ringsHeight);
}
