function verify_consulta() {
		
	var alerta = ""
	if (consulta.DESTINATARIO.value == "") {alerta += "- Seleccione destinatario.\n"}
	if (consulta.NOMBRE.value == "") {alerta += "- Escriba su Nombre.\n"}
	if (consulta.APELLIDOS.value == "") {alerta += "- Escriba sus Apellidos.\n"}
	if (consulta.EMPRESA.value == "") {alerta += "- Escriba la Empresa a la que pertenece.\n"}
	if (consulta.DIRECCION.value == "") {alerta += "- Escriba su Dirección Postal.\n"}
	if (consulta.LOCALIDAD.value == "") {alerta += "- Escriba su Localidad.\n"}
	if (consulta.PROVINCIA.value == "") {alerta += "- Escriba la Provincia a la que pertenece su Localidad.\n"}
	if (consulta.PAIS.value == "") {alerta += "- Dirección: Introduzca texto.\n"}
	if (consulta.EMAIL.value.indexOf ('@',0) == -1 || consulta.EMAIL.value.indexOf ('.',0) == -1) {alerta += "- Escriba correctamente su dirección de e-mail.\n"}
	if (consulta.TELEFONO.value == "") {alerta += "- Escriba su telefono de Contacto.\n"}
	if (consulta.CONSULTAA.value == "") {alerta += "- Consulta: Introduzca Texto.\n"}

	if (alerta =="") {
		consulta.submit()
		//consulta.BOTON.disabled=true;
		} else {
		alerta = "Error:\n\n" + alerta
		alert (alerta + "")
		return false;
	}
}


function alertas(numalerta) {

var matriz = new Array();

	 matriz[0] = "- Usuario y/o Clave no válida.\nAsegúrese de haberlo escrito correctamente y reinténtelo de nuevo.";
	 matriz[1] = "- Intentos excedidos.\nCierre las ventanas de su explorador referidas a DAYFOR y vuelva a intentarlo.";
	 matriz[2] = "- Le hemos enviado un correo electrónico recordándole su Clave."
	 matriz[3] = "- No existe en nuestra base de datos ningún usuario con la dirección indicada"
	 matriz[7] = "- No se encontraron resultados."
	matriz[10] = "- Ya existe un usuario a la espera de confirmación con esa dirección de correo electrónico."
	matriz[11] = "- Ya existe un usuario activo con esa dirección de correo electrónico.\nPuede recuperar su clave de acceso en la página principal de nuestra web."
	matriz[12] = "- El proceso de Alta se ha realizado correctamente.\nNos pondremos en contacto contigo en la dirección de correo electrónico que nos has indicado.\nGracias por tu interés."

alert(matriz[numalerta]);

}

function see(myimg)
{ventana=window.open("see.asp?img="+myimg,"window","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=10,height=10,left=100,top=25");
 ventana.moveTo(((screen.width/2)-(250)),((screen.height/2)-(150)));
 ventana.focus();
}

function see2(myimg)
{ventana=window.open("see3.asp?img="+myimg,"window","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=50,height=50,left=0,top=25");
ventana.focus();
}

function pop(ID) {
ventana=window.open("news.asp?id="+ID+"","dayfor","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width=375,height=300,left=200,top=100");
ventana.moveTo(((screen.width/2)-(200)),((screen.height/2)-(100)));
ventana.focus();
}


function SeePass() {
ventana=window.open("pass.asp","dayfor","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=350,height=200,left=200,top=100");
ventana.moveTo(((screen.width/2)-(200)),((screen.height/2)-(100)));
ventana.focus();
}

function download(file) {
	ventana = window.open("mydownload.asp?file="+file,"window","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=30,height=30,left=10,top=10");
}


function verify_usuario() {
		
	var alerta = ""

	if (usuario.EMPRESA.value == "") {alerta += "- Empresa: Introduzca Texto.\n"}
	if (usuario.sector.value == "") {alerta += "- Sector: Seleccione el sector al que pertenece.\n"}
	if (usuario.RESPONSABLE.value == "") {alerta += "- Responsable: Introduzca Texto.\n"}
	if (usuario.TELEFONO.value == "") {alerta += "- Teléfono: Introduzca Número.\n"}
	if (usuario.EMAIL.value.indexOf ('@',0) == -1 || usuario.EMAIL.value.indexOf ('.',0) == -1) {alerta += "- E-mail: Dirección incorrecta.\n"}
	if (usuario.CLAVE.value == "") {alerta += "- Clave: Introduzca Texto.\n"}
	if (usuario.CLAVE.value.length > 12 || usuario.CLAVE.value.length < 5) {alerta += "- Su Clave debe contener entre 5 y 12 caracteres.\n"}

	if (alerta =="") {
		usuario.submit()
		usuario.Submit.disabled=true;
	} else {
		alerta = "Error:\n\n" + alerta
		alert (alerta + "")
		return false;
	}
}



function verify_login() {
		
		var alerta = ""
		
		if (login.EMAIL.value.indexOf ('@',0) == -1 || login.EMAIL.value.indexOf ('.',0) == -1) {alerta += "- E-mail: Dirección incorrecta.\n"}
		if (login.CLAVE.value == "") {alerta += "- Clave: Introduzca texto.\n"}
		
		if (alerta =="")
			{
			login.submit()
			}
		else
			{
			alerta = "Error:\n\n" + alerta
			alert (alerta + "")
			return false;
			}
}




    function fSiguiente ()
    {
	 if (wNomFotos.length-1>wFotoActual)
	  {
	   wFotoActual++;
	   fCambiaFoto(wFotoActual);
	  }
	 }
    function fAnterior ()
    {
	 if (wFotoActual>0)
	{
	 wFotoActual--;
	 fCambiaFoto(wFotoActual);
	 }
	}
    function fCambiaFoto(pNum)
	{
	 document.foto.src = wNomFotos[pNum];
	}


//CARGADOR DE IFRAMES
function show(iframe) {

if (iframe != "")
{
document.frames.contenido.location=iframe
}
else
{
alert('Información actualmente no disponible.')
}
}

function popup(URL,ancho,alto,scroll) 
{ 
if (scroll==null)
{
ancho = 400;
alto = 350;
scroll = 0;
}

iz=(screen.width-ancho) /2; 
ar=(screen.height-alto) /2; 
propiedades='toolbar=no,directories=no,menubar=no,scrollbars=' + scroll + ',status=no,width=' + ancho + ',height='+alto; 
propiedades +=',left='+iz+',top='+ar; 
window.open(URL,'ventana',propiedades); 
} 

//ABRIR VENTANA
function Popup(URL,ancho,alto,scroll) {
if (ancho==null)
{
	ancho=300;
	alto=300;
	scroll=0;
}
ventana=window.open(URL,"Win","toolbars=0,scrollbars="+scroll+",location=0,statusbars=0,menubars=0,resizable=0,width="+ancho+",height="+alto+",left="+Myleft+",top="+Mytop+"");
ventana.focus();
}

//ENLACE QUE CIERRA VENTANA
function get(url) {
  opener.location = url;
  self.close()
}

//ADAPTA VENTANA A FOTO
function resizePage(){
  x=document.images['foto'].width;
  y=document.images['foto'].height;
  x=x+40;
  y=y+90; 
  window.resizeTo(x,y);
}



//CAMBIA COLOR A CELDAS
function mOvr(src,clrOver) {
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.bgColor = clrOver;
}
}
function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.bgColor = clrIn;
}
}
function mClk(src) {
if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();
}
}


ns=document.layers
ie=document.all
function esconde() {
	if (ie) precarga.style.visibility="hidden";
	if(ns) document.precarga.visibility="hide";
}


//RESIZA PAGINA

function resizePage(){
  x=document.images['foto'].width;
  y=document.images['foto'].height;
  x=x+25; // el margen que le doy de la foto al borde de la ventana
  y= y+ 75; // lo mismo que arriba
  window.resizeTo(x,y);
esconde()
  var TieneFoco = true

function CambiarTieneFoco() {
	if (TieneFoco == true) {
		TieneFoco = false
		document.formModo.modo.value = "Normal"
	} else if (TieneFoco == false) {
		TieneFoco = true
		document.formModo.modo.value = "Siempre visible"
		DaFoco()
	}
}

function DaFoco() {
	if (TieneFoco == true)
		setTimeout("self.focus()",100)
}
DaFoco()
  
}


//MENU DESPLEGABLE

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}