1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
function WZDD()
{
this.elements = new Array(0);
this.obj = null;
this.n = navigator.userAgent.toLowerCase();
this.db = (document.compatMode && document.compatMode.toLowerCase() != "backcompat")?
document.documentElement
: (document.body || null);
this.op = !!(window.opera && document.getElementById);
if(this.op) document.onmousedown = new Function('e',
'if(((e = e || window.event).target || e.srcElement).tagName == "IMAGE") return false;');
this.ie = !!(this.n.indexOf("msie") >= 0 && document.all && this.db && !this.op);
this.iemac = !!(this.ie && this.n.indexOf("mac") >= 0);
this.ie4 = !!(this.ie && !document.getElementById);
this.n4 = !!(document.layers && typeof document.classes != dd_u);
this.n6 = !!(typeof window.getComputedStyle != dd_u && typeof document.createRange != dd_u);
this.w3c = !!(!this.op && !this.ie && !this.n6 && document.getElementById);
this.ce = !!(document.captureEvents && document.releaseEvents);
this.px = this.n4? '' : 'px';
this.tiv = this.w3c? 40 : 10;
}
var dd = new WZDD();
dd.Int = function(d_x, d_y)
{
return isNaN(d_y = parseInt(d_x))? 0 : d_y;
};
dd.getWndW = function()
{
return dd.Int(
(dd.db && !dd.op && !dd.w3c && dd.db.clientWidth)? dd.db.clientWidth
: (document.getElementById("banniere").innerWidth || 0)
);
};
dd.getWndH = function()
{
return dd.Int(
(dd.db && !dd.op && !dd.w3c && dd.db.clientHeight)? dd.db.clientHeight
: (document.getElementById("banniere").innerHeight || 0)
);
};
dd.getScrollX = function()
{
return dd.Int(window.pageXOffset || (dd.db? dd.db.scrollLeft : 0));
};
dd.getScrollY = function()
{
return dd.Int(window.pageYOffset || (dd.db? dd.db.scrollTop : 0));
};
dd.getPageXY = function(d_o)
{
if(dd.n4 && d_o)
{
dd.x = d_o.pageX || 0;
dd.y = d_o.pageY || 0;
}
else
{
dd.x = dd.y = 0; //global helper vars
while(d_o)
{
dd.x += dd.Int(d_o.offsetLeft);
dd.y += dd.Int(d_o.offsetTop);
d_o = d_o.offsetParent || null;
}
}
}; |
Partager