//document.location = "index.asp";
// funções para facilitar a vida
function $obj(obj){ return document.getElementById(obj.id); }
function $id(id){ return document.getElementById(id); }
function $tag(id){ return document.getElementsByTagName(id); }

// centraliza o pop-up na tela
function meds(w,h){
	wi = w;
	he = h;
	cim = (screen.height-he)/2;
	dir = (screen.width-wi)/2;
}

// abrir pop-up
function maps(){
	meds(760,505);//chama função meds com parâmetros
	window.open("mapa.htm","mapa","width="+wi+", height="+he+", top="+cim+", left="+dir)
}


/*  envio de emails  */
function form_envio(){
nom = document.getElementById("nome").value;
	if (nom == ""){
		alert("por favor digite o seu nome")
		return false;
	}

cemail = document.getElementById("email").value
	if (cemail == "" ){
		alert("por favor digite o seu email")
		return false;
	}

strMail = cemail;
var re = new RegExp;
re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var arr = re.exec(strMail);
	if (arr == null){
		alert("por favor digite o seu email corretamente")	
		return false;
	}

cemail = document.getElementById("mensagem").value
	if (cemail == "" ){
		alert("por favor digite o sua mensagem")
		return false;
	}

return true;
}



// ---------------------------------------------------------------------------------------------------------------------------------------------------

function somemte_algumas_teclas(e){
if (document.all) // Internet Explorer
 var tecla = event.keyCode;
 else if(document.layers) // Nestcape
 var tecla = e.which;
//alert(tecla)
  if ((tecla > 47 && tecla < 58) || (tecla == 13) || (tecla == 32) || (tecla == 40) || (tecla == 41)|| (tecla == 45) ) // numeros de 0 a 9
   return true;
  else
  {

   if (tecla != 8) // backspace
    event.keyCode = 0;

	//return false;
   else
    return true;
  }
}

 
// --------------------------------------------------------------------------------------------------------------------------------------------------- 


// ---------------------------------------------------------------------------------------------------------------------------------------------------


var abra;
abra = "funciona";
function cv(profissional){

	if(document.getElementById("reload")){//página indivual não tem esse elemento, por isso a função abaixo não deve ser executada.  No evento onclick há o window.location com a âncora referente ao profissional

	document.getElementById("reload").innerHTML = "n";
	/* if(document.getElementById('cv-' + profissional)){  */

		if(document.getElementById('cv-' + profissional).innerHTML != ""){
			//alert("tira texto")
		}
		else
		{
			box.location = "pro-" + profissional + "-cv.asp";
		}

	w3Opacity.toggle('cv-' + profissional,1000);
	//alert(profissional);
	//pega_cv = $id("cv-claudiozalaf");


	}



}

// ---------------------------------------------------------------------------------------------------------------------------------------------------	
// escrever iframe via js para validar o xhtml
function iframe_box(){
	document.write("<iframe name=\"box\" id=\"box\" height=\"0\" width=\"0\" frameborder=\"0\"></iframe>");
}