function esIE(){
    nNav=navigator.appName;
    if (nNav=='Microsoft Internet Explorer') return true;
    else return false;
}

//Ajuste: Espacio que se debe restar para que no sobrepase la altura de la ventana del navegador 
//(solo para IE).
function FullHeight(NombreTabla, Ajuste){
    var h=0;
    var tabla=document.getElementById(NombreTabla);
    if (!esIE()){
        h=window.innerHeight+'px';
        tabla.style.height=h;
    }else{ 
        h=document.body.parentNode.offsetHeight-Ajuste;
        tabla.height=h;
    } 
}


HMarquee1=function (id, speed, pause, WidthForIE) {
	var container=document.getElementById(id);
	    var _timer;
	    var Width=parseInt(container.scrollWidth);
	    if (esIE()) Width=WidthForIE;
	    var scrollSpeed=(parseInt(speed)>0)?speed:30;
    	var Pause=(parseInt(pause)>0)?pause:scrollSpeed;

    Right1=function() { 
	    if(container.scrollLeft>Width) { window.setTimeout(Right, Pause);
		    container.scrollLeft=Width;
	    } else container.scrollLeft+=1;}
	Left1=function() { 
	    if(container.scrollLeft<=0) {
		    //Left();
		    window.setTimeout(Left, Pause);
		    container.scrollLeft=1;
	    } else container.scrollLeft-=1;}
    goLeft1=function() {
	    _timer=window.setInterval(Left1, scrollSpeed); }
	goRight1=function() {
	    _timer=window.setInterval(Right1, scrollSpeed);}
    stop1=function() { 
	    if (_timer) window.clearInterval(_timer);}
}

HMarquee=function (id, speed, pause, WidthForIE) {
	var container=document.getElementById(id);
	    var _timer;
	    var Width=parseInt(container.scrollWidth);
	    if (esIE()) Width=WidthForIE;
	    var scrollSpeed=(parseInt(speed)>0)?speed:30;
    	var Pause=(parseInt(pause)>0)?pause:scrollSpeed;

    Right=function() { 
	    if(container.scrollLeft>Width) { window.setTimeout(Right, Pause);
		    container.scrollLeft=Width;
	    } else container.scrollLeft+=1;}
	Left=function() { 
	    if(container.scrollLeft<=0) {
		    //Left();
		    window.setTimeout(Left, Pause);
		    container.scrollLeft=1;
	    } else container.scrollLeft-=1;}
    goLeft=function() {
	    _timer=window.setInterval(Left, scrollSpeed); }
	goRight=function() {
	    _timer=window.setInterval(Right, scrollSpeed);}
    stop=function() { 
	    if (_timer) window.clearInterval(_timer);}
}

      VMarquee=function (id, speed, pause, HeightForIE) {
	var container=document.getElementById(id);
	//if (container.offsetWidth<parseInt(container.scrollWidth)){
	    var _timer;
	    var Height=parseInt(container.scrollHeight);
	    if (esIE()) Height=HeightForIE;
	    //container.innerHTML=container.innerHTML+container.innerHTML; 
	    var scrollSpeed=(parseInt(speed)>0)?speed:30;
    	var Pause=(parseInt(pause)>0)?pause:scrollSpeed;
	//}    	
    Down=function() { 
	    if(container.scrollTop>Height) {
		    stop();
		    window.setTimeout(Down, Pause);
		    container.scrollTop=0;
	    } else container.scrollTop+=1;
    }
	Up=function() { 
	    if(container.scrollTop<=0) {
		    stop();
		    window.setTimeout(Up, Pause);
		    container.scrollTop=1;
	    } else container.scrollTop-=1;
    }
    goUp=function() {
	    _timer=window.setInterval(Up, scrollSpeed); 
    }
	goDown=function() {
	    _timer=window.setInterval(Down, scrollSpeed);
    }
    vstop=function() { 
	    if (_timer) window.clearInterval(_timer);
    }
}


      VMarquee1=function (id, speed, pause, HeightForIE) { 
	var container=document.getElementById(id);
	//if (container.offsetWidth<parseInt(container.scrollWidth)){
	    var _timer;
	    var Height=parseInt(container.scrollHeight);
	    if (esIE()) Height=HeightForIE;
	    //container.innerHTML=container.innerHTML+container.innerHTML; 
	    var scrollSpeed=(parseInt(speed)>0)?speed:30;
    	var Pause=(parseInt(pause)>0)?pause:scrollSpeed;
	//}    	
    Down1=function() { 
	    if(container.scrollTop>Height) {
		   vstop1();
		    window.setTimeout(Down1, Pause);
		    container.scrollTop=0;
	    } else container.scrollTop+=1;
    }
	Up1=function() { 
	    if(container.scrollTop<=0) {
		    vstop1();
		    window.setTimeout(Up1, Pause);
		    container.scrollTop=1;
	    } else container.scrollTop-=1;
    }
    goUp1=function() {
	    _timer=window.setInterval(Up1, scrollSpeed); 
    }
	goDown1=function() {
	    _timer=window.setInterval(Down1, scrollSpeed);
    }
    vstop1=function() { 
	    if (_timer) window.clearInterval(_timer);
    }
}

//
function ObtenerExt(Arch){
  arrArch=Arch.split(".");
  Ext=arrArch[arrArch.length - 1];
  return Ext=Ext.toUpperCase();
}

function esArchBanner(oSrc, args){
  args.IsValid=false;
  Ext=ObtenerExt(args.Value);
  if (Ext=="SWF"||Ext=="GIF"||Ext=="JPG"||Ext=="PNG") args.IsValid=true;
  return args.IsValid;  
}

function esArchImagen(oSrc, args){
  args.IsValid=false;
  Ext=ObtenerExt(args.Value);
  if (Ext=="JPG"||Ext=="GIF"||Ext=="PNG") args.IsValid=true;
  return args.IsValid;
}

function esArchDeProyecto(oSrc, args){
  args.IsValid=false;
  Ext=ObtenerExt(args.Value);
  if (Ext=="ZIP"||Ext=="PDF"||Ext=="DOC") args.IsValid=true;
  return args.IsValid;
}

function esArchVideo(oSrc, args){
  args.IsValid=false;
  Ext=ObtenerExt(args.Value);
  if (Ext=="MPG"||Ext=="AVI"||Ext=="WMV") args.IsValid=true;
  return args.IsValid;
}

function esIE(){
    nNav=navigator.appName;
    if (nNav=='Microsoft Internet Explorer') return true;
    else return false;
}
//-----------------------------
function ConfirmarEliminar(){ 
	return (confirm('Se van a eliminar los elementos seleccionados. ¿Continuar?\n(Se eliminará toda la información dependiente. No se podrán restaurar datos eliminados)'));
}

function CerrarVentana(){
    if (!esIE())
        alert('Si no se cierra automáticamente esta ventana utilice el botón Cerrar');
    window.close();
}

