	function centralizar(id, l, a) {
		w = $('#body').innerWidth();
		h = $('#body').innerHeight();
		$('#'+id).css('left', (w-l)/2-2 );
		$('#'+id).css('top', (h-a)/2-2 );			
	}
	function grupo () {
		centralizar('box_conteudo', 958, 552);
		centralizar('fundo', 1297, 764);
		centralizar('menu', 947, 540);
		centralizar('conteudo', 956, 550);
		centralizar('menu_fotos', 956, 550);
		if ($.browser.mozilla) {
			centralizar('home_fundo', 950, 545);
		} else {
			centralizar('home_fundo', 953, 547);
		}
	}
	function link_menu (qual) {
		switch (qual) {
				case 0:
					document.location = '/site/';
					break;
				case 1:
					document.location = '/site/contato.asp';
					break;
				case 2:
					document.location = '/site/fotografos.asp';
					break;
				case 3:
					document.location = '/site/album.asp';
					break;
				case 4:
					document.location = '/site/eventos.asp';
					break;
				case 5:
					document.location = '/site/videos.asp';
					break;
				case 6:
					document.location = '/site/email.asp';
					break;
				default:
					alert('Menu nao disponivel');
					break;
		}
	}
	
	// Popup home
function somepop() {
	$("#popmsg").slideUp("slow");
}
function surgepop() {
	$("#popmsg").slideDown("normal");
}
function createpopup(adiv,arquivo,w,h) {
	var oiframe ='<div class="barracmd"><a href="javascript:somepop()">[X] Fechar</a></div>\n'
				+'<iframe frameborder="0" width="100%" height="90%" id="fr_msg" src="'+arquivo+'"></iframe>\n';
	   pai = document.getElementById(adiv);
	   elem = document.createElement("div");
	   elem.setAttribute("id", "popmsg");
	   elem.setAttribute("class", "popmsg");
	   if(w!='')elem.style.width=w+'px';
	   if(h!='')elem.style.height=h+'px';
	   txt = document.createTextNode(oiframe);
	   elem.innerHTML = oiframe;
	   pai.appendChild(elem);
	   var tempo1 = setTimeout('surgepop()', 2000);
	   var tempo2 = setTimeout('somepop()', 60000);
	   
}

jQuery.preloadImages = function() {
  for(var i=0; i<arguments.length; i++)   {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$(document).ready(function() {
	
	//Preload popup
	$.preloadImages("img/popup1.jpg");
	
});

