// Deshabilitar boton derecho del mouse:
var mensaje="Copyright MBA & Arquitectos Asociados"; 
/*function click(e) {
	if (document.all) {
		if (event.button == 2) {
			alert(mensaje);
			return false;
		}
	}
	if (document.layers) {
		if (e.which == 3) {
			alert(message);
			return false;
		}
	}
}
if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;*/
document.oncontextmenu = function(){
	alert(mensaje);
	return false;
}
////////////////////////////////////////////////

/// Funciones de Equipo //////
function despliega_equipo() {
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('capa'+i)) {
			document.getElementById('capa'+i).style.display='none';
		}
	}
	document.getElementById('capa1').style.display='block';
	document.getElementById('capa1a').style.color='#df5823';
}

function tab_equipo(pestana) {
	var c = document.getElementById(pestana);
	var d = document.getElementById(pestana+'a');
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('capa'+i)) {
			document.getElementById('capa'+i).style.display='none';
		}
	}
	c.style.display='block';
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('capa'+i+'a')) {
			document.getElementById('capa'+i+'a').style.color='#c8c8c8';
		}
	}
	d.style.color='#df5823';
}
///////////////////////////////


function despliega() {
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('capa'+i)) {
			document.getElementById('capa'+i).style.display='none';
		}
	}
	document.getElementById('capa1').style.display='block';
	document.getElementById('capa1a').style.backgroundImage='url(imagenes/flecha_up.gif)';
	document.getElementById('cont1').style.display='block';
	document.getElementById('cont2').style.display='none';
}



function init_tabs() {
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('cont'+i)) {
			document.getElementById('cont'+i).style.display='none';
		}
	}
	document.getElementById('cont1').style.display='block';
	/*document.getElementById('tab1').style.borderBottom='1px solid #F4F4F4';*/
}



function tab(id) {
	var c = document.getElementById('cont' + id);
	var t = document.getElementById('tab' + id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('cont'+i)) {
			document.getElementById('cont'+i).style.display='none';
			document.getElementById('tab'+i).style.backgroundColor='#333333';
			
		}
	}
	c.style.display='block';
	t.style.backgroundColor='#cb6b25';
}



function cambia(id) {
	var d = document.getElementById(id);
	var c = document.getElementById(id+"a");
	if (d.style.display=='block') {
		/*document.activeElement.style.background='#666666 url(imagenes/flecha_down.gif) no-repeat 99% 50%';
		No utilizamos activeElement porque Firefox no lo soporta. Así como tampoco parentElement y otros más.
		Por eso, para hacer referencia al li que contiene a "d", le he puesto directamente un id.
		*/
		c.style.backgroundImage='url(imagenes/flecha_down.gif)';
		d.style.display='none';
	}else{
		/*document.activeElement.style.background='#666666 url(imagenes/flecha_up.gif) no-repeat 99% 50%';*/
		c.style.backgroundImage='url(imagenes/flecha_up.gif)';
		d.style.display='block';
	}

	/*if (document.getElementById(id).style.display=='block') {
		document.getElementById(id).style.display='none';
	}else{
		document.getElementById(id).style.display='block';
	}*/
}



function inscripcion() {
	var e = document.getElementById('cont1');
	var f = document.getElementById('cont2');
	if (e.style.display=='block') {
		e.style.display='none';
		f.style.display='block';
	}else{
		e.style.display='block';
		f.style.display='none';
	}
}


function tab_proyecto(pestana) {
	document.getElementById('miniaturas').style.display='none';
	document.getElementById('datos_tecnicos').style.display='none';
	var c = document.getElementById(pestana);
	c.style.display='block';
}


function cambiaImagen(nuevaImagen) {
	imagenid=document.getElementById("imagenCambiante");
	imagenid.src=nuevaImagen;
}



function validar_formulario_inscripcion() {
  if (form_inscripcion.nombre.value == "" || form_inscripcion.nombre.value==null) {
    alert("Por favor, indíquenos el nombre o razón social.");
	form_inscripcion.nombre.focus();
 	return (false);
  }
  else if (form_inscripcion.cargo.value == "" || form_inscripcion.cargo.value==null)
  {
    alert("Por favor, indíquenos su cargo en la empresa.");
	form_inscripcion.cargo.focus();
 	return (false);
  }
   else if (form_inscripcion.empresa.value == "" || form_inscripcion.empresa.value==null)
  {
    alert("Por favor, indíquenos la empresa a la que pertenece.");
	form_inscripcion.empresa.focus();
 	return (false);
  }
  else if (form_inscripcion.cifnif.value == "" || form_inscripcion.cifnif.value==null)
  {
    alert("Por favor, indíquenos su CIF/NIF.");
	form_inscripcion.cifnif.focus();
 	return (false);
  }
  else if (form_inscripcion.direccion.value == "" || form_inscripcion.direccion.value==null)
  {
    alert("Por favor, indíquenos la dirección.");
	form_inscripcion.direccion.focus();
 	return (false);
  }
  else if (form_inscripcion.localidad.value == "" || form_inscripcion.localidad.value==null)
  {
    alert("Por favor, indíquenos la localidad.");
	form_inscripcion.localidad.focus();
 	return (false);
  }
  else if (form_inscripcion.cp.value == "" || form_inscripcion.cp.value==null)
  {
    alert("Por favor, indíquenos el código postal.");
	form_inscripcion.cp.focus();
 	return (false);
  }
  else if (form_inscripcion.telefono.value == "" || form_inscripcion.telefono.value==null)
  {
    alert("Por favor, indíquenos su teléfono.");
	form_inscripcion.telefono.focus();
 	return (false);
  }
  else if (form_inscripcion.email.value == "" || form_inscripcion.email.value==null)
  {
    alert("Por favor, indíquenos su email.");
	form_inscripcion.email.focus();
 	return (false);
  }
  else
  {
	form_inscripcion.submit();  
  }
  
  return (true);
}


function validar_formulario_contacto() {
  if (form_contacto.nombre.value == "" || form_contacto.nombre.value==null) {
    alert("Por favor, indíquenos su nombre o razón social.");
	form_contacto.nombre.focus();
 	return (false);
  }
  else if (form_contacto.email.value == "" || form_contacto.email.value==null)
  {
    alert("Por favor, indíquenos su email.");
	form_contacto.email.focus();
 	return (false);
  }
  else if (form_contacto.comentario.value == "" || form_contacto.comentario.value==null)
  {
    alert("Por favor, indíquenos su comentario.");
	form_contacto.comentario.focus();
 	return (false);
  }
  else
  {
	form_contacto.submit();  
  }
  
  return (true);
}
