// JavaScript Document

/**
 * @author Tobe
 */
 
function selec_equipo(form){
	var indice = form.equipo.selectedIndex;
	
	for(var i = 0; i < 3; i++)
		document.getElementById(i).style.display="none"
		
	document.getElementById(indice).style.display="block"
}

function validar(form) {
	var patron = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	
	if(form.nombre.value.length == 0){
		alert("El campo Nombre es obligatorio.");
		form.nombre.focus();
		return (false);
	} else if(form.empresa.value.length == 0){
		alert("El campo Empresa es obligatorio.");
		form.empresa.focus();
		return (false);
	} else if(form.tel.value.length == 0){
		alert("El campo Telefono es obligatorio.");
		form.tel.focus();
		return false;
	} else if(form.ciudad.value.length == 0){
		alert("El campo Ciudad es obligatorio.");
		form.ciudad.focus();
		return false;
	} else if(form.pais.value.length == 0){
		alert("El campo Pais es obligatorio.");
		form.pais.focus();
		return false;
	} else if(form.equipo.selectedIndex == 0 && form.descripcionE.value.length == 0){
			alert("El campo Descripcion del equipo es obligatorio.");
			form.descripcionE.focus();
			return false;
	} else if(!patron.test(form.mail.value)){
		alert("La cuenta de e-mail no es válida, debes escribirla de forma: nombre@servidor.dominio");
		form.mail.select();
		form.mail.focus();
		return (false);
	} 
	
	return (true);
}

/*
*@Carlo
*/


function form_selector(){

var x=document.getElementById("seleccion");
//alert(x.selectedIndex);

if(x.selectedIndex == 0)
{
	document.getElementById("contactblock").style.display="none"
	document.getElementById("cotizacionblock").style.display="none"
}
else if(x.selectedIndex == 1)
{
	document.getElementById("contactblock").style.display="block"
	document.getElementById("cotizacionblock").style.display="none"
}
else
{
	document.getElementById("contactblock").style.display="none"
	document.getElementById("cotizacionblock").style.display="block"
}
//	document.getElementById(valor).style.display="block"
	
	}
	
	
	
	
	
	