function abrirCalendario(cadena)
{
	window.open('http://194.30.15.88/comercio_grupopikolinos/vistas/calendario.aspx?txt=' + cadena, 'Calendario', 'width=250,height=190,resizable=yes');
}

function Fade(objID,CurrentAlpha,TargetAlpha,steps){

  var obj = document.getElementById(objID);
  
  CurrentAlpha = parseInt(CurrentAlpha);
  if (isNaN(CurrentAlpha)){
       CurrentAlpha = parseInt(obj.style.opacity*100);
       if (isNaN(CurrentAlpha))CurrentAlpha=100;
  }
  
  var DeltaAlpha=parseInt((CurrentAlpha-TargetAlpha)/steps);
  var NewAlpha = CurrentAlpha - DeltaAlpha;
  
  obj.style.opacity = (NewAlpha / 100);
  obj.style.MozOpacity = obj.style.opacity;
  obj.style.filter = 'alpha(opacity='+NewAlpha+')';
  
  if (steps>1){
       setTimeout('Fade("'+objID+'",'+NewAlpha+','+TargetAlpha+','+(steps-1)+')', 50);
  }
} 

function mostrarElemento(elemento)
{
    document.getElementById(elemento).style.display = 'block';
    //document.getElementById(elemento).className = 'display_block';
}

function ocultarElemento(elemento)
{
    document.getElementById(elemento).style.display = 'none';
    //document.getElementById(elemento).className = 'display_none';
}

function comprobarCampos()
{
    var faltan_campos = true;
    for (i = 0; i < comprobarCampos.arguments.length - 1; i += 2)
    {
        if (EnBlanco(document.getElementById(comprobarCampos.arguments[i]).value))
        {
            faltan_campos = false;
            document.getElementById(comprobarCampos.arguments[i + 1]).className = 'campo_obligatorio';
        }
        else
        {
            document.getElementById(comprobarCampos.arguments[i + 1]).className = 'display_none';
        }
    }
    
    return faltan_campos;
}

function comprobarCamposValor0()
{
    var faltan_campos = true;
    for (i = 0; i < comprobarCamposValor0.arguments.length - 1; i += 2)
    {
        if (document.getElementById(comprobarCamposValor0.arguments[i]).value == 0)
        {
            faltan_campos = false;
            document.getElementById(comprobarCamposValor0.arguments[i + 1]).className = 'campo_obligatorio';
        }
        else
        {
            document.getElementById(comprobarCamposValor0.arguments[i + 1]).className = 'display_none';
        }
    }
    
    return faltan_campos;
}

//function getWindowHeight() {
//	var windowHeight = 0;
//	if (typeof(window.innerHeight) == 'number') {
//		windowHeight = window.innerHeight;
//	}
//	else {
//		if (document.documentElement && document.documentElement.clientHeight) {
//			windowHeight = document.documentElement.clientHeight;
//		}
//		else {
//			if (document.body && document.body.clientHeight) {
//				windowHeight = document.body.clientHeight;
//			}
//		}
//	}
//	return windowHeight;
//}
//function getWindowWidth() {
//	var windowWidth = 0;
//	if (typeof(window.innerWidth) == 'number') {
//		windowWidth = window.innerWidth;
//	}
//	else {
//		if (document.documentElement && document.documentElement.clientWidth) {
//			windowWidth = document.documentElement.clientWidth;
//		}
//		else {
//			if (document.body && document.body.clientWidth) {
//				windowWidth = document.body.clientWidth;
//			}
//		}
//	}
//	return windowWidth;
//}
//function setFooter() {
//	if (document.getElementById) {
//		var windowHeight = getWindowHeight();
//		if (windowHeight > 0) {
//			var contentHeight = document.getElementById('content').offsetHeight;
//			var footerElement = document.getElementById('footer');
//			//var tableElement = document.getElementById('tbl_central');
//			var footerHeight  = footerElement.offsetHeight;
//			if (windowHeight - (contentHeight + footerHeight) >= 0) {
//				footerElement.style.position = 'relative';
//				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
//			}
//			else {
//				footerElement.style.position = 'static';
//			}
//		}
//	}
//}

//window.onload = function() {
//	setFooter();
//}
//window.onresize = function() {
//	setFooter();
//}


