/* Built from X 4.22 by XAG 1.0. 26Nov10 04:47 UT */
xLibrary={version:"4.22",license:"GNU LGPL",url:"http://cross-browser.com/"};

function xEvent(evt){var e=evt||window.event;if(!e){return}this.nativeEvent=e;this.type=e.type;this.target=e.target||e.srcElement;this.relatedTarget=e.relatedTarget;
/*@cc_on if (e.type == 'mouseover') this.relatedTarget = e.fromElement;
  else if (e.type == 'mouseout') this.relatedTarget = e.toElement; @*/
if(xDef(e.pageX)){this.pageX=e.pageX;this.pageY=e.pageY}else{if(xDef(e.clientX)){this.pageX=e.clientX+xScrollLeft();this.pageY=e.clientY+xScrollTop()}}if(xDef(e.offsetX)){this.offsetX=e.offsetX;this.offsetY=e.offsetY}else{if(xDef(e.layerX)){this.offsetX=e.layerX;this.offsetY=e.layerY}else{this.offsetX=this.pageX-xPageX(this.target);this.offsetY=this.pageY-xPageY(this.target)}}this.keyCode=e.keyCode||e.which||0;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey;this.altKey=e.altKey;if(typeof e.type=="string"){if(e.type.indexOf("click")!=-1){this.button=0}else{if(e.type.indexOf("mouse")!=-1){this.button=e.button;
/*@cc_on if (e.button & 1) this.button = 0;
      else if (e.button & 4) this.button = 1;
      else if (e.button & 2) this.button = 2; @*/
}}}}function xAddEventListener(d,c,b,a){if(!(d=xGetElementById(d))){return}c=c.toLowerCase();if(d.addEventListener){d.addEventListener(c,b,a||false)}else{if(d.attachEvent){d.attachEvent("on"+c,b)}else{var f=d["on"+c];d["on"+c]=typeof f=="function"?function(e){f(e);b(e)}:b}}}function xCamelize(d){var e,g,b,f;b=d.split("-");f=b[0];for(e=1;e<b.length;++e){g=b[e].charAt(0);f+=b[e].replace(g,g.toUpperCase())}return f}function xClientHeight(){var b=0,c=document,a=window;if((!c.compatMode||c.compatMode=="CSS1Compat")&&c.documentElement&&c.documentElement.clientHeight){b=c.documentElement.clientHeight}else{if(c.body&&c.body.clientHeight){b=c.body.clientHeight}else{if(xDef(a.innerWidth,a.innerHeight,c.width)){b=a.innerHeight;if(c.width>a.innerWidth){b-=16}}}}return b}function xClientWidth(){var b=0,c=document,a=window;if((!c.compatMode||c.compatMode=="CSS1Compat")&&!a.opera&&c.documentElement&&c.documentElement.clientWidth){b=c.documentElement.clientWidth}else{if(c.body&&c.body.clientWidth){b=c.body.clientWidth}else{if(xDef(a.innerWidth,a.innerHeight,c.height)){b=a.innerWidth;if(c.height>a.innerHeight){b-=16}}}}return b}function xDef(){for(var a=0;a<arguments.length;++a){if(typeof(arguments[a])=="undefined"){return false}}return true}function xEachE(){var c,b=arguments,d=b.length-1;for(c=0;c<d;++c){b[d](xGetElementById(b[c]),c)}}function xEachN(g,a,h,b){var c=xGetElementById(g+a);while(c){b(c,a,h);c=xGetElementById(g+(++a))}}function xGetComputedStyle(g,f,c){if(!(g=xGetElementById(g))){return null}var d,a="undefined",b=document.defaultView;if(b&&b.getComputedStyle){d=b.getComputedStyle(g,"");if(d){a=d.getPropertyValue(f)}}else{if(g.currentStyle){a=g.currentStyle[xCamelize(f)]}else{return null}}return c?(parseInt(a)||0):a}function xGetElementById(a){if(typeof(a)=="string"){if(document.getElementById){a=document.getElementById(a)}else{if(document.all){a=document.all[a]}else{a=null}}}return a}function xGetElementsByClassName(l,k,b,h){var g=[],d,j,a;d=new RegExp("(^|\\s)"+l+"(\\s|$)");j=xGetElementsByTagName(b,k);for(a=0;a<j.length;++a){if(d.test(j[a].className)){g[g.length]=j[a];if(h){h(j[a])}}}return g}function xGetElementsByTagName(a,c){var b=null;a=a||"*";c=xGetElementById(c)||document;if(typeof c.getElementsByTagName!="undefined"){b=c.getElementsByTagName(a);if(a=="*"&&(!b||!b.length)){b=c.all}}else{if(a=="*"){b=c.all}else{if(c.all&&c.all.tags){b=c.all.tags(a)}}}return b||[]}function xHasPoint(f,i,g,j,a,h,d){if(!xNum(j)){j=a=h=d=0}else{if(!xNum(a)){a=h=d=j}else{if(!xNum(h)){d=a;h=j}}}var c=xPageX(f),k=xPageY(f);return(i>=c+d&&i<=c+xWidth(f)-a&&g>=k+j&&g<=k+xHeight(f)-h)}function xHeight(g,d){var c,f=0,b=0,a=0,i=0;if(!(g=xGetElementById(g))){return 0}if(xNum(d)){if(d<0){d=0}else{d=Math.round(d)}}else{d=-1}c=xDef(g.style);if(g==document||g.tagName.toLowerCase()=="html"||g.tagName.toLowerCase()=="body"){d=xClientHeight()}else{if(c&&xDef(g.offsetHeight)&&xStr(g.style.height)){if(d>=0){if(document.compatMode=="CSS1Compat"){f=xGetComputedStyle(g,"padding-top",1);if(f!==null){b=xGetComputedStyle(g,"padding-bottom",1);a=xGetComputedStyle(g,"border-top-width",1);i=xGetComputedStyle(g,"border-bottom-width",1)}else{if(xDef(g.offsetHeight,g.style.height)){g.style.height=d+"px";f=g.offsetHeight-d}}}d-=(f+b+a+i);if(isNaN(d)||d<0){return}else{g.style.height=d+"px"}}d=g.offsetHeight}else{if(c&&xDef(g.style.pixelHeight)){if(d>=0){g.style.pixelHeight=d}d=g.style.pixelHeight}}}return d}function xLeft(c,a){if(!(c=xGetElementById(c))){return 0}var b=xDef(c.style);if(b&&xStr(c.style.left)){if(xNum(a)){c.style.left=a+"px"}else{a=parseInt(c.style.left);if(isNaN(a)){a=xGetComputedStyle(c,"left",1)}if(isNaN(a)){a=0}}}else{if(b&&xDef(c.style.pixelLeft)){if(xNum(a)){c.style.pixelLeft=a}else{a=c.style.pixelLeft}}}return a}function xMoveTo(b,a,c){xLeft(b,a);xTop(b,c)}function xNum(){for(var a=0;a<arguments.length;++a){if(isNaN(arguments[a])||typeof(arguments[a])!="number"){return false}}return true}function xOffset(d,a){var b={x:0,y:0};d=xGetElementById(d);a=xGetElementById(a);while(d&&d!=a){b.x+=d.offsetLeft;b.y+=d.offsetTop;d=d.offsetParent}return b}function xOpacity(a,b){var c=xDef(b);if(!(a=xGetElementById(a))){return 2}if(xStr(a.style.opacity)){if(c){a.style.opacity=b+""}else{b=parseFloat(a.style.opacity)}}else{if(xStr(a.style.filter)){if(c){a.style.filter="alpha(opacity="+(100*b)+")"}else{if(a.filters&&a.filters.alpha){b=a.filters.alpha.opacity/100}}}else{if(xStr(a.style.MozOpacity)){if(c){a.style.MozOpacity=b+""}else{b=parseFloat(a.style.MozOpacity)}}else{if(xStr(a.style.KhtmlOpacity)){if(c){a.style.KhtmlOpacity=b+""}else{b=parseFloat(a.style.KhtmlOpacity)}}}}}return isNaN(b)?1:b}function xPageX(b){var a=0;b=xGetElementById(b);while(b){if(xDef(b.offsetLeft)){a+=b.offsetLeft}b=xDef(b.offsetParent)?b.offsetParent:null}return a}function xPageY(a){var b=0;a=xGetElementById(a);while(a){if(xDef(a.offsetTop)){b+=a.offsetTop}a=xDef(a.offsetParent)?a.offsetParent:null}return b}function xPreventDefault(a){if(a&&a.preventDefault){a.preventDefault()}else{if(window.event){window.event.returnValue=false}}}function xRemoveEventListener(d,c,b,a){if(!(d=xGetElementById(d))){return}c=c.toLowerCase();if(d.removeEventListener){d.removeEventListener(c,b,a||false)}else{if(d.detachEvent){d.detachEvent("on"+c,b)}else{d["on"+c]=null}}}function xResizeTo(c,a,b){return{w:xWidth(c,a),h:xHeight(c,b)}}function xScrollLeft(c,b){var a,d=0;if(!xDef(c)||b||c==document||c.tagName.toLowerCase()=="html"||c.tagName.toLowerCase()=="body"){a=window;if(b&&c){a=c}if(a.document.documentElement&&a.document.documentElement.scrollLeft){d=a.document.documentElement.scrollLeft}else{if(a.document.body&&xDef(a.document.body.scrollLeft)){d=a.document.body.scrollLeft}}}else{c=xGetElementById(c);if(c&&xNum(c.scrollLeft)){d=c.scrollLeft}}return d}function xScrollTop(c,b){var a,d=0;if(!xDef(c)||b||c==document||c.tagName.toLowerCase()=="html"||c.tagName.toLowerCase()=="body"){a=window;if(b&&c){a=c}if(a.document.documentElement&&a.document.documentElement.scrollTop){d=a.document.documentElement.scrollTop}else{if(a.document.body&&xDef(a.document.body.scrollTop)){d=a.document.body.scrollTop}}}else{c=xGetElementById(c);if(c&&xNum(c.scrollTop)){d=c.scrollTop}}return d}function xStopPropagation(a){if(a&&a.stopPropagation){a.stopPropagation()}else{if(window.event){window.event.cancelBubble=true}}}function xStr(b){for(var a=0;a<arguments.length;++a){if(typeof(arguments[a])!="string"){return false}}return true}function xStyle(p,v){var i,e;for(i=2;i<arguments.length;++i){e=xGetElementById(arguments[i]);try{e.style[p]=v}catch(ex){
/*@cc_on
@if (@_jscript_version <= 5.7) // IE7 and down
if(p!='display'){continue;}var s='',t=e.tagName.toLowerCase();switch(t){case'table':case'tr':case'td':case'li':s='block';break;case'caption':s='inline';break;}e.style[p]=s;
@end @*/
}}}function xTop(b,c){if(!(b=xGetElementById(b))){return 0}var a=xDef(b.style);if(a&&xStr(b.style.top)){if(xNum(c)){b.style.top=c+"px"}else{c=parseInt(b.style.top);if(isNaN(c)){c=xGetComputedStyle(b,"top",1)}if(isNaN(c)){c=0}}}else{if(a&&xDef(b.style.pixelTop)){if(xNum(c)){b.style.pixelTop=c}else{c=b.style.pixelTop}}}return c}function xWidth(f,a){var c,d=0,h=0,g=0,b=0;if(!(f=xGetElementById(f))){return 0}if(xNum(a)){if(a<0){a=0}else{a=Math.round(a)}}else{a=-1}c=xDef(f.style);if(f==document||f.tagName.toLowerCase()=="html"||f.tagName.toLowerCase()=="body"){a=xClientWidth()}else{if(c&&xDef(f.offsetWidth)&&xStr(f.style.width)){if(a>=0){if(document.compatMode=="CSS1Compat"){d=xGetComputedStyle(f,"padding-left",1);if(d!==null){h=xGetComputedStyle(f,"padding-right",1);g=xGetComputedStyle(f,"border-left-width",1);b=xGetComputedStyle(f,"border-right-width",1)}else{if(xDef(f.offsetWidth,f.style.width)){f.style.width=a+"px";d=f.offsetWidth-a}}}a-=(d+h+g+b);if(isNaN(a)||a<0){return}else{f.style.width=a+"px"}}a=f.offsetWidth}else{if(c&&xDef(f.style.pixelWidth)){if(a>=0){f.style.pixelWidth=a}a=f.style.pixelWidth}}}return a};

// xAnimation r5, Copyright 2006-2010 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
function xAnimation(r)
{
  this.res = r || 10;
}
// Initialize an array of n axis objects.
xAnimation.prototype.axes = function(n)
{
  var j, i = this;
  if (!i.a || i.a.length != n) {
    i.a = [];
    for (j = 0; j < n; ++j) {
      i.a[j] = { i:0, t:0, d:0, v:0 }; // initial value, target value, displacement, instantaneous value
    }
  }
};
// The caller must set the axes' initial and target values before calling init.
xAnimation.prototype.init = function(e,t,or,ot,oe,at,b)
{
  var ai, i = this;
  i.e = xGetElementById(e);
  i.t = t;
  i.or = or; // onRun
  i.ot = ot; // onTarget
  i.oe = oe; // onEnd
  i.at = at || 0; // acceleration type
  i.v = xAnimation.vf[i.at];
  i.qc = 1 + (b || 0); // quarter-cycles
  i.fq = 1 / i.t; // frequency
  if (i.at > 0 && i.at < 4) {
    i.fq *= i.qc * Math.PI;
    if (i.at == 1 || i.at == 2) { i.fq /= 2; }
  }
  // displacements
  for (ai = 0; ai < i.a.length; ++ai) {
    i.a[ai].d = i.a[ai].t - i.a[ai].i;
  }
};
xAnimation.prototype.run = function(r)
{
  var ai, qcm2, rep, i = this;
  if (!r) { i.t1 = new Date().getTime(); }
  if (!i.tmr) i.tmr = setInterval(
    function() {
      i.et = new Date().getTime() - i.t1; // elapsed time
      if (i.et < i.t) {
        // instantaneous values
        i.f = i.v(i.et * i.fq);
        for (ai = 0; ai < i.a.length; ++ai) {
          i.a[ai].v = i.a[ai].d * i.f + i.a[ai].i;
        }
        i.or(i); // call onRun
      }
      else { // target time reached
        clearInterval(i.tmr);
        i.tmr = null;
        qcm2 = i.qc % 2;
        for (ai = 0; ai < i.a.length; ++ai) {
          if (qcm2) { i.a[ai].v = i.a[ai].t; }
          else { i.a[ai].v = i.a[ai].i; }
        }
        i.ot(i); // call onTarget
        // handle onEnd
        rep = false;
        if (typeof i.oe == 'function') { rep = i.oe(i); }
        else if (typeof i.oe == 'string') { rep = eval(i.oe); }
        if (rep) { i.resume(1); }
      }
    }, i.res
  );
};
xAnimation.prototype.pause = function()
{
  clearInterval(this.tmr);
  this.tmr = null;
};
xAnimation.prototype.resume = function(fs)
{
  if (typeof this.tmr != 'undefined' && !this.tmr) {
    this.t1 = new Date().getTime();
    if (!fs) {this.t1 -= this.et;}
    this.run(!fs);
  }
};
// Static array of velocity functions
xAnimation.vf = [
  function(r){return r;},
  function(r){return Math.abs(Math.sin(r));},
  function(r){return 1-Math.abs(Math.cos(r));},
  function(r){return (1-Math.cos(r))/2;},
  function(r) {return (1.0 - Math.exp(-r * 6));}
];
// end xAnimation

// xAnimation.line r3, Copyright 2006-2010 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
xAnimation.prototype.line = function(e,x,y,t,a,b,oe)
{
  var i = this;
  i.axes(2);
  i.a[0].i = xLeft(e); i.a[1].i = xTop(e); // initial position
  i.a[0].t = Math.round(x); i.a[1].t = Math.round(y); // target position
  i.init(e,t,h,h,oe,a,b);
  i.run();
  function h(i) { // onRun and onTarget
    i.e.style.left = Math.round(i.a[0].v) + 'px';
    i.e.style.top = Math.round(i.a[1].v) + 'px';
  }
};

// xAnimation.size r3, Copyright 2006-2010 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
xAnimation.prototype.size = function(e,w,h,t,a,b,oe)
{
  var i = this;
  i.axes(2);
  i.a[0].i = xWidth(e); i.a[1].i = xHeight(e); // initial size
  i.a[0].t = Math.round(w); i.a[1].t = Math.round(h); // target size
  i.init(e,t,o,o,oe,a,b);
  i.run();
  function o(i) { xWidth(i.e, Math.round(i.a[0].v)); xHeight(i.e, Math.round(i.a[1].v)); } // onRun and onTarget
};

// xAnimation.sizeLine r1, Copyright 2009-2010 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
/**
 @param e ID string or object reference of the element to be animated.
 @param s A "sequence" array.
 @param a Acceleration type.
 @param b Number of bounces.
 @param oe onEnd handler. Return true to repeat sequence.
*/
xAnimation.prototype.sizeLine = function(e,s,a,b,oe)
{
  var i = this, si = 0;
  i.axes(4); // axes: x, y, w and h
  prep();
  i.run();
  function h(i) { // onRun and onTarget
    // set position
    i.e.style.left = Math.round(i.a[0].v) + 'px';
    i.e.style.top = Math.round(i.a[1].v) + 'px';
    // set size
    xWidth(i.e, Math.round(i.a[2].v));
    xHeight(i.e, Math.round(i.a[3].v));
  }
  // onEnd handler
  function end(i) {
    if (++si < s.length) {
      prep();
      return true; // start next animation in sequence
    }
    else {
      if (oe && oe(i)) {
        si = 0;
        prep();
        return true; // restart sequence
      }
      return false; // stop
    }
  }
  // prepare for the next animation in the sequence
  function prep() {
    // initial position
    i.a[0].i = xLeft(e);
    i.a[1].i = xTop(e);
    // target position
    i.a[0].t = Math.round(s[si][0]);
    i.a[1].t = Math.round(s[si][1]);
    // initial size
    i.a[2].i = xWidth(e);
    i.a[3].i = xHeight(e);
    // target size
    i.a[2].t = Math.round(s[si][2]);
    i.a[3].t = Math.round(s[si][3]);
    i.init(e,s[si][4],h,h,end,a,b);
  }
};

// xAnimation.opacity r3, Copyright 2006-2010 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
xAnimation.prototype.opacity = function(e,o,t,a,b,oe)
{
  var i = this;
  i.axes(1);
  i.a[0].i = xOpacity(e); i.a[0].t = o; // initial and target opacity
  i.init(e,t,h,h,oe,a,b);
  i.run();
  function h(i) {xOpacity(i.e, i.a[0].v);} // onRun and onTarget
};


