// fontes
Cufon.replace('h1,h2,h3', { hover:true, fontFamily: 'aller-light' });	
Cufon.replace('h4', { hover:true, fontFamily: 'aller-light' });	
Cufon.replace('#top-menu ul li a', { hover:false, fontFamily: 'aller-light-italic' });	
Cufon.replace('#top-menu ul li a.selected', { hover:false, fontFamily: 'aller_italic_700' });	


//encomendas
$("#encomendas").formToWizard({ submitButton: 'SaveAccount' })

$("#encomendas select").change( function() {
	var nome_elemento = $(this).attr('name');
			
	$("#"+nome_elemento +" option:selected").each(function () {
		str = $(this).text() + " ";
		valor = $(this).text() * 50 * 0.25;
	});

	if (str == 0) {
		$("#"+nome_elemento+"_txt").addClass("hidden");
		$("#"+nome_elemento+"_txt input").val(str);
	}

	if (str != 0) {
		$("#"+nome_elemento+"_txt").removeClass("hidden");
		$("#"+nome_elemento+"_txt input").val(str);
		
	}
});

$("#encomendas input").change(function() {

	var nome_elemento = $(this).attr('name');
	var str = $(this).val();

	$("#"+nome_elemento+"_txt").removeClass("hidden");
	$("#"+nome_elemento+"_txt input").val(str);
});


//validação
/*
var sayHello = new LiveValidation('nome', { validMessage: 'Hey there!', wait: 500});
sayHello.add(Validate.Presence, {failureMessage: "Don't just ignore me, I wanna be your friend!"});
sayHello.add(Validate.Format, {pattern: /^hello$/i, failureMessage: "How come you've not said 'hello' yet?" } );
*/
