$(document).ready(function(){
	$(".fieldItalic input").focus(function(){ $(this).parent('div').addClass('write'); if (this.value==this.title){ this.value=''; } });
	$(".fieldItalic input").blur(function(){ $(this).parent('div').removeClass('write'); if (this.value!=this.title){ $(this).parent('div').addClass('write'); } if (this.value==''){ this.value=this.title; $(this).parent('div').removeClass('write'); } });
	
	$('.nav').children('li').hover(
		function() {
			$(this).addClass('hover')
		},
		function() {
			$(this).removeClass('hover')
		}
	);
	
	$('.tooltip').css('opacity', '0.9');
	
	$('.packages .title a').mouseover(function(){
		$(this).parent().children('.tooltip').slideDown();
	});
	
	$('.packages .title a').mouseout(function(){
		$(this).parent().children('.tooltip').slideUp();
	});
	
	if ($('form').is('.form')) {
		valideForm("form.form");	
	}
});

function valideForm(handler) {
	jQuery.validator.addMethod("defaultInvalid", function(value, element) {
		return value != element.defaultValue;
	}, "");
	
	jQuery.validator.messages.required = "";
	$(handler).validate({
		onkeyup: false
	});
}

