function DesHabilitar( ID ){
	document.getElementById( ID ).disabled = true;
}
function Habilitar( ID ){
	document.getElementById( ID ).disabled = false;
}
function PonerPunto( ID ){
  var Elem = document.getElementById( ID ).style;
  
  Elem.visibility = "visible";
  Elem.display = "block";
}
function QuitarPunto( ID ){
  var Elem = document.getElementById( ID ).style;
  
  Elem.visibility = "hidden";
  Elem.display = "none";
}

function IrA( Menu, SubMenu ){
  if (Menu == "-1" && SubMenu == "-1"){
    location.href = "index.asp";
  }else if( Menu.toLowerCase().indexOf("http://") != -1 && SubMenu == "-1" ){
    location.href = Menu;
  }else if( Menu == "7" ){
    location.href = "index.asp?Seccion=-1&SubSeccion=10";
  }else{
    location.href = "index.asp?Seccion=" + Menu + "&SubSeccion=" + SubMenu;
  }
}

var IE = navigator.appVersion.indexOf("MSIE") != -1;
var IE6 = navigator.appVersion.indexOf("MSIE 6") != -1;
var Safari = navigator.appVersion.indexOf("Safari") != -1;
var ScrollVisible = false;
var myWidth=0;
var myHeight=0;
function Medidas(){
      var pHeight = 0;
      var pWidth = 0;
    
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
        pWidth = parent.window.innerWidth;
        pHeight = parent.window.innerHeight;
      }else if( document.documentElement ){
        if ( document.documentElement.clientWidth || document.documentElement.clientHeight ){
          //IE 6+ in 'standards compliant mode'
          myWidth = document.documentElement.clientWidth;
          myHeight = document.documentElement.clientHeight;
          pWidth = parent.document.documentElement.clientWidth;
          pHeight = parent.document.documentElement.clientHeight;
        }else if ( document.body.clientWidth || document.body.clientHeight ){
          //IE 4 compatible
          myWidth = document.body.clientWidth;
          myHeight = document.body.clientHeight;
          pWidth = parent.document.body.clientWidth;
          pHeight = parent.document.body.clientHeight;
        }
      }else if( document.body ){
        if( document.body.clientWidth || document.body.clientHeight ){
          //IE 4 compatible
          myWidth = document.body.clientWidth;
          myHeight = document.body.clientHeight;
          pWidth = parent.document.body.clientWidth;
          pHeight = parent.document.body.clientHeight;
        }
      }
      if ( myHeight < document.getElementById("Contenido").scrollHeight || myHeight < document.documentElement.scrollHeight ){
        ScrollVisible = true;
      }
      
      var Barra = 0;

      if ( IE ){
        if (myHeight < document.documentElement.scrollHeight){ h = document.documentElement.scrollHeight;}
        else{ h =  myHeight;} /*document.documentElement.scrollHeight*/
        H_Fondo = h + 195;
      }else if ( Safari ){
        h = document.body.scrollHeight;
        H_Fondo = h + 195;
      }else{
        if (! ScrollVisible){
          h = myHeight;
        }else{
          if (myHeight < document.documentElement.scrollHeight){ h = document.documentElement.scrollHeight;}
          else{ h =  myHeight;} /*document.documentElement.scrollHeight*/
        }
        H_Fondo = h + 195;
      }
      document.getElementById("Contenido").style.height = h + "px";
}

function FormCheck(){
  if (document.getElementById("Nombre").value == ""){
    alert("El campo de Nombre es obligatorio");
    return false;
  }else if ( document.getElementById("Apellidos").value == ""){
    alert("El campo de Apellidos es obligatorio");
    return false;
  }else if ( document.getElementByid("EMail").value == ""){
    alert("El campo de Email es obligatorio");
    return false;
  }
}

function ActivarFondo(){
  Fondo = document.getElementById("Oscuro");
  Fondo.style.width = myWidth + "px";
  Fondo.style.height = myHeight + "px";
  if (IE){
    Fondo.style.top = document.documentElement.scrollTop + "px";
  }else{
    Fondo.style.top = window.pageYOffset + "px";
  }
  Fondo.style.left = "0px";
  Fondo.style.display = "block";
  Fondo.style.visibility = "visible";     
  document.body.style.overflow = "hidden";
  
  Fondo.onclick = function(){
    DesActivarFondo();
  }
}
function DesActivarFondo(){
  document.body.style.overflow = "auto";
  Fondo = document.getElementById("Oscuro");
  Fondo.style.display = "none";
  Fondo.style.visibility = "hidden";
  Fondo.onclick = function(){}
  
  Rep = document.getElementById("RepVideo");
  Rep.innerHTML = "";
  Rep.style.display = "none";
  Rep.style.visibility = "hidden";
}

function VerVideo( Video ){
  if ( myHeight == 0 ){ Medidas(); }
  
  ActivarFondo();
  var Desplazamiento = 0;
  if (IE){
    Desplazamiento = parseInt(document.documentElement.scrollTop,10);
  }else{
    Desplazamiento = parseInt(window.pageYOffset,10);
  }
  
  Rep = document.getElementById("RepVideo");
  Rep.style.top = parseInt(Desplazamiento + myHeight/2 - 290/2,10) + "px";
  Rep.style.left = parseInt(myWidth/2 - 530/2,10) + "px";
  Rep.style.width = "530px";
  Rep.style.height = "290px";
  Rep.style.display = "block";
  Rep.style.visibility = "visible";
  
  var so = new SWFObject("Reproductor.swf", "ReoproductorFlash", "530px", "290px", "6", "#000000",false, "high");
  so.addParam("menu", "false");
  so.addParam("allowScriptAccess", "sameDomain");
  so.addVariable("srcVideo", Video);
  so.write("RepVideo");
}