_g = {};
_gA = [
	  ["home.html", "overflow-y", "hidden"],
	  ["a_secret.html", "overflow-y", "scroll"],
	  ["colecao.html", "overflow-y", "hidden"],
	  ["promocoes.html", "overflow-y", "auto"],
	  ["mapa.html", "overflow-y", "auto"],
	  ["contato.html","overflow-y", "hidden"],
	  ];

function initMenu()
{
	  $('#menu div').hide();
  $('#menu div:first').show();
  $('#menu li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('div')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('div')) && (!checkElement.is(':visible'))) {
        $('#menu div:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
}


$(document).ready(function()
{
	_g.carregando = $("#carregando");
	_g.qTela = null;
	_g.content = ".cnt";
	_g.carregando.hide();
	
	initMenu();
	
	//rel="prettyPhoto[gallery1]" 
	$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});




	// FUNCTION LOAD //
	
	/*function loadPage(e)
	{
		//alert(_gA[e][0]);
		
		/// HACK TELA HOME ///
		
		if (e == 0) $(_g.content).css("width", "1024px");
		else $(_g.content).css("width", "790px");
	
		/// HACK TELA HOME ///
	
		if(_g.qTela == _gA[e][0]) 
		{ 
			///alert("mesma, parou");//
			return false; 
		}
		
		_g.carregando.ajaxStart(function()
		{
			$(_g.content).hide();
			$(this).show();
		});
		_g.carregando.ajaxStop(function()
		{
			$(this).hide();
			$(_g.content).show();
		});
		
		_g.qTela = _gA[e][0];
		$(_g.content).load(_gA[e][0]);
		if(_gA[e][1] != undefined)
		{ 
			$(_g.content).css(_gA[e][1], _gA[e][2])
		}
	}*/
	
	// FUNCITON LOAD //
	$('a').click( function()
	{
		var args = $(this).attr("rel");
		//var v = args.split(',');
		//alert(_gA[args][0])
		if(args) loadPage(args);
	});
	
	loadPage(0);
	
})
