
// Evento para verificar si hubo cambios en la página y confirmar la salida
window.onbeforeunload = confirmarSalida;

// Variable para controlar los cambios en la página
var cambioRealizado = false;

// Evento para verificar si hubo cambios en la página y confirmar la salida
function confirmarSalida(e)
{
    if (cambioRealizado)
    {
        return "Si sale de la pagina, se perderan sus cambios.";
    }
}

// Funcion que redimenciona la altura del iframe que contiene una pagina
// de acuerdo al contenido de la misma
function redimensionarIframe()
{
    if (navigator.userAgent.indexOf("Firefox") >= 0 || navigator.userAgent.indexOf("Opera") >= 0)
        top.grand(document.body.scrollHeight + 25);
    else
        top.grand(document.body.scrollHeight);
}


// Funcion que redimenciona la altura del iframe que contiene una pagina
// de acuerdo al contenido de la misma
function redimensionarIframe2(aumento)
{
    if (navigator.userAgent.indexOf("Firefox") >= 0 || navigator.userAgent.indexOf("Opera") >= 0)
        top.grand(document.body.scrollHeight + 25 + aumento);
    else
        top.grand(document.body.scrollHeight + aumento);
}


///
/// GOOGLE ANALITICS
///
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try
{
    var pageTracker = _gat._getTracker("UA-7413531-1");
    pageTracker._trackPageview();
} 
catch(err) {}

////////////////////////////////////////////////////////////
     
/*
// Función para deshabilitar el menú que aparece cuando se hace click derecho sobre
// una página web.
function InhabilitarContextMenu()
{
    return false 
} 
document.oncontextmenu = InhabilitarContextMenu;


// Función para deshabilitar las teclas F3 y F5 (Actualizar).
document.onkeydown = function(e) 
{ 
    if(e) 
    document.onkeypress = function(){return true;} 

    var evt = e?e:event; 
    
    if(evt.keyCode==116 || evt.keyCode==114) 
    { 
        if(e) 
        document.onkeypress = function(){return false;} 
        else 
        { 
            evt.keyCode = 0; 
            evt.returnValue = false; 
        } 
    } 
} */


    
    
function f_clientWidth() {
    return f_filterResults (
	    window.innerWidth ? window.innerWidth : 0,
	    document.documentElement ? document.documentElement.clientWidth : 0,
	    document.body ? document.body.clientWidth : 0
    );
}
function f_clientHeight() {
    return f_filterResults (
	    window.innerHeight ? window.innerHeight : 0,
	    document.documentElement ? document.documentElement.clientHeight : 0,
	    document.body ? document.body.clientHeight : 0
    );
}
function f_scrollLeft() {
    return f_filterResults (
	    window.pageXOffset ? window.pageXOffset : 0,
	    document.documentElement ? document.documentElement.scrollLeft : 0,
	    document.body ? document.body.scrollLeft : 0
    );
}
function f_scrollTop() {
    return f_filterResults (
	    window.pageYOffset ? window.pageYOffset : 0,
	    document.documentElement ? document.documentElement.scrollTop : 0,
	    document.body ? document.body.scrollTop : 0
    );
}
function f_filterResults(n_win, n_docel, n_body) {
    var n_result = n_win ? n_win : 0;
    if (n_docel && (!n_result || (n_result > n_docel)))
	    n_result = n_docel;
    return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}


function heightWindow() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function getScrollY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfY;
}