
function abrirSise(){
	
	window.open('http://sise.summerday.com.br/sise_segLogin.aspx','','directories=no,height=10,width=10,menubar=no,resizable=yes,status=yes,titlebar=no,scrollbars=yes,toolbar=no')	
	
//	window.open('http://localhost:2968/Polaris.SISE.WebClient2/sise_segLogin.aspx','','directories=no,height=500,width=500,menubar=no,resizable=yes,status=yes,titlebar=yes,scrollbars=yes,toolbar=no')	
	
	
}

function CheckEmail(email)
{
   var achou_ponto=false;
   var achou_arroba=false;
   var nao_achou_espaco=false;

   for (var i=0; i < email.length; i++)
   {
      if (email.charAt(i)=="@")
      {
         if (email.charAt(i+1)==".") achou_arroba=false;
         else achou_arroba=true;
      }
      else if (email.charAt(i)==".") achou_ponto=true;
      else if (email.charAt(i)!=" ") nao_achou_espaco=true;
   }
   if(email.charAt(email.length-1)==".") achou_ponto=false;
   if (achou_ponto && achou_arroba && nao_achou_espaco) return true;
   else
   {
      return false;
   }
}

function FormataTel(tammax,pos,teclapres){
	var tecla = teclapres.keyCode;
	var fvr = '';
	// ao invés de recuperar valor do campo utilizadno o form, vou
	// pegar pelo evento<b></b>
	vr = event.srcElement.value;
	for(i=0;i<vr.length;i++){
		ch=vr.charAt(i);
		if((ch=="1")||(ch=="2")||(ch=="3")||(ch=="4")||(ch=="5")||(ch=="6")||(ch=="7")||(ch=="8")||(ch=="9")||(ch=="0")){
			fvr=fvr+ch;
		}
		}
		vr=fvr;
	tam = vr.length ;
	if (tam < tammax && tecla != 8){ tam = vr.length + 1 ; }

	if (tecla == 8 ){ tam = tam - 1 ; }

	if ( tecla == 8 || tecla == 88 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ){
		if ( tam <= 2 ){
			event.srcElement.value = "("+vr
		}
		if ( tam > pos+2 && tam <= tammax ){
			event.srcElement.value = vr.substr( 0, tam - pos ) + '-' + vr.substr( tam - pos, tam );
			txt=event.srcElement.value
			event.srcElement.value = "("+txt.substr(0,2)+")"+txt.substr(2,tam)

		}
	}
}


function FormataTel2(tammax,pos,teclapres){
	var fvr = '';
	vr = event.srcElement.value;
	for(i=0;i<vr.length;i++){
		ch=vr.charAt(i);
		if((ch=="1")||(ch=="2")||(ch=="3")||(ch=="4")||(ch=="5")||(ch=="6")||(ch=="7")||(ch=="8")||(ch=="9")||(ch=="0")){
			fvr=fvr+ch;
		}
		}
		vr=fvr;

	tam = vr.length ;
		if ((tam>0)&&(tam<=2)){
			event.srcElement.value = "("+vr
		}
		if ( tam > pos+2 && tam <= tammax ){
			event.srcElement.value = vr.substr( 0, tam - pos ) + '-' + vr.substr( tam - pos, tam );
			txt=event.srcElement.value
			event.srcElement.value = "("+txt.substr(0,2)+")"+txt.substr(2,tam)

		}
}

function verificaFormFaleConosco(){

	with(document.form1){
			// Verifica se o nome foi informado
			if (nome.value == "") {
				alert('O Campo NOME é de preenchimento obrigatório.');
				nome.focus();
				return false;
			}
			// Fim da verificação do nome

			// Verifica se o e-mail foi informado
			if (email.value == "") {
				alert('O Campo E-MAIL é de preenchimento obrigatório.');
				email.focus();
				return false;
			}else{
				//Verifica se o e-mail informado é válido.
				if (!(CheckEmail(email.value))){
					alert('E-MAIL inválido!');
					email.focus();
					return false;
				}
			}
			// Fim da verificação do e-mail

			// Verifica se o telefone foi informado
			if (tel.value == "") {
					alert('O Campo TELEFONE é de preenchimento obrigatório.');
						tel.focus();
						return false;
			}else{
				telAux = tel.value;
				telAux = telAux.replace("(","");
				telAux = telAux.replace(")","");
				telAux = telAux.replace("-","");
				if (isNaN(telAux)){
					alert('TELEFONE inválido!');
					tel.focus();
					return false;
				}else{
					if (telAux.length < 9 ){
						alert('TELEFONE inválido!');
						tel.focus();
						return false;
					}
				}

			}
			// Fim da verificação do telefone

			// Verifica se a mensagem foi informada
			if (mensagem.value == "") {
				alert('O Campo MENSAGEM é de preenchimento obrigatório.');
				mensagem.focus();
				return false;
			}
			// Fim da verificação da mensagem

	}

}

function verificaFormCurriculos(){

	with(document.form1){
			// Verifica se o nome foi informado
			if (nome.value == "") {
				alert('O Campo NOME é de preenchimento obrigatório.');
				nome.focus();
				return false;
			}
			// Fim da verificação do nome

			// Verifica se o e-mail foi informado
			if (email.value == "") {
				alert('O Campo E-MAIL é de preenchimento obrigatório.');
				email.focus();
				return false;
			}else{
				//Verifica se o e-mail informado é válido.
				if (!(CheckEmail(email.value))){
					alert('E-MAIL inválido!');
					email.focus();
					return false;
				}
			}
			// Fim da verificação do e-mail

			// Verifica se o telefone foi informado
			if (tel.value == "") {
					alert('O Campo TELEFONE é de preenchimento obrigatório.');
						tel.focus();
						return false;
			}else{
				telAux = tel.value;
				telAux = telAux.replace("(","");
				telAux = telAux.replace(")","");
				telAux = telAux.replace("-","");
				if (isNaN(telAux)){
					alert('TELEFONE inválido!');
					tel.focus();
					return false;
				}else{
					if (telAux.length < 9 ){
						alert('TELEFONE inválido!');
						tel.focus();
						return false;
					}
				}

			}
			// Fim da verificação do telefone
			
			// Verifica se o nome foi informado
			if (myFile.value == "") {
				alert('Selecione o arquivo que contém o currículo.');
				nome.focus();
				return false;
			}
			// Fim da verificação do nome

	}

}

