// *******************Barra de status********************
//AbreJanela

// ******************* Dia - Męs e ANO ******************

function AbreJanela(link,x,y,s,u) {

  var t = (screen.height - y) / 2;
  var e = (screen.width - x) / 2;

  window.open(link,x+y+s,'width=' + x + ',height=' + y + ',scrollbars=' + s + ',toolbar=0,location=0,status=0,menubar=0,resizable=0,left=' + e + ',top=' + t + '');
  if(u==1){
    window.focus();
  }

}
// *****************************************************
// Como usar:
// <a href="javascript:;" onMouseOver="AbreJanela('http://www.terra.com.br',500,400,1,0)">Clique 
// Aqui para abrir em PopUp</a><BR>
// <BR>
// 
// <a href="javascript:;" onclick="AbreJanela('http://www.terra.com.br',500,400,1,1); ">Clique Aqui para abrir em PopUnder</a>
//******************************************************


// *******************Barra de status********************
//defaultStatus="FPP MEDIA"

// ******************* Dia - Męs e ANO ******************

var now = new Date();
var mName = now.getMonth() + 1;
var dName = now.getDay() + 1;
var dayNr = now.getDate();
var yearNr=now.getYear();
if(dName==1) Day = "Domingo";
if(dName==2) Day = "Segunda-feira";
if(dName==3) Day = "Ter&ccedil;a-feira";
if(dName==4) Day = "Quarta-feira";
if(dName==5) Day = "Quinta-feira";
if(dName==6) Day = "Sexta-feira";
if(dName==7) Day = "S&aacute;bado";
if(yearNr < 2000) Year = 1900 + yearNr;
else Year = yearNr;
var todaysDate =(" " + Day + ", " + dayNr + "/" + mName + "/" + " de " +mName);

// *****************************************************
// Como usar:
//******************************************************

function Hoje() { 
ContrRelogio = setTimeout ("Hoje()", 1000) 
Hr = new Date() 
dd = Hr.getDate() 
mm = Hr.getMonth() + 1 
aa = Hr.getYear() 
hh = Hr.getHours() 
min = Hr.getMinutes() 
seg = Hr.getSeconds() 
DataAtual = ((dd < 10) ? "0" + dd + "/" : dd + "/") 
DataAtual += ((mm < 10) ? "0" + mm + "/" + aa : mm + "/" + aa) 
HoraAtual = ((hh < 10) ? "0" + hh + ":" : hh + ":") 
HoraAtual += ((min < 10) ? "0" + min + ":" : min + ":") 
HoraAtual += ((seg < 10) ? "0" + seg : seg) 
document.DataHora.Data.value=DataAtual 
document.DataHora.Hora.value=HoraAtual 
} 
// 
function CriaArray (n) { 
this.length = n } 
// 
NomeDia = new CriaArray(7) 
NomeDia[0] = "sunday" 
NomeDia[1] = "monday" 
NomeDia[2] = "tuesday" 
NomeDia[3] = "wednesday" 
NomeDia[4] = "thursday" 
NomeDia[5] = "friday" 
NomeDia[6] = "saturday" 
// 
NomeMes = new CriaArray(12) 
NomeMes[0] = "january"
NomeMes[1] = "february" 
NomeMes[2] = "march" 
NomeMes[3] = "april" 
NomeMes[4] = "may" 
NomeMes[5] = "june" 
NomeMes[6] = "july" 
NomeMes[7] = "august" 
NomeMes[8] = "september" 
NomeMes[9] = "october" 
NomeMes[10] = "november" 
NomeMes[11] = "december"
// 
Data1 = new Date() 
dia = Data1.getDate() 
dias = Data1.getDay() 
mes = Data1.getMonth() 
ano = Data1.getYear() 
// ******************************************************
// Como usar:
// <script> document.write (NomeDia[dias] + " " + dia + " de " + NomeMes[mes] + " de " + (ano ) ) </script>
// NO INGLĘS: <script> document.write (NomeDia[dias] + ", " + NomeMes[mes] + " " + dia + ", " + (ano ) )</script>
//******************************************************


//******************************************************
// AbrePop
//******************************************************
function AbrePop(link,x,y,s) {

	var t = (screen.height - y) / 2;
	var e = (screen.width - x) / 2;

	d = new Date();
	segundo = d.getSeconds();

	window.open(link,x+y+s+segundo,'width=' + x + ',height=' + y + ',scrollbars=' + s + ',toolbar=0,location=0,status=0,menubar=0,resizable=0,left=' + e + ',top=10');

}

//******************************************************
// AbrePopExpo
//******************************************************
function AbrePopExpo(link,x,y,s) {

	var t = (screen.height - y) / 2;
	var e = (screen.width - x) / 2;

	d = new Date();
	segundo = d.getSeconds();

	window.open(link,x+y+s+segundo,'width=' + x + ',height=' + y + ',scrollbars=' + s + ',toolbar=1,location=1,status=1,menubar=1,resizable=1,left=' + e + ',top=10');

}


	function ShowMenu(strName){

		if(strName=='mnu_empresa'){

			mnu_empresa.style.visibility='';
			mnu_solucoes.style.visibility='hidden';

		}else if(strName=='mnu_solucoes'){

			mnu_empresa.style.visibility='hidden';
			mnu_solucoes.style.visibility='';

		}

	}

	function HiddenMenu(){

		mnu_empresa.style.visibility='hidden';
		mnu_solucoes.style.visibility='hidden';

	}
//******************************************************
// Como Usar:
//   <A title="Texto explicativo" onclick="AbrePop('pop_up.html', 400, 450, 1);" href="javascript:;"><IMG height=50 src="bt_enviar.gif" width=150 border=0></A>
//******************************************************

//***************** VerificarForm *********************-

	function VerificarForm(){
		
		if(form_contato.txt_nome.value=='') { 
			alert('Campo Nome Requerido'); 
			form_contato.txt_nome.focus();	
			return false;
		}

		if(form_contato.txt_email.value=='' || validarEmail(form_contato.txt_email.value) == false) { 
			alert('Campo Email Requerido'); 
			form_contato.txt_email.focus();	
			return false;
		}

		if(form_contato.txt_cidade.value=='') { 
			alert('Campo Cidade Requerido'); 
			form_contato.txt_cidade.focus();	
			return false;
		}

		if(form_contato.txt_uf.value=='') { 
			alert('Campo Estado Requerido'); 
			form_contato.txt_uf.focus();	
			return false;
		}

		if(form_contato.txt_telefone.value=='') { 
			alert('Campo Telefone Requerido'); 
			form_contato.txt_telefone.focus();	
			return false;
		}

		if(form_contato.txt_mensagem.value=='') { 
			alert('Campo Mensagem Requerido'); 
			form_contato.txt_mensagem.focus();	
			return false;
		}

	}


	function validarEmail(email){

		var valor = true;

		Result = email.indexOf("@", 0);

		if (Result == -1 || email.length < 6){
			valor = false;
		}else{
			Result2 = email.indexOf(".", Number(Result + 3));
			if (Result2 == -1 || email.length < 6){
				valor = false;
			}
		}

		return valor;

	}

//******************************************************
// Como Usar:
//   <FORM name=form_contato onsubmit="return VerificarForm();" action="" method=post>
//******************************************************

//******************************************************
//
//
//******************************************************

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//******************************************************
