function validarImagen(imagen) {
 
  var ext = imagen;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase(); 
  if(ext != 'jpg') {
    return false; }
  else
    return true; }

function cambiarTitulo(opcion,op){

if (op=='buscador'){
    document.title='Página de Buscador';	
  }else
  if (op=='mapa'){
    document.title='Página de Mapa de la Web';	
  }else
  if (op=='correo'){
	   document.title='Página de Envío de E-mail';	
   }else
  document.title='Página de '+opcion;	
}

function comprobar(texto){
var copia="";
 for(conta = 0, tag = 0; conta < texto.value.length; conta++)
 {
   switch(texto.value.charAt(conta))
   {
    case "<": tag++;break;
    case ">": tag--;break;
	default:
	   if(tag == 0) copia = copia+texto.value.charAt(conta);
   }
 }
texto.value=copia;
}

function comprobarTodo(datosform,num){
for(i=0;i<num;i++){
 comprobar(datosform.elements[i]);
}
}

function abrir(tipo,estilo){
  window.open('modulos/masNotifs.php?tipo='+tipo+'&estilo='+estilo, '_blank', 'width=400,height=660,resizable=no,scrollbars=yes,left=20,top=20');	
}

function abrirNot(op,sec){
  window.opener.location="../modulo.php?op="+op+"&seccion="+sec+"";	
  window.close();
}

function abrirLink(enlace){
 window.open(enlace,'_blank');
 window.close();
}

function esinicio(element){
	var IE = navigator.appName.match(/(Microsoft Internet Explorer)/gi),
    NS = navigator.appName.match(/(Netscape)/gi);
	
	if (IE){
	  element.style.behavior='url(#default#homepage)';
	  element.setHomePage('http://www.fexvela.com');
	}
	else if(NS){
		alert("Para poner esta página como inicio en tu navegador:\nMenu Herramientas -> Opciones -> General -> Página de inicio");
	}
}

function agregarAFavoritos(enlace,titulo){
	var IE = navigator.appName.match(/(Microsoft Internet Explorer)/gi),
    NS = navigator.appName.match(/(Netscape)/gi),
    BK = document.getElementById('favoritos');

    if(IE && document.uniqueID){
		window.external.AddFavorite(enlace,titulo);
	}

    else if(NS){
		  alert('Presiona Ctrl+D para añadir esta página a tus favoritos');
    }

}