var Version4 = (parseInt(navigator.appVersion) >= 4);
var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var layerObj = (NS4) ? 'document' : 'document.all';
var styleObj = (NS4) ? '' : '.style';
var memObj = (NS4) ? 'document.frames["mem"]' : 'document.all["mem"]';
var ancho=0;
var alto=0;

function cambiarMemUK(){
  memObj.location="memUK.html";
}

function cambiarMem(){
  memObj.location="mem.html";
}

function cambiarBackground(){
  //ancho = (NS4) ? window.innerWidth : document.body.clientWidth;
  ancho = screen.width;
  //alto = (NS4) ? window.innerHeight : document.body.clientHeight;
  alto = screen.height;

  if(ancho==800)
    document.write('<body background="img/fireback800.jpg" text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70>');
  else if(ancho==1024)
    document.write('<body background="img/fireback1024.jpg" text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70>');    
  else
    document.write('<body bgcolor=black text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70 bgcolor=black>');
}

function cambiarBackgroundCast(){
  ancho = screen.width;
  alto = screen.height;

  if(ancho==800)
    document.write('<body background="img/fireback800.jpg" text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70 onload=parent.cambiarMem()>');
  else if(ancho==1024)
    document.write('<body background="img/fireback1024.jpg" text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70 onload=parent.cambiarMem()>');    
  else
    document.write('<body bgcolor=black text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70 bgcolor=black onload=parent.cambiarMem()>');
}

function cambiarBackgroundUK(){
  ancho = screen.width;
  alto = screen.height;

  if(ancho==800)
    document.write('<body background="img/fireback800.jpg" text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70 onload=parent.cambiarMemUK()>');
  else if(ancho==1024)
    document.write('<body background="img/fireback1024.jpg" text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70 onload=parent.cambiarMemUK()>');    
  else
    document.write('<body bgcolor=black text=red LINK=cyan VLINK=white ALINK=purple marginwidth=70 bgcolor=black onload=parent.cambiarMemUK()>');
}
