// JavaScript Document
$(document).ready(function() {
	// INIT LABEL FORMS
	$('.label').each(function() {
		var default_value = this.value;					
		$(this).focus(function() {
			if(this.value == default_value){
				this.value = '';
				$(this).addClass('filled');
			}
		});					
		$(this).blur(function() {
			if(this.value == ''){
				this.value = default_value;
				$(this).removeClass('filled');
			}
		});	
	});
	// INIT PASSWORD REPLACER
	$('.fake-password').each(function() {				
		$(this).focus(function() {
			$(this).hide();
			var parent = $(this).parent();
			var password = $(parent).children('.password');
			$(password).show();
			$(password).focus();
		});		
	});
	$('.password').each(function() {
		var default_value = this.value;					
		$(this).blur(function() {
			if (this.value == ''){
				$(this).hide();
				var parent = $(this).parent();
				var password = $(parent).children('.fake-password');
				$(password).show();
			}
		});		
	});
	// INIT NAVIGATION MENU
	$('.navigation li').mouseover(function() {
		$('.navigation li').each(function() {
			$(this).removeClass('active');								  
		});									  
		$(this).addClass('active');
	});
	//INIT FOOTER TABS
    $("#sitemap").jVertTabs({
		equalHeights: true
	});
	//INIT ROLLOVERS
	$('.rollover').mouseover(function() {
		var src = $(this).attr("src").replace(".png", "_over.png");
		$(this).attr("src", src);
	});
    $('.rollover').mouseout(function() {
		var src = $(this).attr("src").replace("_over", "");
		$(this).attr("src", src);
	});
});
