// JavaScript Document

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 centrar ()
{	
	var w = 0;
	var layerw = 0;

	w = document.all?document.body.offsetWidth:window.innerWidth;
//	layerw = window.document.getElementById("main").style.width;
	
	if(w > 900)
	{
		dist_i = (w / 2) - 470;//430.2
		window.document.getElementById('lmain').style.marginLeft = dist_i + "px";//linnerdif
//		window.document.getElementById('lmain').style.width = 80 + "%";
//		window.document.getElementById('linnerdif').style.width = 70 + "%";


		

	}
	else
	{
		window.document.getElementById('lmain').style.marginLeft = 1.20 + "%";
//		window.document.getElementById('lmain').style.width = 50 + "%";
//		window.document.getElementById('linnerdif').style.width = 50 + "%";
	}	
}
window.onresize=function ()
{
	centrar();
}
function verifica(form) 
{
	var email = document.getElementById("temail").value;
	var check;
  if ((!document.getElementById("tnombre").value) || (!email) || (!document.getElementById("tcoment").value))  
  {
	alert("Por favor llene todos los campos");
	return false;
  } 
  else
  {
  	check = verificaEmail(email);
	if(check == 1)
	{
		return true;

	}
	else
	{
		return false;
	}
  }
} 
function verificaEmail(email)
{
	if((email.length <= 3) || (email.indexOf("@") == -1) || (email.indexOf(".") == -1))
	{
		alert("Por favor ingrese un email válido");
		return 2;
	}
	else
	{
		return 1;
	}
}
