
<!-- FUNÇÃO PARA ESCREVER DATA (DD//MM/YYYY) -->

function escreveData() {
  today = new Date()
  if (today.getDate() < 10)
    dia = "0" + today.getDate()
  else dia = today.getDate()
    mes = today.getMonth()+1
  
  if (mes < 10)
    mes = "0" + mes
				
  document.write(dia + '/' + mes + '/' + today.getFullYear());
}

<!-- FUNCAO - DATA --> 

function printDate() {

  today = new Date()
  if (today.getDay()==0)
  	dataCompleta = "Domingo"
  else if (today.getDay()==1)
  	dataCompleta = "Segunda-feira"
  else if (today.getDay()==2)
  	dataCompleta = "Terça-feira"
  else if (today.getDay()==3)
  	dataCompleta = "Quarta-feira"
  else if (today.getDay()==4)
  	dataCompleta = "Quinta-feira"
  else if (today.getDay()==5)
  	dataCompleta = "Sexta-feira"
  else if (today.getDay()==6)
  	dataCompleta = "Sábado"
  
  if (today.getDate() < 10)
  	dataCompleta += ", " + "0" + today.getDate() + "/"
  else dataCompleta += ", " + today.getDate() + "/"
  
  if (today.getMonth()==0)
  	dataCompleta += "JAN"
  else if (today.getMonth()==1)
  	dataCompleta += "FEV"
  else if (today.getMonth()==2)
  	dataCompleta += "MAR"
  else if (today.getMonth()==3)
  	dataCompleta += "ABR"
  else if (today.getMonth()==4)
  	dataCompleta += "MAI"
  else if (today.getMonth()==5)
  	dataCompleta += "JUN"
  else if (today.getMonth()==6)
  	dataCompleta += "JUL"
  else if (today.getMonth()==7)
  	dataCompleta += "AGO"
  else if (today.getMonth()==8)
  	dataCompleta += "SET"
  else if (today.getMonth()==9)
  	dataCompleta += "OUT"
  else if (today.getMonth()==10)
  	dataCompleta += "NOV"
  else if (today.getMonth()==11)
  	dataCompleta += "DEZ"
  
  if (today.getHours() < 10)
  	horas = "0" + today.getHours()
  else horas = today.getHours()
  
  if (today.getMinutes() < 10)
  	minutos = "0" + today.getMinutes()
  else minutos = today.getMinutes()
  
  dataCompleta += "/" + today.getFullYear() + " :: " + horas + ":" + minutos
  document.write (dataCompleta);
}

<!-- FUNCAO - PARA ESCREVER A DATA -->
  
function makeMonthArray() {
  this.length=12;
  this[1] = "Janeiro", this[2] = "Fevereiro"; this[3] = "Março";
  this[4] = "Abril", this[5] = "Maio"; this[6] = "Junho";
  this[7] = "Julho", this[8] = "Agosto"; this[9] = "Setembro";
  this[10] = "Outubro", this[11] = "Novembro"; this[12] = "Dezembro";
  return(this);
}

function makeDayArray() {
  this.length=7;
  this[1] = "Domingo", this[2] = "Segunda"; this[3] = "Terça";
  this[4] = "Quarta", this[5] = "Quinta"; this[6] = "Sexta";
  this[7] = "Sábado";
  return(this);
}

function writeDate() {
  attdate = new Date();
  monthName = new makeMonthArray();
  dayName = new makeDayArray();
  day = attdate.getDay() + 1;
  date = attdate.getDate();
  month = attdate.getMonth() + 1;
  year = attdate.getYear();
  sec = attdate.getSeconds()

  if (90 <= year && year < 2000) {
    year = "2000";
  }

  dateStr  = dayName[day];
  dateStr += ", ";
  dateStr += date;
  dateStr += " ";
  dateStr += "de ";
  dateStr += monthName[month];
  dateStr += " ";
  dateStr += "de ";
  dateStr += year;
  document.write(dateStr);
}


<!-- FUNCAO - ABRE POPUP -->

function Abre(url, width, height) {
  window.open(url,"_blank","resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,width=" + width + ",height=" + height);
}

function abrePopup() { 
  var popup = window.open('evento.shtml', "avisos" ,"scrollbars=yes,resizearea=no,width=610,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no");
  popup.focus();
  /*
  if (document.cookie.indexOf(cookieName) == -1) {
	var random_num = Math.floor(Math.random() * 100);
	if (random_num < 15) {
		var popup = window.open('/survey_popup.html','survey_popup','width=300,height=300,scrollbars=no,noresize');
		popup.focus();
	}
  }
  */
}

function pop_up(pagina,nome_pagina,largura,altura) {
  // Este script mostra um pop-up no meio da página do visitante  
  // Variaveis da página 
  var posLargura = (screen.width / 2) - (largura / 2); 
  var posAltura  = (screen.height / 2) - (altura / 2); 

  var propriedades = 'toolbar=no,';       // retira a barra de  
  propriedades += 'location=no,';         // retira a barra de 
  propriedades += 'directories=no,';      // retira a barra de  
  propriedades += 'status=no,';           // retira a barra de  
  propriedades += 'menubar=no,';          // retira a barra de  
  propriedades += 'scrollbars=yes,';      // retira as barras  
  propriedades += 'resizable=no,';        // retira a opcao de  
  propriedades += 'width='+largura+',';   // largura da janela 
  propriedades += 'height='+altura+',';   // altura da janela 
  propriedades += 'left='+posLargura+','; // posicao inicial  
  propriedades += 'top='+posAltura;       // posicao inicial  

  window.open(pagina, nome_pagina, propriedades); 
}

function popUpWindowPrivacidade(valor) {
  var comprimento;
  var largura;
  //verifica as posições do topo e da esquerda baseado na resolução utilizada pelo usuário deixando a janela centralizada.
  comprimento = (window.screen.width/2) - (285 + 10); //metade do comprimento da tela menos metade do comprimento da nova janela (mais 5 pixel de bordas).
  altura = (window.screen.height/2) - (201 + 50); //metade da altura da tela menos metade da altura da nova janela (mais as barras de título e status).
  var win2 = window.open(valor,"Privacidade","status=no,height=402,width=570,resizable=no,left=" + comprimento + ",top=" + altura + ",screenX=" + comprimento + ",screenY=" + altura + ",scrollbars=no");
  win2.focus();
}

function newWindow(file,window) {
    msgWindow=open(file,window,config='height=300,width=500,toolbar=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,status=no');
    if (msgWindow.opener == null) msgWindow.opener = self;
}

/*
function pop(a,b,x,y) {
  window.open(a,b,'width=' + x + ',height=' + y + ',resizable=0,status=1,menubar=0,scrollbars=0');
}

function popCEP(a,b,x,y) {
  window.open(a,b,'width=' + x + ',height=' + y + ',resizable=0,status=1,menubar=0,scrollbars=0');
}

function PopUp(pathname) { 
  var finalname = escape(pathname); 
  window.open(finalname, "Ajuda", 'width=580,height=472,menubar=no,scrollbars=no,toolbar=no,resizable=yes'); 
  return; 
}

function NewWindow(mypage,myname,w,h){
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? ((screen.height-h)/2)-20 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,resizable=no,statusbar=no,menubar=no';
  window.open (mypage,myname,settings);
}

function DisplayAd_Blur() {
  var adWindow
  adWindow = window.open("http://www.widesoft.com.br","240x240","width=260,height=260,scrollbars=no,status=no,menubar=no,resizable=no");
  adWindow.blur();
  window.focus();
}	
 Immediate popup;
 DisplayAd_Blur();


function popUpWin(url, x, y) {
    if (x == null || y == null) {
        var newWin = window.open(url, '');
    } else {
        eval ("window.open(url, 'Popup', 'width="+x+",height="+y+",,resizable=1,scrollbars=1');")
    }   
}

function popUpWinWithStatus(url, x, y) {
  if (x == null || y == null) {
    var newWin = window.open(url, '');
  } 
  else {
    eval ("window.open(url, 'Popup', 'width="+x+",height="+y+",,resizable=1,scrollbars=1,status=1');")
  }   
}

function popWindow(url,winName) { //v2.0
  if (url != "")
    var w = window.open(url,winName,'width=640,height=400,scrollbars=1,resizable=0,status=0,menubar=0,fullscreen=0');
}

function popUpWinWithToolbar(url, x, y) {
 if (x == null || y == null) {
   var newWin = window.open(url, '');
 } 
 else {
   eval ("window.open(url, 'Popup', 'width="+x+",height="+y+",,toolbar=yes,location=yes,resizable=1,scrollbars=1');")
 }   
}
*/

<!-- FUNCAO - IMAGENS RANDÔMICAS -->

function imageRand(){
  number = Math.round(Math.random()*6)+1
  if(number==1){
    document.write("<a href='index.shtml'><img src='imagens/img_comunicacao.gif' border=0></a>");
  }
  if(number==2) {
    document.write("<a href='index.shtml'><img src='imagens/img_integracao.gif' border=0></a>")
  }
  if(number==3) {
    document.write("<a href='index.shtml'><img src='imagens/img_perspectivas.gif' border=0></a>")
  }
  if(number==4) {
    document.write("<a href='index.shtml'><img src='imagens/img_sincronia.gif' border=0></a>")
  }
  if(number==5) {
    document.write("<a href='index.shtml'><img src='imagens/img_supplychain.gif' border=0></a>")
  }
  if(number==6) {
    document.write("<a href='index.shtml'><img src='imagens/img_vencendo.gif' border=0></a>")
  }
}

function imageRand2(){
  var url;
  site = "";
  var number = 2;
  day = new Date();
  seed = day.getTime();
  ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*number + 1,10) -1;
  if(ran==(0)) {
    document.write("<a href='index.shtml'><img src='http://a154.g.akamai.net/f/154/7690/15m/www.visteon.com/images/home/main_swap1.jpg' width='655' height='164' border='0' alt=''></a>")
  }
  if(ran==(1)) {
    document.write("<a href='index.shtml'><img src='http://a154.g.akamai.net/f/154/7690/15m/www.visteon.com/images/home/main_swap2.jpg' width='655' height='164' border='0' alt=''></a>")
  }	
  else 
    alert(ran);
}

  
<!-- FUNCAO - DROPDOWN-LINKS -->

function dropdown(formID,dropdownID) { 
  var selectedLink = document[formID][dropdownID].options[document[formID][dropdownID].selectedIndex].value;
  if (selectedLink != '#') {
    window.location=document[formID][dropdownID].options[document[formID][dropdownID].selectedIndex].value;
  } else if (selectedLink == '#') {
  	document[formID][dropdownID].selectedIndex = 0;
  }
}

/*
<select id=LanguageSelector style="WIDTH: 168px" onchange="document.location.href=document.getElementById('LanguageSelector').value">                          
  <option value="" selected>Escoha aqui ...</option> 
  <option value=http://www.widelog.com.br/>Widelog</option>
  <option value=http://www.widesoft.com.br/>Widesoft</option>
</select>
*/

<!-- FUNCAO - PARA ADICIONAR PARA FAVORITOS -->

function addFav(){
  //window.external.AddFavorite('http://www.widesoft.com.br', 'Widesoft Sistemas');
  if (navigator.appName.indexOf("Microsoft") != -1  &&  parseInt(navigator.appVersion.charAt(0)) >= 4 && navigator.appVersion.indexOf("Win") != -1) {
    window.external.AddFavorite(document.location.href,'WideLog')
  } 
  /*else {
      var newWin = window.open("","newWindow", "width=200,height=120")
      var newContent = '<html><head><SCRIPT LANGUAGE="JavaScript" SRC="http://www.unisinos.br/_java/estilo_mostra.js"></SCRIPT><title>U n i s i n o s : Espaço Vitae</title></head><body><br><p>Para adicionar essa página entre suas favoritas, <a href="javascript:window.close()">feche</a> esta janela e após pressione <br><br><center><b>Ctrl + d</b></center></p></body></html>'
      newWin.document.write(newContent)
      newWin.document.close()
  }
  */
}


var bookmarkurl=document.location
var bookmarktitle=document.title

function addbookmark(){
  if (document.all)
    window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

//<form>
//<input type="button" name="btn_bookmark" value="adicionar aos favoritos" onclick="javascript:addbookmark()">
//</form>


<!-- FUNCAO - DEFINI O SITE COMO PÁGINA INICIAL -->

function DefaultHomePage(){

}

<!-- FUNCAO - PARA CHECAR O FORMULÁRIO DE CONTATO -->

function checkContato() {
  if ((document.contato.nome.value == "") || (document.contato.email.value == "") || (document.contato.fone.value == "") || (document.contato.msg.value == "")) {
    alert("Todos os campos são obrigatórios!");
	document.contato.nome.focus();
	return;
  }
  else {
    document.contato.submit();
  }
}

function checkFields() {
  missinginfo = "";
  if (document.RequestForm.clientid.value == "") {
    alert("Por favor, preencha o campo clientid!");
    document.RequestForm.clientid.focus();
	document.RequestForm.clientid.select();
	return false;
  }
  if (document.RequestForm.senha.value == "") {
    alert("Por favor, preencha o campo senha!");
    document.RequestForm.senha.focus();
	document.RequestForm.senha.select();
	return false;
  }
}

var reEmail = /^.+\@.+\..+$/    
    
function validateEmail(email){
  aEmail = email.split(';')
  for (i=0;i<aEmail.length;i++) {
    if (aEmail[i] != ""){
  	  if ( ! (reEmail.test(aEmail[i])) ){
		return false;
	  }
	}
  }
  return true;
}
    

<!-- FUNCAO - CHAMA O CSS -->

function css() 	{
  var nav = new String(navigator.appName)
  document.write("<BASE HREF=\"http://www.visic.com/\">")
  if (nav.charAt(0)=="M")
    document.write('<LINK REL="stylesheet" REV="stylesheet" HREF="/common/styles/msie.css">')
    // document.write("<LINK REL=\"stylesheet\" REV=\"stylesheet\" HREF=\"http://www.visic.com/MSIE.css\">")
  else if (nav.charAt(0)=="N")
    document.write('<LINK REL="stylesheet" REV="stylesheet" HREF="/common/styles/netscape.css">')		
    // document.write("<LINK REL=\"stylesheet\" REV=\"stylesheet\" HREF=\"netscape.css\">") 
  else
    document.write('<LINK REL="stylesheet" REV="stylesheet" HREF="/common/styles/msie.css">')		
    // document.write("<LINK REL=\"stylesheet\" REV=\"stylesheet\" HREF=\"http://www.visic.com/MSIE.css\">")
}


<!-- FUNCAO - VALIDAR FORMULÁRIO -->
	
function checkFields() {

  missinginfo = "";
    
  if (document.RequestForm.customerName.value == "") {
    alert("Por favor, entre o nome da pessoa para contato !");
    document.RequestForm.customerName.focus();
    document.RequestForm.customerName.select();
    return false;
  }
  	  
  if (document.RequestForm.customerLast.value == "") {
    alert("Por favor, entre o sobrenome  da pessoa para contato!");
    document.RequestForm.customerLast.focus();
    document.RequestForm.customerLast.select();
    return false;
  }
  	  
  if (document.RequestForm.email.value == "") {
    alert("Por favor, entre o email para contato!");
    document.RequestForm.email.focus();
    document.RequestForm.email.select();
    return false;
  }
    
  if (document.RequestForm.estado.value == "") {
    alert("Por favor, entre o seu estado !");
    document.RequestForm.estado.focus();
    document.RequestForm.estado.select();
    return false;
  }
  	  
  if (document.RequestForm.phone.value == "") {
    alert("Por favor entre o código de area do telefone para contato !");
    document.RequestForm.phone.focus();
    document.RequestForm.phone.select();
    return false;
  }
  
  if (document.RequestForm.phone2.value == "") {
    alert("Por favor entre o telefone da pessoa para contato !");
    document.RequestForm.phone2.focus();
    document.RequestForm.phone2.select();
    return false;
  }
    
  if (document.RequestForm.webaddress.value == "") {
    alert("Por favor entre a url (endereço) do seu site !");
    document.RequestForm.webaddress.focus();
    document.RequestForm.webaddress.select();
    return false;
  }
  
  if (document.RequestForm.question.value == "") {
    alert("Por favor descreva brevemenente o seu website !");
    document.RequestForm.question.focus();
    document.RequestForm.question.select();
    return false;
  }
  	  
  if (document.RequestForm.referer.value == "") {
    alert("Por favor escreva aonde você encontrou a webalcance !");
    document.RequestForm.referer.focus();
    document.RequestForm.referer.select();
    return false;
  }
   
}


<!-- FUNCAO - SEILA -->

function FormataCampo(object,evento,mascara) {
  var tecla = evento.keyCode;
  var valor, temp, temp2;
  valor = object.value;

  temp = "";
  temp2 = "";
  if (tecla==8){
	valor=valor.substring(0,valor.length);
  }
  
  for (i=0;i<valor.length;i++){
	if (valor.substring(i,i+1) != "." && valor.substring(i,i+1) != "," && valor.substring(i,i+1) != "-" && valor.substring(i,i+1) != "/") {
	  temp = temp + valor.substring(i,i+1);
	}
  }
  
  temp2 = "";
  j = 0;
  for (i=0; i<temp.length;i++) {
    if (mascara.substring(j,j+1)=="#")	{
  	  temp2 = temp2 + temp.substring(i,i+1);
	  j = j + 1;
	}
	else {
	  temp2 = temp2 + mascara.substring(j,j+1) + temp.substring(i,i+1);
	  j = j + 2;
	}
  }
  object.value = temp2;
}


<!-- FUNCAO - VALIDA CPF -->

function ValidaCPF(CPF){
  soma=0;
  Resto=0;
  I=0;

  if (CPF == "") return (true);	
  if (CPF.length!=11)	return (false);
  if (CPF=="11111111111" || CPF=="22222222222" || CPF=="33333333333" || CPF=="44444444444" || CPF=="55555555555" || CPF=="66666666666" || CPF=="77777777777" || CPF=="88888888888" || CPF=="99999999999" || CPF=="00000000000") return false;
		
  for (I=0;I<=8;I++) soma = soma +  parseInt(CPF.substring(I,I+1)) * (10 - I);
  Resultado = (soma - (soma%11))/11
  Resto = 11 - (soma - Resultado * 11);

  if (Resto == 10 || Resto == 11) Resto = 0;
  if (Resto != parseInt(CPF.substring(9,10))) return (false);

  soma = 0;
  for (I=0; I<=9;I++) soma = soma + parseInt(CPF.substring(I,I+1)) * (11-I);

  Resultado = (soma - (soma%11))/11
  Resto = 11 - (soma - Resultado * 11);

  if (Resto == 10 || Resto ==11)	Resto = 0;
  if (Resto != parseInt(CPF.substring(10,11)))	return (false);
  return (true);
}

<!--
// Rotina Carregando Site - Versão 1.0
/*
Dim Bar, Line, SP
Bar = 0
Line = "|"
SP = 100

Function Window_onLoad()
  Bar = 95 
  SP = 10
End Function

Function Count()
If Bar < 100 Then
  Bar = Bar + 1
  Window.Status = "Carregando : " & Bar & "%" & " " & String(Bar, Line)
  setTimeout "Count()", SP
Else
  Window.Status = "Widesoft Sistemas"
  Document.Body.Style.Display = ""
End If
End Function

//Call Count()
*/
-->
