<!--
//#############################################################
msg			= "Todos os campos devem ser preenchidos.";
msgEmail	= "Esse não é um e-mail válido.";
//#############################################################
function loginClient(){

	// VALIDANDO
	with(document.formCliente){
		if(cliUsuario.value.length == 0 || cliUsuario.value == 'usu&aacute;rio'){
			alert(msg);
			cliUsuario.focus();
			return false;
		}
		if(cliSenha.value.length == 0){
			alert(msg);
			cliSenha.focus();
			return false;
		}

	}

	var cliUsuario		= document.formCliente.cliUsuario.value;
	var cliSenha		= document.formCliente.cliSenha.value;

	// ENVIANDO
	var div_var = document.getElementById('return');

	div_var.innerHTML = '<div id="loading"><img src="img/loading.gif" /></div>';

	createXMLHttp();
	http_request.open("GET", "inc_cliente_action.php?cliUsuario=" + cliUsuario + "&cliSenha=" + cliSenha, true);
	http_request.onreadystatechange=function() {
		if(http_request.readyState == 4){
			if(http_request.status == 200){

				if(http_request.responseText == 'true'){
					window.location = './area_cliente/';
				}else{
					div_var.innerHTML = '<div id="return">Usu&aacute;rio ou senha inv&aacute;lido.</div>';
				}

			}
		}
	}
	http_request.send(null);

}
//#############################################################
function sendContact(){

	// VALIDANDO
	with(document.formContato){
		if(nome.value.length == 0 || nome.value == 'nome'){
			alert(msg);
			nome.focus();
			return false;
		}
		if(email.value.length == 0 || email.value == 'e-mail'){
			alert(msg);
			email.focus();
			return false;
		}else{
			if(!vld_email(email.value)){
				alert(msgEmail);
				email.focus();
				return false;
			}
		}
		if(telefone.value.length == 0 || telefone.value == 'telefone'){
			alert(msg);
			telefone.focus();
			return false;
		}
		if(assunto.value.length == 0 || assunto.value == 'assunto'){
			alert(msg);
			assunto.focus();
			return false;
		}
		if(mensagem.value.length == 0 || mensagem.value == 'mensagem'){
			alert(msg);
			mensagem.focus();
			return false;
		}

	}

	var nome		= document.formContato.nome.value;
	var email		= document.formContato.email.value;
	var telefone	= document.formContato.telefone.value;
	var assunto		= document.formContato.assunto.value;
	var mensagem	= document.formContato.mensagem.value;
	var news		= document.formContato.news.checked;

	// ENVIANDO
	var div_var = document.getElementById('formContato');

	div_var.innerHTML = '<div id="loading"><img src="img/loading.gif" /></div>';

	createXMLHttp();
	http_request.open("GET", "inc_contato_action.php?nome=" + nome + "&email=" + email + "&telefone=" + telefone + "&assunto=" + assunto + "&mensagem=" + mensagem + "&news=" + news, true);
	http_request.onreadystatechange=function() {
		if(http_request.readyState == 4){
			if(http_request.status == 200){

				if(http_request.responseText == 'true'){
					div_var.innerHTML = '<div id="return">Sua mensagem foi enviada com sucesso!</div>';
				}else{
					div_var.innerHTML = '<div id="return">Ocorreu um erro no envio de sua mensagem. Pedimos, por favor, que netre em contato atrav&eacute;s de nossos telefones.</div>';
				}

			}
		}
	}
	http_request.send(null);

}
//#############################################################
jQuery(function($){
	$.supersized({
		autoplay		 : 1,
		start_slide      : 1,
		transition       : 1,
		transition_speed : 1000,
		slides 			 : [
							{image : '../img/bkgs/home_1.jpg'},
							{image : '../img/bkgs/home_2.jpg'},
							{image : '../img/bkgs/home_3.jpg'},
							{image : '../img/bkgs/home_4.jpg'},
							{image : '../img/bkgs/home_5.jpg'},
							{image : '../img/bkgs/cliente.jpg'},
							{image : '../img/bkgs/contato.jpg'},
							{image : '../img/bkgs/depoimentos.jpg'},
							{image : '../img/bkgs/estudio.jpg'},
							{image : '../img/bkgs/parceiros.jpg'},
							{image : '../img/bkgs/portfolio.jpg'},
							{image : '../img/bkgs/premiacao.jpg'}
						   ],
	});
});
//#############################################################
var atualContent = 'home';
function showContent(div,content){
	// LIMPA A DIV DO CENTRO
	document.getElementById('content_center').innerHTML = '';
	// EMPURRA A DIV PARA FORA DA TELA
	$('#content').animate({
		'marginLeft' : '-400px'
	}, function(){
		// LIMPA O CONTEÚDO DA DIV
		cleanContent(content)
		// EMPURRA A DIV DE VOLTA À TELA
		$('#content').animate({
			'marginLeft' : '0px'
		}, function(){
			// CARREGA O CONTEÚDO NA DIV
			loadContent(div,content)
			// TROCA A IMAGEM DE FUNDO
			if(content == 'home'){
				api.options.slideshow = 1;
				api.goTo(1);
			}else{
				api.options.slideshow = 1;
				var contents = new Array();
					contents['cliente']		= 6; 
					contents['contato']		= 7; 
					contents['depoimentos']	= 8; 
					contents['estudio']		= 9; 
					contents['parceiros']	= 10; 
					contents['portfolio']	= 11; 
					contents['premiacao']	= 12; 
				api.goTo(contents[content]);
				api.options.slideshow = 0;
			}
		});
	});
	atualContent = content;
}
function cleanContent(content){
	document.getElementById('content').innerHTML = '';
	if(content != 'home'){
		document.getElementById('content').className = '';
	}else{
		document.getElementById('content').className = 'home';
	}
}
function loadContent(div,content,par){

	var div_var = document.getElementById(div);

	div_var.innerHTML = '<div id="loading"><img src="img/loading.gif" /></div>';

	createXMLHttp();
	http_request.open("GET", "inc_" + content + ".php?par=" + par, true);
	http_request.onreadystatechange=function() {
		if(http_request.readyState == 4){
			if(http_request.status == 200){

				div_var.innerHTML = http_request.responseText;

				if(content == 'estudio_cristina'){
					document.getElementById('content_aux').innerHTML = '<img src="img/estudio_foto_cristina.png" class="estudio_foto" />';
				}else if(content == 'estudio_alexandre'){
					document.getElementById('content_aux').innerHTML = '<img src="img/estudio_foto_alexandre.png" class="estudio_foto" />';
				}else if(content == 'estudio_historia' || content == 'estudio_equipe'){
					document.getElementById('content_aux').innerHTML = '';
				}else if(content == 'portfolio_detalhes'){
					$(function() {
						$('#galeria a').lightBox();
					});
				}

			}
		}
	}
	http_request.send(null);

}
//#############################################################
function contentResize(){
	var myHeight = 0;
	if(typeof(window.innerHeight) == 'number'){
		myHeight = window.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){
		myHeight = document.documentElement.clientHeight;
	}else if(document.body && document.body.clientHeight){
		myHeight = document.body.clientHeight;
	}
	myHeight = myHeight;
	document.getElementById("content").style.height = myHeight - 95 + 'px'; 
	document.getElementById("content_center").style.height = myHeight - 140 + 'px'; 
}
window.onresize = function(){
	contentResize();
}
//#############################################################
function preloadImages(){
	MM_preloadImages(
					 '/img/bkgs/cliente.jpg',
					 '/img/bkgs/contato.jpg',
					 '/img/bkgs/depoimentos.jpg',
					 '/img/bkgs/estudio.jpg',
					 '/img/bkgs/parceiros.jpg',
					 '/img/bkgs/portfolio.jpg',
					 '/img/bkgs/premiacao.jpg',
					 '/img/bkgs/home_1.jpg',
					 '/img/bkgs/home_2.jpg',
					 '/img/bkgs/home_3.jpg',
					 '/img/bkgs/home_4.jpg',
					 '/img/bkgs/home_5.jpg'
					 );
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//#############################################################
var http_request = false;
//#############################################################
// CRIA O XMLHTTP
function createXMLHttp(){
	if(window.XMLHttpRequest){ //Mozilla, Safari, ...
		http_request = new XMLHttpRequest();
		if(http_request.overrideMimeType){
			http_request.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){ //IE
		try{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
			}
		}
	}
	if(!http_request){
		alert("O sistema não conseguiu ativar todos os recursos necessários à exibição desta página.\nPor favor, entre em contato conosco para obter mais informações.");
	}
}
//#############################################################
function vld_email(email){
	prim = email.indexOf("@");
	if((email.indexOf("@",prim + 1) != -1) || (email.indexOf(".") < 1)){
		return false;
	}else{
		return true;
	}
}
//#############################################################
-->
