//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function checkAll(chkName){
  for (var i=0;i<document.formulario.elements.length;i++){
    var e=document.formulario.elements[i];
    if (e.name == chkName){
      e.checked = (!e.checked)
    }
  }
}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function chkDel(){
  for (var i=0; i<(document.formulario.length); i++) {
    e = document.formulario.elements[i];
    if (e.checked) {
      msg= "żEsta seguro que desea continuar?";
      if (confirm (msg)){
        document.formulario.toDo.value = "borrar";
        document.formulario.submit();//
        return true;
      }
      else{
        return false;
      }
    }
  }
  alert('Seleccione al menos un elemento de la lista.');
  return false;
}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function chkPrm(){
  for (var i=0; i<(document.formulario.length); i++) {
    e = document.formulario.elements[i];
    if (e.checked) {
      document.formulario.toDo.value = "asignar";
      document.formulario.submit();//
      return true;
    }
  }
  alert('Seleccione al menos un elemento de la lista.');
  return false;
}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function chkSend(value){
  for (var i=0; i<(document.formulario.length); i++) {
    e = document.formulario.elements[i];
    if (e.checked) {
      document.formulario.toDo.value = value;
      document.formulario.submit();//
      return true;
    }
  }
  alert('Seleccione al menos un elemento de la lista.');
  return false;
}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function chkOne(){
  for (var i=0; i<(document.formulario.length); i++) {
    e = document.formulario.elements[i];
    if (e.checked) {
        return true;
    }
  }
  alert('Seleccione al menos un elemento de la lista.');
  return false;
}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function btnOvr(btn){btn.src = "../imagesadmin/trie_btn_" + btn.name + "_on.gif"}
function btnOut(btn){btn.src = "../imagesadmin/trie_btn_" + btn.name + "_off.gif"}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function supOvr(btn){btn.src = "../imagesadmin/trie_menusup_" + btn.name + "_on.gif"}
function supOut(btn){btn.src = "../imagesadmin/trie_menusup_" + btn.name + "_off.gif"}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function latOvr(btn){btn.src = "../imagesadmin/trie_menulat_" + btn.name + "_on.gif"}
function latOut(btn){btn.src = "../imagesadmin/trie_menulat_" + btn.name + "_off.gif"}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function logOvr(btn){btn.src = "../imagesadmin/gmie_login_" + btn.name + "_on.gif"}
function logOut(btn){btn.src = "../imagesadmin/gmie_login_" + btn.name + "_off.gif"}
//+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
function winOpen(template,url,type){
  if (!isNaN(url)){//es un contenido
    if (type==1){
      type=3;
    }
    else if (type==2){
      type=4;
    }
  }
  if (type==1){//new - blank
    win = window.open("","","resizable=1,scrollbars=1,menubar=0,location=0,toolbar=0,status=0,directories=0,width=800,top=0,left=0");
	url = url.replace("../","")
    win.location.href = url
    if (win.opener == null) win.opener = window;
    //***win.opener.name = "opener";
    win.focus();
  }
  if (type==2){//self - blank
    this.location.href = url
  }
  if (type==3){//new - embed 
    win = window.open("","","resizable=1,scrollbars=1,menubar=0,location=0,toolbar=0,status=0,directories=0,width=800,top=0,left=0");
    if(url.indexOf("showFile")>0){
      win.location.href =  url ;
    }
    else{
      win.location.href = "index.jsp?template=" + template + "&cont_url=" + url ;
    }

    if (win.opener == null) win.opener = window;
    //win.opener.name = "opener";
    win.focus();
  }
  if (type==4){//self - embed
	if(url.indexOf("showFile")>0){
	     if(this.name=="accd"){
            top = window.open("","","resizable=1,scrollbars=1,menubar=0,location=0,toolbar=0,status=0,directories=0,width=800,top=0,left=0");
            top.location.href =  url ;
         }
         else {
            this.location.href =  url ;
         }
    }
    else {
		if(this.name=="accd" || this.name=="opener"){
     		//top.location.href =  "../index/gmie_" + template + ".jsp?cont_url=" + url ;
		  	top.location.href = "index.jsp?template=" + template + "&cont_url=" + url ;
        }
        else {
     	  	this.location.href = "index.jsp?template=" + template + "&cont_url=" + url ;
        }
    }
  }
}


str='';
function removeTags(stin){
  str=stin;
  strlen=str.length;
  ltpos=str.indexOf('<',0);
  if(ltpos!=-1){
    mtpos=str.indexOf('>',ltpos);
    strBef=str.substring(0, ltpos);
    strAft=str.substring(mtpos+1,strlen);
    str=strBef+strAft;
    removeTags(str);
  }
  else{
    modificado = str;
  }
  return(modificado);
}
