// scripts


//----------------------------


// script de mensagem da barra de status
defaultStatus=" ---->  B R  d e s i g n  -  web design and web development solutions   -  w w w . b r d e s i g n . n e t "





// -->  Função de validação do formulário - sugestões

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->



//----------------
 function contato_orcamento() {
open("?area=contato_orcamento","janela","height=500,width=480,top=20,left=150,menubar=no,toolbar=no,status=no,scrollbars=no")
}


//-----------
 function contato_contato() {
open("?area=contato_contato","janela","height=500,width=480,top=20,left=150,menubar=no,toolbar=no,status=no,scrollbars=no")
}



//-------- Validação - Contato
function ValidacaoContato() {
	if(document.getElementById("Nome").value==''){
		alert('O campo Nome não foi preenchido!');	
		document.getElementById("Nome").focus();
		return false;
	}else if(document.getElementById("Email").value==''){
		alert('O campo Email não foi preenchido!');	
		document.getElementById("Email").focus();
		return false;
	}else if(document.getElementById("Assunto").value==''){
		alert('O campo Assunto não foi preenchido!');	
		document.getElementById("Assunto").focus();
		return false;
	}else if(document.getElementById("Mensagem").value==''){
		alert('O campo Mensagem não foi preenchido!');	
		document.getElementById("Mensagem").focus();
		return false;
	}
}


//-------- Validação - Orçamento
function ValidacaoOrcamento() {
	if(document.getElementById("Nome").value==''){
		alert('O campo Nome não foi preenchido!');	
		document.getElementById("Nome").focus();
		return false;
	}else if(document.getElementById("Email").value==''){
		alert('O campo Email não foi preenchido!');	
		document.getElementById("Email").focus();
		return false;
	}else if(document.getElementById("Cidade").value==''){
		alert('O campo Cidade/UF não foi preenchido!');	
		document.getElementById("Cidade").focus();
		return false;
	}else if(document.getElementById("Servico").value==''){
		alert('O campo Serviço não foi preenchido!');	
		document.getElementById("Servico").focus();
		return false;
	}else if(document.getElementById("ExecucaodoProjeto").value==''){
		alert('O campo Execução do Projeto não foi preenchido!');	
		document.getElementById("ExecucaodoProjeto").focus();
		return false;
	}else if(document.getElementById("DescricaodoServico").value==''){
		alert('O campo Descricao do Servico não foi preenchido!');	
		document.getElementById("DescricaodoServico").focus();
		return false;
	}
}

function popPortfolioDetalhe(varImagem,varAltura,varLargura) {
	var vAltura = (screen.height-varAltura)/2;
	var vLargura =(screen.width-varLargura)/2;
	window.open("PortfolioDetalhe.php?Imagem="+varImagem,"pop_"+varImagem,"top="+vAltura+",left="+vLargura+",height="+varAltura+",width="+varLargura+",status=no,menubar=no,toolbar=no,scrollbars=yes,location=no,resizable=no")
}

function Fade(img){
	if (document.getElementById(img).className == "PortfolioIMG"){
		document.getElementById(img).className = "PortfolioIMG2";
	} else {
		document.getElementById(img).className = "PortfolioIMG";
	}
}

//Banner ------------------------------------------------------------------------------

window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so_init);

var d=document, imgs = new Array(), zInterval = null, current=0, pause=false;


function so_init() {
if(!d.getElementById || !d.createElement)return;

css = d.createElement("link");
css.setAttribute("href","css.css");
css.setAttribute("rel","stylesheet");
css.setAttribute("type","text/css");
d.getElementsByTagName("head")[0].appendChild(css);

imgs = d.getElementById("imgBanner").getElementsByTagName("img");
for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
imgs[0].style.display = "block";
imgs[0].xOpacity = .99;

setTimeout(so_xfade,19000);
}

function so_xfade() {
cOpacity = imgs[current].xOpacity;
nIndex = imgs[current+1]?current+1:0;

nOpacity = imgs[nIndex].xOpacity;

cOpacity-=.05;
nOpacity+=.05;

imgs[nIndex].style.display = "block";
imgs[current].xOpacity = cOpacity;
imgs[nIndex].xOpacity = nOpacity;

setOpacity(imgs[current]);
setOpacity(imgs[nIndex]);

if(cOpacity<=0) {
imgs[current].style.display = "none";
current = nIndex;
setTimeout(so_xfade,19000);
} else {
setTimeout(so_xfade,50);
}

function setOpacity(obj) {
if(obj.xOpacity>.99) {
obj.xOpacity = .99;
return;
}
obj.style.opacity = obj.xOpacity;
obj.style.MozOpacity = obj.xOpacity;
obj.style.filter = "alpha(opacity=' + (obj.xOpacity*100) + ')";
}

}

//-------------------------

