var vlrPadraoBusca = "";

$(document).ready(function(){
	vlrPadraoBusca = $("#busca-site").val();
	
	//--- Cufon	
	Cufon.replace('.futura', { fontFamily: 'Futura-Condensed-Normal' });
	Cufon.replace('.kauffman', { fontFamily: 'Kaufmann BT' });
	
	//--- Submenu
	$("ul.topnav li a, p").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").show('fast'); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").hide('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			//$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			//$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

	//--- Acordion Responsabilidade Social	
	$("#accordion").accordion( {
		autoHeight: false,
		navigation: true,
		active: false
	});
	
});

//--- Limpa os campos dos formulários
function limparPadrao(campo){
	if (campo.value == campo.defaultValue){
		campo.value = "";
	}
}

function escreverPadrao(campo){
	 if (campo.value == ""){
		 campo.value = campo.defaultValue;
	}
}

function verificarTexto(){
	if ($("#busca-site").val() == vlrPadraoBusca){
		$("#busca-site").val("");
	}
}

//--- Se for IE6, redireciona para página de atualização
var isIE6 = /msie|MSIE 6/.test(navigator.userAgent);

if(isIE6){
	window.location.replace('ie6');
}
