function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}


var win = null;
function pop(mypage,myname,w,h){

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable'

win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}


function pop_centrado(img, ancho, alto){
derecha=((screen.width-ancho)/2);
arriba=((screen.height-alto)/2);
string="toolbar=0,scrollbars=1,location=0,statusbar=0,menu bar=0,resizable=0,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
fin=window.open(img,"",string);
}