// JavaScript Document

	//REQUISICOES DIVERSAS	
	function mostraDivs() {
		$("#divMenu").show();
		$("#divPrincipal").show();
		$("#divDestaques").show();
	}
	
	// HISTORICO
	function pageload(hash) {		
		// hash doesn't contain the first # character.
		if(hash) {
			// restore ajax loaded state
			$("#divPrincipal").load(hash + ".php");
		} else {
			// start page
			$("#divPrincipal").load("home.php");
		}
	}
	
	$(document).ready(function(){
	//esconde as divs
	$("#galAp").hide();
	$("#galCafe").hide();
	$("#galTur").hide();
	$("#divMenu").hide();
	$("#divPrincipal").hide();
	$("#divDestaques").hide();
	//Drag'n Drop
	$("#galAp").jqDrag("#dragAp");
	$("#galCafe").jqDrag("#dragCafe");
	$("#galTur").jqDrag("#dragTur");
	// Initialize history plugin.
	// The callback is called at once by present location.hash. 
	$.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. 
		$("#divPrincipal").html('<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle"><img src="images/load.gif" /></td></tr></table>');
		$.historyLoad(hash);
		return false;
	});
	});
	//FIM DO HISTORICO
	