$(document).ready(function(){
	//LavaLamp Menu
		$("#lavaLamp").lavaLamp({
		fx: "easeOutSine",
		speed: 400,
		click: function() {return false;}
		})	
	//Fix PNG images on Ie6
		$(this).pngFix();
	// Initialize history plugin
		$.historyInit(pageload);
		// set onlick event for buttons
		$("a[@rel='history']").livequery('click',function(){		
			var hash = this.href;
			hash = hash.replace(/^.*#/, '');
			// moves to a new page. 
			// pageload is called at once. 
			$("#divConteudo").html('<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="center"><img src="images/load.gif" /><br />Carregando...</td></tr></table>');
			$.historyLoad(hash);
			return false;
		});
});

// HISTORICO
function pageload(hash) {		
	// hash doesn't contain the first # character.
	if(hash) {
		// restore ajax loaded state
		$("#divConteudo").load(hash + ".html");
		
	} else {
		// start page
		$("#divConteudo").load("home.html");
	}
}

//Flash Content
function flash(file, width, height, wmode){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9' width='" + width + "' height='" + height + "'>");
    document.write("<param name='movie' value='" + file + "'>");
    document.write("<param name='quality' value='high'>");
	document.write("<param name='wmode' value='" + wmode + "'>");	
    document.write("<embed src='" + file + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "' wmode='" + wmode + "'></embed>");
    document.write("</object>");
};

//carregar o flash do fundo
function loadIntro(){
	$('#divFlashFundo').css(
	{visibility:"visible"}
	);
}



