function getfocus_contacto(){
	document.frm_contacto.Nombre.focus();
}
function getfocus_curric(){
	document.frm_curriculum.Nombre_Apellidos.focus();	
}
function validaFormContacto(){
	var regexp = /^[0-9a-zA-Z._]+\@[0-9a-zA-Z]+\.[0-9a-zA-Z.]+$/; 
	
	if (document.frm_contacto.Nombre.value== ""){
		alert("Escribe tu NOMBRE, por favor");
		document.frm_contacto.Nombre.focus();
		return 0;
	}
	if (document.frm_contacto.Apellidos.value== ""){
		alert("Escribe tus APELLIDOS, por favor");
		document.frm_contacto.Apellidos.focus();
		return 0;
	}
	if (document.frm_contacto.Telefono.value== ""){
		alert("Escribe un TELÉFONO de contacto, por favor");
		document.frm_contacto.Telefono.focus();
		return 0;
	}else if (isNaN(document.frm_contacto.Telefono.value)) {
		alert("El campo TELÉFONO debe ser numérico");
		document.frm_contacto.Telefono.focus();
		return 0;
	}
	if (document.frm_contacto.Email.value== ""){
		alert("Escribe tu dirección de CORREO, por favor");
		document.frm_contacto.Email.focus();
		return 0;
	}else if (regexp.test(document.frm_contacto.Email.value) == false){
		alert("E-MAIL incorrecto");
		document.frm_contacto.Email.focus();
		return 0;
	}
	if (document.frm_contacto.Consulta.value== ""){
		alert("Escribe tu CONSULTA, por favor");
		document.frm_contacto.Consulta.focus();
		return 0;
	}
	document.frm_contacto.submit();
}
function validaFormCurric(){
	var regexp = /^[0-9a-zA-Z._]+\@[0-9a-zA-Z]+\.[0-9a-zA-Z.]+$/; 
	
	if (document.frm_curriculum.Nombre_Apellidos.value== ""){
		alert("Escribe tu NOMBRE y APELLIDOS, por favor");
		document.frm_curriculum.Nombre_Apellidos.focus();
		return 0;
	}
	if (document.frm_curriculum.Telefono.value== ""){
		alert("Escribe un TELÉFONO de contacto, por favor");
		document.frm_curriculum.Telefono.focus();
		return 0;
	}else if (isNaN(document.frm_curriculum.Telefono.value)) {
		alert("El campo TELÉFONO debe ser numérico");
		document.frm_curriculum.Telefono.focus();
		return 0;
	}
	if (document.frm_curriculum.Email.value== ""){
		alert("Escribe tu dirección de CORREO, por favor");
		document.frm_curriculum.Email.focus();
		return 0;
	}else if (regexp.test(document.frm_curriculum.Email.value) == false){
		alert("E-MAIL incorrecto.");
		document.frm_curriculum.Email.focus();
		return 0;
	}
	if (document.frm_curriculum.Puesto_deseado.value== "seleccione"){
		alert("Selecciona el PUESTO DESEADO.");
		document.frm_curriculum.Puesto_deseado.focus();
		return 0;
	}
	document.frm_curriculum.submit();
}

//Función para cambiar ID
//Efecto de mouseover en el listado de clientes dentro del apartado de diseño
var peticion = false; 
if (window.XMLHttpRequest) {
      peticion = new XMLHttpRequest();
      } else if (window.ActiveXObject) {
            peticion = new ActiveXObject("Microsoft.XMLHTTP");
}


function ObtenerDatos(datos,divID) { 
if(peticion) {
     var obj = document.getElementById(divID); 
     peticion.open("GET", datos); 
     peticion.onreadystatechange = function()  { 
          if (peticion.readyState == 4) { 
               obj.innerHTML = peticion.responseText; 
          } 
     } 
peticion.send(null); 
}
}

function CambiarEstilo(id) {
	var elementosMenu = getElementsByClassName(document, "li", "activo");
	for (k = 0; k< elementosMenu.length; k++) {
	elementosMenu[k].className = "inactivo";
	}
	var identity=document.getElementById(id);
	identity.className="activo";
}

/*
    function getElementsByClassName
    Written by Jonathan Snook, http://www.snook.ca/jonathan
    Add-ons by Robert Nyman, http://www.robertnyman.com
*/

function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements)
}

//Efecto rollOver de los botones de diseño y comunicacion
//no valida el código en el xhtml
/* check to ensure rollovers are supported in browser */

	if (document.images)
	{
	/* preload the images */
	disenooff = new Image();
	disenooff.src = "img/EX_disenooff.gif";
	disenoon = new Image();
	disenoon.src = "img/EX_disenoon.gif";
	
	comunicacionoff = new Image();
	comunicacionoff.src = "img/EX_comunicacionoff.gif";
	comunicacionon = new Image();
	comunicacionon.src = "img/EX_comunicacionon.gif";
	}
	/* function to set image to on state */
	function On(imageName)
	{
	if (document.images)
	{
	document[imageName].src = eval(imageName+"on.src");
	}
	}
	/* function to reset image back to off state */
	function Off(imageName)
	{
	if (document.images)
	{
	document[imageName].src = eval(imageName+"off.src");
	}
	}