window.onresize = function() { checkSize(); LocalizacaoPosiciona(); };
window.onshow = checkSize;
window.onload = function() { checkSize(); };
window.onopen = checkSize;

//checkSize
function checkSize()
{
	var ie = /msie/i.test(navigator.userAgent);
	var ieBox = ie && (document.compatMode == null || document.compatMode == "BackCompat");
	var canvasEl = ieBox ? document.body : document.documentElement;
	var w = window.innerWidth || canvasEl.clientWidth;
	var h = window.innerHeight || canvasEl.clientHeight;
	
	/*if (h>=935)
	{
		document.getElementById("obj").style.height = Math.max(0, 100) + "%";
	}
	else
	{
		document.getElementById("obj").style.height = "935px";
	}*/
	
	if (w>=990)
	{
		document.getElementById("obj").style.width = Math.max(0, 100) + "%";
	}
	else
	{
		document.getElementById("obj").style.width = "990px";
	}
}

//FastFood
function FastFood(c)
{
	if($(".localizacao-" + c).html() == ""){
		$(".localizacao-" + c).load("estrutura/shopping-" + c + ".php");
	}
	$(".localizacao-" + c).popup({
		objectHide: false,
		height: 530,
		width: 720
	});
}

//Localizacao
var stage_w = 999;
var new_stage_w = 0;
function LocalizacaoPosiciona()
{
	if(stage_w > new_stage_w)
	{
		var left = (205 + ((new_stage_w - stage_w) / 2));
	}
	else
	{
		var left = (205 - ((stage_w - new_stage_w) / 2));
	}
	$(".localizacao").css("left", left + "px");
}
function LocalizacaoDefineStageWidth(w)
{
	new_stage_w = w;
	if($(".localizacao").html() == ""){
		$(".localizacao").html('<iframe width="271" height="272" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com.br/maps?f=q&amp;source=s_q&amp;hl=pt-BR&amp;geocode=&amp;q=cantina+da+nena&amp;sll=-14.179186,-50.449219&amp;sspn=110.433584,228.339844&amp;ie=UTF8&amp;hq=cantina+da+nena&amp;hnear=&amp;ll=-23.181474,-45.88809&amp;spn=0.007318,0.013937&amp;z=14&amp;iwloc=A&amp;cid=12905784876677667804&amp;output=embed"></iframe>');
	}
	$(".localizacao").show();
	LocalizacaoPosiciona();
}
function LocalizacaoFecha()
{
	$(".localizacao").hide();
}
