$(document).ready( function() {
	
	// hide show text in input and textarea

    $(this).find("input").add($(this).find("textarea")).each(function() {
        if (this.type == 'text' && $submittedValues[this.name]) {
            this.value = $submittedValues[this.name];
            this.className = 'hide';
        }
        if (this.type == 'textarea' && $submittedValues[this.name]) {
            this.value = $submittedValues[this.name];
            this.className = 'hide';
        }
    });

	$('.hidde').focus(function() {
        // clear value if current value is the default
        if($(this).val() === this.defaultValue) {
            $(this).val("").removeClass('hell');
            }
    }).blur(function() {
        // restore to the default value if current value is empty
        if($(this).val() == "") {
            $(this).addClass('hell').val(this.defaultValue);
            }
        else {
            $(this).removeClass('hell');
            }
    });
        
	$("#forma").submit(function() {
		$(this).find("input").add($(this).find("textarea")).each(function() {
			var input = $(this);
            if (this.type == 'text' || this.type == 'textarea') {
                if($(this).val() == this.defaultValue) {
                    $(this).val("");
                }
            }
		});
	});
	
	$('a[rel="external"]').click(function(){
		this.target = "_blank";
	});

    
});


