Update of /cvsroot/easystruts/easystruts-website/lib/x-cbe/x3151_cbe4191_z4/cross-browser.com/x
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv435/lib/x-cbe/x3151_cbe4191_z4/cross-browser.com/x
Added Files:
x_alt.js x_event.js x_img.js x_misc.js x_dom.js x_drag.js
x_timer.js x_event_nn4.js x_debug.js x_slide.js x_tip.js
x_win.js x_bar.js x_core.js s6.js x_cook.js x_popup.js
x_load.js x_core_nn4.js
Log Message:
Added new web site sources and data
--- NEW FILE: x_debug.js ---
// x_debug.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xName(e) {
if (!e) return e;
else if (e.id && e.id != "") return e.id;
else if (e.nodeName && e.nodeName != "") return e.nodeName;
else if (e.tagName && e.tagName != "") return e.tagName;
else return e;
}
function xParentChain(e,delim,bNode) {
if (!(e=xGetElementById(e))) return;
var lim=100, s = "", d = delim || "\n";
while(e) {
s += xName(e) + ', ofsL:'+e.offsetLeft + ', ofsT:'+e.offsetTop + d;
e = xParent(e,bNode);
if (!lim--) break;
}
return s;
}
function xLoadScript(url)
{
if (document.createElement && document.getElementsByTagName) {
var s = document.createElement('script');
var h = document.getElementsByTagName('head');
if (s && h.length) {
s.src = url;
h[0].appendChild(s);
}
}
}
function xEvalTextarea()
{
var f = document.createElement('FORM');
f.onsubmit = 'return false';
var t = document.createElement('TEXTAREA');
t.id='xDebugTA';
t.name='xDebugTA';
t.rows='20';
t.cols='60';
var b = document.createElement('INPUT');
b.type = 'button';
b.value = 'Evaluate';
b.onclick = function() {eval(this.form.xDebugTA.value);};
f.appendChild(t);
f.appendChild(b);
document.body.appendChild(f);
}
// keepieapart.js from PPK
if (document.all)
{
var detect = navigator.userAgent.toLowerCase();
var browser,thestring;
var version = 0;
if (checkIt('msie'))
{
browser = "IE "
browser += detect.substr(place + thestring.length,3);
document.title = browser + ' - ' + document.title;
}
}
function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}
// end x_debug.js
--- NEW FILE: x_event.js ---
// x_event.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xAddEventListener(e,eventType,eventListener,useCapture) {
if(!(e=xGetElementById(e))) return;
eventType=eventType.toLowerCase();
if((!xIE4Up && !xOp7) && e==window) {
if(eventType=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eventListener; xResizeEvent(); return; }
if(eventType=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eventListener; xScrollEvent(); return; }
}
var eh='e.on'+eventType+'=eventListener';
if(e.addEventListener) e.addEventListener(eventType,eventListener,useCapture);
else if(e.attachEvent) e.attachEvent('on'+eventType,eventListener);
else if(e.captureEvents) {
if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.captureEvents(eval('Event.'+eventType.toUpperCase())); }
eval(eh);
}
else eval(eh);
}
function xRemoveEventListener(e,eventType,eventListener,useCapture) {
if(!(e=xGetElementById(e))) return;
eventType=eventType.toLowerCase();
if((!xIE4Up && !xOp7) && e==window) {
if(eventType=='resize') { window.xREL=null; return; }
if(eventType=='scroll') { window.xSEL=null; return; }
}
var eh='e.on'+eventType+'=null';
if(e.removeEventListener) e.removeEventListener(eventType,eventListener,useCapture);
else if(e.detachEvent) e.detachEvent('on'+eventType,eventListener);
else if(e.releaseEvents) {
if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.releaseEvents(eval('Event.'+eventType.toUpperCase())); }
eval(eh);
}
else eval(eh);
}
function xEvent(evt) { // cross-browser event object prototype
this.type = '';
this.target = null;
this.pageX = 0;
this.pageY = 0;
this.offsetX = 0;
this.offsetY = 0;
this.keyCode = 0;
var e = evt ? evt : window.event;
if(!e) return;
if(e.type) this.type = e.type;
if(e.target) this.target = e.target;
else if(e.srcElement) this.target = e.srcElement;
if(xOp5or6) { this.pageX = e.clientX; this.pageY = e.clientY; }
else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }
if(xDef(e.offsetX,e.offsetY)) { this.offsetX = e.offsetX; this.offsetY = e.offsetY; }
else { this.offsetX = this.pageX - xPageX(this.target); this.offsetY = this.pageY - xPageY(this.target); }
if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which
else if (xDef(e.which)) { this.keyCode = e.which; }
}
function xResizeEvent() { // window resize event simulation
if (window.xREL) setTimeout('xResizeEvent()', 250);
var cw = xClientWidth(), ch = xClientHeight();
if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
}
function xScrollEvent() { // window scroll event simulation
if (window.xSEL) setTimeout('xScrollEvent()', 250);
var sl = xScrollLeft(), st = xScrollTop();
if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
}
// end x_event.js
--- NEW FILE: x_core_nn4.js ---
// x_core_nn4.js
// For NN4 use this file instead of x_core.js. xInclude() will do this for you automatically.
// X v3.15.1, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
// Variables:
var xVersion='3.15.1',xNN4=false,xOp7=false,xOp5or6=false,xIE4Up=false,xIE4=false,xIE5=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if (document.layers) {xNN4=true;}
else if (document.all) {
xIE4Up=xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;
xIE4=xUA.indexOf('msie 4')!=-1;
xIE5=xUA.indexOf('msie 5')!=-1;
}
// Object:
function xGetElementById(e) {
if(typeof(e)!='string') return e;
if(document.getElementById) e=document.getElementById(e);
else if(document.all) e=document.all[e];
else if(document.layers) e=xLayer(e);
else e=null;
return e;
}
function xLayer(id,root) { // only for nn4
var i,layer,found=null;
if (!root) root=window;
for(i=0; i<root.document.layers.length; i++) {
layer=root.document.layers[i];
if(layer.id==id) return layer;
if(layer.document.layers.length) found=xLayer(id,layer);
if(found) return found;
}
return null;
}
function xParent(e,bNode){
if (!(e=xGetElementById(e))) return null;
var p=null;
if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
else if (xDef(e.parentNode)) p=e.parentNode;
else if (xDef(e.parentElement)) p=e.parentElement;
else if (xDef(e.parentLayer)){if (e.parentLayer!=window) p=e.parentLayer;}
return p;
}
function xDef() {
for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
return true;
}
function xStr(s) {
return typeof(s)=='string';
}
function xNum(n) {
return typeof(n)=='number';
}
// Appearance:
function xShow(e) {
if(!(e=xGetElementById(e))) return;
if(e.style && xDef(e.style.visibility)) e.style.visibility='visible';
else if(xDef(e.visibility)) e.visibility='show';
}
function xHide(e) {
if(!(e=xGetElementById(e))) return;
if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
else if(xDef(e.visibility)) e.visibility='hide';
}
function xZIndex(e,uZ) {
if(!(e=xGetElementById(e))) return 0;
if(e.style && xDef(e.style.zIndex)) {
if(xNum(uZ)) e.style.zIndex=uZ;
uZ=parseInt(e.style.zIndex);
}
else if(xDef(e.zIndex)) {
if(xNum(uZ)) e.zIndex=uZ;
uZ=e.zIndex;
}
return uZ;
}
function xColor(e,sColor) {
if(!(e=xGetElementById(e))) return '';
var c='';
if(e.style && xDef(e.style.color)) {
if(xStr(sColor)) e.style.color=sColor;
c=e.style.color;
}
return c;
}
function xBackground(e,sColor,sImage) {
if(!(e=xGetElementById(e))) return '';
var bg='';
if(e.style) {
if(xStr(sColor)) {
if(!xOp5or6) e.style.backgroundColor=sColor;
else e.style.background=sColor;
}
if(xStr(sImage)) e.style.backgroundImage=(sImage!='')? 'url('+sImage+')' : null;
if(!xOp5or6) bg=e.style.backgroundColor;
else bg=e.style.background;
}
else if(xDef(e.bgColor)) {
if(xStr(sColor)) e.bgColor=sColor;
bg=e.bgColor;
if(xStr(sImage)) e.background.src=sImage;
}
return bg;
}
// Position:
function xMoveTo(e,iX,iY) {
xLeft(e,iX);
xTop(e,iY);
}
function xLeft(e,iX) {
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if (css && xStr(e.style.left)) {
if(xNum(iX)) e.style.left=iX+'px';
else {
iX=parseInt(e.style.left);
if(isNaN(iX)) iX=0;
}
}
else if(css && xDef(e.style.pixelLeft)) {
if(xNum(iX)) e.style.pixelLeft=iX;
else iX=e.style.pixelLeft;
}
else if(xDef(e.left)) {
if(xNum(iX)) e.left=iX;
else iX=e.left;
}
return iX;
}
function xTop(e,iY) {
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if(css && xStr(e.style.top)) {
if(xNum(iY)) e.style.top=iY+'px';
else {
iY=parseInt(e.style.top);
if(isNaN(iY)) iY=0;
}
}
else if(css && xDef(e.style.pixelTop)) {
if(xNum(iY)) e.style.pixelTop=iY;
else iY=e.style.pixelTop;
}
else if(xDef(e.top)) {
if(xNum(iY)) e.top=iY;
else iY=e.top;
}
return iY;
}
function xPageX(e) {
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.pageX)) return e.pageX;
var x = 0;
while (e) {
if (xDef(e.offsetLeft)) x += e.offsetLeft;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
return x;
}
function xPageY(e) {
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.pageY)) return e.pageY;
var y = 0;
while (e) {
if (xDef(e.offsetTop)) y += e.offsetTop;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
// if (xOp7) return y - document.body.offsetTop; // v3.14, temporary hack for opera bug 130324
return y;
}
function xOffsetLeft(e) {
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetLeft)) return e.offsetLeft;
else return xPageX(e) - xPageX(xParent(e));
}
function xOffsetTop(e) {
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetTop)) return e.offsetTop;
else return xPageY(e) - xPageY(xParent(e));
}
function xScrollLeft(e) {
var offset=0;
if (!(e=xGetElementById(e))) {
if(xDef(window.pageXOffset)) offset=window.pageXOffset;
else if(document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft;
else if(document.body && xDef(document.body.scrollLeft)) offset=document.body.scrollLeft;
}
else { if (xNum(e.scrollLeft)) offset = e.scrollLeft; }
return offset;
}
function xScrollTop(e) {
var offset=0;
if (!(e=xGetElementById(e))) {
if(xDef(window.pageYOffset)) offset=window.pageYOffset;
else if(document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop;
else if(document.body && xDef(document.body.scrollTop)) offset=document.body.scrollTop;
}
else { if (xNum(e.scrollTop)) offset = e.scrollTop; }
return offset;
}
function xHasPoint(ele, iLeft, iTop, iClpT, iClpR, iClpB, iClpL) {
if (!xNum(iClpT)){iClpT=iClpR=iClpB=iClpL=0;}
else if (!xNum(iClpR)){iClpR=iClpB=iClpL=iClpT;}
else if (!xNum(iClpB)){iClpL=iClpR; iClpB=iClpT;}
var thisX = xPageX(ele), thisY = xPageY(ele);
return (iLeft >= thisX + iClpL && iLeft <= thisX + xWidth(ele) - iClpR &&
iTop >=thisY + iClpT && iTop <= thisY + xHeight(ele) - iClpB );
}
// Size:
function xResizeTo(e,uW,uH) {
xWidth(e,uW);
xHeight(e,uH);
}
function xWidth(e,uW) {
if(!(e=xGetElementById(e))) return 0;
if (xNum(uW)) { // v3.13.1
if (uW<0) uW = 0;
else uW=Math.round(uW);
}
else uW=0;
var css=xDef(e.style);
if(css && xDef(e.offsetWidth) && xStr(e.style.width)) {
if(uW) xSetCW(e, uW);
uW=e.offsetWidth;
}
else if(css && xDef(e.style.pixelWidth)) {
if(uW) e.style.pixelWidth=uW;
uW=e.style.pixelWidth;
}
else if(xDef(e.clip) && xDef(e.clip.right)) {
if(uW) e.clip.right=uW;
uW=e.clip.right;
}
return uW;
}
function xHeight(e,uH) {
if(!(e=xGetElementById(e))) return 0;
if (xNum(uH)) { // v3.13.1
if (uH<0) uH = 0;
else uH=Math.round(uH);
}
else uH=0;
var css=xDef(e.style);
if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
if(uH) xSetCH(e, uH);
uH=e.offsetHeight;
}
else if(css && xDef(e.style.pixelHeight)) {
if(uH) e.style.pixelHeight=uH;
uH=e.style.pixelHeight;
}
else if(xDef(e.clip) && xDef(e.clip.bottom)) {
if(uH) e.clip.bottom=uH;
uH=e.clip.bottom;
}
return uH;
}
function xGetCS(ele,sP){return parseInt(document.defaultView.getComputedStyle(ele,'').getPropertyValue(sP));}
function xSetCW(ele,uW){
var pl=0,pr=0,bl=0,br=0;
if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
pl=xGetCS(ele,'padding-left');
pr=xGetCS(ele,'padding-right');
bl=xGetCS(ele,'border-left-width');
br=xGetCS(ele,'border-right-width');
}
else if(xDef(ele.currentStyle,document.compatMode)){
if(document.compatMode=='CSS1Compat'){
pl=parseInt(ele.currentStyle.paddingLeft);
pr=parseInt(ele.currentStyle.paddingRight);
bl=parseInt(ele.currentStyle.borderLeftWidth);
br=parseInt(ele.currentStyle.borderRightWidth);
}
}
else if(xDef(ele.offsetWidth,ele.style.width)){ // ?
ele.style.width=uW+'px';
pl=ele.offsetWidth-uW;
}
if(isNaN(pl)) pl=0; if(isNaN(pr)) pr=0; if(isNaN(bl)) bl=0; if(isNaN(br)) br=0;
var cssW=uW-(pl+pr+bl+br);
if(isNaN(cssW)||cssW<0) return;
else ele.style.width=cssW+'px';
}
function xSetCH(ele,uH){
var pt=0,pb=0,bt=0,bb=0;
if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
pt=xGetCS(ele,'padding-top');
pb=xGetCS(ele,'padding-bottom');
bt=xGetCS(ele,'border-top-width');
bb=xGetCS(ele,'border-bottom-width');
}
else if(xDef(ele.currentStyle,document.compatMode)){
if(document.compatMode=='CSS1Compat'){
pt=parseInt(ele.currentStyle.paddingTop);
pb=parseInt(ele.currentStyle.paddingBottom);
bt=parseInt(ele.currentStyle.borderTopWidth);
bb=parseInt(ele.currentStyle.borderBottomWidth);
}
}
else if(xDef(ele.offsetHeight,ele.style.height)){ // ?
ele.style.height=uH+'px';
pt=ele.offsetHeight-uH;
}
if(isNaN(pt)) pt=0; if(isNaN(pb)) pb=0; if(isNaN(bt)) bt=0; if(isNaN(bb)) bb=0;
var cssH=uH-(pt+pb+bt+bb);
if(isNaN(cssH)||cssH<0) return;
else ele.style.height=cssH+'px';
}
function xClip(e,iTop,iRight,iBottom,iLeft) {
if(!(e=xGetElementById(e))) return;
if(e.style) {
if (xNum(iLeft)) e.style.clip='rect('+iTop+'px '+iRight+'px '+iBottom+'px '+iLeft+'px)';
else e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)';
}
else if(e.clip) {
if (xNum(iLeft)) { e.clip.top=iTop; e.clip.right=iRight; e.clip.bottom=iBottom; e.clip.left=iLeft; }
else { e.clip.top=0; e.clip.right=xWidth(e); e.clip.bottom=xHeight(e); e.clip.left=0; }
}
}
// Window:
function xClientWidth() {
var w=0;
if(xOp5or6) w=window.innerWidth;
else if(!window.opera && document.documentElement && document.documentElement.clientWidth) // v3.12
w=document.documentElement.clientWidth;
else if(document.body && document.body.clientWidth)
w=document.body.clientWidth;
else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
w=window.innerWidth;
if(document.height>window.innerHeight) w-=16;
}
return w;
}
function xClientHeight() {
var h=0;
if(xOp5or6) h=window.innerHeight;
else if(!window.opera && document.documentElement && document.documentElement.clientHeight) // v3.12
h=document.documentElement.clientHeight;
else if(document.body && document.body.clientHeight)
h=document.body.clientHeight;
else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
h=window.innerHeight;
if(document.width>window.innerWidth) h-=16;
}
return h;
}
// end x_core_nn4.js
--- NEW FILE: x_dom.js ---
// x_dom.js
// X v3.15.1, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
/* xWalkTree()
Perform a preorder traversal
on the subtree starting at oNode
and pass each Element node to fnVisit.
*/
function xWalkTree(oNode, fnVisit)
{
if (oNode) {
if (oNode.nodeType == 1) {fnVisit(oNode);}
for (var c = oNode.firstChild; c; c = c.nextSibling) {
xWalkTree(c, fnVisit);
}
}
}
/* xGetComputedStyle
For sProp use the css property name, not the object property name.
For finding width this works in Moz and Op, but in IE this only works
if padding and border use pixel units in the CSS.
*/
function xGetComputedStyle(oEle, sProp)
{
var p = 0;
if(document.defaultView && document.defaultView.getComputedStyle){
p = document.defaultView.getComputedStyle(oEle,'').getPropertyValue(sProp)
}
else if(oEle.currentStyle) {
// convert css property name to object property name for IE (can this be done with RE?)
var a = sProp.split('-');
sProp = a[0];
for (var i=1; i<a.length; ++i) {
c = a[i].charAt(0);
sProp += a[i].replace(c, c.toUpperCase());
}
p = oEle.currentStyle[sProp];
}
return parseInt(p) || 0;
}
/* xGetElementsByClassName()
Returns an array of elements which are
descendants of parentEle and have tagName and clsName.
If parentEle is null or not present, document will be used.
if tagName is null or not present, "*" will be used.
*/
function xGetElementsByClassName(clsName, parentEle, tagName) {
var found = new Array();
var re = new RegExp('\\b'+clsName+'\\b', 'i');
var list = xGetElementsByTagName(tagName, parentEle);
for (var i = 0; i < list.length; ++i) {
if (list[i].className.search(re) != -1) {
found[found.length] = list[i];
}
}
return found;
}
/* xGetElementsByTagName()
Returns an array of elements which are
descendants of parentEle and have tagName.
If parentEle is null or not present, document will be used.
if tagName is null or not present, "*" will be used.
*/
function xGetElementsByTagName(tagName, parentEle)
{
var list = null;
tagName = tagName || '*';
parentEle = parentEle || document;
if (xIE4 || xIE5) {
if (tagName == '*') list = parentEle.all;
else list = parentEle.all.tags(tagName);
}
else if (parentEle.getElementsByTagName) list = parentEle.getElementsByTagName(tagName);
return list || new Array();
}
/* xGetElementsByAttribute
Return an array of all sTag elements whose sAtt attribute matches sRE.
sAtt can also be a property name but the property must be of type string.
*/
function xGetElementsByAttribute(sTag, sAtt, sRE)
{
var a, list, found = new Array(), re = new RegExp(sRE, 'i');
list = xGetElementsByTagName(sTag);
for (var i = 0; i < list.length; ++i) {
a = list[i].getAttribute(sAtt);
if (!a) {a = list[i][sAtt];}
if (typeof(a)=='string' && a.search(re) != -1) {
found[found.length] = list[i];
}
}
return found;
}
// end x_dom.js
--- NEW FILE: x_event_nn4.js ---
// x_event_nn4.js
// For NN4 use this file instead of x_event.js. xInclude() will do this for you automatically.
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xAddEventListener(e,eventType,eventListener,useCapture) {
if(!(e=xGetElementById(e))) return;
eventType=eventType.toLowerCase();
if((!xIE4Up && !xOp7) && e==window) {
if(eventType=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eventListener; xResizeEvent(); return; }
if(eventType=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eventListener; xScrollEvent(); return; }
}
var eh='e.on'+eventType+'=eventListener';
if(e.addEventListener) e.addEventListener(eventType,eventListener,useCapture);
else if(e.attachEvent) e.attachEvent('on'+eventType,eventListener);
else if(e.captureEvents) {
if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.captureEvents(eval('Event.'+eventType.toUpperCase())); }
eval(eh);
}
else eval(eh);
}
function xRemoveEventListener(e,eventType,eventListener,useCapture) {
if(!(e=xGetElementById(e))) return;
eventType=eventType.toLowerCase();
if((!xIE4Up && !xOp7) && e==window) {
if(eventType=='resize') { window.xREL=null; return; }
if(eventType=='scroll') { window.xSEL=null; return; }
}
var eh='e.on'+eventType+'=null';
if(e.removeEventListener) e.removeEventListener(eventType,eventListener,useCapture);
else if(e.detachEvent) e.detachEvent('on'+eventType,eventListener);
else if(e.releaseEvents) {
if(useCapture||(eventType.indexOf('mousemove')!=-1)) { e.releaseEvents(eval('Event.'+eventType.toUpperCase())); }
eval(eh);
}
else eval(eh);
}
function xEvent(evt) { // cross-browser event object prototype
this.type = '';
this.target = null;
this.pageX = 0;
this.pageY = 0;
this.offsetX = 0;
this.offsetY = 0;
this.keyCode = 0;
var e = evt ? evt : window.event;
if(!e) return;
if(e.type) this.type = e.type;
if(e.target) this.target = e.target;
else if(e.srcElement) this.target = e.srcElement;
else if(xNN4) this.target = xLayerFromPoint(e.pageX, e.pageY);
if(xOp5or6) { this.pageX = e.clientX; this.pageY = e.clientY; }
else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; } // v3.14
else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }
if(xDef(e.offsetX,e.offsetY)) { this.offsetX = e.offsetX; this.offsetY = e.offsetY; }
else if(xDef(e.layerX,e.layerY)) { this.offsetX = e.layerX; this.offsetY = e.layerY; }
else { this.offsetX = this.pageX - xPageX(this.target); this.offsetY = this.pageY - xPageY(this.target); }
if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which
else if (xDef(e.which)) { this.keyCode = e.which; }
}
function xLayerFromPoint(x,y,root) { // only for nn4
var i, hn=null, hz=-1, cn;
if (!root) root = window;
for (i=0; i < root.document.layers.length; ++i) {
cn = root.document.layers[i];
if (cn.visibility != "hide" && x >= cn.pageX && x <= cn.pageX + cn.clip.right && y >= cn.pageY && y <= cn.pageY + cn.clip.bottom ) {
if (cn.zIndex > hz) { hz = cn.zIndex; hn = cn; }
}
}
if (hn) {
cn = xLayerFromPoint(x,y,hn);
if (cn) hn = cn;
}
return hn;
}
function xResizeEvent() { // window resize event simulation
if (window.xREL) setTimeout('xResizeEvent()', 250);
var cw = xClientWidth(), ch = xClientHeight();
if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
}
function xScrollEvent() { // window scroll event simulation
if (window.xSEL) setTimeout('xScrollEvent()', 250);
var sl = xScrollLeft(), st = xScrollTop();
if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
}
// end x_event_nn4.js
--- NEW FILE: x_misc.js ---
// x_misc.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xLinearScale(value, inMin, inMax, outMin, outMax)
{
var m = (outMax - outMin) / (inMax - inMin);
var b = outMin - (inMin * m);
return (m * value + b);
}
function xIntersection(e1, e2, o)
{
var ix1, iy2, iw, ih, intersect = true;
var e1x1 = e1.pageX();
var e1x2 = e1x1 + e1.width();
var e1y1 = e1.pageY();
var e1y2 = e1y1 + e1.height();
var e2x1 = e2.pageX();
var e2x2 = e2x1 + e2.width();
var e2y1 = e2.pageY();
var e2y2 = e2y1 + e2.height();
// horizontal
if (e1x1 <= e2x1) {
ix1 = e2x1;
if (e1x2 < e2x1) intersect = false;
else iw = Math.min(e1x2, e2x2) - e2x1;
}
else {
ix1 = e1x1;
if (e2x2 < e1x1) intersect = false;
else iw = Math.min(e1x2, e2x2) - e1x1;
}
// vertical
if (e1y2 >= e2y2) {
iy2 = e2y2;
if (e1y1 > e2y2) intersect = false;
else ih = e2y2 - Math.max(e1y1, e2y1);
}
else {
iy2 = e1y2;
if (e2y1 > e1y2) intersect = false;
else ih = e1y2 - Math.max(e1y1, e2y1);
}
// return intersected rectangle
if (intersect && arguments.length == 3) {
o.x = ix1;
o.y = iy2 - ih;
o.w = iw;
o.h = ih;
}
return intersect;
}
// end x_misc.js
--- NEW FILE: x_bar.js ---
// x_bar.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xBar(dir, // direction, 'ltr', 'rtl', 'ttb', or 'btt'
conStyle, barStyle) // container and bar style class names
{
//// Public Properties
this.value = 0; // current value, read-only
//// Public Methods
// Update current value
this.update = function(v)
{
if (v < 0) v = 0;
else if (v > this.inMax) v = this.inMax;
this.con.title = this.bar.title = this.value = v;
switch(this.dir) {
case 'ltr': // left to right
v = this.scale(v, this.w);
xLeft(this.bar, v - this.w);
break;
case 'rtl': // right to left
v = this.scale(v, this.w);
xLeft(this.bar, this.w - v);
break;
case 'btt': // bottom to top
v = this.scale(v, this.h);
xTop(this.bar, this.h - v);
break;
case 'ttb': // top to bottom
v = this.scale(v, this.h);
xTop(this.bar, v - this.h);
break;
}
}
// Change position and/or size
this.paint = function(x, y, // container position
w, h) // container size
{
if (xNum(x)) this.x = x;
if (xNum(y)) this.y = y;
if (xNum(w)) this.w = w;
if (xNum(h)) this.h = h;
xResizeTo(this.con, this.w, this.h);
xMoveTo(this.con, this.x, this.y);
xResizeTo(this.bar, this.w, this.h);
xMoveTo(this.bar, 0, 0);
}
// Change scale and/or start value
this.reset = function(max, start) // non-scaled values
{
if (xNum(max)) this.inMax = max;
if (xNum(start)) this.start = start;
this.update(this.start);
}
//// Private Methods
this.scale = function(v, outMax)
{
return Math.round(xLinearScale(v, 0, this.inMax, 0, outMax));
}
//// Private Properties
this.dir = dir;
this.x = 0;
this.y = 0;
this.w = 100;
this.h = 100;
this.inMax = 100;
this.start = 0;
this.conStyle = conStyle;
this.barStyle = barStyle;
//// Constructor
// Create container
this.con = document.createElement('DIV');
this.con.className = this.conStyle;
// Create bar
this.bar = document.createElement('DIV');
this.bar.className = this.barStyle;
// Insert in object tree
this.con.appendChild(this.bar);
document.body.appendChild(this.con);
} // end xBar
//// Support Functions
function xLinearScale(value, inMin, inMax, outMin, outMax)
{
var m = (outMax - outMin) / (inMax - inMin);
var b = outMin - (inMin * m);
return (m * value + b);
}
// end x_bar.js
--- NEW FILE: x_load.js ---
// x_load.js
// X v3.15.1, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
// Global Variables:
// now i've got these vars in 2 lib files - crap. i'd like to leave them here... but i'm not sure
var xVersion='3.15.1',xNN4=false,xOp7=false,xOp5or6=false,xIE4Up=false,xIE4=false,xIE5=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if (document.layers) {xNN4=true;}
else if (document.all) {
xIE4Up=xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;
xIE4=xUA.indexOf('msie 4')!=-1;
xIE5=xUA.indexOf('msie 5')!=-1;
}
// xInclude()
// Call before the window.onload event.
// Only supports files with extensions '.js' and '.css'.
// Automatically loads files with NN4 support if browser is NN4.
// Returns true if browser has minimal dhtml support, else returns false.
function xInclude(url1, url2, etc)
{
if (document.getElementById || document.all || document.layers) {
var h, f;
for (var i=0; i<arguments.length; ++i) {
h = ''; // html to be written
f = arguments[i].toLowerCase(); // lowercase file url
// JS
if (f.indexOf('.js') != -1) {
if (xNN4) {
var c='x_core', e='x_event', n='_nn4';
if (f.indexOf(c) != -1) { f = f.replace(c, c+n); }
else if (f.indexOf(e) != -1) { f = f.replace(e, e+n); }
}
h = "<script type='text/javascript' src='" + f + "'></script>";
}
// CSS
else if (f.indexOf('.css') != -1) {
h = "<link rel='stylesheet' type='text/css' href='" + f + "'>";
}
// Write the html into the document
if (h.length) { document.writeln(h); }
}
return true;
}
return false;
}
// end x_load.js
--- NEW FILE: x_cook.js ---
// x_cook.js
// Cookie functions.
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
// cookie implementations based on code from Netscape Javascript Guide
function xSetCookie(name, value, expire, path) {
document.cookie = name + "=" + escape(value) + ((!expire) ? "" : ("; expires=" + expire.toGMTString())) + "; path=/";
}
function xGetCookie(name) {
var value=null, search=name+"=";
if (document.cookie.length > 0) {
var offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
var end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
value = unescape(document.cookie.substring(offset, end));
}
}
return value;
}
// end x_cook.js
--- NEW FILE: x_drag.js ---
// x_drag.js
// Drag events implementation.
// X v3.15.1, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
var xDragMgr = {ele:null, mm:false};
function xEnableDrag(id, fnDragStart, fnDrag, fnDragEnd)
{
var ele = xGetElementById(id);
ele.xDraggable = true;
ele.xOnDragStart = fnDragStart;
ele.xOnDrag = fnDrag;
ele.xOnDragEnd = fnDragEnd;
xAddEventListener(ele, 'mousedown', xdOnMousedown, false);
if (!xDragMgr.mm) {
xDragMgr.mm = true;
xAddEventListener(document, 'mousemove', xdOnMousemove, false);
}
}
function xdOnMousedown(e) // drag start
{
var evt = new xEvent(e);
var ele = evt.target;
while(ele && !ele.xDraggable) {
ele = xParent(ele);
}
if (ele) {
if (e && e.preventDefault) e.preventDefault();
else if (window.event) window.event.returnValue = false;
ele.xDragX = evt.pageX;
ele.xDragY = evt.pageY;
xDragMgr.ele = ele;
xAddEventListener(ele, 'mouseup', xdOnMouseup, false);
if (ele.xOnDragStart) {
ele.xOnDragStart(ele, evt.pageX, evt.pageY);
}
}
}
function xdOnMousemove(e) // drag
{
var evt = new xEvent(e);
if (xDragMgr.ele) {
if (e && e.preventDefault) e.preventDefault();
else if (window.event) window.event.returnValue = false;
var ele = xDragMgr.ele;
var dx = evt.pageX - ele.xDragX;
var dy = evt.pageY - ele.xDragY;
ele.xDragX = evt.pageX;
ele.xDragY = evt.pageY;
if (ele.xOnDrag) {
ele.xOnDrag(ele, dx, dy);
}
else {
xMoveTo(ele, xLeft(ele) + dx, xTop(ele) + dy);
}
}
}
function xdOnMouseup(e) // drag end
{
if (xDragMgr.ele) {
if (e && e.preventDefault) e.preventDefault();
else if (window.event) window.event.returnValue = false;
xRemoveEventListener(xDragMgr.ele, 'mouseup', xdOnMouseup, false);
if (xDragMgr.ele.xOnDragEnd) {
var evt = new xEvent(e);
xDragMgr.ele.xOnDragEnd(xDragMgr.ele, evt.pageX, evt.pageY);
}
xDragMgr.ele = null;
}
}
// end x_drag.js
--- NEW FILE: x_slide.js ---
// x_anim.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xSlideTo(e,x,y,uTime) {
if (!(e=xGetElementById(e))) return;
if (!e.timeout) e.timeout = 25;
e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false;
e.yA = e.yTarget - xTop(e); e.xA = e.xTarget - xLeft(e); // A = distance
e.B = Math.PI / (2 * e.slideTime); // B = period
e.yD = xTop(e); e.xD = xLeft(e); // D = initial position
var d = new Date(); e.C = d.getTime();
if (!e.moving) xSlide(e);
}
function xSlide(e) {
if (!(e=xGetElementById(e))) return;
var now, s, t, newY, newX;
now = new Date();
t = now.getTime() - e.C;
if (e.stop) { e.moving = false; }
else if (t < e.slideTime) {
setTimeout("xSlide('"+e.id+"')", e.timeout);
s = Math.sin(e.B * t);
newX = Math.round(e.xA * s + e.xD);
newY = Math.round(e.yA * s + e.yD);
xMoveTo(e, newX, newY);
e.moving = true;
}
else {
xMoveTo(e, e.xTarget, e.yTarget);
e.moving = false;
}
}
// end x_anim.js
--- NEW FILE: x_popup.js ---
// x_popup.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xPopup(sTmrType, uTimeout, sPosition, sStyle, sId, sUrl) // sTmrType: 'timeout' or 'interval'
{
if (document.getElementById && document.createElement && document.body && document.body.appendChild)
{
// create popup element
//var e = document.createElement('DIV');
var e = document.createElement('IFRAME');
this.ele = e;
e.id = sId;
e.style.position = 'absolute';
e.className = sStyle;
//e.innerHTML = sHtml;
e.src = sUrl
document.body.appendChild(e);
xShow(e);
this.tmr = xTimer.set(sTmrType, this, sTmrType, uTimeout);
// timer event listeners
this.timeout = function() // hide popup
{
var e = this.ele;
xSlideTo(e, -xWidth(e), -xHeight(e), this.slideTime);
}
this.interval = function() // size, position and show popup
{
var x=0, y=0, e = this.ele;
var ew = xWidth(e), eh = xHeight(e);
var cw = xClientWidth(), ch = xClientHeight();
switch (this.pos) {
case 'e':
x = cw - ew - this.margin;
y = (ch - eh)/2;
break;
case 'se':
x = cw - ew - this.margin;
y = ch - eh - this.margin;
break;
case 'w':
x = this.margin;
y = (ch - eh)/2;
break;
case 'cen': default:
x = (cw - ew)/2;
y = (ch - eh)/2;
break;
} // end switch
xSlideTo(e, xScrollLeft() + x, xScrollTop() + y, this.slideTime);
}
// init
this.margin = 10;
this.pos = sPosition;
this.slideTime = 500; // slide time in ms
this.interval();
}
} // end xPopup
// end x_popup.js
--- NEW FILE: x_timer.js ---
// x_timer.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
function xTimerMgr() // object prototype
{
// Public Methods
this.set = function(type, obj, sMethod, uTime, data) // type: 'interval' or 'timeout'
{
return (this.timers[this.timers.length] = new xTimerObj(type, obj, sMethod, uTime, data));
}
// Private Properties
this.timers = new Array();
// Private Methods
this.run = function()
{
var i, t, d = new Date(), now = d.getTime();
for (i = 0; i < this.timers.length; ++i) {
t = this.timers[i];
if (t && t.running) {
t.elapsed = now - t.time0;
if (t.elapsed >= t.preset) { // timer event on t
t.obj[t.mthd](t); // pass listener this xTimerObj
if (t.type.charAt(0) == 'i') { t.time0 = now; }
else { t.stop(); }
}
}
}
}
// Private Object Prototype
function xTimerObj(type, obj, mthd, preset, data)
{
// Public Methods
this.stop = function() { this.running = false; }
this.start = function() { this.running = true; } // continue after a stop
this.reset = function()
{
var d = new Date();
this.time0 = d.getTime();
this.elapsed = 0;
this.running = true;
}
// Public Properties
this.data = data;
// Read-only Properties
this.type = type; // 'interval' or 'timeout'
this.obj = obj;
this.mthd = mthd; // string
this.preset = preset;
this.reset();
} // end xTimerObj
} // end xTimerMgr
var xTimer = new xTimerMgr(); // applications assume global name is 'xTimer'
setInterval('xTimer.run()', 250);
// end x_timer.js
--- NEW FILE: x_core.js ---
// x_core.js
// X v3.15.1, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
// Variables:
var xVersion='3.15.1',xNN4=false,xOp7=false,xOp5or6=false,xIE4Up=false,xIE4=false,xIE5=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if (document.all) {
xIE4Up=xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;
xIE4=xUA.indexOf('msie 4')!=-1;
xIE5=xUA.indexOf('msie 5')!=-1;
}
// Object:
function xGetElementById(e) {
if(typeof(e)!='string') return e;
if(document.getElementById) e=document.getElementById(e);
else if(document.all) e=document.all[e];
else e=null;
return e;
}
function xParent(e,bNode){
if (!(e=xGetElementById(e))) return null;
var p=null;
if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
else if (xDef(e.parentNode)) p=e.parentNode;
else if (xDef(e.parentElement)) p=e.parentElement;
return p;
}
function xDef() {
for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
return true;
}
function xStr(s) {
return typeof(s)=='string';
}
function xNum(n) {
return typeof(n)=='number';
}
// Appearance:
function xShow(e) {
if(!(e=xGetElementById(e))) return;
if(e.style && xDef(e.style.visibility)) e.style.visibility='visible';
}
function xHide(e) {
if(!(e=xGetElementById(e))) return;
if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
}
function xZIndex(e,uZ) {
if(!(e=xGetElementById(e))) return 0;
if(e.style && xDef(e.style.zIndex)) {
if(xNum(uZ)) e.style.zIndex=uZ;
uZ=parseInt(e.style.zIndex);
}
return uZ;
}
function xColor(e,sColor) {
if(!(e=xGetElementById(e))) return '';
var c='';
if(e.style && xDef(e.style.color)) {
if(xStr(sColor)) e.style.color=sColor;
c=e.style.color;
}
return c;
}
function xBackground(e,sColor,sImage) {
if(!(e=xGetElementById(e))) return '';
var bg='';
if(e.style) {
if(xStr(sColor)) {
if(!xOp5or6) e.style.backgroundColor=sColor;
else e.style.background=sColor;
}
if(xStr(sImage)) e.style.backgroundImage=(sImage!='')? 'url('+sImage+')' : null;
if(!xOp5or6) bg=e.style.backgroundColor;
else bg=e.style.background;
}
return bg;
}
// Position:
function xMoveTo(e,iX,iY) {
xLeft(e,iX);
xTop(e,iY);
}
function xLeft(e,iX) {
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if (css && xStr(e.style.left)) {
if(xNum(iX)) e.style.left=iX+'px';
else {
iX=parseInt(e.style.left);
if(isNaN(iX)) iX=0;
}
}
else if(css && xDef(e.style.pixelLeft)) {
if(xNum(iX)) e.style.pixelLeft=iX;
else iX=e.style.pixelLeft;
}
return iX;
}
function xTop(e,iY) {
if(!(e=xGetElementById(e))) return 0;
var css=xDef(e.style);
if(css && xStr(e.style.top)) {
if(xNum(iY)) e.style.top=iY+'px';
else {
iY=parseInt(e.style.top);
if(isNaN(iY)) iY=0;
}
}
else if(css && xDef(e.style.pixelTop)) {
if(xNum(iY)) e.style.pixelTop=iY;
else iY=e.style.pixelTop;
}
return iY;
}
function xPageX(e) {
if (!(e=xGetElementById(e))) return 0;
var x = 0;
while (e) {
if (xDef(e.offsetLeft)) x += e.offsetLeft;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
return x;
}
function xPageY(e) {
if (!(e=xGetElementById(e))) return 0;
var y = 0;
while (e) {
if (xDef(e.offsetTop)) y += e.offsetTop;
e = xDef(e.offsetParent) ? e.offsetParent : null;
}
// if (xOp7) return y - document.body.offsetTop; // v3.14, temporary hack for opera bug 130324
return y;
}
function xOffsetLeft(e) {
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetLeft)) return e.offsetLeft;
else return 0;
}
function xOffsetTop(e) {
if (!(e=xGetElementById(e))) return 0;
if (xDef(e.offsetTop)) return e.offsetTop;
else return 0;
}
function xScrollLeft(e) {
var offset=0;
if (!(e=xGetElementById(e))) {
if(document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft;
else if(document.body && xDef(document.body.scrollLeft)) offset=document.body.scrollLeft;
}
else { if (xNum(e.scrollLeft)) offset = e.scrollLeft; }
return offset;
}
function xScrollTop(e) {
var offset=0;
if (!(e=xGetElementById(e))) {
if(document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop;
else if(document.body && xDef(document.body.scrollTop)) offset=document.body.scrollTop;
}
else { if (xNum(e.scrollTop)) offset = e.scrollTop; }
return offset;
}
function xHasPoint(ele, iLeft, iTop, iClpT, iClpR, iClpB, iClpL) {
if (!xNum(iClpT)){iClpT=iClpR=iClpB=iClpL=0;}
else if (!xNum(iClpR)){iClpR=iClpB=iClpL=iClpT;}
else if (!xNum(iClpB)){iClpL=iClpR; iClpB=iClpT;}
var thisX = xPageX(ele), thisY = xPageY(ele);
return (iLeft >= thisX + iClpL && iLeft <= thisX + xWidth(ele) - iClpR &&
iTop >=thisY + iClpT && iTop <= thisY + xHeight(ele) - iClpB );
}
// Size:
function xResizeTo(e,uW,uH) {
xWidth(e,uW);
xHeight(e,uH);
}
function xWidth(e,uW) {
if(!(e=xGetElementById(e))) return 0;
if (xNum(uW)) {
if (uW<0) uW = 0;
else uW=Math.round(uW);
}
else uW=0;
var css=xDef(e.style);
if(css && xDef(e.offsetWidth) && xStr(e.style.width)) {
if(uW) xSetCW(e, uW);
uW=e.offsetWidth;
}
else if(css && xDef(e.style.pixelWidth)) {
if(uW) e.style.pixelWidth=uW;
uW=e.style.pixelWidth;
}
return uW;
}
function xHeight(e,uH) {
if(!(e=xGetElementById(e))) return 0;
if (xNum(uH)) {
if (uH<0) uH = 0;
else uH=Math.round(uH);
}
else uH=0;
var css=xDef(e.style);
if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
if(uH) xSetCH(e, uH);
uH=e.offsetHeight;
}
else if(css && xDef(e.style.pixelHeight)) {
if(uH) e.style.pixelHeight=uH;
uH=e.style.pixelHeight;
}
return uH;
}
function xGetCS(ele,sP){return parseInt(document.defaultView.getComputedStyle(ele,'').getPropertyValue(sP));}
function xSetCW(ele,uW){
var pl=0,pr=0,bl=0,br=0;
if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
pl=xGetCS(ele,'padding-left');
pr=xGetCS(ele,'padding-right');
bl=xGetCS(ele,'border-left-width');
br=xGetCS(ele,'border-right-width');
}
else if(xDef(ele.currentStyle,document.compatMode)){
if(document.compatMode=='CSS1Compat'){
pl=parseInt(ele.currentStyle.paddingLeft);
pr=parseInt(ele.currentStyle.paddingRight);
bl=parseInt(ele.currentStyle.borderLeftWidth);
br=parseInt(ele.currentStyle.borderRightWidth);
}
}
else if(xDef(ele.offsetWidth,ele.style.width)){ // ?
ele.style.width=uW+'px';
pl=ele.offsetWidth-uW;
}
if(isNaN(pl)) pl=0; if(isNaN(pr)) pr=0; if(isNaN(bl)) bl=0; if(isNaN(br)) br=0;
var cssW=uW-(pl+pr+bl+br);
if(isNaN(cssW)||cssW<0) return;
else ele.style.width=cssW+'px';
}
function xSetCH(ele,uH){
var pt=0,pb=0,bt=0,bb=0;
if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
pt=xGetCS(ele,'padding-top');
pb=xGetCS(ele,'padding-bottom');
bt=xGetCS(ele,'border-top-width');
bb=xGetCS(ele,'border-bottom-width');
}
else if(xDef(ele.currentStyle,document.compatMode)){
if(document.compatMode=='CSS1Compat'){
pt=parseInt(ele.currentStyle.paddingTop);
pb=parseInt(ele.currentStyle.paddingBottom);
bt=parseInt(ele.currentStyle.borderTopWidth);
bb=parseInt(ele.currentStyle.borderBottomWidth);
}
}
else if(xDef(ele.offsetHeight,ele.style.height)){ // ?
ele.style.height=uH+'px';
pt=ele.offsetHeight-uH;
}
if(isNaN(pt)) pt=0; if(isNaN(pb)) pb=0; if(isNaN(bt)) bt=0; if(isNaN(bb)) bb=0;
var cssH=uH-(pt+pb+bt+bb);
if(isNaN(cssH)||cssH<0) return;
else ele.style.height=cssH+'px';
}
function xClip(e,iTop,iRight,iBottom,iLeft) {
if(!(e=xGetElementById(e))) return;
if(e.style) {
if (xNum(iLeft)) e.style.clip='rect('+iTop+'px '+iRight+'px '+iBottom+'px '+iLeft+'px)';
else e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)';
}
}
// Window:
function xClientWidth() {
var w=0;
if(xOp5or6) w=window.innerWidth;
else if(!window.opera && document.documentElement && document.documentElement.clientWidth) // v3.12
w=document.documentElement.clientWidth;
else if(document.body && document.body.clientWidth)
w=document.body.clientWidth;
else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
w=window.innerWidth;
if(document.height>window.innerHeight) w-=16;
}
return w;
}
function xClientHeight() {
var h=0;
if(xOp5or6) h=window.innerHeight;
else if(!window.opera && document.documentElement && document.documentElement.clientHeight) // v3.12
h=document.documentElement.clientHeight;
else if(document.body && document.body.clientHeight)
h=document.body.clientHeight;
else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
h=window.innerHeight;
if(document.width>window.innerWidth) h-=16;
}
return h;
}
// end x_core.js
--- NEW FILE: x_win.js ---
// x_win.js
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
/* xWindow()
Create an xWindow object for each child window the page will need.
Pass a zero for width, height, left, and top and the window will
have default size and position. Pass a zero or one for the boolean
parameters (location field, menubar, etc.).
*/
function xWindow(name, w, h, x, y, loc, men, res, scr, sta, too)
{
var f = '';
if (w && h) {
if (document.layers) f = 'screenX=' + x + ',screenY=' + y;
else f = 'left=' + x + ',top=' + y;
f += ',width=' + w + ',height=' + h + ',';
}
f += ('location='+loc+',menubar='+men+',resizable='+res
+',scrollbars='+scr+',status='+sta+',toolbar='+too);
this.features = f;
this.name = name;
this.load = function(sUrl) {
if (this.wnd && !this.wnd.closed) this.wnd.location.href = sUrl;
else this.wnd = window.open(sUrl, this.name, this.features);
this.wnd.focus();
return false;
}
}
// end x_win.js
--- NEW FILE: x_img.js ---
// x_img.js
// Image rollover functions.
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
/* xImgRollSetup
Can not be called before the window onload event.
Pass image IDs starting with 4th argument.
Assumes this image file naming convention:
out img = path + imgEleId + fileExt
over img = path + imgEleId + ovrSuffix + fileExt
*/
function xImgRollSetup(path, ovrSuffix, fileExt)
{
var ele, id;
for (var i=3; i<arguments.length; ++i) {
id = arguments[i];
if (ele = xGetElementById(id)) {
ele.xOutUrl = path + id + fileExt;
ele.xOvrObj = new Image();
ele.xOvrObj.src = path + id + ovrSuffix + fileExt;
ele.onmouseout = xImgOnMouseout;
ele.onmouseover = xImgOnMouseover;
}
}
}
function xImgOnMouseout(e)
{
if (this.xOutUrl) {
this.src = this.xOutUrl;
}
}
function xImgOnMouseover(e)
{
if (this.xOvrObj && this.xOvrObj.complete) {
this.src = this.xOvrObj.src;
}
}
// end x_img.js
--- NEW FILE: x_tip.js ---
// x_tip.js
// X v3.15.1, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
// X Tooltip Groups
// v2.01, mf, 1Mar04, Now works in IE 4 and 5. Used document.write
// instead of document.createElement.
// v2.00, mf, 13Dec03, Almost completely rewritten. Now supports html for
// tooltip text instead of using the title attribute.
// v1.01, mf, 12Dec03, Correction for when the mouse moves
// directly from one trigger element to another.
// v1.00, mf, 11Dec03, Initial release.
document.write("<style type='text/css'>#xTooltipElement{position:absolute;visibility:hidden;}</style>");
document.write("<div id='xTooltipElement'>xTooltipElement</div>");
var xttTrigger = null; // current trigger element
function xTooltipGroup(grpClassOrIdList, tipClass, origin, xOffset, yOffset, textList)
{
//// Public Methods
this.show = function(trigEle, mx, my)
{
if (xttTrigger != trigEle) { // if not active or moved to an adjacent trigger
this.t.className = trigEle.xTooltip.c;
this.t.innerHTML = trigEle.xTooltipText ? trigEle.xTooltipText : trigEle.title;
xttTrigger = trigEle;
}
var x, y;
switch(this.o) {
case 'right':
x = xPageX(trigEle) + xWidth(trigEle);
y = xPageY(trigEle);
break;
case 'top':
x = xPageX(trigEle);
y = xPageY(trigEle) - xHeight(trigEle);
break;
case 'mouse':
x = mx;
y = my;
break;
}
xMoveTo(this.t, x + this.x, y + this.y);
xShow(this.t);
}
this.hide = function()
{
xMoveTo(this.t, -1000, -1000);
xttTrigger = null;
}
//// Private Methods
this.docOnMousemove = function(oEvent)
{
// this == document at runtime
var o, e = new xEvent(oEvent);
if (e.target && (o = e.target.xTooltip)) {
o.show(e.target, e.pageX, e.pageY);
}
else if (xttTrigger) {
xttTrigger.xTooltip.hide();
}
}
//// Private Properties
this.c = tipClass;
this.o = origin;
this.x = xOffset;
this.y = yOffset;
this.t = null; // tooltip element - all groups use the same element
//// Constructor Code
var i, tips;
if (xStr(grpClassOrIdList)) {
tips = xGetElementsByClassName(grpClassOrIdList);
for (i = 0; i < tips.length; ++i) {
tips[i].xTooltip = this;
}
}
else {
tips = new Array();
for (i = 0; i < grpClassOrIdList.length; ++i) {
tips[i] = xGetElementById(grpClassOrIdList[i]);
if (!tips[i]) {
alert('Element not found for id = ' + grpClassOrIdList[i]);
}
else {
tips[i].xTooltip = this;
tips[i].xTooltipText = textList[i];
}
}
}
if (!this.t) { // only execute once
this.t = xGetElementById('xTooltipElement');
xAddEventListener(document, 'mousemove', this.docOnMousemove, false);
}
} // end xTooltipGroup
// end x_tip.js
--- NEW FILE: x_alt.js ---
// x_alt.js
// Alternatives to existing X functions.
// X v3.15, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003,2004 Michael Foster (mi...@cr...)
// This library is distributed under the terms of the LGPL (gnu.org)
/* xWinOpen()
A simple alternative to xWindow.
*/
var xChildWindow = null;
function xWinOpen(sUrl) {
if (xChildWindow && !xChildWindow.closed) {xChildWindow.location.href = sUrl;}
else {xChildWindow = window.open(sUrl, "myWinName");}
xChildWindow.focus();
return false;
}
// Alternatives to xSlideTo()
function xSlideX(e,iX,fInc,iterating) { // experimental
if (!(e=xGetElementById(e))) return;
if (!e.slideXActive) e.slideXTarget = iX;
else if (!iterating) {e.slideXTarget = iX; return;}
var dX, X=xLeft(e);
e.slideXActive = true;
if (fInc < 1) {
dX = fInc * Math.abs(Math.abs(X) - Math.abs(e.slideXTarget));
if (dX < 1) dX = 1;
}
else dX = fInc;
if (X < e.slideXTarget) {
if (X + dX <= e.slideXTarget) X += dX;
else X = e.slideXTarget;
}
else if (X > e.slideXTarget) {
if (X - dX >= e.slideXTarget) X -= dX;
else X = e.slideXTarget;
}
else {e.slideXActive = false; return;}
xLeft(e, X);
setTimeout("xSlideX('"+e.id+"',"+e.slideXTarget+","+fInc+","+true+")",25);
}
function xSlideY(e,iY,fInc,iterating) { // experimental
if (!(e=xGetElementById(e))) return;
if (!e.slideYActive) e.slideYTarget = iY;
else if (!iterating) {e.slideYTarget = iY; return;}
var dY, Y=xTop(e);
e.slideYActive = true;
if (fInc < 1) {
dY = fInc * Math.abs(Math.abs(Y) - Math.abs(e.slideYTarget));
if (dY < 1) dY = 1;
}
else dY = fInc;
if (Y < e.slideYTarget) {
if (Y + dY <= e.slideYTarget) Y += dY;
else Y = e.slideYTarget;
}
else if (Y > e.slideYTarget) {
if (Y - dY >= e.slideYTarget) Y -= dY;
else Y = e.slideYTarget;
}
else {e.slideYActive = false; return;}
xTop(e, Y);
setTimeout("xSlideY('"+e.id+"',"+e.slideYTarget+","+fInc+","+true+")",25);
}
// alternative to xHasPoint()
function xHasPoint(ele, iLeft, iTop, iClpT, iClpR, iClpB, iClpL) {
if (arguments.length==3){iClpT=iClpR=iClpB=iClpL=0;}
else if (arguments.length==4){iClpR=iClpB=iClpL=iClpT;}
else if (arguments.length==5){iClpL=iClpR; iClpB=iClpT;}
var thisX = xPageX(ele), thisY = xPageY(ele);
return (iLeft >= thisX + iClpL && iLeft <= thisX + xWidth(ele) - iClpR &&
iTop >=thisY + iClpT && iTop <= thisY + xHeight(ele) - iClpB );
}
// xScrollXxxx functions without element support
function xScrollLeft() {
var offset=0;
if(xDef(window.pageXOffset)) offset=window.pageXOffset;
else if(document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft;
else if(document.body && xDef(document.body.scrollLeft)) offset=document.body.scrollLeft;
return offset;
}
function xScrollTop() {
var offset=0;
if(xDef(window.pageYOffset)) offset=window.pageYOffset;
else if(document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop;
else if(document.body && xDef(document.body.scrollTop)) offset=document.body.scrollTop;
return offset;
}
// end x_alt.js
--- NEW FILE: s6.js ---
// Collapsible Element Support
// Mike Foster, Cross-Browser.com
document.write("<style type='text/css'>#header h1, #leftColumn h3{cursor:pointer;}</style>");
function setupCollapsibleH3s(bMin)
{
setupCollapsibleHs('H3', H3_OnClick, bMin);
}
function setupCollapsibleColumn()
{
var h, i, c, list, lc;
h = xGetElementById('header');
h.collapsed = true;
h.onclick = H1_OnClick;
h.onclick();
return;
}
function setupCollapsibleHs(sTag, fnOnClick, bMin)
{
var h, i, c, list, lc;
lc = xGetElementById('leftColumn');
aH = xGetElementsByTagName(sTag, lc); // from leftColumn only
aC = xGetElementsByClassName('collapsible', lc);
for (i = 0; i < aH.length; ++i) {
h = aH[i]; // sTag element (trigger)
c = aC[i]; // collapsible element (target)
if (h && c) {
h.collapsibleEle = c;
h.collapsed = !bMin;
h.onclick = fnOnClick;
h.onclick();
}
}
}
function H3_OnClick()
{
var d, t;
if (this.collapsed) {
d = 'block';
t = 'Hide';
}
else {
d = 'none';
t = 'Show';
}
this.collapsibleEle.style.display = d;
this.setAttribute('title', 'Click to ' + t + ' Section');
this.collapsed = !this.collapsed;
}
function H1_OnClick()
{
var d, t, w;
var lc = xGetElementById('leftColumn');
var rc = xGetElementById('rightColumn');
if (this.collapsed) {
d = 'block';
t = 'Hide';
w = '70';
}
else {
d = 'none';
t = 'Show';
w = '96';
}
rc.style.display = d;
lc.style.width = w + '%';
this.setAttribute('title', 'Click to ' + t + ' Side Panel');
this.collapsed = !this.collapsed;
}
|