// Funciones para mantener la compatibilidad entre browsers window.scrollY = function(obj) { //Desplazamiento (Scroll) vertical de la pagina var result = 0; if (obj) topDocument = obj.document; else topDocument = document; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant result = window.pageYOffset; } else if( topDocument.body && ( topDocument.body.scrollLeft || topDocument.body.scrollTop ) ) { //DOM compliant result = topDocument.body.scrollTop; } else if( topDocument.documentElement && ( topDocument.documentElement.scrollLeft || topDocument.documentElement.scrollTop ) ) { //IE6 standards compliant mode result = topDocument.documentElement.scrollTop; } return result; } window.scrollX = function() { //Desplazamiento (Scroll) horizontal de la pagina var result = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant result = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant result = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode result = document.documentElement.scrollLeft; } else { result = 0; } return result; } window.sizeY = function() { var result = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE result = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' result = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible result = document.body.clientHeight; } return result; } window.sizeX = function() { var result = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE result = window.innerWidth; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' result = document.documentElement.clientWidth; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible result = document.body.clientWidth; } return result; } function isChildOf(obj, target) { //Devuelve true si target es child de obj while (target && (target.nodeName!='BODY') && (target.nodeName!='HTML') && (target!=obj)) target = target.parentNode; return (target==obj) } function objsAreRelated(a, b) { var obja = a; var objb = b; var found = false; while (!found && objb && (objb.nodeName!='BODY') && (objb.nodeName!='HTML')) { while (!found && obja && (obja.nodeName!='BODY') && (obja.nodeName!='HTML')) { found = (obja == objb); obja = obja.parentNode; } if (!found) { objb = objb.parentNode; obja = a; } } return found; } function offsetTop(obj) { var curtop = 0; curtop = obj.offsetTop if (obj.offsetParent) { while (obj = obj.offsetParent) curtop += obj.offsetTop; } return curtop; } function offsetLeft(obj) { var curleft = 0; curleft = obj.offsetLeft if (obj.offsetParent) { while (obj = obj.offsetParent) curleft += obj.offsetLeft; } return curleft; } function heightObj(obj) { return obj.offsetHeight || obj.pixelHeight; } function widthObj(obj) { return obj.offsetWidth || obj.pixelWidth; } function mouseX(e) { // pos contains the mouse position relative to the document var pos = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { pos = e.pageX; } else if (e.clientX || e.clientY) { pos = e.clientX + scrollX(); } return pos; } function mouseY(e) { // pos contains the mouse position relative to the document var pos = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { pos = e.pageY; } else if (e.clientX || e.clientY) { pos = e.clientY + scrollY(); } return pos; } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } //************ Fin funciones compatibilidad ************** //IE background flicker hack try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {};