var tempoSubMenu = 10000;
var skippedIntro = false;

function botaoChat(){
	document.write("<a href='index.html'><script language='JavaScript' src='https://www.chatcomercial.com.br/livehelp/lib/javascript/support_status.php?COMPANY_ID=12342&SITE_ID=14514&ssl=1'></script></a>");
}

function abrir() {
	var width = 920;
	var height = 292;
	var left = 99;
	var top = 99;
	window.open("https://ssl2211.websiteseguro.com/skinmax/Loja.swf",'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
	}
	
	function musica() {
	window.open("http://www.skinmax.com.br/novo/musica.html","janela", "width=280, height=130, top=3000, STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESIZABLE=NO, SCROLLBARS=YES, left=3000, menubar=0,fullscreen=no");
	} 
	
	function musica2() {
	window.open("musica.html","janela", "width=280, height=130, top=3000, STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESIZABLE=NO, SCROLLBARS=YES, left=3000, menubar=0,fullscreen=no");
	}
	
	/*
	function abrirFoto(foto, numero) {
	var width = 500;
	var height = 320;
	var left = 99;
	var top = 99;
	window.open("../Album/galeria"+numero+"/g/"+foto+".jpg",'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
	}*/
	
	/*function mostra_imagem(foto, numero){*/
	function abrirFoto(foto, numero){
	var width=450;
	var height=300;
   /*
   xWidth ('ampliacao',width + 6)
   xHeight ('ampliacao',height + 6 + 20)
   xWidth ('c1',width)
   xHeight ('c1',height)
   xWidth ('fecharampliacao',width)
   */
   xInnerHtml('c1','<img src=../Album/galeria'+numero+'/g/'+foto+'.jpg width="' + width + '" height="' + height + '" border="0">')
   xShow('ampliacao');
	}
	
	function fechar_ampliacao(){
	xHide('ampliacao');
	} 
	
function openElementsMessage(action, content){
	if(action){
		$('#focusPanel_black').fadeTo('slow', 0.8, function(){
			$('#focusPanel_white').css({visibility: 'visible'});
			$("#wrapContent").empty();
			$("#wrapContent").wrapInner(content);
		});
	}else{
		$("#wrapContent").empty();
		$('#focusPanel_white').css({visibility: 'hidden'});
		$('#focusPanel_black').fadeOut("normal");
	}
}
function openFlyElements(isTurnOn, cHtml){
	if(isTurnOn)
	{
		$('#focusPanel_black').fadeTo('slow', 0.8, function(){
			$('#flyBanner').css({visibility: 'visible'});
			$(".wrapContent").empty();
			$(".wrapContent").wrapInner(cHtml);
		});
	}
	else
	{
		$(".wrapContent").empty();
		$('#flyBanner').css({visibility: 'hidden'});
		$('#focusPanel_black').fadeOut("normal");
	}
}

function openFlyFooter(isTurnOn, cHtml){
	if(isTurnOn)
	{
		$('#flyFooter').fadeIn('slow', function(){
			$("#ctFooterFloat").empty();
			$("#ctFooterFloat").wrapInner(cHtml);
		});
	}
	else
	{
		$("#ctFooterFloat").empty();
		$('#flyFooter').fadeOut("normal");
	}
}

function openInternalContent(page){
	var tPage = page.toLowerCase();
	if($("#main").length <= 0)
		createMainElement();
	$("#main").attr("src", page);
	if(tPage.indexOf("servicos") != -1 && tPage.indexOf("4") != -1){
		$("#content").removeClass();
		$("#content").addClass("bgFlash_area");
	}else{
		$("#content").removeClass();
		$("#content").addClass("centralBordas");
	}
	closeAllSubMenu();
}
function openHomeContent(){
	$("#content").removeClass();
	$("#content").removeAttr("style");
	if(skippedIntro){
		if($("#main").length <= 0)
			createMainElement();
		$("#main").attr("src", "main.aspx");
	}
}
function createPhotoAlbum(){
	if($("#main").length > 0){
		$("#content").empty();
		$("#content").css({height: '290px'});
		$("#content").css({borderTop: '1px solid #CCC'});
		$("#content").css({borderBottom: '1px solid #CCC'});
		$.ajax({url: "album.html", cache: false, success: function(html){
			$("#content").wrapInner(html);
			closeAllSubMenu();
		}});
	}
}
function createStore(){
	if($("#main").length > 0){
		closeAllSubMenu();
		$("#content").empty();
		$("#content").css({height: '290px'});
		$("#content").css({borderTop: '1px solid #CCC'});
		$("#content").css({borderBottom: '1px solid #CCC'});		
		$("#content").wrapInner("<embed height='292' width='920' align='middle' type='application/x-shockwave-flash' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' allowfullscreen='false' allowscriptaccess='sameDomain' name='loja' scale='noscale' quality='high' src='loja.swf'>");
	}
}
function loading(){return "<p align='center'><img src='Imagens/lightbox-ico-loading.gif' alt='Carregando'></p>";}
function openGallery(indice){
	var fullPath = "Galerias.aspx?id="+indice;
	$.ajax({url: fullPath, cache: false, success: function(html){$("#direitaAlbum").empty();$("#direitaAlbum").wrapInner(html);}});
}
function createMainElement(){
	$("#content").empty();
	$("#content").wrapInner("<iframe src='main.aspx' frameborder='0' scrolling='no' allowtransparency='true' id='main' hspace='0' vspace='0' />");
}
function doMainPage(){	
	$("body").addClass("fundo");
	$("#avaliacao").css({visibility: 'visible'});
	$("#fale").css({visibility: 'visible'});
	$("#cadastro").css({visibility: 'visible'});	
	$("#ctl00_ctl06_whiteMenu").fadeIn("normal", function(){
		$("#ctl00_ctl06_whiteInfo").fadeIn("slow");
		createMainElement();
		$("#whiteFooter").fadeIn("slow");
	});
	skippedIntro = true;
}
function openUnidades(){
	openElementsMessage(true, loading());	
	$.ajax({url: "Unidades.aspx", cache: false, success: function(html){openElementsMessage(true, html);}});
}
function closeSubMenuTimer(option){
	var nomeObj = "#";
	switch(option){
		case "emp":
			nomeObj += "mnEmpresa";
			mnEmpresa_inter = setTimeout(function(){
				$(nomeObj).fadeOut("slow");
			}, tempoSubMenu);
			break;
		case "ser":
			nomeObj += "mnServicos";
			mnServicos_inter = setTimeout(function(){
				$(nomeObj).fadeOut("slow");
			}, tempoSubMenu);
			break;
		case "pro":
			nomeObj += "mnPromocoes";
			mnPromocoes_inter = setTimeout(function(){
				$(nomeObj).fadeOut("slow");
			}, tempoSubMenu);
			break;
		case "dep":
			nomeObj += "mnDepilacao";
			mnDepilacao_inter = setTimeout(function(){
				$(nomeObj).fadeOut("slow");
			}, tempoSubMenu+5000);
			break;
	}
}
function openSubMenu(option){
	var nomeObj = "#";
	
	switch(option){
		case "emp":
			nomeObj += "mnEmpresa";
			$("#mnServicos").fadeOut("fast");
			$("#mnPromocoes").fadeOut("fast");
			$("#mnDepilacao").fadeOut("fast");			
			break;
		case "ser":
			nomeObj += "mnServicos";
			$("#mnEmpresa").fadeOut("fast");
			$("#mnPromocoes").fadeOut("fast");
			$("#mnDepilacao").fadeOut("fast");
			break;
		case "pro":
			nomeObj += "mnPromocoes";
			$("#mnEmpresa").fadeOut("fast");
			$("#mnServicos").fadeOut("fast");
			$("#mnDepilacao").fadeOut("fast");
			break;
		case "dep":
			nomeObj += "mnDepilacao";
			$("#mnEmpresa").fadeOut("fast");
			$("#mnServicos").fadeOut("fast");
			$("#mnPromocoes").fadeOut("fast");
			break;
	}
	$(nomeObj).fadeIn("slow");
	clearTimeout(mnEmpresa_inter);
	clearTimeout(mnServicos_inter);
	clearTimeout(mnPromocoes_inter);
	clearTimeout(mnDepilacao_inter);
}
function breakSubMenu(option){
	switch(option){
		case "emp":
			clearTimeout(mnEmpresa_inter);			
			break;
		case "ser":
			clearTimeout(mnServicos_inter);
			break;
		case "pro":
			clearTimeout(mnPromocoes_inter);
			break;
		case "dep":
			clearTimeout(mnDepilacao_inter);
			break;
	}
}
function closeAllSubMenu()
{
	$("#mnEmpresa").fadeOut("fast");
	$("#mnServicos").fadeOut("fast");
	$("#mnPromocoes").fadeOut("fast");
	$("#mnDepilacao").fadeOut("fast");
	clearTimeout(mnEmpresa_inter);
	clearTimeout(mnServicos_inter);
	clearTimeout(mnPromocoes_inter);
	clearTimeout(mnDepilacao_inter);
	}
function criarCurvas(){
	var internalSettings = {
		tl: { radius: 10 },
		tr: { radius: 10 },
		bl: { radius: 10 },
		br: { radius: 10 },
		antiAlias: true
	}
	curvyCorners(internalSettings, "#pnImagem");	
}
function openUnidadeInterno(indice){
	$("#direitaUnidades").empty();
	$("#direitaUnidades").wrapInner(loading());
	$.ajax({url: "Unidades_interno.aspx?id="+indice, cache: false, success: function(html){
		$("#direitaUnidades").empty();
		$("#direitaUnidades").wrapInner(html);
	}});
}
function openMap(caminho){
	var fullPath = "url("+caminho+")";
	$("#pnImagem").css({"background": 'none'});
	$("#pnImagem").css({"background-image": fullPath});
}

