

 var   d  =  window["Spif"] = {
    e:"undefined",
    f:"*",
    g:" ",
    
    h:"none",

    j:"threadStart",
    k:"threadEnd",
    l:"beforeChangeClassName",
    m:"afterChangeClassName",
    n:"beforeHtmlChanged",
    o:"afterHtmlChanged",
    r:"beforeAction",
    t:"afterElementActivation",
    v:"linkExecuteRequest",
    w:  400,
    z:  "loaded",
    B:  "unloaded\\b|\\bloading\\b|\\bloaded",

    C:"load",
    D:"click",
    F:"keydown",
    G:"keypress",
    H:"mousedown",
    I:"mousemove",
    J:"mouseup",

    K:"DXImageTransform.Microsoft.Alpha",

    L:  true,
    M:  false,

    N:"onBefore",
    O:"onFinish",

    P:"-delay",


    Q:(typeof(window.opera) !=  "undefined"),
    R:(navigator.userAgent.indexOf("MSIE") != -1) && !window.opera,
    
    
    S:(navigator.userAgent.indexOf("MSIE") != -1) && !window.opera  && (typeof(XMLHttpRequest) !=  "undefined"),
    T:((navigator.userAgent.indexOf("Gecko") != -1) && (navigator.appVersion.indexOf("AppleWebKit") == -1)),
    U:(navigator.appVersion.indexOf("AppleWebKit") != -1),
    
    V:  document.documentElement,

    W:  function(X)
   {
      if  (d.Y)
        for  (var   Z   in   d)
          if  (d[Z] ==  X)
 
 
            d.Y.aa(X,  "Spif."  +  Z);
 
      if  (X.ba)
        X.ba();
   }
};

 d["isIE"] =  d.R;
 d["isIE7"] =  d.S;
 d["isOpera"] =  d.Q;
 d["isGecko"] =  d.T;
 d["isSafari"] =  d.U;
 d["DEFAULTMORPHDURATION"] =  d.w;
 d["SUPPRESSEVENTS"] =  d.L;
 d["FIREEVENTS"] =  d.M;
 d.ca  = {
    da:"Q42",
    get:  function(name,  defaultValue)
   {
      var   ea  =  this.fa();

      return   ea[name] ||  null;
   },
    ga:  function(name,  value)
   {
      var   ea  =  this.fa();

      delete   ea[name];

      if  (value  !=  null)
        ea[name] =  value;

      this.ha(ea);
   },
    remove:  function(name)
   {
      var   ea  =  this.fa();

      delete   ea[name];

      this.ha(ea);
   },
    fa:  function()
   {
      var   c  =  document.cookie  +  "|;";
      var   ia  =  c.indexOf(this.da  +  "=");

      if  (ia  == -1)
        return  {};

      var   ja  =  c.indexOf("|;",  ia);

      var   ka  =  c.substring(ia  +  this.da.length  +  1,  ja).split("|");

      var   ea  = {};
      for  (var   i=0;  i<ka.length;  i++)
     {
        var   la  =  ka[i].split(":");
        ea[la[0]] =  unescape(la[1]);
     }
      
      return   ea;
   },
    ha:  function(ea)
   {
      var   s  =  "";
      for  (var   ma   in   ea)
        if  (ma)
          s  +=  ma  +  ":"  +  escape(ea[ma]) +  "|";

      var   na  =  new   Date();
      na.setFullYear(na.getFullYear()+1);

      var   c  =  this.da  +  "="  +  s  +  "; expires="  +  na.toGMTString() +  "; path=/;";

 
      document.cookie  =  c;
   }
};

 d["Cookies"] =  d.ca;
 d.ca["get"] =  d.ca.get;
 d.ca["set"] =  d.ca.ga;
 d.ca["remove"] =  d.ca.remove;
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 d.oa  = {
    pa:  function(qa,  delay,  X,  ra)
   {
      if  (delay  >=  0)
        return   setTimeout(this.sa(qa,  X,  ra),  delay);
      else 
     {
        qa.apply(X  ||  window,  ra  || []);
        return   null;
     }
   },
    ta:  function(qa,  ua,  X,  ra)
   {
      var   va  =  this.sa(qa,  X,  ra);
      va();
      return   setInterval(va,  ua);
   },

    sa:  function(qa,  X,  ra)
   {
      return   function()
     {
        d.wa.xa(d.j,  null,  null);
        qa.apply(X  ||  window,  ra  || []);
        d.wa.xa(d.k,  null,  null);
     };
   },

    ya:  function(za,  Aa,  Ba,  Ca,  Da)
   {
      var   Ea  = {};
      Ea.Fa  =  d.Ga.Ha(za,  Aa);
      if  (Ea.Fa)
     {
        Ea.Ia  =  d.Ja.Ka(Ea.Fa,  Aa,  Ca);
        Ea.object  =  d.Ga.Ha(Ea.Fa,  Ba);
        if  (Ea.object)
          Ea.La  =  d.Ja.Ka(Ea.object,  Ba,  Da);
     }
      return   Ea;
   },
    Ma:  function(s,  Na)
   {
      return   s?Function("a",  "b",  "c",  "d",  "e",  "return "  +  s  +  "(a, b, c, d, e);"):Na;
   },
    Oa:  function(za,  Pa,  Qa,  Ra,  Sa)
   {
      return   this.Ta(za,  Pa,  Qa,  Ra,  Sa).Ua[0];
   },
    Va:  function(za,  Pa,  Qa,  Ra,  Sa)
   {
      return   this.Ta(za,  Pa,  Qa,  Ra,  Sa).Ua;
   },
    Ta:  function(za,  Pa,  Qa,  Ra,  Sa)
   {
      var   Wa  = {
        Ua:[],
        za:null 
     };
      var   Xa;
      do 
     {
        if  (!(Xa  =  d.Ja.match(za,  Pa  +  "-[\\w-]+")))
          za  =  za.parentNode;
     }
      while  (!Xa  && !Ra  &&  za  &&  za.nodeType  ==  1);

      if  (Xa)
        for  (var   i=0;  i<Xa.length;  i++)
       {
          var   s  =  Xa[i].substring(Pa.length+1);
          if  (!Sa  || !Sa[s])
         {
            Wa.Ua.push(s);
            Wa.za  =  za;
         }
       }

      if  ((Qa  !=  null) && (Wa.Ua.length  ==  0))
        Wa.Ua[0] =  Qa;
      return   Wa;
   },
    Ya:  function(za,  Za,  _b,  Ra)
   {
      var   Xa;
      do 
     {
        Xa  =  d.Ja.match(za,  Za  +  "-?\\d+");
        za  =  za.parentNode;
     }
      while  (!Ra  &&  za  &&  za.nodeType  ==  1  && !Xa);
      return  (Xa?parseInt(Xa[0].substring(Za.length)):_b);
   },
    ab:  function(a)
   {
      var   bb  = {};
      for  (var   i=0;  i<a.length;  i++)
        bb[a[i]] =  i;
      return   bb;
   },
    cb:  function(za,  Z,  db)
   {
      var   eb  =  za.fb;
      if  (!eb)
        eb  =  za.fb  = {};

      eb[Z] =  db;
   },
    gb:  function(za,  Z)
   {
      var   eb  =  za.fb;
      if  (!eb)
        return   null;
      else 
        return   eb[Z];
   }
};

 d.oa.platform  = (d.S?"ie ie7":(d.R?"ie ie6":(d.T?"gecko":(d.Q?"opera":(d.U?"safari":"unknown")))));



 if  (!Array.prototype.push)
{
    Array.prototype.push  =  function()
   {
      for  (var   i=0;  i<arguments.length;  i++)
        this[this.length] =  arguments[i];
   };
}

 if  (!Function.prototype.apply)
{
    Function.prototype.apply  =  function(X,  ra)
   {
      X.hb  =  this;
      var   ib  =  X.hb(ra[0],  ra[1],  ra[2],  ra[3],  ra[4]);
      X.hb  =  null;
      return   ib;
   }
}

 d.W(d.oa);

 d["Utils"] =  d.oa;
 d.oa["setTimeoutHandler"] =  d.oa.pa;
 d.oa["setIntervalHandler"] =  d.oa.ta;
 d.Ga  = {
    jb:  1,
    kb:{},

    lb:  function(za)
   {
      if  (!za.id)
     {
        var   id  =  "qid_"  +  this.jb++;
        za.id  =  id;
        this.kb[id] =  true;
     }

      return   za.id;
   },

    mb:  function(za)
   {
      var   nb  = [];

      if  (za.id  && !this.kb[za.id])
        nb[0] =  za;

      var   ob  =  za.getElementsByTagName(d.f);
      var   pb  =  ob.length;
      for  (var   i=0;  i<pb;  i++)
     {
        var   za  =  ob[i];
        if  (za.id  && !this.kb[za.id])
          nb[nb.length] =  za;
     }

      return   nb;
   },
    Ha:  function(za,  qb,  rb)
   {
      while  (za  &&  za.nodeType  ==  1)
     {
        if  (d.Ja.contains(za,  qb))
          return   za;

        za  =  za.parentNode;
        if  (rb  &&  za  &&  d.Ja.contains(za,  rb))
          return   null;
     }
   },
    sb:  function(za,  qb)
   {
      var   tb  =  za.getElementsByTagName("*");
      var   ub  =  tb.length;
      for  (var   i=0;  i<ub;  i++)
        if  (d.Ja.contains(tb[i],  qb))
          return   tb[i];
   },
    getElementsByTagName:  function(za,  tagName)
   {
      var   vb  = [];
      var   wb  =  za.getElementsByTagName(tagName);
      var   xb  =  wb.length;
      for  (var   i=0;  i<xb;  i++)
        vb.push(wb[i]);

      return   vb;
   },
    getBoxObjectFor:  function(za)
   {
      if  (d.R)
     {
        var   yb  =  za.getBoundingClientRect();
        return  {
          x:  yb.left,
          y:  yb.top,
          width:  yb.right  -  yb.left,
          height:  yb.bottom  -  yb.top 
       };
     }
      else   if  (d.T)
        return   za.ownerDocument.getBoxObjectFor(za);
      else   if  (d.Q)
     {
 zb("TO DO!!!");
        Ab  = {
          y:za.offsetTop,
          height:Bb.offsetHeight 
       };
     }
   },

    Cb:  function(za)
   {
      var   value  =  za.value;
      switch  (za.nodeName)
     {
        case   "SELECT":
          value  =  za.options[za.selectedIndex].value;
          break;
        case   "INPUT":
          switch  (za.type)
         {
            case   "checkbox":
              value  =  za.checked;
              break;
         }
          break;
     }
      
      return   value;
   },

    Db:  function(Eb,  Fb)
   {
      if  (d.R)
        return   Eb.contains(Fb);

      while  (Fb)
     {
        if  (Eb  ==  Fb)
          return   true;
        else 
          Fb  =  Fb.parentNode;
     }

      return   false;
   },
    Gb:  function(Hb,  Ib)
   {
      if  (!Hb  || !Ib  ||  Hb  ==  Ib)
        return   Hb  ||  Ib;

      while  (Hb)
     {
        if  (this.Db(Hb,  Ib))
          return   Hb;
        Hb  =  Hb.parentNode;
     }
   },
    Jb:  function(za)
   {
      if  (d.R)
        return   za.style.cssText;
      else 
        return   za.getAttribute("style");
   },
    Kb:  function(za,  s)
   {
      if  (d.R)
        za.style.cssText  =  s;
      else 
        za.setAttribute("style",  s);
   }
};

 d.W(d.Ga);

 d["HtmlDomUtils"] =  d.Ga;
 d.Ga["acquireIdForHtmlElement"] =  d.Ga.lb;
 
 d.Ga["getAncestorWithClassName"] =  d.Ga.Ha;



























































 d.Ja = {
   Lb: /\s+/,

   Mb: {},
   Nb: {},
   Ob: function(qb, Pb, ua) {
     this.Nb[qb] = {
       Pb: Pb,
       Qb: "(\\b" + Pb.join("-" + qb) + "-" + qb + "\\b|\\b" + qb + "\\b)",
       ua: ua || 1.1 * d.w
     };
   },

   contains: function(za, qb) {
     return this.Rb(za.className, qb);
   },
   Rb: function(s, qb) {

     return !!(s && s.match(this.Sb(qb)));
   },
   match: function(za, qb) {
   if (za.className)
     return za.className.match(this.Sb(qb));
   },
   add: function(za, Tb, Ub) {
     if (!this.contains(za, Tb))
       if (this.Nb[Tb])
       this.Vb(za, null, Tb, 0, Ub);
     else {
       var Wb = za.className;
       var Xb = Wb + d.g + Tb;
       this.Yb(za, Wb, Xb, Ub);
     }
   },
   replace: function(za, Zb, Tb, Ub, _c) {
     if (this.contains(za, Zb)) {
       if (this.Nb[Zb])
         Zb = this.Nb[Zb].Qb;

       if (!_c && this.Nb[Tb])
         this.Vb(za, Zb, Tb, 0, Ub);
       else
         this.Yb(za, za.className, this.ac(za.className, Zb, Tb), Ub);
     }
     else
       this.add(za, Tb, Ub);
   },
   ac: function(s, bc, cc) {
     var dc = s.replace(this.Sb(bc), cc);
     if (!dc.match(this.Sb(cc)))
       dc += d.g + cc;

     return dc;
   },
   ec: function(za, qb, fc, Ub) {
     if (fc)
       this.add(za, qb, Ub);
     else
       this.remove(za, qb, Ub);
   },
   gc: function(za, hc, ic, Ub, _c) {
     var jc = this.contains(za, hc);
     this.replace(za, (jc ? hc : ic), (jc ? ic : hc), Ub, _c);
   },
   remove: function(za, Zb, Ub) {
     if (this.Nb[Zb])
       Zb = this.Nb[Zb].Qb;

     this.Yb(za, za.className, za.className.replace(this.Sb(Zb), ""), Ub);
   },
   ga: function(za, Xb, Ub) {
     this.Yb(za, za.className, Xb, Ub);

     var qb;
     var kc = Xb.split(this.Lb);
     for (var i = 0; i < kc.length; i++, qb = kc[i])
       if (this.Nb[qb]) {
       this.Vb(za, qb, qb, 0, Ub);
       return;
     }
   },

   lc: new RegExp("(-[^_-]+)|(_-\\d+)|(_\\w+)", "g"),
   mc: {
     "delay": "int",
     "delayOn": "int",
     "delayOff": "int",
     "duration": "int",
     "delta": "int",
     "max": "int",
     "interval": "int",
     "step": "int",
     "onBefore": "function",
     "onFinish": "function",
     "props": "array",
     "classes": "array",
     "limitmorphto": "array",
     "replace": "array",
     "target": "array"
   },
   Ka: function(za, nc, oc) {
     var pc = null;
     var qc = this.Sb(nc + "\\b-?([\\w\\-\\_]*)\\b");

     if (!za.className)
       return;
       
     var matches = za.className.match(qc);
     if (matches) {
       pc = {};
       if (oc)
         for (var ma in oc)
         pc[ma] = oc[ma];

       pc.rc = matches[0].split("-")[0];

       for (var sc = 0; sc < matches.length; sc++) {
         var ea = matches[sc].match(this.lc);
         if (ea)
           for (var i = 0; i < ea.length; i++) {
           var Z = ea[i].substring(1);
           if (i < ea.length - 1 && ea[i + 1].charAt(0) == "_") {
             var db = ea[i++ + 1].substring(1);
             switch (this.mc[Z]) {
               case "function":
                 db = d.oa.Ma(db);
                 break;
               case "int":
                 db = parseInt(db);
                 break;
               case "array":
                 db = db.split("_");
                 break;
             }
             pc[Z] = db;
             if (!pc.action)
               pc.action = Z;
           }
           else {
             pc[Z] = true;
             pc.action = Z;
           }
         }
       }
     }

     return pc;
   },



   tc: null,
   uc: function() {
     this.tc = {
       vc: null,
       setData: []
     };
   },

   wc: function() {
     var xc = this.tc;

     this.tc = null;

     if (xc.setData.length > 0) {
       var yc = this.zc(xc.Ac, xc.vc.className, false);

       d.wa.xa(d.l, xc.vc, yc);

       for (var i = 0; i < xc.setData.length; i++) {
         var Bc = xc.setData[i];
         this.Yb(Bc.za, Bc.Wb, Bc.Xb, d.M, true);
       }

       d.wa.xa(d.m, xc.vc, yc);
     }
   },

   Cc: function(za, pc) {
     for (var name in pc)
       switch (name) {
       case "add":
         this.add(za, pc[name]);
         break;
       case "remove":
         this.remove(za, pc[name]);
         break;
       case "replace":
         this.replace(za, pc[name][0], pc[name][1]);
         break;
       case "set":
         this.ga(za, pc[name]);
         break;
       case "empty":
         this.ga(za, "");
         break;
     }
   },
   Sb: function(qb) {
     return this.Mb[qb] || (this.Mb[qb] = new RegExp("(?:^|\\b)" + qb + "(?:\\b|$)", "g"));
   },
   Yb: function(za, Wb, Xb, Ub, Dc) {
     Xb = Xb.replace(/^\s+|\s+$/g, "");
     if (Xb != Wb) {
       if (this.tc) {
         var Ec = d.Ga.Gb(this.tc.vc, za);
         if (Ec != this.tc.vc) {
           this.tc.vc = Ec;
           this.tc.Ac = Ec.className;
         }

         this.tc.setData.push(
           {
             za: za,
             Wb: Wb,
             Xb: Xb
           }
         );
       }
       else {
         if (!Ub) {
           var Fc = this.zc(Wb, Xb, Dc);
           d.wa.xa(d.l, za, Fc);
         }
         za.className = Xb;
         if (!Ub)
           d.wa.xa(d.m, za, Fc);

         if (d.R) {




           if (za.getAttribute("tabIndex", 2) == 0) {
             za.tabIndex = -1;
             setTimeout(function() { za.tabIndex = 0; }, 0);
           }
         }
       }
     }
   },
   Vb: function(za, Zb, qb, Gc, Ub) {
     var data = this.Nb[qb];
     var Pb = data.Pb;

     var Tb = Pb[Gc] + "-" + qb;

     d.oa.cb(za, d.w, data.ua);

     if (Zb && this.contains(za, Zb))
       this.replace(za, Zb, Tb, Ub, true);
     else
       this.add(za, Tb, Ub, true);

     var Hc = this;
     if (Gc < Pb.length - 1)
       d.oa.pa(function() { Hc.Vb(za, Tb, qb, Gc + 1, Ub); }, data.ua);
     else
       d.oa.pa(function() { if (Hc.contains(za, Tb)) Hc.replace(za, Tb, qb, Ub, true); }, data.ua);
   },

   zc: function(Wb, Xb, Dc) {
     var Ic = Wb.split(this.Lb);
     var Jc = Xb.split(this.Lb);

     var Kc = {};
     for (var i = 0; i < Ic.length; i++) {
       Kc[Ic[i]] = 1;

       var Lc = Ic[i].split(/[-_]/);
       for (var Mc = 0; Mc < Lc.length; Mc++)
         Kc[Lc[Mc]] = 1;
     }

     var addCNs = [];
     for (var i = 0; i < Jc.length; i++) {
       if (!Kc[Jc[i]])
         addCNs.push(Jc[i]);
       var Nc = Jc[i].split(/[-_]/);
       for (var Mc = 0; Mc < Nc.length; Mc++)
         if (!Kc[Nc[Mc]])
         addCNs.push(Nc[Mc]);
     }


     var delCNs = [];
     for (var i = 0; i < Ic.length; i++)
       if (!addCNs[Ic[i]])
       delCNs.push(Ic[i]);

     return { fromValue: Wb, toValue: Xb, delCNs: delCNs, addCNs: addCNs, Dc: Dc };
   }
 };

 d.W(d.Ja);

 d["ClassNameAbstraction"] =  d.Ja;
 d.Ja["addClassNameSequence"] =  d.Ja.Ob;
 d.Ja["contains"] =  d.Ja.contains;
 d.Ja["add"] =  d.Ja.add;
 d.Ja["replace"] =  d.Ja.replace;
 d.Ja["swap"] =  d.Ja.gc;
 d.Ja["toggle"] =  d.Ja.ec;
 d.Ja["remove"] =  d.Ja.remove;
 d.Ja["set"] =  d.Ja.ga;
 
 
 

 
 
 
 
 
 
 
 
 

 
 
 

 
 
 
 
 
 
 

 d.Oc  = {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

    Pc:  false,
    Qc: {},
    Rc:{},
    
    Sc:  function(Tc,  Uc,  qa,  X)
   {
      var   Vc  = {qa:qa,  X:X};
      var   Wc  =  d.Ga.lb(Tc) +  "-"  +  Uc;

      var   Xc  =  this.Qc[Wc];
      if  (this.Rc[Wc] ==  Tc  &&  Xc)
        Xc.push(Vc);
      else 
     {
        this.Rc[Wc] =  Tc;
        Xc  =  this.Qc[Wc] = [Vc];

        var   va  =  function(Yc)
       {
          
          
          
          
          if  ((typeof(d) !=  "undefined") && (!d.T  ||  document.defaultView))
         {
 

            
            d.wa.xa(d.j,  Yc);

            Yc  =  d.Oc.Zc(Yc);

            
            
            if  (Yc.type  ==  d.D  &&  d.T  &&  Yc._d)
              return   false;

            var   ib  =  false;

            var   ra  = [Yc,  Tc];
            for  (var   i=0;  i<Xc.length;  i++)
              ib  =  Xc[i].qa.apply(Xc[i].X  ||  Tc,  ra) &&  ib;

            if  (Yc.ad  ==  true)
              d.Oc.bd(Yc);

            
            d.wa.xa(d.k,  Yc);

            return   ib;
         }
       };
        if  (d.Y)
       {
          var   X  = {  cd:va  };
          d.Y.ed(X,  "eventHandler",  "Spif.DOMEvents."  +  Uc);
          va  =  X.cd;
       }

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

        if  (Tc.addEventListener)
          Tc.addEventListener(Uc,  va,  false);
        else 
       {
          if  (Uc  ==  "DOMMouseScroll")
            Uc  =  "mousewheel";
          Tc.attachEvent("on"  +  Uc,  va);
       }
     }
   },

    fd:  function()
   {
      this.ad  =  true;
   },
    bd:  function(Yc)
   {
      Yc.preventDefault();
      Yc.stopPropagation();

      if  (d.U  &&  this.type  ==  d.D)
     {
        var   za  =  Yc.subject;
        while  (za  &&  za.nodeName  !=  "A")
          za  =  za.parentNode;

        if  (za)
       {
          za.gd  =  za.href;
          za.href  =  "javascript://";
          setTimeout(function(){  za.href  =  za.gd; },  10);
       }
     }
   },
    hd:  function()
   {
      this.returnValue  =  false;
   },
    jd:  function()
   {
      this.cancelBubble  =  true;
   },

    Zc:  function(Yc)
   {
 
      if  (d.R)
     {
        Yc.subject  =  Yc.srcElement;
        Yc.preventDefault   =  this.hd;
        Yc.stopPropagation  =  this.jd;
     }
      else 
     {
        Yc.subject  =  Yc.target  ||  Yc.currentTarget;
        if  (Yc.subject  &&  Yc.subject.nodeType  ==  3)
          Yc.subject  =  Yc.subject.parentNode;
     }

      Yc.cancel  =  this.fd;

      switch  (Yc.type)
     {
        case   d.D:
        case   "mousedown":
        case   "mouseup":
        case   "mousemove":
          Yc.kd   = (d.R||d.U?Yc.button  ==  1:Yc.button  ==  0);
          Yc._d  =  Yc.button  ==  2;
          break;
        case   d.F:
        case   "keyup":
        case   d.G:
          if  (d.R  &&  Yc.subject.isContentEditable)
         {
            var   ld  =  document.selection.createRange();
            if  (ld.length)
              Yc.subject  =  ld.item(0);
            else 
              Yc.subject  =  ld.parentElement();
         }

          if  (d.T  &&  Yc.subject  ==  document.documentElement)
            
            
            Yc.subject  =  document.body;
          break;
        case   "mousewheel":
          if  (d.R)
            Yc.detail  = -Yc.wheelDelta/20;
          break;
     }

      return   Yc;
   }
};

 d["DOMEvents"] =  d.Oc;
 d.Oc["attach"] =  d.Oc.Sc;
 d.wa  = {
    md: {},
    nd:  function(Uc,  qa,  X)
   {
      var   od  =  this.md[Uc] =  this.md[Uc] || [];

      od[od.length] = {qa:qa,  X:X};
   },
    xa:  function(Uc,  subject,  ea)
   {
      var   ib  =  true;

      var   od  =  this.md[Uc];
      if  (od)
     {
        var   Yc  =  ea  || {};
        Yc.type  =  Uc;
        Yc.subject  =  subject;

        for  (var   i=od.length-1;  i>=0;  i--)
          ib  = (od[i].qa.apply(od[i].X  ||  subject, [Yc]) !=  false) &&  ib;
     }
    
      return   ib;
   }
};

 d["CustomEvents"] =  d.wa;
 d.wa["listen"] =  d.wa.nd;
 d.wa["fire"] =  d.wa.xa;
 
 
 
 
 
 
 
 
 


 d.pd  = {
    ba:  function()
   {
      d.wa.nd(d.m,  this.qd,  this);
      d.wa.nd(d.o,  this.rd,  this);
      d.Oc.Sc(document.documentElement,  "DOMMouseScroll",    this.sd,  this);
   },
    qd:  function(Yc)
   {
      if  (Yc.addCNs.length  >  0  &&  d.wa.xa(d.r,  Yc.subject))
        this.ud(Yc.subject,  Yc.addCNs);
   },
    rd:  function(Yc)
   {
      if  (d.wa.xa(d.r,  Yc.subject))
        this.ud(Yc.subject, [d.C]);
   },
    ud:  function(vd,  wd,  context)
   {
      var   xd  =  false;

      
      for  (var   i=0;  i<wd.length;  i++)
        d.wa.xa("on"  +  wd[i],  vd);

      var   yd  =  "\\bon"  +  wd.join("\\b|\\bon") +  "\\b";
      for  (var   zd  =  vd.firstChild;  zd;  zd  =  zd.nextSibling)
        if  (zd.nodeName  ==  "A"  &&  d.Ja.contains(zd,  yd))
       {
          d.wa.xa(d.v,  zd, {  context:context  });
          xd  =  true;
       }

      return   xd;
   },
    sd:  function(Yc)
   {
      var   Ad  =  false;
      var   Uc  = ["mousescroll"  + (Yc.detail>0?"down":"up")];
      for  (var   za  =  Yc.subject;  za;  za  =  za.parentNode)
        Ad  =  Ad  ||  this.ud(za,  Uc,  null);

      if  (Ad)
        Yc.cancel();
   }
};

 d.W(d.pd);
 
 
 
 
 
 
 
 
 
 
 
 
 

 d.Bd  = {
    Cd:[],
    Dd:  null,
    Ed:{},
    Fd:{},
    Gd:  null,
    Hd:  null,
    Id:  false,
    ba:  function()
   {
      d.Oc.Sc(document.documentElement,  d.D,    this.Jd,  this);

      
      
      
      d.Oc.Sc(document.documentElement, (d.R?d.F:d.G),  this.Jd,  this);
   },
    Kd:  function(qb,  qa,  X)
   {
      this.Ld(qb,  qa,  X,  true);
   },
    Md:  function(qb,  qa,  X)
   {
      this.Ld(qb,  qa,  X,  false);
      this.Id  =  true;
   },
    Ld:  function(qb,  qa,  X,  Nd)
   {
      this.Cd[this.Cd.length] =  qb;
      this.Ed[qb] = {  qa:qa,  X:X  };
      this.Fd[qb] =  Nd;

      this.Cd  =  this.Cd.sort().reverse();

      this.Dd  =  new   RegExp("(\\b"  +  this.Cd.join("\\b)|(\\b") +  "\\b)|(\\b[\\w\\-]+\\b|\\s+)",  "g");
   },
    Jd:  function(Yc)
   {
      this.Hd  = (Yc.type  ==  d.D  ||  Yc.keyCode  ==  13  ||  Yc.keyCode  ==  32);

      if  (!this.Id  && !this.Hd)
        return;

      this.Gd  =  Yc;
      var   ob  = [];

      for  (var   za  =  Yc.subject;  za  &&  za.nodeType  ==  1;  za  =  za.parentNode)
        ob[ob.length] =  za;

      for  (var   i=0;  i<ob.length;  i++)
     {
        this.Od  =  ob[i];
        if  (this.Od.className)
          this.Od.className.replace(this.Dd,  this.Pd);
     }
   },
    Pd:  function()
   {
      if  (!arguments[arguments.length-3])
     {
        var   Hc  =  d.Bd;
        for  (var   i=1;  i<arguments.length-3;  i++)
          if  (arguments[i])
         {
            var   qb  =  Hc.Cd[i-1];
            if  (Hc.Hd  || !Hc.Fd[qb])
           {
              if  (d.wa.xa(d.r,  Hc.Od))
             {
                var   qa  =  Hc.Ed[qb];
                qa.qa.apply(qa.X  ||  Hc.Od, [Hc.Od,  arguments[i],  Hc.Gd]);
             }
              return;
           }
         }
     }
   }
};

 d.W(d.Bd);
 
 
 


 d.Qd  = {
    Rd:[],
    Sd:"",
    Td:{},
    Ud:{},
    Vd:[],

    ba:  function()
   {
      d.Oc.Sc(document.documentElement,  d.D,      this.Wd,  this);
      d.Oc.Sc(document.documentElement,  "dblclick",      this.Wd,  this);
      d.Oc.Sc(document.documentElement,  "keyup",   this.Xd,  this);
      d.wa.nd(d.v,  this.Yd,  this);
   },
    Zd:  function(_e,  X)
   {
      this.Vd.push({qa:_e,  X:X});
   },
    ae:  function(be,  ce,  _e,  X)
   {
      var   de  =  "("  +  ce.join("|") +  ")";
      for  (var   i=0;  i<be.length;  i++)
     {
        var   nc  =  be[i];
        this.Rd[this.Rd.length] =  nc;
        this.Td[nc] =  de;
        this.Ud[nc] = {  qa:_e,  X:X};
     }

      this.Sd  =  "(\\b"  +  this.Rd.join("\\b|\\b") +  "\\b)";
   },
    Wd:  function(Yc)
   {
      this.Yd(Yc);
   },
    Xd:  function(Yc)
   {
      if  (Yc.keyCode  ==  32  ||  Yc.keyCode  ==  13)
        this.Yd(Yc);
   },
    Yd:  function(Yc)
   {
 
      var   be;
      var   za  =  Yc.subject;

      
      while  (za  &&  za.nodeType  ==  1)
     {
        
        
        if  (Yc.type  ==  d.G  &&  za.nodeName  ==  "A")
          return;

        if  ((be  =  d.Ja.match(za,  this.Sd)) &&  d.wa.xa(d.r,  za))
       {
          var   ee  = {};

          for  (var   i=0;  i<be.length;  i++)
         {
            var   nc  =  be[i];
            if  (nc  && !ee[nc])
           {
              var   fe  =  d.Ja.Ka(za,  nc);
              if  (
               (!fe["require"] ||  d.Ga.Ha(za,  fe["require"]))
               &&
               (!fe["disallow"] || !d.Ga.Ha(za,  fe["disallow"]))
             )
             {
                var   ge  =  this.he(za,  nc,  Yc.context);
                if  (!ge  || !ge.za  || !d.wa.xa(d.r,  ge.za))
                  continue;

                var   ie  =  d.Ja.Ka(ge.za,  ge.je);
                if  (
                  ie 
                 &&
                 (!ie["require"] ||  d.Ga.Ha(za,  ie["require"]))
                 &&
                 (!ie["disallow"] || !d.Ga.Ha(za,  ie["disallow"]))
               )
                  ee[nc] = {
                    ke:  this.Ud[nc],
                    ge:  ge,
                    fe:  fe,
                    ie:  ie 
                 };
           }
           }
         }

          for  (nc   in   ee)
         {
            var   le  =  ee[nc];
            d.oa.pa(this.me(Yc,  za,  nc,  le),  1*le.fe.delay||-1);
         }
       }

        if  (za.nodeName  ==  "A")
       {
          for  (var   i=0;  i<this.Vd.length;  i++)
         {
            var   qa  =  this.Vd[i];
            qa.qa.apply(qa.X  ||  za, [za,  Yc]);
         }
          
          
          if  (Yc.cancel  &&  be  &&  be.length  >  0  &&  za.getAttribute("href",  2).charAt(0) ==  "#")
            Yc.cancel();
       }

        za  =  za.parentNode;
     }
   },

    me:  function(Yc,  za,  nc,  le)
   {
      return   function()
     {
        le.ke.qa.apply(le.ke.X  ||  za, [za,  nc,  le.ge.za,  le.ge.je,  Yc,  le.fe,  le.ie]);
     };
   },

    he:  function(ne,  nc,  context)
   {
      var   oe  =  this.pe(ne,  nc,  context);

      if  (oe)
     {
        var   qe  =  d.Ja.match(oe,  this.Td[nc]);
        return  {  za:oe,  je:(qe?qe[0]:null) };
     }
   },
    pe:  function(ne,  nc,  context)
   {
      var   re  =  ne.href;
      if  (re)
        var   se  =  re.split("#")[1];
      
      if  (se)
        return   document.getElementById(se);

      
      for  (var   za  =  context  ||  ne;  za  !=  document.documentElement;  za  =  za.parentNode)
        if  (d.Ja.match(za,  this.Td[nc]))
          return   za;
   }
};

 d.W(d.Qd);
 
 
 
 
 
 
 
 
 
 
 

 d.wa.nd(
    d.r,
    function(Yc)
   {
      return  !d.Ga.Ha(Yc.subject,  "(^|\\s)disabled(\\s|$)");
   }
);
(function(){
 d.te  = {
    ue:"exclusive-",
    ve:"(allexclusive-|exclusive-)",
    we:"delayexclusive",
    xe:"exclusive-reset",

    ye:1,
    ze:{},
    Ae:{},
    Be:{},
    Ce:{},
    De:{},
    Ee:{},
    Fe:{},
    Ge: {},

    ba:  function()
   {
      d.wa.nd(d.j,  this.He,  this);
      d.wa.nd(d.m,  this.qd,  this);
   },

    Ie:  function(be,  Je,  Ke,  Le)
   {
      var   id  =  this.ye++;
      var   Me  =  Je[Je.length  -  1];
      for  (var   i=0;  i<be.length;  i++)
     {
        var   nc  =  be[i];
        var   Ne  =  Je[i];

        this.Be[Me] =  Ne;
        this.Ce[Ne] =  Me;

        Me  =  Ne;

        this.ze[nc] =  Ne;
        this.Ae[Ne] =  nc;
        this.De[nc] =  id;
     }

      if  (Ke)
     {
        for  (var   i=0;  i<Ke.length;  i++)
       {
          be[be.length] =  Ke[i];
          this.Ee[Ke[i]] =  true;
          this.ze[Ke[i]] =  Je[0];
       }
     }
      if  (Le)
     {
        for  (var   i=0;  i<Le.length;  i++)
       {
          be[be.length] =  Le[i];
          this.Fe[Le[i]] =  true;
          this.ze[Le[i]] =  Je[0];
       }
     }

      d.Qd.ae(be,  Je,  this.Oe,  this);
   },

    He:  function()
   {
      this.Ge  = {};
   },
    qd:  function(Yc)
   {
      var   Pe  = [];

      for  (var   i=0;  i<Yc.addCNs.length;  i++)
        this.Qe(Yc.subject,  Yc.addCNs[i],  Pe);

      for  (var   i=Pe.length-1;  i>=0;  i--)
        this.Re(Pe[i]);
   },
    Oe:  function(ne,  nc,  oe,  Se)
   {
      var   Pe  = [];
      this.Te(Pe,  nc,  oe,  Se);

      d.Ja.uc();
      for  (var   i=Pe.length-1;  i>=0;  i--)
        this.Re(Pe[i]);
      d.Ja.wc();
   },     
    Te:  function(Pe,  nc,  oe,  Se)
   {
      var   Ue  =  this.ze[nc];

      if  (this.Ee[nc])
     {
        Ue  =  this.Be[Se];
        nc  =  this.Ae[Ue];
     }
      else   if  (this.Fe[nc])
     {
        Ue  =  this.Ce[Se];
        nc  =  this.Ae[Ue];
     }

      if  (!d.Ja.contains(oe,  Ue))
     {
        Pe[Pe.length] = {
          nc:nc,
          oe:oe,
          Ve:Se,
          Ue:Ue,
          delay:-1 
       };

        this.Qe(oe,  Ue,  Pe);
     }
   },

    Qe:  function(oe,  Ue,  Pe)
   {
      var   We,  Xe;
      
      if  (We  =  d.Ga.Ha(oe,  this.ve  +  Ue,  this.xe))
        if  (d.Ja.contains(We,  this.ue  +  Ue))
          Xe  =  oe.parentNode.childNodes;
        else 
          Xe  =  d.Ga.getElementsByTagName(We,  d.f);
      
      if  (Xe)
     {
        var   Ye  =  this.Be[Ue];
        var   Ze  =  this.Ae[Ye];

        var   _f  =  Xe.length;
        for  (var   i=0;  i<_f;  i++)
       {
          var   af  =  Xe[i];

          if  (af.nodeType  ==  1  &&  af  !=  oe  &&  d.Ja.contains(af,  Ue))
            if  (d.wa.xa(d.r,  af))
           {
              if  (Pe.length  >  0  &&  Pe[Pe.length-1].delay  == -1)
                Pe[Pe.length-1].delay  =  d.oa.Ya(oe.parentNode,  this.we, -1);

              this.Te(Pe,  Ze,  af,  Ue);
           }
       }
     }
   },
    
    Re:  function(bf)
   {
      var   cf  =  d.Ga.lb(bf.oe) +  "-"  +  this.De[bf.nc];
      if  (!this.Ge[cf])
     {
        this.Ge[cf] =  true;
        
        d.oa.pa(
          function()
         {
            
            d.Ja.replace(bf.oe,  bf.Ve,  bf.Ue,  d.M);
         },
          bf.delay 
       );
   }
   }
};

 d.W(d.te);

 d["Behaviors"] =  d.te;
 d.te["addStateSequence"] =  d.te.Ie;

 
 d.te.Ie(["collapser",  "expander"],    ["collapsed",  "expanded"],   ["expandedToggle",  "expandcollapser"]);
 d.te.Ie(["opener",     "closer"],      ["open",       "close"],      ["openToggle"]);
 d.te.Ie(["selector",   "unselector"],  ["selected",   "unselected"], ["selectedToggle"]);
 d.te.Ie(["shower",     "hider"],       ["shown",      "hidden"],     ["shownToggle",  "showswitch"]);
 d.te.Ie(["focuser",    "blurrer"],     ["focus",      "blur"],       ["focusToggle"]);
 d.te.Ie(["onswitch",   "offswitch"],   ["on",         "off"],        ["onToggle"]);
 d.te.Ie(["enabler",    "disabler"],    ["enabled",    "disabled"],   ["enabledToggle"]);
 d.te.Ie(["checker",    "unchecker"],   ["checked",    "unchecked"],  ["checkedToggle"]);
})();
 d.Qd.ae(
   ["classchanger"],
   [],
    function(ne,  x,  oe,  Se,  Yc,  fe,  ie)
   {
      d.oa.pa(
        function()
       {
          d.Ja.Cc(oe,  fe);
       },
        fe["delay"]
     );
   }
);
 d.Qd.ae(
   ["execute"],
   [],
    function(ne,  nc,  oe,  Se,  Yc,  fe,  ie)
   {
      var   ra  =  fe[fe.action];
      ra  = (ra!=true?ra.split("_"):null);
      d.oa.Ma(fe.action)(ne,  oe,  ra);
   }
);
 d.df  =
{
    ef:  "activation-inert",
    ff:  "delayOn",
    gf:  "delayOff",
    hf:  "delaySwitch",
    jf: [],
    kf: [],
    lf:{},
    mf: [],
    nf: {},
    of: {},
    pf:  null,

    qf: {},
    rf: {},
    sf: {},
    tf: {},
    uf: {},
    vf: {},

    ba:  function()
   {
      
      this.wf("unhover",  "hover");
      this.wf("mouseout",  "mouseover");
      this.wf("neverhovered",  "");

      
      this.xf("inactive",  "active",  "activator",  "inactivator");
      this.xf("blurred",  "focused",  "focuser",  "blurrer");

      d.Oc.Sc(document.documentElement,  "mouseover",  this.yf,  this);

      d.Oc.Sc(document.documentElement,  d.D,  this.Yd,  this);
      d.Oc.Sc(document.documentElement,  "contextmenu",  this.Yd,  this);
      d.Oc.Sc(document.documentElement,  "keyup",  this.Yd,  this);

      d.wa.nd(d.m,  this.qd,  this);
   },
    wf:  function(zf,  Af)
   {
      if  (zf)
     {
        this.jf.push(zf);
        this.lf[zf] =  Af;
     }
      if  (Af)
     {
        this.jf.push(Af);
        this.lf[Af] =  Af;
     }
      this.Bf  =  "("  +  this.jf.join("\\b|\\b") +  ")";
      this.of[zf] =  Af;
      this.of[Af] =  zf;
   },
    xf:  function(Cf,  Df,  Ef,  Ff)
   {
      if  (Cf)
        this.mf.push(Cf);
      if  (Df)
     {
        this.lf[Df] =  Df;
        if  (Cf)
          this.lf[Cf] =  Df;
        this.kf.push(Df);
     }
      this.Gf  =  "("  +  this.kf.join("\\b|\\b") +  ")";
      this.Hf  =  "("  +  this.mf.join("\\b|\\b") +  ")";
      this.If  =  "("  +  this.kf.join("\\b|\\b") +  "\\b|\\b"  +  this.mf.join("\\b|\\b") +  ")";
      this.of[Cf] =  Df;
      this.of[Df] =  Cf;

      if  (Ef  &&  Ff)
     {
        this.nf[Ef] =  Ef;
        d.Qd.ae([Ef,  Ff], [Df,  Cf],  this.Jf,  this);
     }
   },

    Jf:  function(ne,  nc,  oe,  Se)
   {
      var   Kf  =  d.Ga.lb(oe);
      var   pc  =  d.Ja.Ka(oe,  this.If);
      var   data  = {  za:oe,  pc:pc  };
      if  (this.nf[nc])
        this.Lf(Kf,  data,  this.uf,  this.tf,  this.vf);
      else 
     {
        pc.rc  =  this.of[pc.rc];
        this.Mf(Kf,  data,  this.uf,  this.tf,  this.vf);
     }
   },

    yf:  function(Yc)
   {
      this.Nf(Yc,  this.Bf,  this.rf,  this.qf,  this.sf);
   },

    Yd:  function(Yc)
   {
      var   za  =  Yc.subject;
      
      if  (za  !=  this.pf)
     {
        this.pf  =  za;

        if  (!d.Ga.Ha(za,  this.ef))
       {
          this.Nf(
            Yc,
            this.If,
            this.uf,
            this.tf,
            this.vf,
            d.Ga.Ha(za,  this.ef) !=  null,
            Yc.ctrlKey  ||  d.Ga.Ha(za,  this.ef) !=  null,
            d.Ga.Ha(za,  "activation-box")
         );

          d.wa.xa("afterActivationChange",  Yc.subject);
       }
     }
   },

    qd:  function(Yc)
   {
      if  (!d.Ja.Rb(Yc.fromValue,  this.Gf) &&  d.Ja.Rb(Yc.toValue,  this.Gf))
        
        this.Yd(Yc);
      else   if  (d.Ja.Rb(Yc.fromValue,  this.Gf) && !d.Ja.Rb(Yc.toValue,  this.Gf))
     {
        var   Kf  =  d.Ga.lb(Yc.subject);
        delete   this.qf[Kf];
     }
   },

    Nf:  function(Yc,  Of,  Pf,  Qf,  Rf,  Sf,  Tf,  Uf)
   {
      var   Vf  = {};

 
 
      var   za  =  Yc.subject;
      while  (za  &&  za.nodeType  ==  1)
     {
        var   pc  =  d.Ja.Ka(za,  Of);
        if  (
          pc 
         && (!pc["require"]  ||   d.Ga.Ha(za,  pc["require"]))
         && (!pc["disallow"] || !d.Ga.Ha(za,  pc["disallow"]))
       )
          Vf[d.Ga.lb(za)] = {  za:za,  pc:pc  };

        za  =  za.parentNode;
     }   

      this.Wf  =  false;

 
 
      if  (!Tf)
        for  (var   Kf   in   Qf)
          if  (!Vf[Kf] && (!Uf  ||  d.Ga.Db(Uf,  Qf[Kf].za)))
            this.Mf(Kf,  Qf[Kf],  Pf,  Qf,  Rf);

      if  (!Sf)
        for  (var   Kf   in   Vf)
          if  (!Qf[Kf] && (!Uf  ||  d.Ga.Db(Uf,  Vf[Kf].za)))
            this.Lf(Kf,  Vf[Kf],  Pf,  Qf,  Rf);
   },
    
    Lf:  function(Kf,  data,  Pf,  Qf,  Rf)
   {
 
      if  (!Qf[Kf] &&  d.wa.xa(d.r,  data.za))
     {
        if  (Rf[Kf])
          this.Xf(Kf,  Rf);
        else 
       {
          var   delay  = (this.Wf?data.pc[this.hf]:0) ||  data.pc[this.ff];
          if  (delay)
         {
            Pf[Kf] =  data;
            data.Yf  =  d.oa.pa(this.Zf,  delay,  this, [Kf,  data,  Pf,  Rf]);
         }
          else 
            this._g(Kf,  data,  Rf);
       }
        Qf[Kf] =  data;
     }
   },
    Mf:  function(Kf,  data,  Pf,  Qf,  Rf)
   {
 
      if  (Qf[Kf] &&  d.wa.xa(d.r,  data.za))
     {
        if  (Pf[Kf])
          this.ag(Kf,  Pf[Kf],  Pf,  Qf);
        else 
       {
          this.Wf  =  true  &&  data.pc[this.hf];
          if  (data.pc[this.gf])
         {
            Rf[Kf] =  data;
            data.Yf  =  d.oa.pa(this.bg,  data.pc[this.gf],  this, [Kf,  Rf]);
         }
          else 
            this.cg(Kf,  data);

          delete   Qf[Kf];
       }
     }
   },
    ag:  function(Kf,  data,  Pf,  Qf)
   {
      clearTimeout(data.Yf);
      delete   Pf[Kf];
      delete   Qf[Kf];
   },
    Zf:  function(Kf,  data,  Pf,  Rf)
   {
      delete   Pf[Kf];
      this._g(Kf,  data,  Rf);
   },
    _g:  function(Kf,  data,  Rf)
   {
      d.Ja.replace(data.za,  this.of[this.lf[data.pc.rc]],  this.lf[data.pc.rc]);

      var   We  =  d.Ga.Ha(data.za,  "exclusive"  +  this.of[data.pc.rc]);
      for  (var   Kf   in   Rf)
        if  (We  &&  d.Ga.Ha(Rf[Kf].za,  "exclusive"  +  this.of[data.pc.rc]) ==  We)
       {
          this.cg(Kf,  Rf[Kf]);
          this.Xf(Kf,  Rf);
       }
   },
    bg:  function(Kf,  Rf)
   {
      this.cg(Kf,  Rf[Kf]);
      delete   Rf[Kf];
   },
    Xf:  function(Kf,  Rf)
   {
      clearTimeout(Rf[Kf].Yf);
      delete   Rf[Kf];
   },
    cg:  function(Kf,  data)
   {
      d.Ja.replace(data.za,  this.lf[data.pc.rc],  this.of[this.lf[data.pc.rc]]);
   }
};

 d.W(d.df);

 
 
 
 

 

 d.dg  = {
    eg:1,
    fg:2,
    gg:3,
    hg:4,
    ig:5,
    jg:6,
    kg:7,
    lg:8,
    mg:9,
    ng:null,
    ba:  function()
   {
      if  (d.R)
     {
        this.og  =  this.pg;
        this.qg  =  this.rg;
     }
      d.dg["getRawComputedStyleProperty"] =  d.dg.og;

      this.ng  = {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
        "borderWidth":this.fg,
        "borderTopWidth":this.fg,
        "borderRightWidth":this.fg,
        "borderBottomWidth":this.fg,
        "borderLeftWidth":this.fg,
        "width":this.gg,
        "height":this.gg,
        "scrollTop":this.hg,
        "scrollLeft":this.hg,
        "color":this.ig,
        "backgroundColor":this.ig,
        "borderColor":this.ig,
        "borderTopColor":this.ig,
        "borderRightColor":this.ig,
        "borderBottomColor":this.ig,
        "borderLeftColor":this.ig,
        "opacity":this.jg,
        "zoom":this.kg,
        "display":this.lg,
        "overflow":this.lg,
        "position":this.lg,
        "visibility":this.lg,
        "zIndex":this.mg 
     };

      this.sg  = {};
      this.sg[this.eg] =  "px";
      this.sg[this.fg] =  "px";
      this.sg[this.gg] =  "px";
      this.sg[this.hg] =  "px";
      this.sg[this.ig] =  "";
      this.sg[this.jg] =  "%";
      this.sg[this.kg] =  "%";
      this.sg[this.lg] =  "";
      this.sg[this.mg] =  "";
   },
    tg:{
      "width":["offsetWidth"],
      "height":["offsetHeight"]
   },
    ug:{
      "width":["height",  "offsetHeight"],
      "height":["width",  "offsetWidth"]
   },

    vg:  function(za,  Z)
   {
      var   wg  =  this.og(za,  Z);
      return   this.qg(za,  Z,  wg).value;
   },

    og:  function(za,  Z,  xg)
   {
      var   yg  =  this.zg(Z);
      var   Ag  =  document.defaultView.getComputedStyle(za,  "");

      if  (Ag)
        switch  (this.Bg(Z))
       {
          case   this.gg:
            if  (d.Q)
           {
              var   Cg  =  this.tg[Z];
              var   db  =  za[Cg[0]];
              for  (var   i=1;  i<Cg.length;  i++)
                db  -=  parseInt(za.currentStyle[Cg[i]]);
              return   Math.max(0,  db);
           }
          case   this.fg:
            if  (Ag.getPropertyValue(yg.replace(/width/,  "style")) ==  d.h)
              return   0;
          case   this.mg:
          case   this.eg:
          case   this.kg:
          case   this.jg:
            return   Ag.getPropertyValue(yg);
          case   this.hg:
            return   za[Z];
            break;
          case   this.ig:
            if  (
              yg.indexOf("border") != -1 
             &&  Ag.getPropertyValue(yg.replace(/color/,  "style")) ==  d.h 
           )
              return   null;
            
          case   this.lg:
            return   Ag.getPropertyValue(yg);
       }

      return   null;
   },
    qg:  function(za,  Z,  wg)
   {
      var   Dg  =  this.Bg(Z);

      var   X  = {  value:  wg  };

      switch  (Dg)
     {
        case   this.mg:
        case   this.eg:
        case   this.kg:
          var   Eg  =  parseInt(wg);
          if  (isNaN(Eg))
            switch  (wg)
           {
              case   "auto":  X.value  =  0;  break;
              default:  X.value  =  null;
           }
          else 
            X.Fg  = (""  +  wg).replace(/^[-\d]+/,  "") ||  null;
          X.value  =  Eg;
          break;
        case   this.jg:
          X.value  =  Math.round(100*wg);
          break;
        case   this.ig:
          X.value  =  this.Gg(wg);
          break;
        case   this.gg:
        case   this.hg:
          X.value  =  parseInt(wg);
     }

      return   X;
   },


    pg:  function(za,  Z)
   {
      
      if  (!za.currentStyle)
        return   null;

      switch  (this.Bg(Z))
     {
        case   this.gg:
 
 
 
            
            
            var   Hg  =  za[this.ug[Z][1]] ==  0;
            if  (Hg)
              za.runtimeStyle[this.ug[Z][0]] =  "1px";

            var   db  =  za[this.tg[Z]];

 za.runtimeStyle[Z] =  db;
 db  +=  db  -  za[this.tg[Z]];
 za.runtimeStyle[Z] =  "";

            if  (Hg)
              za.runtimeStyle[this.ug[Z][0]] =  "";
 

          return   db;
        case   this.hg:
          return   za[Z];
          break;
        case   this.jg:
          try 
         {
            return   za.filters.item(d.K).opacity;
         }
          catch(Ig)
         {
            return   100;
         }
          break;
        case   this.eg:
        case   this.kg:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
        default:
          return   za.currentStyle[Z];
     }
   },

    rg:  function(za,  Z,  wg)
   {
      var   Dg  =  this.Bg(Z);

      var   X  = {  value:  wg  };
      var   Eg  =  null;

      if  (wg  ==  "0px")
        wg  =  "0";

      switch  (Dg)
     {
        case   this.gg:

 Eg  =  parseInt(wg);

          X.Fg  = (""  +  wg).replace(/^[-\d\.]+/,  "") ||  null;
          X.value  =  Math.max(0,  Eg);
          break;
        case   this.ig:
          X.value  =  this.Gg(wg);
          break;
        case   this.fg:
        case   this.mg:
        case   this.eg:
        case   this.kg:
          Eg  =  parseInt(wg);
          if  (isNaN(Eg))
            switch  (wg)
           {
              case   "auto":  Eg  =  0;  break;
              case   "thin":  Eg  =  2;  break;
              case   "medium":  Eg  =  4;  break;
              case   "thick":Eg  =  6;  break;
              default:  Eg  =  parseInt(wg);
           }
          else 
            X.Fg  = (""  +  wg).replace(/^[-\d\.]+/,  "") ||  null;

          X.value  =  Eg;
          break;
     }

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

      return   X;
   },

    Jg:  function(za,  Z,  db)
   {
      switch  (this.Bg(Z))
     {
        case   this.ig:
          za.style[Z] =  "rgb("  +  db.join(",") +  ")";
          break;
        case   this.lg:
        case   this.mg:
          za.style[Z] =  db;
          break;
        case   this.gg:
        case   this.kg:
        case   this.fg:
        case   this.eg:
          za.style[Z] =  db  +  "px";
          break;
        case   this.hg:
          za[Z] =  db  +  "px";
          break;
     }
   },

    Kg:  function(za,  Z)
   {
      za.style[Z] =  "";
   },

    Bg:  function(Z)
   {
      return   this.ng[Z] ||  this.eg;
   },

    zg:  function(Z)
   {
      return   Z.replace(/([A-Z])/g,  function(Lg){  return   "-"  +  Lg.toLowerCase(); });
   },
    Mg: {
      "white":"#FFFFFF",  "black":"#000000","blue":"#0000FF",
      "green":"#008000",  "red":"#FF0000",  "yellow":"#FFFF00",
      "aqua":"#00FFFF","azure":"#F0FFFF","beige":"#F5F5DC",
      "black":"#000000","blue":"#0000FF","brown":"#A52A2A",
      "cyan":"#00FFFF","darkblue":"#00008B","darkcyan":"#008B8B",
      "darkgray":"#A9A9A9","darkgreen":"#006400","darkred":"#8B0000",
      "fuchsia":"#FF00FF","gold":"#FFD700","gray":"#808080",
      "green":"#008000","indigo":"#4B0082","lightblue":"#ADD8E6",
      "lightcyan":"#E0FFFF","lightgreen":"#90EE90","lightgrey":"#D3D3D3",
      "lightyellow":"#FFFFE0","lime":"#00FF00","magenta":"#FF00FF",
      "maroon":"#800000","navy":"#000080","orange":"#FFA500",
      "pink":"#FFC0CB","purple":"#800080","red":"#FF0000",
      "silver":"#C0C0C0","steelblue":"#4682B4","turquoise":"#40E0D0",
      "violet":"#EE82EE","white":"#FFFFFF","yellow":"#FFFF00" 
    },

    Gg:  function(c)
   {
      c  =  this.Mg[c] ||  c;

      if  (typeof(c) ==  "object")
        return   c;
      if  (c.indexOf("#") ==  0)
     {
        if  (c.length  ==  7)
          return  [
            parseInt(c.substring(1,  3),  16),
            parseInt(c.substring(3,  5),  16),
            parseInt(c.substring(5,  7),  16)
         ];
        else 
          return  [
            17*parseInt(c.substring(1,  2),  16),
            17*parseInt(c.substring(2,  3),  16),
            17*parseInt(c.substring(3,  4),  16)
         ];
     }
      if  (c.indexOf("rgb(") ==  0)
     {
        var   Ng  =  c.substring(4,  c.length  -  1).split(",");
        return  [
          parseInt(Ng[0]),
          parseInt(Ng[1]),
          parseInt(Ng[2])
       ];
     }

      return  [255,  255,  255];
   }
};

 d.W(d.dg);

 d["StyleUtils"] =  d.dg;
 d.dg["getComputedStyleProperty"] =  d.dg.vg;
 
 
 d.Animator  =  _a  = {
    Og:{},
    animate:  function(Pg,  Qg)
   {
      var   Rg  =  Pg.length;

 
 
 
 
 
 
 
 
 
 
 
      var   Sg  =  10;
      var   Tg  =  1  <<  Sg;

      var   Ug  =  7;
      var   Vg  =  1  <<  Ug;

      var   code  = [
        "  var tPhase = Math.min(1, (t - TSTART)/DURATION);\n",
        "if (tPhase>=0){\n",
        "  var f = ",  _a.Wg[Qg.profile],  ";\n",
        "\n" 
     ];

      var   Xg  = [];
      var   Yg  = [];
      var   Zg  = [];


      for  (var   i=0;  i<Rg;  i++)
     {
        var   _h  =  Pg[i];
        var   za  =  _h.element;
        var   id  =  d.Ga.lb(za);
        var   ah  =  _h.targetState;

        for  (var   bh   in   ah)
       {
          var   ch  =  bh;
          if  (!d.R)
            ch  =  bh.replace(/([A-Z])/g,  function(Lg){  return   "-"  +  Lg.toLowerCase(); });

          var   dh  =  ah[bh];

          
          var   eh  = (_h.currentState&&typeof(_h.currentState[bh])!=d.e)?_h.currentState[bh]:d.dg.vg(za,  bh);

          if  (bh  ==  "zoom")
         {
            
            eh  *=  100;
            dh  *=  10000;
         }

          
          _a[id  +  "el"] =  za;
          switch  (d.dg.Bg(bh))
         {
            case   d.dg.hg:
                _a[id  +  "elscroll"] = (za  !=  document.body  ||  document.compatMode  ==  "BackCompat")?za:document.documentElement;
              break;
            case   d.dg.jg:
              if  (d.R)
             {
                _a[id  +  "opacity"] =  za.filters.item(d.K);
                break;
             }
              
            default:
              _a[id  +  "elStyle"] =  za.style;

              if  (Qg.removeAfterwards)
 
                Zg.push("_a[\"",  id,  "elStyle\"]."  +  bh  +  "='';\n");
         }

          
          if  (d.dg.Bg(bh) ==  "rgb")
            dh  =  d.dg.Gg(dh);

          if  (dh.constructor  ==  Array)
         {
            var   fh  = [];
            for  (var   Mc=0;  Mc<dh.length;  Mc++)
              fh[Mc] =  Math.floor(dh[Mc] -  eh[Mc]);
         }
          else   if  (!isNaN(dh))
         {
            var   fh  =  Math.floor(dh-eh);
         }

          var   gh  = (_h.units  &&  _h.units[bh])?" + '"  +  _h.units[bh] +  "';\n":_a.hh;

          
          switch  (d.dg.Bg(bh))
         {
            case   d.dg.ig:
              if  (d.R)
             {
                if  (bh  ==  "borderColor")
                  Yg.push(
                    '_a["',  id,  'elStyle"].',  bh,  '=["rgb(",',
                    '(',  Math.floor(Vg*(eh[0]+0.5)),  '+cP*',  fh[0],  ')>>',  Ug,  ',",", ',
                    '(',  Math.floor(Vg*(eh[1]+0.5)),  '+cP*',  fh[1],  ')>>',  Ug,  ',",", ',
                    '(',  Math.floor(Vg*(eh[2]+0.5)),  '+cP*',  fh[2],  ')>>',  Ug,  ', ")"].join("");\n' 
                 );
                else 
                  Yg.push(
                    '_a["',  id,  'elStyle"].',  bh,  '=',
                    '((',  Math.floor(Vg*(eh[0]+0.5)),  '+cP*',  fh[0],  ')>>',  Ug,  '<<16) | ',
                    '((',  Math.floor(Vg*(eh[1]+0.5)),  '+cP*',  fh[1],  ')>>',  Ug,  '<<8) | ',
                    '((',  Math.floor(Vg*(eh[2]+0.5)),  '+cP*',  fh[2],  ')>>',  Ug,  ');\n' 
                 );
             }
              else 
                Yg.push(
                  '_a["',  id,  'elStyle"].',  bh,  '=["rgb(",',
                  '(',  Math.floor(Vg*(eh[0]+0.5)),  '+cP*',  fh[0],  ')>>',  Ug,  ',",", ',
                  '(',  Math.floor(Vg*(eh[1]+0.5)),  '+cP*',  fh[1],  ')>>',  Ug,  ',",", ',
                  '(',  Math.floor(Vg*(eh[2]+0.5)),  '+cP*',  fh[2],  ')>>',  Ug,  ', ")"].join("");\n' 
               );
              break;
            case   d.dg.jg:
              Yg.push('try{_a["',  id, (d.R?'opacity"].opacity=(':'elStyle"].opacity=(('),  Vg*(eh+0.5),  '+cP*',  fh,  ')>>',  Ug, (d.R?';':')/100;'),  "}catch(e){};\n");
              break;
            case   d.dg.hg:
              Xg.push('_a["',  id,  'elscroll"].',  bh,  '=(',  Tg*(eh+0.5),  '+normalPhase*',  fh,  ')>>',  Sg,  ';\n');
              break;
            case   d.dg.kg:
              Xg.push('_a["',  id,  'elStyle"].',  bh,  '=((',  Math.floor(Tg*(eh+0.5)),  '+normalPhase*',  fh,  ')>>',  Sg,  ')/10000;\n');
            case   d.dg.lg:
              switch  (bh)
             {
                case   "visibility":
                  za.style.visibility  =  "visible";
                  break;
                case   "display":
                  za.style.display  = (dh=='none'?eh:dh);
                  break;
                case   "overflow":
                  za.style.overflow  =  "hidden";
                  break;
 
 
 
 
 
 
             }
              break;
            case   d.dg.mg:
              Xg.push('_a["',  id,  'elStyle"].',  bh,  '=((',  Math.floor(Tg*(eh+0.5)),  '+normalPhase*',  fh,  ')>>',  Sg,  ');\n');
              break;
            default:
              Xg.push('_a["',  id,  'elStyle"].',  bh,  '=((',  Math.floor(Tg*(eh+0.5)),  '+normalPhase*',  fh,  ')>>',  Sg,  ')', (bh=='zoom'?'/10000':''),  gh,  ";\n");
         }

       }
     }

 

      if  (Xg.length  >  0)
     {
        code.push(
          "var normalPhase=Math.round(",  Tg,  "*f);\n",
          Xg.join("")
       );
     }
      if  (Yg.length  >  0)
     {
        code.push(
          'var cP=Math.round(',  Vg,  '*f);\n',
         Yg.join("")
       );
     }

 

      if  (Qg.removeAfterwards)
        code.push(
          "",
          "if(t==TSTOP)",
          "{",
          Zg.join(""),
          "}\n");

      code.push("}\n\n");

      _a.ih(code,  Qg.delay,  Qg.duration,  Pg,  Qg.onFinish);
   },

    Wg: [
      'tPhase',
      'tPhase*tPhase',
      '(1-Math.pow(1-tPhase, 4))',
      '(1-Math.cos('  +  Math.PI  +  '*tPhase)/2.0)',
      '(tPhase<0.5?Math.exp(3*Math.log(tPhase*2))/2:1-Math.exp(3*Math.log((1-tPhase)*2))/2)',
      '(-Math.cos('  +  4*Math.PI  +  '*tPhase) + 1)/2',
      'tPhase + (1-tPhase)*Math.sin('   +   3*Math.PI   +   '*tPhase)',
      '(1-Math.exp(4*Math.log(1-tPhase)))' 
   ],

    hh: (document.defaultView?" + 'px';\n":";\n"),
    jh:  0,
    kh:  null,
    lh:  1,
    mh:  0,
    nh:  Infinity,
    oh:  500,
    ph:  "",
    ih:  function(qh,  delay,  duration,  Pg,  onFinish)
   {
      _a.jh++;
      _a.lh++;

      for  (var   i=0;  i<Pg.length;  i++)
        _a.Og[Pg[i].element.id] =  _a.lh++;

      if  (onFinish)
     {
        _a["__onFinish"  +  _a.lh] =  onFinish;
        _a["__anims"  +  _a.lh] =  Pg;
     }

      rh  = [
        "/*** ",  _a.lh,  " ***/\n",
        "var t=Math.min(tNow, TSTOP);\n",
        qh.join(""),
        "if(t==TSTOP)\n",
        "{\n",
        "_a.__rC(",  _a.lh,  ");\n",
       (onFinish?("_a.__onFinish"  +  _a.lh  +  "(_a.__anims"  +  _a.lh  +  ");"):""),
        "\n}\n",
        "/*** /",  _a.lh,  " ***/\n"].join("");

      var   sh  = +new   Date() +  delay  -  _a.mh;
      var   uh  =  sh  +  duration;
      rh  =  rh.replace(/TSTART/g,  sh);
      rh  =  rh.replace(/DURATION/g,  duration);
      rh  =  rh.replace(/TSTOP/g,  uh);
      rh  =  rh.replace(/RUNINDEX/g,  _a.lh);

      if  (_a.kh)
        _a.vh(Pg);

      _a.ph  =  _a.ph  +  rh;

 

      _a.wh  =  Function("tNow",  _a.ph);

 

      if  (!_a.kh)
     {
        _a.mh  =  0;
        _a.nh  =  Infinity;

 
 

        _a.kh  =  setInterval(_a.xh,  1);
 _a.yh  =  true;
        _a.xh();
 _a.yh  =  false;
     }
   },
    xh:  function()
   {
      var   zh  = +new   Date() -  _a.mh;

      var   Ah  =  zh  -  _a.nh;
      if  (Ah  >  _a.oh)
     {
        _a.mh  +=  Ah;
        zh  -=  Ah;
     }

      _a.nh  =  zh;

 
 

      _a.wh(zh);
   },
    "__rC":  function(Bh)
   {
      var   Ch  =  "/*** "  +  Bh  +  " ***/";
      var   Dh    =  "/*** /"  +  Bh  +  " ***/";
      _a.ph  =  _a.ph.substring(0,  _a.ph.indexOf(Ch)) +  _a.ph.substring(_a.ph.indexOf(Dh) +  Dh.length);

      _a.wh  =  Function("tNow",  _a.ph);

      _a.Eh(Bh);

      _a.jh--;
      if  (_a.jh  ==  0)
     {
        clearInterval(_a.kh);
        _a.Og  = {};
        _a.kh  =  null;
     }
   },
    Eh:  function(Bh)
   {
      for  (var   id   in   _a.Og)
        if  (_a.Og[id] ==  Bh)
          delete   _a.Og[id];
   },
   vh:  function(Pg)
   {
      var   Fh  = [];
      var   Rg  =  Pg.length;
      for  (var   i=0;  i<Rg;  i++)
     {
        var   _h  =  Pg[i];
        var   id  =  _h.element.id.replace(/(\W)/g,  "\\$1");
        var   ah  =  _h.targetState;

        for  (var   bh   in   ah)
       {
          
          switch  (bh)
         {
            case   'scrollTop':
            case   'scrollLeft':
              Fh.push("|_a\\[\"",  id,  "el\"\\]\\.",  bh,  "[^;]+;");
              break;
            case   "opacity":
              Fh.push("|try{_a\\[\"",  id,  "opacity\"\\][^;]+}catch(e){};");
              break;
            default:
              Fh.push("|_a\\[\"",  id,  "elStyle\"\\]\\.",  bh,  "[^;]+;");
              Fh.push("|_a\\[\"",  id,  "elStyle\"\\]\\.",  bh,  "='';");
         }
       }
     }

      if  (Fh.length  >  0)
     {
 
        _a.ph  =  _a.ph.replace(new   RegExp(Fh.join("").substr(1),  "g"),  "");
 
     }
   },
    Gh:  function(Hh)
   {
 
 
 
 
 
 
 
 
 
 
 
 
   }
};


 d.Modifiers  =  function  ()
{
    this.delay  =  0;
    this.duration  =  300;
    this.profile  =  7;
    this.removeAfterwards  =  false;
    this.onFinish  =  null;
};

 d.Modifiers.prototype  = {
    "LINEAR":0,
    "ACCELERATING":1,
    "DECELERATING":2,
    "NORMAL":3,
    "SLOWFASTSLOW":4,
    "BLINK":5,
    "HEARTBEAT":6,
    "FAST":7 
};

 d["Animator"] =  d.Animator;
 d.Animator["disabled"] =  d.Animator.disabled;
 d.Animator["animate"] =  d.Animator.animate;
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 
 
 
 

 
 
 


 



 d.Ih  = {
    Jh:"display",
    Kh:"block",
    Lh:"morph",
    Mh:"shallow",


    Nh:  true,
    Oh:[
      "display",
      "overflow",
      "backgroundColor",
 
 
 
 
 
      "color",
      "fontSize",
      "height",
      "left",
      "marginTop",
 
 
      "marginLeft",
      "opacity",
 
 
 
 
 
      "top",
 
      "width",
      "zIndex",
      "visibility"
   ],
    Ph:{},
    Qh:  false,
    Rh:  true,
    Sh:  {  BODY:1,  DIV:1,  A:1,  IMG:1,  LI:1,  OL:1,  UL:1,  SPAN:1,  TD:1,  TH:1,  TR:1,  TABLE:1,  H1:1,  H2:1,  H3:1  },
    ba:  function()
   {
      d.wa.nd(d.k,  this.Th,  this);
      d.wa.nd(d.l,  this.Uh,  this);
      d.wa.nd(d.n,  this.Uh,  this);
   },

    Vh:  function()
   {
      this.Nh  =  true;
   },
    Wh:  function()
   {
      this.Nh  =  false;
   },
    Xh:  function()
   {
      this.Rh  =  false;
   },
    Yh:  function(Zh)
   {
      d.w  =  Zh;
   },
    _i:  function(ai)
   {
      var   bi  = {};
      for  (var   i=0;  i<ai.length;  i++)
        bi[ai[i].toUpperCase()] =  1;
      this.Sh  =  bi;
   },
    ci:  function(di)
   {
      this.Oh  =  di;
   },
    Uh:  function(Yc)
   {
      if  (d.Ih.Nh  && !Yc.Dc)
        this.ei(Yc.subject);
   },
    ei:function(vd)
   {
 
      var   fi  = {};

      var   pc  =  d.Ja.Ka(vd,  this.Lh, {"delay":0,  "duration":d.w});
      if  (!pc  || (!pc["not"] && (!pc["require"] ||  d.Ja.contains(vd,  pc["require"]))))
     {
        if  (pc)
          this.gi(fi,  vd,  pc);
        else   if  (!this.Rh)
          this.hi(vd,  fi);

        if  (this.Qh)
       {
          this.ii(fi,  true);

          for  (var   Kf   in   fi)
            this.Ph[Kf] =  fi[Kf];
       }
     }
 
   },

    gi:  function(Hh,  za,  pc)
   {
      var   Kf  =  d.Ga.lb(za);
      if  (!this.Ph[Kf])
     {
        Hh[Kf] = {
          element:za,
          pc:pc,
          eb:pc[this.ji]||this.Oh 
       };

        this.Qh  =  true;
     }

      if  (!this.Rh  ||  pc["deep"])
        this.hi(za,  Hh);
   },

    hi:  function(za,  fi)
   {
      for  (var   zd  =  za.firstChild;  zd;  zd  =  zd.nextSibling)
        if  (zd.nodeType  ==  1)
       {
          var   pc  =  null;
          var   ki  =  false;
          if  (this.Sh[zd.nodeName])
         {
            pc  =  d.Ja.Ka(zd,  this.Lh, {"delay":0,  "duration":d.w});
            if  (pc  && !pc["not"])
           {
              this.gi(fi,  zd,  pc);
              ki  =  true;
           }
         }

          if  (!ki)
         {
            var   mi  =  d.dg.og(zd,  "display");
            if  (mi  !=  d.h  && (!pc  || !pc[this.Mh]))
              this.hi(zd,  fi);
         }
       }
   },

    Th:function()
   {
      
      
      
      if  (d.Q)
        document.body.scrollLeft  +=  0;

      if  (this.Qh)
     {
        
        
        for  (var   Kf   in   this.Ph)
          if  (!this.ni(this.Ph[Kf].element))
         {
            var   za  =  document.getElementById(Kf);
            if  (za)
              this.Ph[Kf].element  =  document.getElementById(Kf);
            else 
              delete   this.Ph[Kf];
         }

 
        this.oi(this.Ph);
 
        this.ii(this.Ph,  false);
 
        this.pi(this.Ph);
 

        var   qi  =  this.ri();
 

        this.Qh  =  false;
        this.Ph  = {};
 

        this.si(qi);
 

        
        
        
        
        
        
        
        if  (d.T)
          document.body.offsetWidth;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
     }
   },
    oi:  function(Hh)
   {
 
 
 
 
 

      for  (var   Kf   in   Hh)
        if  (d.Animator.Og[Kf])
       {
          var   ti  =  Hh[Kf];
          var   za  =  ti.element;

          if  (d.R)
         {
            ti.ui  =  za.style.cssText;
            za.style.cssText  =  "";
         }
          else 
            for  (var   Z   in   ti.vi)
           {
              var   db  =  za.style[Z];
              if  (db)
             {
                ti.wi[Z] =  db;
                za.style[Z] =  "";
             }
           }
       }
   },
    pi:  function(Hh)
   {
      for  (var   Kf   in   Hh)
     {
        if  (d.Animator.Og[Kf])
       {
          var   ti  =  Hh[Kf];
          var   za  =  ti.element;
          if  (d.R)
            za.style.cssText  =  ti.ui;
          else 
            for  (var   Z   in   ti.wi)
              za.style[Z] =  ti.wi[Z];
       }
     }
   },
    ii:  function(Hh,  xi)
   {
      var   yi  = [];
      var   zi  = [];
      var   Ai  =  null;

      for  (var   Kf   in   Hh)
     {
        var   ti  =  Hh[Kf];
        var   za  =  ti.element;

 
 
 
 if  (za.offsetWidth  ==  0  && (!za.parentNode  ||  za.parentNode.offsetWidth  ==  0))
{
    delete   Hh[Kf];
    continue;
}
        if  (xi)
       {
          ti.wi  = {};
          ti.vi  = {};
          ti.Bi  = {};
       }

        
        if  (!xi  &&  Ai  &&  d.Ga.Db(Ai,  za) && (Ai.style.display  ==  d.h))
       {
          delete   Hh[Kf];
          continue;
       }

        var   Ci  = (xi?ti.vi:ti.Bi);

        for  (var   i=0;  i<ti.eb.length;  i++)
       {
          var   Z  =  ti.eb[i];
 

          Ci[Z] =  d.dg.og(za,  Z);

          if  (Z  ==  this.Jh  &&  Ci[Z] ==  d.h)
         {
 
 
 
 
 
            
            if  (!xi  &&  ti.vi.display  ==  d.h)
           {
              delete   Hh[Kf];
              break;
           }

            Ai  =  za;
            yi.push(Ai);
            zi.push(Ai.style.display);
            Ai.style.display  =  this.Kh;
         }
       }
     }

      for  (var   i=0;  i<yi.length;  i++)
        yi[i].style.display  =  zi[i];
   },
    ri:  function()
   {
      var   qi  = {};
      var   Di  = {};
      for  (var   Kf   in   this.Ph)
     {
        var   ti  =  this.Ph[Kf];
        var   za  =  ti.element;
        var   currentState  = {};
        var   units  = {};
        var   targetState  = {};
        var   Ei  =  false;
        for  (var   Z   in   ti.Bi)
       {
          var   Fi  =  ti.vi[Z];
          var   Gi  =  ti.Bi[Z];

          if  (Gi  !=  null)
         {
            
 
 
 
 
            if  (Fi  !=  Gi)
           {
              Ei  =  true;
              var   Hi  =  d.dg.qg(za,  Z,  Fi);
              var   Ii    =  d.dg.qg(za,  Z,  Gi);
              currentState[Z] =  Hi.value;
              targetState[Z] =  Ii.value;
              units[Z] =  Hi.Fg  ||  Ii.Fg;
           }
         }
       }

        if  (Ei)
       {
          if  (d.Q)
         {
            
            
            
            if  (targetState.top  &&  targetState.marginTop  &&  targetState.top  ==  targetState.marginTop)
              delete   targetState.top;
            if  (targetState.left  &&  targetState.marginLeft  &&  targetState.left  ==  targetState.marginLeft)
              delete   targetState.left;
         }

          var   Ji  =  qi[ti.pc["delay"]] =  qi[ti.pc["delay"]] || {};
          var   Pg  =  Ji[ti.pc["duration"]] =  Ji[ti.pc["duration"]] || [];

          Pg[Pg.length] = {
            element:za,
            currentState:currentState,
            targetState:targetState,
            units:units 
         };
       }
     }
      return   qi;
   },
    si:  function(qi)
   {
      for  (var   delay   in   qi)
     {
        delay  *=  1;
        for  (var   duration   in   qi[delay])
       {
          duration  *=  1;
          var   Pg  =  qi[delay][duration];
          for  (var   i=0;  i<Pg.length;  i++)
         {
            var   _h  =  Pg[i];
            var   za  =  _h.element;
            
 
 
            
            for  (var   Z   in   _h.currentState)
           {
 
 
              d.dg.Jg(za,  Z,  _h.currentState[Z]);
           }
         }

 
 
 
 
 
 
 
 
 

          var   Qg  =  new   d.Modifiers();
          Qg.delay  =  delay;
          Qg.duration  =  duration;
 
 
          Qg.removeAfterwards  =  true;

 
 
          d.Animator.animate(Pg,  Qg);
 
       }
     }
   },
    ni:  function(za)
   {
      if  (d.R)
        return   za.parentTextEdit  !=  null;
      else   if  (d.Q)
        return   za.sourceIndex  != -1;
      else 
        return   za.offsetParent  !=  null;
   },
    Ki:  function(Li,  Mi)
   {
      for  (var   i=0;  i<Li.length;  i++)
        if  (Li[i] !=  Mi[i])
          return   false;

      return   true;
   }
};
 d.W(d.Ih);

 d["StyleMorpher"] =  d.Ih;
 d.Ih["enableDeepMorphing"] =  d.Ih.Xh;
 d.Ih["setMorphDuration"] =  d.Ih.Yh;
 d.Ih["setMorphableNodeNames"] =  d.Ih._i;
 d.Ih["setMorphableProperties"] =  d.Ih.ci;
 d.Ih["enable"] =  d.Ih.Vh;
 d.Ih["disable"] =  d.Ih.Wh;

 d.Ih["morph"] =  d.Ih.Th;
 d.Ih["beforeClassNameChange"] =  d.Ih.Uh;
 
 
 
 
 


 d.Ni  = {
    Oi:  null,
    Pi:  null,
    ba:  function()
   {
      d.Oc.Sc(document.documentElement,  d.H,  this.Qi,  this);
      d.Oc.Sc(document.documentElement,  d.I,  this.Ri,  this);
      d.Oc.Sc(document.documentElement,  d.J,    this.Si,  this);
      d.Oc.Sc(document.documentElement,  "DOMMouseScroll",    this.sd,  this);

      d.wa.nd("persist-pos",  this.Ti,  this);
   },
    
    Ti:  function(Yc)
   {
      var   za  =  Yc.subject;
      if  (d.Ja.contains(za,  "movable"))
     {
        var   Ui  = {  x:  parseInt(za.style.left),  y:  parseInt(za.style.top) };
        if  (!isNaN(Ui.x) || !isNaN(Ui.y))
       {
          var   La  =  d.Ja.Ka(za,  "movable");
          if  (La[d.N])
            La[d.N](za,  Ui);
       }
     }
   },

    Qi:  function(Yc)
   {
      this.Si();

      this.Vi  =  d.oa.ya(Yc.subject,  "mover",  "movable");
      if  (this.Vi.object)
     {
       this.Vi.box  =  this.Vi.object.offsetParent  ||  d.V;

        this.Wi  =  d.V.scrollTop;
        this.Xi  =  this.Vi.object.offsetLeft  -  Yc.clientX  -  d.dg.vg(this.Vi.object,  "marginLeft");
        this.Yi  =  this.Vi.object.offsetTop  -  Yc.clientY  -  d.dg.vg(this.Vi.object,  "marginTop");

        this.Zi();

        this._j  =  false;
     }
      else 
        this.Vi  =  null;
   },
    Ri:  function(Yc)
   {
      this.Pi  =  Yc.clientY;

      if  (this.Vi)
        if  (Yc.kd)
       {
          if  (!this._j)
         {
            d.Oc.Pc  =  true;

            if  (d.R)
              this.Vi.Fa.setCapture();

            d.Ja.replace(this.Vi.box,  "notMoving",  "moving");
            d.Ja.replace(this.Vi.object,  "notMoving",  "moving");
            d.Ja.replace(this.Vi.Fa,  "notMoving",  "moving");

            this.Oi  =  d.oa.ta(this.aj,  15,  this);

            this._j  =  true;
         }

          this.bj  = {  x:  this.Xi  +  Yc.clientX,  y:  this.Yi  +  Yc.clientY  +  d.V.scrollTop  -  this.Wi  };
          this.cj();

          if  (this.Vi.La[d.N])
         {
            this.Vi.La[d.N](this.Vi.object,  this.bj);
            this.cj();
         }

          if  (this.Vi.Ia.dir  !=  "vertical")
            d.dg.Jg(this.Vi.object,  "left",  this.bj.x);
          if  (this.Vi.Ia.dir  !=  "horizontal")
            d.dg.Jg(this.Vi.object,  "top",   this.bj.y);
       }
        else 
          this.Si();
   },
    sd:  function(Yc)
   {
      this.Si();

      var   dj  =  d.Ga.Ha(Yc.subject,  "move");
      if  (dj)
     {
        var   pc  =  d.Ja.Ka(dj,  "move");

        if  (pc["onMouseScroll"])
       {
          if  (this.ej)
            clearTimeout(this.ej);

          var   fj  =  document.getElementById(pc["onMouseScroll"]);
          this.Vi  = {
            box:  fj.offsetParent  ||  d.V,
            object:  fj,
            La:  d.Ja.Ka(fj,  "movable")
         };
          
          this.Zi();

          var   gj  =  this.Vi.object.offsetTop;

          var   hj  =  pc["delta"] ||  Math.abs(Yc.detail);

          this.bj  = {  x:0,  y:gj  +  hj  *  Yc.detail  /  Math.abs(Yc.detail) };
          this.cj();

          if  (this.Vi.La[d.N])
         {
            this.Vi.La[d.N](this.Vi.object,  this.bj);
            this.cj();
         }

          d.dg.Jg(this.Vi.object,  "top",   this.bj.y);

          var   ij  =  d.Ni.Vi.La[d.O];
          if  (this.Vi.La[d.O])
         {
            var   X  =  d.Ni.Vi.object;
            var   Ui  =  d.Ni.bj;
            this.ej  =  d.oa.pa(function() {  ij(X,  Ui); },  500);
         }

          this.Si();
          
          Yc.cancel();
       }
     }
   },

    Zi:  function()
   {
      
      
      
      var   jj   = -1;
      var   kj  = -1;
      var   lj  =  this.Vi.box;
      while  (jj  <=  1  ||  kj  <=  1)
     {
        jj  = (document.compatMode  !=  "BackCompat"  ||  lj  !=  d.V)?lj.offsetWidth:lj.clientWidth;
        kj  =  lj.offsetHeight;
        lj  =  lj.offsetParent  ||  d.V;
     }
      

      if  (this.Vi.La["restricted"])
     {
        this.mj  =  jj   -  d.dg.vg(this.Vi.object,  "width") -  d.dg.vg(this.Vi.object,  "marginRight") - (lj  ==  d.V?2:0);
        this.nj  =  kj  -  d.dg.vg(this.Vi.object,  "height") -  d.dg.vg(this.Vi.object,  "marginBottom");
     }
   },

    cj:  function()
   {
      if  (this.Vi.La["restricted"])
     {
        this.bj.x  =  Math.max(0,  Math.min(this.bj.x,  this.mj)),
        this.bj.y  =  Math.max(0,  Math.min(this.bj.y,  this.nj))
     }
   },
    Si:  function()
   {
      if  (this.Vi)
     {
        if  (this._j)
       {
          if  (this.Vi.box)
            d.Ja.replace(this.Vi.box,  "moving",  "notMoving");
          if  (this.Vi.object)
            d.Ja.replace(this.Vi.object,  "moving",  "notMoving");
          if  (this.Vi.Fa)
            d.Ja.replace(this.Vi.Fa,  "moving",  "notMoving");

          if  (this.Vi.La[d.O])
            this.Vi.La[d.O](this.Vi.object,  this.bj);

          d.Oc.Pc  =  false;

          if  (d.R)
            this.Vi.Fa.releaseCapture();

          this.Pi  =  null;
          clearTimeout(this.Oi);
          this.Oi  =  null;
       }

        this.Vi  =  null;
     }

      this.oj  =  d.V.scrollHeight  -  d.V.offsetHeight;
   },
    aj:  function()
   {
      if  (this.bj  &&  this.Vi.Ia.dir  !=  "horizontal")
     {
        var   pj  =  d.V.scrollTop;
      
        if  (this.Pi  <  50)
          d.V.scrollTop  -=  Math.round(10  -  this.Pi/5);

        if  (this.Pi  >  d.V.offsetHeight  -  50)
          d.V.scrollTop  =  Math.min(d.V.scrollTop  +  Math.round(10  - (d.V.offsetHeight  -  this.Pi)/5),  this.oj);

        if  (d.V.scrollTop  !=  pj)
       {
          this.bj.y  +=  d.V.scrollTop  -  pj;
          this.cj();

          if  (this.Vi.La[d.N])
         {
            this.Vi.La[d.N](this.Vi.object,  this.bj);
            this.cj();
         }
          d.dg.Jg(this.Vi.object,  "top",   this.bj.y);
       }
     }
   }
};

 d.W(d.Ni);
 d.qj  = {
    ba:  function()
   {
      d.Oc.Sc(document.documentElement,  d.H,  this.Qi,  this);
      d.Oc.Sc(document.documentElement,  d.I,  this.Ri,  this);
      d.Oc.Sc(document.documentElement,  d.J,    this.Si,  this);

      d.wa.nd("persist-dim",  this.Ti,  this);
   },

    Ti:  function(Yc)
   {
      var   za  =  Yc.subject;
      if  (d.Ja.contains(za,  "resizable"))
     {
        var   rj  = {  width:  parseInt(za.style.width),  height:  parseInt(za.style.height) };
        if  (!isNaN(rj.width) || !isNaN(rj.height))
       {
          var   La  =  d.Ja.Ka(za,  "resizable");
          if  (La[d.N])
            La[d.N](za,  rj);
       }
     }
   },
    
    Qi:  function(Yc)
   {
      
      this.Si();

      this.sj  =  d.oa.ya(Yc.subject,  "resizer",  "resizable");
      if  (this.sj.object)
     {
        
        this.tj  =  d.dg.vg(this.sj.object,  "width");
        this.uj  =  d.dg.vg(this.sj.object,  "minWidth") ||  0;
        this.vj  =  d.dg.vg(this.sj.object,  "maxWidth") ||  Infinity;

        this.wj  =  d.dg.vg(this.sj.object,  "height");
        this.xj  =  d.dg.vg(this.sj.object,  "minHeight") ||  0;
        this.yj  =  d.dg.vg(this.sj.object,  "maxHeight") ||  Infinity;

        this.Xi  =  Yc.clientX;
        this.Yi  =  Yc.clientY;

        this.zj  =  false;
     }
      else 
        this.sj  =  null;
   },
    
    Ri:  function(Yc)
   {
      if  (this.sj)
        if  (Yc.kd)
       {
          if  (!this.zj)
         {
            d.Oc.Pc  =  true;

            if  (d.R)
              this.sj.Fa.setCapture();

            d.Ja.replace(this.sj.object,  "notResizing",  "resizing");
            d.Ja.replace(this.sj.Fa,  "notResizing",  "resizing");
            this.zj  =  true;
         }

          this.Aj  = {
            width:this.tj  +  Yc.clientX  -  this.Xi,
            height:this.wj  +  Yc.clientY  -  this.Yi 
         };
          this.cj();

          if  (this.sj.La[d.N])
         {
            this.sj.La[d.N](this.sj.object,  this.Aj);
            this.cj();
         }

          if  (this.sj.Ia.Bj  !=  "height")
            this.sj.object.style.width   =  this.Aj.width   +  "px";
          if  (this.sj.Ia.Bj  !=  "width")
            this.sj.object.style.height  =  this.Aj.height  +  "px";
       }
        else 
          this.Si();
   },
    cj:  function()
   {
      this.Aj.width   =  Math.max(this.uj,  Math.min(this.vj,  this.Aj.width));
      this.Aj.height  =  Math.max(this.xj,  Math.min(this.yj,  this.Aj.height));
   },

    Si:  function()
   {
      if  (this.sj)
     {
        if  (this.zj)
       {
          d.Ja.replace(this.sj.object,  "resizing",  "notResizing");
          d.Ja.replace(this.sj.Fa,  "resizing",  "notResizing");

          if  (this.sj.La[d.O])
            this.sj.La[d.O](this.sj.object,  this.Aj);

          d.Oc.Pc  =  false;

          if  (d.R)
            this.sj.Fa.releaseCapture();
       }

        this.sj  =  null;
     }
   }
};

 d.qj.ba();
 d.Cj  = {
    pf:  null,
    Dj:  Math.pow(2,  15),
    ba:  function()
   {
      d.Oc.Sc(document.documentElement,  "mousedown",  this.Ej,  this);
      d.Oc.Sc(document.documentElement,  "keyup",  this.Ej,  this);
      d.wa.nd(d.m,  this.Ej,  this);
   },
    
    Ej:  function(Yc)
   {
      var   za  =  Yc.subject;

      if  (za  !=  this.pf)
     {
        this.pf  =  za;

        for  (;za  &&   za.nodeType  ==  1;  za  =  za.parentNode)
          if  (d.Ja.contains(za,  "stackable"))
            za.style.zIndex  =  this.Dj++;
     }
   }
};


 d.Cj.ba();
 d.Fj  = {
    Gj:"dragging",
    Hj:"notDragging",
    Ij:"dropping",
    Jj:"notDropping",
    ba:  function()
   {
      d.Oc.Sc(document.documentElement,  d.H,  this.Qi,  this);
      d.Oc.Sc(document.documentElement,  d.I,  this.Ri,  this);
      d.Oc.Sc(document.documentElement,  d.J,    this.Kj,  this);
   },
    
    Qi:  function(Yc)
   {
      
      this.Si();

      
      var   Lj  =  d.Ga.Ha(Yc.subject,  "dragger");
      if  (Lj)
     {
        
        var   Mj  =  d.Ga.Ha(Yc.subject,  "draggable");

        
        if  (Mj)
       {
          
          if  (!d.Ga.Ha(Yc.subject,  "dragging-disabled"))
            
            this.Nj(Mj,  Lj);

          
          
          Yc.cancel();
       }
     }
   },
    
    Ri:  function(Yc)
   {
      this.Pi  =  Yc.clientY;

      if  (this.Oj)
        if  (Yc.kd)
       {
          this.Pj();

          
          this.Qj.style.left  = (d.V.scrollLeft  +  Yc.clientX) +  "px";
          this.Qj.style.top  = (d.V.scrollTop  +  5  +  this.Pi) +  "px";

          
          
          
          var   Mj  =  d.Ga.Ha(Yc.subject,  "draggable");
          if  (Mj  !=  this.Qj)
         {
            
            var   Rj  =  d.Ga.Ha(Yc.subject,  "dropBox");
            if  (Rj  &&  Rj  !=  this.Sj)
           {
              
              var   Tj  =  d.oa.Va(Rj,  "dropType",  "",  true);
              for  (var   i=0;  i<Tj.length;  i++)
                if  (!isNaN(this.Uj[Tj[i]]))
                  break;
              
              if  (i  >=  Tj.length)
                Rj  =  null;
           }

            var   Vj  =  null;

            if  (d.Ga.Ha(Yc.subject,  "noDrop",  "dropBox"))
              Rj  =  null;

            if  (Rj)
           {
              var   Wj  =  d.R?Yc.clientY:(Yc.clientY  +  d.V.scrollTop);
              if  (d.Q)
             {
                Wj  =  Yc.offsetY;
                var   za  =  Yc.subject;
                while  (za  !=  Rj)
               {
                  Wj  +=  za.offsetTop;
                  za  =  za.offsetParent  ||  d.V;
               }
             }

              for  (var   i=0; !Vj  &&  i<Rj.childNodes.length;  i++)
             {
                var   Bb  =  Rj.childNodes[i];
                if  (Bb  !=  this.Xj  &&  Bb  !=  this.Qj  &&  Bb.nodeType  ==  1)
               {
                  var   Ab  =  d.Ga.getBoxObjectFor(Bb);
                  if  (Wj  < (Ab.y  +  Ab.height/2))
                    Vj  =  Bb;
               }
             }
           }
            this.Yj(Rj,  Vj);
         }

          
          Yc.cancel();
       }
        else 
          this.Kj();
   },

 Pi:  null,
 Zj:  null,
 _k:  null,
        
    Nj:  function(Mj,  Lj)
   {
      this.ak  =  Lj;
      this.Oj  =  Mj;
      this.bk  =  Mj.parentNode;
      this.ck  =  Mj.nextSibling;

      
      this.dk  =  d.oa.Va(this.Oj,  "dragType",  "",  true);
      this.Uj  =  d.oa.ab(this.dk);

      this.ek  =  false;

      
      d.Ja.add(document.body,  "dragging-"  +  this.dk.join(" dragging-"));
   },


    Pj:  function()
   {
      if  (this.ek)
        return;

      this.ek  =  true;

      d.Oc.Pc  =  true;

      if  (d.R)
        this.ak.setCapture();

      
      var   fk  =  d.Ga.sb(this.Oj,  "dragPlaceholder");
      if  (fk)
        this.Qj  =  fk.cloneNode(true);
      else 
     {
        this.Qj  =  this.Oj.cloneNode(true);
        this.Qj.style.width  =  this.Oj.offsetWidth  +  "px";
     }

      d.Ja.add(this.Qj,  "dragPlaceholder");
      d.Ja.replace(this.Qj,  this.Hj,  this.Gj);
      this.Oj.parentNode.insertBefore(this.Qj,  this.Oj);

      this.Qj.style.position  =  "absolute";
      this.Qj.style.zIndex  =  Math.pow(2,  15);
      document.body.appendChild(this.Qj);

      
      var   gk  =  d.Ga.sb(this.Oj,  "dropPlaceholder");
      if  (gk)
        this.Xj  =  gk.cloneNode(true);
      else 
     {
        this.Xj  =  this.Oj.cloneNode(true);
 
     }
      d.Ja.add(this.Xj,  "dropPlaceholder");
      d.Ja.remove(this.Xj,  this.Hj);

      
      d.Ja.replace(this.Oj,  this.Hj,  this.Gj);
      d.Ja.replace(this.Oj.parentNode,  this.Hj,  this.Gj);

      this.Oi  =  d.oa.ta(this.aj,  15,  this);
   },
    Yj:  function(Rj,  Vj)
   {
      if  (Rj  !=  this.Sj  ||  Vj  !=  this.hk)
     {
        
        if  (this.Sj  &&  Rj  !=  this.Sj)
          d.Ja.replace(this.Sj,  this.Ij,  this.Jj);

        
        this.Sj  =  Rj;
        this.hk  =  Vj;

        if  (!Rj)
          this.Xj.parentNode.removeChild(this.Xj);
        else 
       {
          d.Ja.replace(Rj,  this.Jj,  this.Ij);
          Rj.insertBefore(this.Xj,  Vj  ||  null);
       }
     }
   },

    Kj:  function()
   {
      if  (this.Oj  &&  this.Sj)
     {
        var   Mj  =  this.Oj;
        var   ik  =  this.Xj.parentNode;
        var   jk  =  this.Xj.nextSibling;

        this.Si();

        var   kk  =  d.Ja.contains(this.bk,  "clone-box") &&  ik  !=  this.bk;
        if  (ik  !=  this.bk  ||  jk  !=  this.ck)
       {
          var   Vj  =  kk?Mj.cloneNode(true):Mj;

          ik.insertBefore(Vj,  jk);

          var   lk  =  d.Ja.Ka(ik,  "dropBox");
          if  (lk[d.O])
            if  (lk[d.O](Vj,  this.bk,  this.ck,  ik,  jk) ==  false)
              this.bk.insertBefore(Vj,  this.ck);
       }
     }

      this.Si();
   },

    Si:  function()
   {
      if  (this.Oj)
     {
        d.Ja.remove(document.body,  "dragging-"  +  this.dk.join(" dragging-"));

        if  (this.ek)
       {
          d.Ja.replace(this.Oj.parentNode,  this.Gj,  this.Hj);
          d.Ja.replace(this.Oj,  this.Gj,  this.Hj);
          if  (this.Sj)
            d.Ja.replace(this.Sj,  this.Ij,  this.Jj);

          
          this.Qj.parentNode.removeChild(this.Qj);
          if  (this.Xj.parentNode)
            this.Xj.parentNode.removeChild(this.Xj);
       }

        d.Oc.Pc  =  false;

        if  (d.R)
          this.ak.releaseCapture();

        this.ak  =  null;
        this.Oj  =  null;
        this.Sj  =  null;
        this.Pi  =  null;
        clearTimeout(this.Oi);
        this.Oi  =  null;
     }
      this.oj  =  d.V.scrollHeight  -  d.V.offsetHeight;
   },
    
    aj:  function()
   {
      var   pj  =  d.V.scrollTop;
      
      if  (this.Pi  <  50)
        d.V.scrollTop  -=  Math.round(10  -  this.Pi/5);

      if  (this.Pi  >  d.V.offsetHeight  -  50)
        d.V.scrollTop  =  Math.min(d.V.scrollTop  +  Math.round(10  - (d.V.offsetHeight  -  this.Pi)/5),  this.oj);

      if  (d.V.scrollTop  !=  pj)
        this.Qj.style.top  = (d.V.scrollTop  +  5  +  this.Pi) +  "px";
   }
};

 d.W(d.Fj);


 
 
 
 
 
 
 
 
 d.mk  =
{
    nk:0,
    ok:1,
    pk:2,
    qk:-1,
    rk:-2,
    sk: {},
    ba:  function()
   {
      d.Qd.ae(["classShifter"], ["classShiftee",  "classChain"],  this.Oe,  this);
      d.Bd.Kd("classChain",  this.tk,  this);
   },
    
    uk:  function(za)
   {
      var   Kf  =  d.Ga.lb(za);
      var   ie  =  d.Ja.Ka(za,  "classChain");
      var   data  =  this.vk(Kf,  document.body,  za,  "classChain", {},  ie);

      data.wk  =  this.qk;
      d.Ja.add(data.oe,  "sliding");
      this.xk(data);
   },
    reset:  function(za)
   {
      var   Kf  =  d.Ga.lb(za);
      delete   this.sk[Kf];
   },

    tk:  function(oe,  yk,  Yc)
   {
      var   za  =  Yc.subject;
      while  (za  &&  za.parentNode  !=  oe)
        za  =  za.parentNode;

      var   Kf  =  d.Ga.lb(oe);
      var   ie  =  d.Ja.Ka(oe,  "classChain");
      var   data  =  this.vk(Kf,  oe,  oe,  "classChain", {},  ie);

      for  (var   c=0;  c<data.children.length;  c++)
        if  (data.children[c] ==  za)
       {
          data.zk  =  c;

          if  (data.zk  ==  data.Ak)
            break;

          if  (data.Yf)
         {
            clearTimeout(data.Yf);
            data.Yf  =  null;
         }

          this.Bk(data);
        
          d.pd.ud(data.oe, ["jump"],  data.oe);

          data.Yf  =  d.oa.pa(this.xk,  data.ua,  this, [data]);
    
          break;
       }
   },
    Oe:  function(ne,  nc,  oe,  Se,  Yc,  fe,  ie)
   {
      var   Kf  =  d.Ga.lb(oe);
      var   data  =  this.vk(Kf,  ne,  oe,  Se,  fe,  ie);

      var   Ck  =  false;
      var   Dk  =  false;
      var   Ek  =  false;

      var   Fk  =  data.wk;

      if  (fe["pause"] &&  data.wk  !=  null)
     {
        data.Gk  =  true;
        Dk  =  true;
        d.Ja.ec(data.oe,  "pausing",  true);
     }

      if  (fe["resume"])
        Ck  =  true;

      if  (fe["stop"])
     {
        Dk  =  true;
        data.wk  =  null;
        d.Ja.remove(data.oe,  "sliding");
        if  (data.Gk)
          d.Ja.remove(data.oe,  "pausing");
     }

      if  (fe["slideToStart"])
     {
        data.wk  =  0;
        Ck  =  true;
     }
      if  (fe["slideToEnd"])
     {
        data.wk  =  data.Hk;
 
        Ck  =  true;
     }
      if  (fe["slideToNext"] ||  fe["jumpToNext"])
     {
        this.Ik(data,  1);
        Ek  =  true;
     }
      if  (fe["slideToPrevious"] ||  fe["jumpToPrevious"])
     {
        this.Ik(data, -1);
        Ek  =  true;
     }
      if  (fe["slideForward"])
     {
        data.wk  =  this.qk;
        Ck  =  true;
     }
      if  (fe["slideBackward"])
     {
        data.wk  =  this.rk;
        Ck  =  true;
     }
      if  (fe["slideTo"])
     {
        if  (data.Jk)
          data.wk  =  this.Kk(data,  fe["slideTo"]);
        else 
          data.wk  =  data.Lk[fe["slideTo"]];
        Ck  =  true;
     }

      if  (fe["jumpToStart"])
     {
        data.zk  =  0;
        Ek  =  true;
     }
      if  (fe["jumpToEnd"])
     {
        data.zk  =  data.Hk;
        Ek  =  true;
     }
      if  (fe["jumpTo"])
     {
        if  (data.Jk)
          data.zk  =  this.Kk(data,  fe["jumpTo"]);
        else 
          data.zk  =  data.Lk[fe["jumpTo"]];
        Ek  =  true;
     }

      if  (Ek  &&  data.zk  ==  data.Ak)
        Ek  =  false;

      if  (!data.Gk  &&  Ck  &&  data.wk  ==  Fk)
        Ck  =  false;

      if  (data.Yf  && (Dk  ||  Ck  ||  Ek))
     {
        clearTimeout(data.Yf);
        data.Yf  =  null;
     }

      if  (Ck  &&  data.Ak  ==  data.wk)
        Ck  =  false;

      if  (Ck)
     {
        data.Gk  =  false;
        data.dir  =  1;
        d.Ja.ec(data.oe,  "pausing",  false);
     }

      if  (Ek)
     {
        this.Bk(data);
        
        d.pd.ud(data.oe, ["jump"],  data.oe);
     }

      if  (Ek)
        data.Yf  =  d.oa.pa(this.xk,  data.ua,  this, [data]);
      else   if  (Ck)
     {
        d.Ja.add(data.oe,  "sliding");
        this.xk(data);
     }
   },
    vk:  function(Kf,  ne,  oe,  Se,  fe,  ie)
   {
      var   data  =  this.sk[Kf];

      if  (!data)
     {
        data  =  this.sk[Kf] = {
          Kf:Kf,
          ne:ne,
          oe:oe,
          Se:Se,
          Jk:(Se  ==  "classChain"),
          Mk:(ie["wrap"]?this.ok:(ie["bounce"]?this.pk:this.nk)),
          dir:1,
          Nk:ie["classes"],
          Lk:d.oa.ab(ie["classes"]),
          Ok:ie["classes"].join("\\b|\\b"),
          wk:null,
          ua:(fe["interval"] ||  ie["interval"] ||  d.w),
          Pk:d.oa.Ma(ie["onbeforechange"],  null)
       };
        if  (data.Jk)
       {
          data.Qk  =  ie["mainClass"];
          data.children  =  this.Rk(data.oe,  data.Ok);
          data.Sk  =  data.Lk[data.Qk];
       }
        data.Hk  = (data.Jk?data.children.length-1:data.Nk.length-1),
        data.Ak  =  this.Tk(data);
     }

      return   data;
   },
    Tk:  function(data)
   {
      for  (var   i=0;  i<=data.Hk;  i++)
        if  (
         (data.Jk  &&  d.Ja.contains(data.children[i],  data.Qk))
         ||
         (!data.Jk  &&  d.Ja.contains(data.oe,  data.Nk[i]))
       )
          return   i;
   },
    Kk:  function(data,  qb)
   {
      for  (var   i=0;  i<data.children.length;  i++)
        if  (d.Ja.contains(data.children[i],  qb))
          return   i;
   },
    Rk:  function(za,  Ok)
   {
      var   Ng  = [];
      for  (var   Uk  =  za.firstChild;  Uk;  Uk  =  Uk.nextSibling)
        if  (d.Ja.contains(Uk,  Ok))
          Ng.push(Uk);
      return   Ng;
   },
    Ik:  function(data,  hj)
   {
      data.zk  =  data.Ak  +  data.dir*hj;
      if  (data.zk  <  0)
     {
        if  (data.Mk  ==  this.ok)
          data.zk  =  data.Hk;
        else   if  (data.Mk  ==  this.pk)
       {
          data.zk  =  1;
          data.dir  *= -1;
       }
        else 
          data.zk  =  0;
     }
      else   if  (data.zk  >  data.Hk)
     {
        if  (data.Mk  ==  this.ok)
          data.zk  =  0;
        else   if  (data.Mk  ==  this.pk)
       {
          data.zk  =  data.Hk  -  1;
          data.dir  *= -1;
       }
        else 
          data.zk  =  data.Hk;
     }
   },
    xk:  function(data)
   {
      if  (!data.Gk  &&  data.wk  !=  null)
     {
        if  (data.wk  ==  this.qk)
          this.Ik(data,  1);
        else   if  (data.wk  ==  this.rk)
          this.Ik(data, -1);
        else   if  (data.Ak  !=  data.wk)
       {
          var   Vk  =  data.wk  -  data.Ak;
          this.Ik(data,  Vk  /  Math.abs(Vk));
       }

        this.Bk(data);

        d.pd.ud(data.oe, ["slide"],  data.oe);

        if  (data.Ak  !=  data.wk)
       {
          var   fe  =  d.Ja.Ka(data.ne,  "classShifter");
          var   ie  =  d.Ja.Ka(data.oe,  data.Se);
          var   ua  = (fe?fe["interval"]:null) ||  ie["interval"] ||  data.ua  ||  d.w;

          data.Yf  =  d.oa.pa(this.xk,  ua,  this, [data]);
       }
        else 
       {
          data.wk  =  null;
          d.Ja.remove(data.oe,  "sliding");
       }
     }
   },
    Bk:  function(data)
   {
      if  (data.zk  !=  data.Ak)
     {
        if  (!data.Pk  || (data.Pk(data.oe) !=  false))
       {
          if  (data.Jk)
         {
 

            if  (data.Hk  >=  data.Nk.length)
           {
              var   Wk  =  0;
              var   Xk  =  data.Nk.length  -  1;
           }
            else 
           {
              var   Wk  =  data.Sk  -  Math.floor(data.Hk/2);
              var   Xk  =  Wk  +  data.Hk;
           }

            var   Nk  = [];
            for  (var   i=0;  i<data.Nk.length;  i++)
              Nk[i] =  i;
            var   Yk  = (data.Mk  ==  this.ok?Xk:Wk);
            for  (var   i=-1;  i<Wk;  i++)
              Nk[i] =  Yk;
            Yk  = (data.Mk  ==  this.ok?Wk:Xk);
            for  (var   i=Xk  +  1;  i<=  data.Nk.length;  i++)
              Nk[i] =  Yk;

 

            var   Zk  = [];
            for  (var   i=0;  i<=data.Hk;  i++)
              Zk[i] =  data.Lk[d.Ja.match(data.children[i],  data.Ok)];

            var   _l  =  data.zk  -  data.Ak;
            var   al  =  _l/Math.abs(_l);
            for  (var   bl  =  1;  bl  <=  Math.abs(_l);  bl++)
           {
              Zk[-1] =  Zk[data.Hk];
              Zk[data.Hk+1] =  Zk[0];

              var   cl  = [];

              if  (al  ==  1)
                for  (var   i  =  0;  i  <=  data.Hk;  i++)
                  cl[i] =  Nk[Zk[i] - (Zk[i] !=  Zk[i-data.dir]?al:0)];
              else 
                for  (var   i  =  data.Hk;  i>=0;  i--)
                  cl[i] =  Nk[Zk[i] - (Zk[i] !=  Zk[i+data.dir]?al:0)];

              Zk  =  cl;
 
           }

            for  (var   i=0;  i<=data.Hk;  i++)
              d.Ja.replace(data.children[i],  data.Ok,  data.Nk[Zk[i]]);
         }
          else 
            d.Ja.replace(data.oe,  data.Ok,  data.Nk[data.zk]);

          data.Ak  =  data.zk;
       }
     }
   }
};

 d.W(d.mk);

 d["ClassShifter"] =  d.mk;
 d.mk["play"] =  d.mk.uk;
 d.mk["reset"] =  d.mk.reset;

 d.el  = {
    fl:null,
    gl:  null,
    ba:  function()
   {
 
 
 
 
 
 
 
 

      d.Oc.Sc(document.documentElement,  "mousedown",  this.Qi,  this);
      d.Oc.Sc(document.documentElement,  "mouseup",  this.hl,  this);
      d.Oc.Sc(document.documentElement,  "mousemove",  this.Ri,  this);
      d.Oc.Sc(document.documentElement,  "dragstart",  this.il,  this);
   },
    
    Qi:  function(Yc)
   {
      if  (d.wa.xa(d.r,  Yc.subject))
        for  (var   za  =  Yc.subject;  za;  za  =  za.parentNode)
          if  (d.Ja.contains(za,  "button"))
         {
            if  (!this.fl)
              this.fl  = [];

            this.fl.push(za);
            d.Ja.replace(za,  "up",  "down");
         }
   },

    hl:  function(Yc)
   {
      if  (d.wa.xa(d.r,  Yc.subject))
        if  (this.fl)
       {
          for  (var   i=0;  i<this.fl.length;  i++)
            d.Ja.replace(this.fl[i],  "down",  "up");

          this.fl  =  null;
       }
   },

    il:  function(Yc)
   {
      if  (d.wa.xa(d.r,  Yc.subject))
        if  (this.fl)
          for  (var   i=0;  i<this.fl.length;  i++)
            if  (Yc.subject  ==  this.fl[i])
              Yc.cancel();
   },

    Ri:  function(Yc)
   {
      if  (d.wa.xa(d.r,  Yc.subject) &&  this.fl  &&  Yc.subject  !=  this.gl)
     {
        this.gl  =  Yc.subject;

        for  (var   i=0;  i<this.fl.length;  i++)
          if  (d.Ga.Db(this.fl[i],  Yc.subject))
            d.Ja.replace(this.fl[i],  "up",  "down");
          else 
            d.Ja.replace(this.fl[i],  "down",  "up");
     }
   }
};

 d.el.ba();d.jl  = {
    ba:  function()
   {
      d.Oc.Sc(document.documentElement,  d.D,  this.Jd,  this);
      d.Oc.Sc(document.documentElement,  "keyup",  this.Jd,  this);
   },
    
    Jd:  function(Yc)
   {
      var   za  =  Yc.subject;
      if  (za.name)
     {
        var   value  =  d.Ga.Cb(za);

        if  (value  ||  za.kl)
       {
          var   ll  =  za.kl?document.getElementById(za.kl):d.Ga.Ha(za,  "reflector");

          if  (ll)
         {
            if  (!za.kl)
           {
              za.kl  =  d.Ga.lb(ll);
              d.Oc.Sc(za,  "paste",  this.ml,  this);
           }

            d.Ja.replace(ll,  za.name  +  "-[^\\s]*",  za.name  +  "-"  +  value);
         }
       }
     }
   },
    
    ml:  function(Yc)
   {
      d.oa.pa(this.Jd,  0,  this, [Yc])
   }
};

 d.W(d.jl);
 
 
 d.Ja.add(document.documentElement,  "spiffy "  +  d.oa.platform,  d.L);

 d.Oc.Sc(
    window,
    d.C,
    function()
   {
      if  (document.compatMode  ==  "BackCompat")
        d.V  =  document.body;

      
      if  (d.R)
     {
        var   nl  =  document.getElementsByTagName("object");
        for  (var   i=nl.length-1;  i>=0;  i--)
          nl[i].outerHTML  =  nl[i].outerHTML;
     }

      d.Ja.replace(document.body,  d.B,  d.z);

      d.wa.xa(d.o,  document.body);
   }
);

 if  (d.R)
{
    
    
    
 

 
 

    
    
    
    

    
    if  (!d.S)
   {
      try 
     {
        document.execCommand("BackgroundImageCache",  false,  true);
     }
      catch(Ig){}
   }
}

 d.wa.xa("spifLoaded");

 d["documentScrollElement"] =  d.V;


/*!
 * jQuery JavaScript Library v1.4.1
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Mon Jan 25 19:43:33 2010 -0500
 */
(function(z,v){function la(){if(!c.isReady){try{r.documentElement.doScroll("left")}catch(a){setTimeout(la,1);return}c.ready()}}function Ma(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for(var n in b)X(a,n,b[n],f,e,d);return a}if(d!==v){f=!i&&f&&c.isFunction(d);for(n=0;n<j;n++)e(a[n],b,f?d.call(a[n],n,e(a[n],b)):d,i);return a}return j?
e(a[0],b):null}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function ma(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function na(a){var b,d=[],f=[],e=arguments,i,j,n,o,m,s,x=c.extend({},c.data(this,"events").live);if(!(a.button&&a.type==="click")){for(o in x){j=x[o];if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete x[o]}i=c(a.target).closest(f,
a.currentTarget);m=0;for(s=i.length;m<s;m++)for(o in x){j=x[o];n=i[m].elem;f=null;if(i[m].selector===j.selector){if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];if(!f||f!==n)d.push({elem:n,fn:j})}}m=0;for(s=d.length;m<s;m++){i=d[m];a.currentTarget=i.elem;a.data=i.fn.data;if(i.fn.apply(i.elem,e)===false){b=false;break}}return b}}function oa(a,b){return"live."+(a?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&")}function pa(a){return!a||!a.parentNode||a.parentNode.nodeType===
11}function qa(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)}}})}function ra(a,b,d){var f,e,i;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0&&(c.support.checkClone||!sa.test(a[0]))){e=true;if(i=c.fragments[a[0]])if(i!==1)f=i}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:r;f=b.createDocumentFragment();
c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=i?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(ta.concat.apply([],ta.slice(0,b)),function(){d[this]=a});return d}function ua(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Na=z.jQuery,Oa=z.$,r=z.document,S,Pa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Qa=/^.[^:#\[\.,]*$/,Ra=/\S/,Sa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Ta=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=navigator.userAgent,
va=false,P=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,Q=Array.prototype.slice,wa=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Pa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:r;if(a=Ta.exec(a))if(c.isPlainObject(b)){a=[r.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ra([d[1]],
[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=r.getElementById(d[2])){if(b.id!==d[2])return S.find(a);this.length=1;this[0]=b}this.context=r;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=r;a=r.getElementsByTagName(a)}else return!b||b.jquery?(b||S).find(a):c(b).find(a);else if(c.isFunction(a))return S.ready(a);if(a.selector!==v){this.selector=a.selector;this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a,
this)},selector:"",jquery:"1.4.1",length:0,size:function(){return this.length},toArray:function(){return Q.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=0;ba.apply(this,a);return this},each:function(a,b){return c.each(this,
a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(r,c);else P&&P.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(Q.apply(this,arguments),"slice",Q.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};
c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,n;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(i in e){j=a[i];n=e[i];if(a!==n)if(f&&n&&(c.isPlainObject(n)||c.isArray(n))){j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(n)?[]:{};a[i]=c.extend(f,j,n)}else if(n!==v)a[i]=n}return a};c.extend({noConflict:function(a){z.$=
Oa;if(a)z.jQuery=Na;return c},isReady:false,ready:function(){if(!c.isReady){if(!r.body)return setTimeout(c.ready,13);c.isReady=true;if(P){for(var a,b=0;a=P[b++];)a.call(r,c);P=null}c.fn.triggerHandler&&c(r).triggerHandler("ready")}},bindReady:function(){if(!va){va=true;if(r.readyState==="complete")return c.ready();if(r.addEventListener){r.addEventListener("DOMContentLoaded",L,false);z.addEventListener("load",c.ready,false)}else if(r.attachEvent){r.attachEvent("onreadystatechange",L);z.attachEvent("onload",
c.ready);var a=false;try{a=z.frameElement==null}catch(b){}r.documentElement.doScroll&&a&&la()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for(b in a);return b===v||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;
return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return z.JSON&&z.JSON.parse?z.JSON.parse(a):(new Function("return "+a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Ra.test(a)){var b=r.getElementsByTagName("head")[0]||
r.documentElement,d=r.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(r.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,i=a.length,j=i===v||c.isFunction(a);if(d)if(j)for(f in a){if(b.apply(a[f],d)===false)break}else for(;e<i;){if(b.apply(a[e++],d)===false)break}else if(j)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=
a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Sa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==
v;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,i=0,j=a.length;i<j;i++){e=b(a[i],i,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=v}else if(b&&!c.isFunction(b)){d=b;b=v}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},
uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});O=c.uaMatch(O);if(O.browser){c.browser[O.browser]=true;c.browser.version=O.version}if(c.browser.webkit)c.browser.safari=true;if(wa)c.inArray=function(a,b){return wa.call(b,a)};S=c(r);if(r.addEventListener)L=function(){r.removeEventListener("DOMContentLoaded",
L,false);c.ready()};else if(r.attachEvent)L=function(){if(r.readyState==="complete"){r.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=r.documentElement,b=r.createElement("script"),d=r.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support=
{leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:r.createElement("select").appendChild(r.createElement("option")).selected,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};
b.type="text/javascript";try{b.appendChild(r.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,a.firstChild);if(z[f]){c.support.scriptEval=true;delete z[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function n(){c.support.noCloneEvent=false;d.detachEvent("onclick",n)});d.cloneNode(true).fireEvent("onclick")}d=r.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=r.createDocumentFragment();a.appendChild(d.firstChild);
c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var n=r.createElement("div");n.style.width=n.style.paddingLeft="1px";r.body.appendChild(n);c.boxModel=c.support.boxModel=n.offsetWidth===2;r.body.removeChild(n).style.display="none"});a=function(n){var o=r.createElement("div");n="on"+n;var m=n in o;if(!m){o.setAttribute(n,"return;");m=typeof o[n]==="function"}return m};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props=
{"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ua=0,xa={},Va={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var f=a[G],e=c.cache;if(!b&&!f)return null;f||(f=++Ua);if(typeof b==="object"){a[G]=f;e=e[f]=c.extend(true,
{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Va:(e[f]={});if(d!==v){a[G]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[G]}catch(i){a.removeAttribute&&a.removeAttribute(G)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,
a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===v){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===v&&this.length)f=c.data(this[0],a);return f===v&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);
return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===v)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||
a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var ya=/[\n\t]/g,ca=/\s+/,Wa=/\r/g,Xa=/href|src|style/,Ya=/(button|input)/i,Za=/(button|input|object|select|textarea)/i,$a=/^(a|area)$/i,za=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(o){var m=
c(this);m.addClass(a.call(this,o,m.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,n=b.length;j<n;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+=" "+b[j]}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var m=c(this);m.removeClass(a.call(this,o,m.attr("class")))});if(a&&typeof a==="string"||a===v)for(var b=(a||"").split(ca),
d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var i=(" "+e.className+" ").replace(ya," "),j=0,n=b.length;j<n;j++)i=i.replace(" "+b[j]+" "," ");e.className=i.substring(1,i.length-1)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),n=b,o=
a.split(ca);e=o[i++];){n=f?n:!j.hasClass(e);j[n?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(ya," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||
{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(za.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Wa,"")}return v}var n=c.isFunction(a);return this.each(function(o){var m=c(this),s=a;if(this.nodeType===1){if(n)s=a.call(this,o,m.val());
if(typeof s==="number")s+="";if(c.isArray(s)&&za.test(this.type))this.checked=c.inArray(m.val(),s)>=0;else if(c.nodeName(this,"select")){var x=c.makeArray(s);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),x)>=0});if(!x.length)this.selectedIndex=-1}else this.value=s}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return v;if(f&&b in c.attrFn)return c(a)[b](d);
f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==v;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Xa.test(b);if(b in a&&f&&!i){if(e){b==="type"&&Ya.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Za.test(a.nodeName)||$a.test(a.nodeName)&&a.href?0:v;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=
""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?v:a}return c.style(a,b,d)}});var ab=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==z&&!a.frameElement)a=z;if(!d.guid)d.guid=c.guid++;if(f!==v){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j=
function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):v};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var n,o=0;n=b[o++];){var m=n.split(".");n=m.shift();if(o>1){d=c.proxy(d);if(f!==v)d.data=f}d.type=m.slice(0).sort().join(".");var s=e[n],x=this.special[n]||{};if(!s){s=e[n]={};if(!x.setup||x.setup.call(a,f,m,d)===false)if(a.addEventListener)a.addEventListener(n,i,false);else a.attachEvent&&a.attachEvent("on"+n,i)}if(x.add)if((m=x.add.call(a,
d,f,m,s))&&c.isFunction(m)){m.guid=m.guid||d.guid;m.data=m.data||d.data;m.type=m.type||d.type;d=m}s[d.guid]=d;this.global[n]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===v||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);for(var n=0;i=b[n++];){var o=i.split(".");i=o.shift();var m=!o.length,s=c.map(o.slice(0).sort(),ab);s=new RegExp("(^|\\.)"+
s.join("\\.(?:.*\\.)?")+"(\\.|$)");var x=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var A in f[i])if(m||s.test(f[i][A].type))delete f[i][A];x.remove&&x.remove.call(a,o,j);for(e in f[i])break;if(!e){if(!x.teardown||x.teardown.call(a,o)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(A=c.data(a,"handle"))A.elem=null;c.removeData(a,
"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return v;a.result=v;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,
b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(i){}if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){d=a.target;var j;if(!(c.nodeName(d,"a")&&e==="click")&&!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){try{if(d[e]){if(j=d["on"+e])d["on"+e]=null;this.triggered=true;d[e]()}}catch(n){}if(j)d["on"+e]=j;this.triggered=false}}},handle:function(a){var b,
d;a=arguments[0]=c.event.fix(a||z.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==v){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||r;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=r.documentElement;d=r.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==v)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;b.liveProxy=a;c.event.add(this,b.live,na,b)},remove:function(a){if(a.length){var b=
0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],na)}},special:{}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};
c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Aa=function(a){for(var b=
a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ba=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ba:Aa,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ba:Aa)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!==
"form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return ma("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return ma("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,
"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var da=/textarea|input|select/i;function Ca(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ea(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Ca(d);if(a.type!=="focusout"||
d.type!=="radio")c.data(d,"_change_data",e);if(!(f===v||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}}c.event.special.change={filters:{focusout:ea,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ea.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ea.call(this,a)},beforeactivate:function(a){a=
a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Ca(a))}},setup:function(a,b,d){for(var f in T)c.event.add(this,f+".specialChange."+d.guid,T[f]);return da.test(this.nodeName)},remove:function(a,b){for(var d in T)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),T[d]);return da.test(this.nodeName)}};var T=c.event.special.change.filters}r.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,
f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){e=f;f=v}var j=b==="one"?c.proxy(e,function(n){c(this).unbind(n,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a,
b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+
a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e){var i,j=0;if(c.isFunction(f)){e=f;f=v}for(d=(d||"").split(/\s+/);(i=d[j++])!=null;){i=i==="focus"?"focusin":i==="blur"?"focusout":i==="hover"?d.push("mouseleave")&&"mouseenter":i;b==="live"?c(this.context).bind(oa(i,this.selector),{data:f,selector:this.selector,
live:i},e):c(this.context).unbind(oa(i,this.selector),e?{guid:e.guid+this.selector+i}:null)}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});z.attachEvent&&!z.addEventListener&&z.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
(function(){function a(g){for(var h="",k,l=0;g[l];l++){k=g[l];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,l,q,p){q=0;for(var u=l.length;q<u;q++){var t=l[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===k){y=l[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=k;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}l[q]=y}}}function d(g,h,k,l,q,p){q=0;for(var u=l.length;q<u;q++){var t=l[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===
k){y=l[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=k;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(o.filter(h,[t]).length>0){y=t;break}}t=t[g]}l[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,i=Object.prototype.toString,j=false,n=true;[0,0].sort(function(){n=false;return 0});var o=function(g,h,k,l){k=k||[];var q=h=h||r;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||
typeof g!=="string")return k;for(var p=[],u,t,y,R,H=true,M=w(h),I=g;(f.exec(""),u=f.exec(I))!==null;){I=u[3];p.push(u[1]);if(u[2]){R=u[3];break}}if(p.length>1&&s.exec(g))if(p.length===2&&m.relative[p[0]])t=fa(p[0]+p[1],h);else for(t=m.relative[p[0]]?[h]:o(p.shift(),h);p.length;){g=p.shift();if(m.relative[g])g+=p.shift();t=fa(g,t)}else{if(!l&&p.length>1&&h.nodeType===9&&!M&&m.match.ID.test(p[0])&&!m.match.ID.test(p[p.length-1])){u=o.find(p.shift(),h,M);h=u.expr?o.filter(u.expr,u.set)[0]:u.set[0]}if(h){u=
l?{expr:p.pop(),set:A(l)}:o.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=u.expr?o.filter(u.expr,u.set):u.set;if(p.length>0)y=A(t);else H=false;for(;p.length;){var D=p.pop();u=D;if(m.relative[D])u=p.pop();else D="";if(u==null)u=h;m.relative[D](y,u,M)}}else y=[]}y||(y=t);y||o.error(D||g);if(i.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))k.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&
y[g].nodeType===1&&k.push(t[g]);else k.push.apply(k,y);else A(y,k);if(R){o(R,q,k,l);o.uniqueSort(k)}return k};o.uniqueSort=function(g){if(C){j=n;g.sort(C);if(j)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};o.matches=function(g,h){return o(g,null,null,h)};o.find=function(g,h,k){var l,q;if(!g)return[];for(var p=0,u=m.order.length;p<u;p++){var t=m.order[p];if(q=m.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");l=m.find[t](q,
h,k);if(l!=null){g=g.replace(m.match[t],"");break}}}}l||(l=h.getElementsByTagName("*"));return{set:l,expr:g}};o.filter=function(g,h,k,l){for(var q=g,p=[],u=h,t,y,R=h&&h[0]&&w(h[0]);g&&h.length;){for(var H in m.filter)if((t=m.leftMatch[H].exec(g))!=null&&t[2]){var M=m.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(u===p)p=[];if(m.preFilter[H])if(t=m.preFilter[H](t,u,k,p,l,R)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=u[U])!=null;U++)if(D){I=M(D,t,U,u);var Da=
l^!!I;if(k&&I!=null)if(Da)y=true;else u[U]=false;else if(Da){p.push(D);y=true}}if(I!==v){k||(u=p);g=g.replace(m.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)o.error(g);else break;q=g}return u};o.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var m=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,h){var k=typeof h==="string",l=k&&!/\W/.test(h);k=k&&!l;if(l)h=h.toLowerCase();l=0;for(var q=g.length,
p;l<q;l++)if(p=g[l]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[l]=k||p&&p.nodeName.toLowerCase()===h?p||false:p===h}k&&o.filter(h,g,true)},">":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var l=0,q=g.length;l<q;l++){var p=g[l];if(p){k=p.parentNode;g[l]=k.nodeName.toLowerCase()===h?k:false}}}else{l=0;for(q=g.length;l<q;l++)if(p=g[l])g[l]=k?p.parentNode:p.parentNode===h;k&&o.filter(h,g,true)}},"":function(g,h,k){var l=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=
h=h.toLowerCase();q=b}q("parentNode",h,l,g,p,k)},"~":function(g,h,k){var l=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,l,g,p,k)}},find:{ID:function(g,h,k){if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var k=[];h=h.getElementsByName(g[1]);for(var l=0,q=h.length;l<q;l++)h[l].getAttribute("name")===g[1]&&k.push(h[l]);return k.length===0?null:k}},
TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,l,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var u;(u=h[p])!=null;p++)if(u)if(q^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||l.push(u);else if(k)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&
"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,l,q,p){h=g[1].replace(/\\/g,"");if(!p&&m.attrMap[h])g[1]=m.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,l,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=o(g[3],null,null,h);else{g=o.filter(g[3],h,k,true^q);k||l.push.apply(l,g);return false}else if(m.match.POS.test(g[0])||m.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);
return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!o(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===
g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,h){return h===0},last:function(g,h,k,l){return h===l.length-1},even:function(g,h){return h%2===
0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return h<k[3]-0},gt:function(g,h,k){return h>k[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,l){var q=h[1],p=m.filters[q];if(p)return p(g,k,h,l);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=h[3];k=0;for(l=h.length;k<l;k++)if(h[k]===g)return false;return true}else o.error("Syntax error, unrecognized expression: "+
q)},CHILD:function(g,h){var k=h[1],l=g;switch(k){case "only":case "first":for(;l=l.previousSibling;)if(l.nodeType===1)return false;if(k==="first")return true;l=g;case "last":for(;l=l.nextSibling;)if(l.nodeType===1)return false;return true;case "nth":k=h[2];var q=h[3];if(k===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var u=0;for(l=p.firstChild;l;l=l.nextSibling)if(l.nodeType===1)l.nodeIndex=++u;p.sizcache=h}g=g.nodeIndex-q;return k===0?g===0:g%k===0&&g/k>=
0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=m.attrHandle[k]?m.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var l=h[2];h=h[4];return g==null?l==="!=":l==="="?k===h:l==="*="?k.indexOf(h)>=0:l==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:l==="!="?k!==h:l==="^="?
k.indexOf(h)===0:l==="$="?k.substr(k.length-h.length)===h:l==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,l){var q=m.setFilters[h[2]];if(q)return q(g,k,h,l)}}},s=m.match.POS;for(var x in m.match){m.match[x]=new RegExp(m.match[x].source+/(?![^\[]*\])(?![^\(]*\))/.source);m.leftMatch[x]=new RegExp(/(^(?:.|\r|\n)*?)/.source+m.match[x].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1)}))}var A=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};
try{Array.prototype.slice.call(r.documentElement.childNodes,0)}catch(B){A=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,l=g.length;k<l;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);return h}}var C;if(r.documentElement.compareDocumentPosition)C=function(g,h){if(!g.compareDocumentPosition||!h.compareDocumentPosition){if(g==h)j=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===
h?0:1;if(g===0)j=true;return g};else if("sourceIndex"in r.documentElement)C=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)j=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)j=true;return g};else if(r.createRange)C=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)j=true;return g.ownerDocument?-1:1}var k=g.ownerDocument.createRange(),l=h.ownerDocument.createRange();k.setStart(g,0);k.setEnd(g,0);l.setStart(h,0);l.setEnd(h,0);g=k.compareBoundaryPoints(Range.START_TO_END,
l);if(g===0)j=true;return g};(function(){var g=r.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var k=r.documentElement;k.insertBefore(g,k.firstChild);if(r.getElementById(h)){m.find.ID=function(l,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(l[1]))?q.id===l[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===l[1]?[q]:v:[]};m.filter.ID=function(l,q){var p=typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id");
return l.nodeType===1&&p&&p.nodeValue===q}}k.removeChild(g);k=g=null})();(function(){var g=r.createElement("div");g.appendChild(r.createComment(""));if(g.getElementsByTagName("*").length>0)m.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var l=0;k[l];l++)k[l].nodeType===1&&h.push(k[l]);k=h}return k};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")m.attrHandle.href=function(h){return h.getAttribute("href",
2)};g=null})();r.querySelectorAll&&function(){var g=o,h=r.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){o=function(l,q,p,u){q=q||r;if(!u&&q.nodeType===9&&!w(q))try{return A(q.querySelectorAll(l),p)}catch(t){}return g(l,q,p,u)};for(var k in g)o[k]=g[k];h=null}}();(function(){var g=r.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===
0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){m.order.splice(1,0,"CLASS");m.find.CLASS=function(h,k,l){if(typeof k.getElementsByClassName!=="undefined"&&!l)return k.getElementsByClassName(h[1])};g=null}}})();var E=r.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)},w=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},fa=function(g,h){var k=[],
l="",q;for(h=h.nodeType?[h]:h;q=m.match.PSEUDO.exec(g);){l+=q[0];g=g.replace(m.match.PSEUDO,"")}g=m.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)o(g,h[q],k);return o.filter(l,k)};c.find=o;c.expr=o.selectors;c.expr[":"]=c.expr.filters;c.unique=o.uniqueSort;c.getText=a;c.isXMLDoc=w;c.contains=E})();var bb=/Until$/,cb=/^(?:parents|prevUntil|prevAll)/,db=/,/;Q=Array.prototype.slice;var Ea=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,i){return!!b.call(e,i,e)===d});else if(b.nodeType)return c.grep(a,
function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Qa.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=
0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ea(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ea(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i={},j;if(f&&a.length){e=0;for(var n=a.length;e<n;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>
-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var o=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(m,s){for(;s&&s.ownerDocument&&s!==b;){if(o?o.index(s)>-1:c(s).is(a))return s;s=s.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),
a);return this.pushStack(pa(a[0])||pa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},
nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);bb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):
e;if((this.length>1||db.test(f))&&cb.test(a))e=e.reverse();return this.pushStack(e,a,Q.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===v||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==
b&&d.push(a);return d}});var Fa=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ga=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,sa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ia=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],
col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==v)return this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(a));return c.getText(this)},
wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?
d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,
false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&
!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Fa,"").replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){qa(this,b);qa(this.find("*"),b.find("*"))}return b},html:function(a){if(a===v)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Fa,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(Ha.exec(a)||
["",""])[1].toLowerCase()]){a=a.replace(Ga,Ia);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,
b,f))});else a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(s){return c.nodeName(s,"table")?s.getElementsByTagName("tbody")[0]||s.appendChild(s.ownerDocument.createElement("tbody")):s}var e,i,j=a[0],n=[];if(!c.support.checkClone&&arguments.length===3&&typeof j===
"string"&&sa.test(j))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(j))return this.each(function(s){var x=c(this);a[0]=j.call(this,s,b?x.html():v);x.domManip(a,b,d)});if(this[0]){e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{fragment:a[0].parentNode}:ra(a,this,n);if(i=e.fragment.firstChild){b=b&&c.nodeName(i,"tr");for(var o=0,m=this.length;o<m;o++)d.call(b?f(this[o],i):this[o],e.cacheable||this.length>1||o>0?e.fragment.cloneNode(true):e.fragment)}n&&c.each(n,
Ma)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);for(var e=0,i=d.length;e<i;e++){var j=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),j);f=f.concat(j)}return this.pushStack(f,a,d.selector)}});c.each({remove:function(a,b){if(!a||c.filter(a,[this]).length){if(!b&&this.nodeType===1){c.cleanData(this.getElementsByTagName("*"));c.cleanData([this])}this.parentNode&&
this.parentNode.removeChild(this)}},empty:function(){for(this.nodeType===1&&c.cleanData(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)}},function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||r;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||r;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j===
"string"){j=j.replace(Ga,Ia);var n=(Ha.exec(j)||["",""])[1].toLowerCase(),o=F[n]||F._default,m=o[0];i=b.createElement("div");for(i.innerHTML=o[1]+j+o[2];m--;)i=i.lastChild;if(!c.support.tbody){m=fb.test(j);n=n==="table"&&!m?i.firstChild&&i.firstChild.childNodes:o[1]==="<table>"&&!m?i.childNodes:[];for(o=n.length-1;o>=0;--o)c.nodeName(n[o],"tbody")&&!n[o].childNodes.length&&n[o].parentNode.removeChild(n[o])}!c.support.leadingWhitespace&&V.test(j)&&i.insertBefore(b.createTextNode(V.exec(j)[0]),i.firstChild);
j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()==="text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e},cleanData:function(a){for(var b=0,d;(d=a[b])!=null;b++){c.event.remove(d);c.removeData(d)}}});var hb=/z-?index|font-?weight|opacity|zoom|line-?height/i,
Ja=/alpha\([^)]*\)/,Ka=/opacity=([^)]*)/,ga=/float/i,ha=/-([a-z])/ig,ib=/([A-Z])/g,jb=/^-?\d+(?:px)?$/i,kb=/^-?\d/,lb={position:"absolute",visibility:"hidden",display:"block"},mb=["Left","Right"],nb=["Top","Bottom"],ob=r.defaultView&&r.defaultView.getComputedStyle,La=c.support.cssFloat?"cssFloat":"styleFloat",ia=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===v)return c.curCSS(d,f);if(typeof e==="number"&&!hb.test(f))e+="px";c.style(d,f,e)})};
c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return v;if((b==="width"||b==="height")&&parseFloat(d)<0)d=v;var f=a.style||a,e=d!==v;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Ja.test(a)?a.replace(Ja,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ka.exec(f.filter)[1])/100+"":""}if(ga.test(b))b=La;b=b.replace(ha,ia);if(e)f[b]=d;return f[b]},css:function(a,
b,d,f){if(b==="width"||b==="height"){var e,i=b==="width"?mb:nb;function j(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,lb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&
a.currentStyle){f=Ka.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ga.test(b))b=La;if(!d&&e&&e[b])f=e[b];else if(ob){if(ga.test(b))b="float";b=b.replace(ib,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ha,ia);f=a.currentStyle[b]||a.currentStyle[d];if(!jb.test(f)&&kb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=
a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var pb=
J(),qb=/<script(.|\s)*?\/script>/gi,rb=/select|textarea/i,sb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ja=/\?/,tb=/(\?|&)_=.*?(&|$)/,ub=/^(\w+:)?\/\/([^\/?#]+)/,vb=/%20/g;c.fn.extend({_load:c.fn.load,load:function(a,b,d){if(typeof a!=="string")return this._load(a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=
c.param(b,c.ajaxSettings.traditional);f="POST"}var i=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(j,n){if(n==="success"||n==="notmodified")i.html(e?c("<div />").append(j.responseText.replace(qb,"")).find(e):j.responseText);d&&i.each(d,[j.responseText,n,j])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&
(this.checked||rb.test(this.nodeName)||sb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,
b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:z.XMLHttpRequest&&(z.location.protocol!=="file:"||!z.ActiveXObject)?function(){return new z.XMLHttpRequest}:
function(){try{return new z.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(o,n,j,w);e.global&&f("ajaxSuccess",[w,e])}function d(){e.complete&&e.complete.call(o,w,j);e.global&&f("ajaxComplete",[w,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}
function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),i,j,n,o=a&&a.context||e,m=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(m==="GET")N.test(e.url)||(e.url+=(ja.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||
N.test(e.url))){i=e.jsonpCallback||"jsonp"+pb++;if(e.data)e.data=(e.data+"").replace(N,"="+i+"$1");e.url=e.url.replace(N,"="+i+"$1");e.dataType="script";z[i]=z[i]||function(q){n=q;b();d();z[i]=v;try{delete z[i]}catch(p){}A&&A.removeChild(B)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&m==="GET"){var s=J(),x=e.url.replace(tb,"$1_="+s+"$2");e.url=x+(x===e.url?(ja.test(e.url)?"&":"?")+"_="+s:"")}if(e.data&&m==="GET")e.url+=(ja.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&
c.event.trigger("ajaxStart");s=(s=ub.exec(e.url))&&(s[1]&&s[1]!==location.protocol||s[2]!==location.host);if(e.dataType==="script"&&m==="GET"&&s){var A=r.getElementsByTagName("head")[0]||r.documentElement,B=r.createElement("script");B.src=e.url;if(e.scriptCharset)B.charset=e.scriptCharset;if(!i){var C=false;B.onload=B.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;b();d();B.onload=B.onreadystatechange=null;A&&B.parentNode&&
A.removeChild(B)}}}A.insertBefore(B,A.firstChild);return v}var E=false,w=e.xhr();if(w){e.username?w.open(m,e.url,e.async,e.username,e.password):w.open(m,e.url,e.async);try{if(e.data||a&&a.contentType)w.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&w.setRequestHeader("If-None-Match",c.etag[e.url])}s||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",
e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(fa){}if(e.beforeSend&&e.beforeSend.call(o,w,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");w.abort();return false}e.global&&f("ajaxSend",[w,e]);var g=w.onreadystatechange=function(q){if(!w||w.readyState===0||q==="abort"){E||d();E=true;if(w)w.onreadystatechange=c.noop}else if(!E&&w&&(w.readyState===4||q==="timeout")){E=true;w.onreadystatechange=c.noop;j=q==="timeout"?"timeout":!c.httpSuccess(w)?
"error":e.ifModified&&c.httpNotModified(w,e.url)?"notmodified":"success";var p;if(j==="success")try{n=c.httpData(w,e.dataType,e)}catch(u){j="parsererror";p=u}if(j==="success"||j==="notmodified")i||b();else c.handleError(e,w,j,p);d();q==="timeout"&&w.abort();if(e.async)w=null}};try{var h=w.abort;w.abort=function(){w&&h.call(w);g("abort")}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){w&&!E&&g("timeout")},e.timeout);try{w.send(m==="POST"||m==="PUT"||m==="DELETE"?e.data:null)}catch(l){c.handleError(e,
w,null,l);d()}e.async||g();return w}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=
f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(j,n){if(c.isArray(n))c.each(n,
function(o,m){b?f(j,m):d(j+"["+(typeof m==="object"||c.isArray(m)?o:"")+"]",m)});else!b&&n!=null&&typeof n==="object"?c.each(n,function(o,m){d(j+"["+o+"]",m)}):f(j,n)}function f(j,n){n=c.isFunction(n)?n():n;e[e.length]=encodeURIComponent(j)+"="+encodeURIComponent(n)}var e=[];if(b===v)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var i in a)d(i,a[i]);return e.join("&").replace(vb,"+")}});var ka={},wb=/toggle|show|hide/,xb=/^([+-]=)?([\d+-.]+)(.*)$/,
W,ta=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(ka[d])f=ka[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();
ka[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&
c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var i=c.extend({},e),j,n=this.nodeType===1&&c(this).is(":hidden"),
o=this;for(j in a){var m=j.replace(ha,ia);if(j!==m){a[m]=a[j];delete a[j];j=m}if(a[j]==="hide"&&n||a[j]==="show"&&!n)return i.complete.call(this);if((j==="height"||j==="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}if(c.isArray(a[j])){(i.specialEasing=i.specialEasing||{})[j]=a[j][1];a[j]=a[j][0]}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(s,x){var A=new c.fx(o,i,s);if(wb.test(x))A[x==="toggle"?n?"show":"hide":x](a);
else{var B=xb.exec(x),C=A.cur(true)||0;if(B){x=parseFloat(B[2]);var E=B[3]||"px";if(E!=="px"){o.style[s]=(x||1)+E;C=(x||1)/A.cur(true)*C;o.style[s]=C+E}if(B[1])x=(B[1]==="-="?-1:1)*x+C;A.custom(C,x,E)}else A.custom(C,x,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",
1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,
b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
"width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=
this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=
c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=
null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in r.documentElement?function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),
f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(s){c.offset.setOffset(this,a,s)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=
b,e=b.ownerDocument,i,j=e.documentElement,n=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var o=b.offsetTop,m=b.offsetLeft;(b=b.parentNode)&&b!==n&&b!==j;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;i=e?e.getComputedStyle(b,null):b.currentStyle;o-=b.scrollTop;m-=b.scrollLeft;if(b===d){o+=b.offsetTop;m+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){o+=parseFloat(i.borderTopWidth)||
0;m+=parseFloat(i.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){o+=parseFloat(i.borderTopWidth)||0;m+=parseFloat(i.borderLeftWidth)||0}f=i}if(f.position==="relative"||f.position==="static"){o+=n.offsetTop;m+=n.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){o+=Math.max(j.scrollTop,n.scrollTop);m+=Math.max(j.scrollLeft,n.scrollLeft)}return{top:o,left:m}};c.offset={initialize:function(){var a=r.body,b=r.createElement("div"),
d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);
d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;a.removeChild(b);c.offset.initialize=c.noop},
bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+i,left:b.left-
e.left+j};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=
this.offsetParent||r.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],i;if(!e)return null;if(f!==v)return this.each(function(){if(i=ua(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f});else return(i=ua(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]}});
c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(i){var j=c(this);j[d](f.call(this,i,j[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||
e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===v?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});z.jQuery=z.$=c})(window);

﻿function MenuComponent()
  {    
  };
  
  MenuComponent.prototype = 
  {
    __initialized: false,
    xsl : null,
    menuXml : null,
    firstDraw : null,
    
    doMovePage : function(id,direction)
    {
      var pageId = document.getElementById("pageId").value;
      var error = "";
    
      if ((id != null || id != "") && (direction != null || direction != ""))
        error = proxies.EditMode.ChangeMenuItemPosition(id, direction, pageId);
        
      if(error != ""){
        alert(error);
        window.location.reload();
      }
      else
      {
        window.location.reload();
      }
    },
    
    deletePage : function(pageId)
    {
      var error = "";
      if (!confirm("Weet u zeker dat u dit bestand wilt verwijderen?"))
        return;
    
      if (pageId != null || pageId != "")
        error = proxies.EditMode.DeletePage(pageId);
        
      if(error != "")
      {
        if (error == "link")
        { 
          window.location.href = "/_actions/Redirect.aspx?type=loggedinuser&id="+CURRENT_USER_ID;
        }
        else
        {
          alert(error);
          window.location.reload();
        }
      }
      else
      {
        this.drawNavigation(this.firstDraw);
      }
    },
    
    initNavigation : function (pageId)
    {
      if (this.xsl==null)
        this.xsl = "navigation.xsl";
        
      var el = document.getElementById("navigationDialog");
      if (Spif.ClassNameAbstraction.contains(el, "hidden"))
        Spif.ClassNameAbstraction.replace(el, "hidden", "shown");  
      
      this.drawNavigation(pageId);
    }, 
    
    drawNavigation : function (pageId)
    {
      try {
        this.menuXml = proxies.EditMode.getNavXmlByPageId(pageId);  
        this.firstDraw = selectSingleNode(this.menuXml, "page/@id").value;

        if (this.menuXml != null)
        {
          var el = document.getElementById("navigatieBox");
          transformXml(this.menuXml, this.xsl, el);
        }
      }
      catch (err) {
        alert(err.message)
      }
    },
    
    doMoveUp : function (pageId)
    {
      try
      {
        proxies.EditMode.movePageUpinNavByPageId(pageId);
        this.initNavigation(pageId);
      }
      catch (err)
      {
        alert(err.message)
      }
    },
    
    doMoveDown : function (pageId)
    {
      try
      {
        proxies.EditMode.movePageDowninNavByPageId(pageId);
        this.initNavigation(pageId);
      }
      catch (err)
      {
        alert(err.message)
      }
    },
    
    doIndent : function (pageId)
    {
      try
      {
        proxies.EditMode.movePageIndentByPageId(pageId);
        this.initNavigation(pageId);
      }
      catch (err)
      {
        alert(err.message)
      }
    },
    
    doOutdent : function (pageId)
    {
      try
      {
        proxies.EditMode.movePageOutdentByPageId(pageId);
        this.initNavigation(pageId);
      }
      catch (err)
      {
        alert(err.message)
      }
    },
    
    closeNavChange : function ()
    {
      var el = document.getElementById("navigationDialog");
      document.getElementById("navigatieBox").innerHTML = "";

      if (Spif.ClassNameAbstraction.contains(el,"shown"))
        Spif.ClassNameAbstraction.add(el, "hidden");        
    }
  }

var menu = new MenuComponent();





function doShownAssetDialog()
{
  // Stub for absence of assetManager
}

function doShownContactDialog()
{
  // Stub for absence of contactManager
}

function doShownPropertiesDialog()
{}

function doShownSettingsDialog()
{}


function doDropComponent(droppedEl, oldParent, oldNextSibling, newParent, newNextSibling)
{
  
  // Replace dropped element with the dropPlaceholder
  for (var i=0; i<droppedEl.childNodes.length; i++)
    if (Spif.ClassNameAbstraction.contains(droppedEl.childNodes[i], "dropPlaceholder"))
    {
      newParent.insertBefore(droppedEl.childNodes[i], droppedEl);
      newParent.removeChild(droppedEl);
      break;
    }

  //stops page from reloading when element id dropped on the place it came from.
  if (oldParent == newParent && oldNextSibling == newNextSibling)
    return;
  
  var error = null
  if (!Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode"))
    error = "You're not in editmode"
  
  if (error == null)
  {
    /*
    **nieuw component
    */ 
    if (Spif.ClassNameAbstraction.contains(oldParent,"clone-box"))
    {
      // get placeholder nummer
      var placeholder = newParent.id;
      // get id's van object en component
      var thisComponentId = droppedEl.id;
          
      if (newNextSibling == null)
        newNextSibling = -1;
      else 
        newNextSibling = newNextSibling.id;
        
      // haal type op
      var componentClass = droppedEl.className.match(/(\w+)Component/)[1];
      
      // initial content
      var xmlDoc = initXML("<initialcontent></initialcontent>");
      if (Spif.ClassNameAbstraction.contains(droppedEl, "asset-image"))
      {
        var asset = xmlDoc.documentElement.appendChild(xmlDoc.createElement("asset"));
        var assetId = asset.appendChild(xmlDoc.createElement("id"));
        assetId.text = oldParent.id.replace("asset-","");
        var assetName = asset.appendChild(xmlDoc.createElement("name"));
        var el = getElementsByTagNameAttributeValue(oldParent,"span","class","assetName")[0];
        assetName.text = (el.textContent || el.innerText);
      }
      else if (Spif.ClassNameAbstraction.contains(droppedEl, "folder"))
      {
        var asset = xmlDoc.documentElement.appendChild(xmlDoc.createElement("asset"));
        var assetId = asset.appendChild(xmlDoc.createElement("id"));
        
        if (isMozilla)
           assetId.textContent = oldParent.id.replace("folder-","");
        else
          assetId.text = oldParent.id.replace("folder-","");
          
        var assetName = asset.appendChild(xmlDoc.createElement("name"));
        var el = getElementsByTagNameAttributeValue(oldParent,"a","class","asset-label")[0];
        
         if (isMozilla)
           assetName.textContent = (el.textContent || el.innerText);
        else
          assetName.text = (el.textContent || el.innerText);
      }
      else if (Spif.ClassNameAbstraction.contains(droppedEl, "slideshowassetimage"))
      {
        var asset = xmlDoc.documentElement.appendChild(xmlDoc.createElement("asset"));
        var assetId = asset.appendChild(xmlDoc.createElement("id"));
        assetId.text = oldParent.id.replace("asset-","");
        var assetName = asset.appendChild(xmlDoc.createElement("name"));
        var el = document.getElementById("assetSlideShowTitle");
        assetName.text = (el.textContent || el.innerText);
      }
      
      // Een Service aanroepen waarin we de wijziging doorgeven 
      var pageId = document.getElementById("pageId").value;
      var error = proxies.EditMode.CreateComponent(pageId, placeholder, componentClass, newNextSibling, xmlDoc);
      if (error == null)
        window.location.reload();  // reload doen 
      else
      {
        alert(error);
        window.location.reload();
      }
    }
    
    //get placeholder nummer
    var placeholder = newParent.id;
    
    if (newNextSibling == null)
      newNextSibling = -1;
    else 
      newNextSibling = newNextSibling.id;
      
    //get current pageId
    var pageId = document.getElementById("pageId").value;
      
    
    /*check if component is from the deleted tab*/      
    if (Spif.ClassNameAbstraction.contains(droppedEl, "deletedComponentId"))
    {
      //now get id
      var delComponentId = droppedEl.className.match(/\bdeletedComponentId-(\d+)/i)[1]
      
      //place component here
      try
      {
        proxies.ComponentManager.placeDeletedComponentInNewPage(delComponentId, pageId);
        
        var error = proxies.EditMode.MoveComponent(delComponentId, placeholder, newNextSibling);
        if (error == null)
          window.location.reload();  // reload doen 
        else
        {
          alert(error);
          window.location.reload();
        }
      }
      catch (err)
      {
        alert(err.message)
      }
    }
    
    /*check if component is from the deleted tab*/      
    if (Spif.ClassNameAbstraction.contains(droppedEl, "cutComponentId"))
    {
      //now get id
      var cutComponentId = droppedEl.className.match(/\bcutComponentId-(\d+)/i)[1];
      
      //place component here
      try
      {
        proxies.ComponentManager.placeCutComponentInNewPage(cutComponentId, pageId);
        
        var error = proxies.EditMode.MoveComponent(cutComponentId, placeholder, newNextSibling);
        if (error == null)
          window.location.reload();  // reload doen 
        else
        {
          alert(error);
          window.location.reload();
        }
      }
      catch (err)
      {
        alert(err.message)
      }
    }
    
    
    /*
    **verplaatsen component
    */
    if (Spif.ClassNameAbstraction.contains(oldParent,"columnContent"))
    {
      //get id's van object en component
      var thisComponentId = droppedEl.id;
        
      // Een Service aanroepen waarin we de wijziging doorgeven 
      var error = proxies.EditMode.MoveComponent(thisComponentId, placeholder, newNextSibling);
      if (error == null)
        window.location.reload();  // reload doen 
      else
      {
        alert(error);
        window.location.reload();
      }
    }
  }
  else
  {
    alert(error);
    window.location.reload();
  }
  
  // optioneel een "implicit save" aanroepen voor Lime
  
}

/*drop image when using it for style*/
function doDropImageComponentForStyle(droppedEl, oldParent, oldNextSibling, newParent, newNextSibling)
{
  var pageId = document.getElementById("pageId").value;
  var error = null
  if (!Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode"))
    error = "You're not in editmode"
    
  if (error != null)
  {
    alert(error)
    newParent.innerHTML = "";
  }
  else
  {
    newParent.innerHTML = "";
    var assetId = oldParent.id.replace("asset-","");
    var link = "/_services/AssetServer.ashx/"+assetId+"?assetserver-small";
    
    newParent.innerHTML = "<img src='"+link+"' />";
        
    //save image in db
    proxies.EditMode.savePageStyleChange(pageId, newParent.id, assetId)
  }
}


/*executes when an image is dropped on another image so we can create or extend te slideshow.*/
function doDropSlideshow(droppedEl, oldParent, oldNextSibling, newParent, newNextSibling)
{
  var error = null
  if (!Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode"))
    error = "You're not in editmode"
  
  if (error == null)
  {
    // get parameterd
    var assetId = oldParent.id.replace("asset-","").replace("folder-","");
    var componentId = getParentElementByTagNameAttributeValue(newParent, "div", "class", "component").id;
    var pageId = document.getElementById("pageId").value;
    
    // submit parameters to server
    var error = proxies.EditMode.AddAssetToMMComponent(componentId, assetId, pageId);

    if (error != null)
      alert(error);
  }
  else
    alert(error);

  window.location.reload();
}

function doDropTextImage(droppedEl, oldParent, oldNextSibling, newParent, newNextSibling) {

  var img = null;
  if (droppedEl.firstChild)
   img = droppedEl.firstChild
  else
    img = droppedEl
    
  //set new className
  img.className = "lime-image";
  
  //set src to match component size
  var size = doGetCompView(newParent);
  img.src = img.src.split("?")[0] + "?multimediacomponent-" + size;

  if (img.src.indexOf(".gif") != -1 || img.src.indexOf(".jpg") != -1 || img.src.indexOf(".png") != -1) {
    alert("Dit type bestand mag niet in dit component gezet worden.\nProbeer het nogmaals met een plaatje.");
    window.location.reload();
    return;
  }

  var newParentEl = jQuery(newParent)
  var newLimeNode = newParentEl.find("span[class='lime-text-placeholder']");
  //if component is empty, with the execption of a lime node, remove that node
  if (newLimeNode.length == 1) {
    newLimeNode.remove()
  }

  if (isMozilla) {
    var tempDiv = document.createElement("p");
    tempDiv.appendChild(img);
    newParentEl.appendChild(tempDiv);
  }
  else if (newParentEl.hasClass("contentBox")) {
    var tempDiv = document.createElement("p");
    tempDiv.appendChild(img);
    var limeChild = newParentEl.find("div.lime-text-block");

    if (limeChild.attr("limeid") != '') {
      limeChild.append(tempDiv);
    }
  }

  ActionSave.execute();
  window.location.reload();
}

function doGetCompView(el)
{
  if (Spif.ClassNameAbstraction.contains(el, "view-small"))
    size =  "small";
  else if (Spif.ClassNameAbstraction.contains(el, "view-large"))
     size = "large";
  else if (Spif.ClassNameAbstraction.contains(el, "view-fullwidth"))
     size = "fullwidth";
  else
    doGetCompView(el.parentNode)
    
  return size;
}

/**
 * CMS functies (alleen editmode)
 */
function CMS()
{

};

/*
* Here an extra item is added to an exsisting component
* voorbeeld: Een weblog artikel
*/

CMS.prototype.doCreateNewItem = function (componentId)
{
  var error = null;
  var pageId = CURRENT_PAGE_ID;
  
  if (!Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode"))
    error = "You're not in editmode"

  if (error == null) 
    error = proxies.EditMode.AddExtraItemToComponent(pageId, componentId);
  if (error == null)
    window.location.reload();  // reload doen 
  else
  {
    alert(error);
    window.location.reload();
  }
}

CMS.prototype.doRemoveItem = function (objectType, componentId, objectId)
{
  var error = null;
  var pageId = CURRENT_PAGE_ID;
  
  if (!Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode"))
  {
    alert("You're not in editmode");
    return;
  }

  if (!confirm("Weet u zeker dat u dit artikel wilt verwijderen?")) return;  

  error = proxies.EditMode.DeleteItem(pageId, componentId, objectId);
    
  if (error == null)
    window.location.reload();  // reload doen 
  else
  {
    alert(error);
    window.location.reload();
  }
}

CMS.prototype.doRemoveComponent = function(componentId, componentType)
{
  var error = null;
  var pageId = CURRENT_PAGE_ID;
  var componentId = componentId;
  
  var prompt;
  switch (componentType)
  {
    case "weblog": prompt= "Weet u zeker dat u uw GEHELE Weblog wilt verwijderen? Al uw artikelen in dit weblog worden dan verwijderd."; break;
    case "map": prompt= "Weet u zeker dat u deze kaart wilt verwijderen? Al uw ingevoerde lokaties op deze kaart worden dan ook verwijderd."; break;
    case "menu": prompt= "Weet u zeker dat u dit menu wilt verwijderen van deze pagina?"; break;
    default:
     prompt = "Weet u zeker dat u deze GEHELE component wilt verwijderen?";
     break;
  }
  
  if (!confirm(prompt)) return;

  if (!Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode"))
    error = "You're not in editmode"

  if (error == null)
    error = proxies.EditMode.DeleteComponent(pageId, componentId);
  if (error == null)
  {
    //instead of a reload, remove from DOM
    var elToRemove = document.getElementById(componentId);
    elToRemove.parentNode.removeChild(elToRemove);
  }
  else
    alert(error);
}

CMS.prototype.doCutComponent = function(componentId, componentType)
{
  var error = null;
  var pageId = CURRENT_PAGE_ID;
  var componentId = componentId;
  
  if (!confirm("Weet u zeker dat u deze component wilt knippen")) return;
   
  if (!Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode"))
    error = "You're not in editmode"
    
  try
  {
    proxies.ComponentManager.CutComponent(pageId, componentId);
    window.location.reload();
  }
  catch (err)
  {
    alert(err.message);
  }
}

CMS.prototype.reloadWeblogComponent = function(componentId, extraVarname,  extraVarValue)
{
   var variableObject = new Array( {name:extraVarname, value:extraVarValue} );
   this.reloadComponent(componentId, variableObject)
}

/*
  define variableObject as var variableObject = new Array( {name:"currentAssetId", value:currentAssetId} );
*/
CMS.prototype.reloadComponent = function(componentId, variableObject)
{
  //check
  if (componentId == null || componentId < 1) return;
  
  //disable all componenttoolbars that are still on
  componentToolbar.__doDeactivateComponent();
  
  //find component
  var componentEl  = document.getElementById(componentId);
  var height = componentEl.offsetHeight;
  
  //empty component
  componentEl.innerHTML = "";
  
  //place div with same height
  var tempDiv = document.createElement("div");
  tempDiv.className = "tempElLoading standardContent";
  tempDiv.style.height = height+"px";
  tempDiv.innerHTML = "Een ogenblik geduld...";
  componentEl.appendChild(tempDiv);
  
  //anti cache
  var now = new Date();
  
  //get the view
  //alert(componentEl.parentNode.parentNode.className)
  var currentView = componentEl.parentNode.className.match(/\bview-(\w+)/i)[1];
  if (!currentView)
    currentView = "small";
    
  //make string out of variableObject
  var objectString = "";
  if (variableObject)
  {
    for (var i = 0 ; i < variableObject.length; i++)
    {
      var object = variableObject[i];
      objectString += "&"+ object["name"] + "=" + object["value"];
    }
  }
  
  //get content (xmlhttp)
  var contentXML = xmlhttp.request("/_fragments/Fragment.aspx?componentId="+componentId+"&view="+currentView+"&xml=true"+objectString+"&now="+now).responseXML;
  
  /*contentXML = contentXML.getElementById(componentId);
  var b = document.createElement("div");
  b.appendChild(contentXML)
  alert(b.innerHTML);;*/

  
  
  contentXML = contentXML.selectSingleNode("//*[@id='"+componentId+"']")
  
  if (isMozilla && contentXML)
  {
  
    componentEl.innerHTML = serializeXMLDoc(contentXML.firstChild);
  }
  else if (contentXML && contentXML.childNodes)
  {
    var newXML = "";
    for (var q = 0; q < contentXML.childNodes.length; q++)
    {
      newXML += contentXML.childNodes[q].xml;
    }
    componentEl.innerHTML = newXML
  }
  else if(contentXML)
  {
    componentEl.innerHTML = contentXML.xml
  }
  else
  {
    componentEl.innerHTML = "Niet gelukt nieuwe deel op te halen. Gelieve de pagina te herladen.";
  }
}


function displayStatus(name, value)
{
  switch (name) 
  {
    case "lime":
      if (value=="saving")
        status="Uw wijzigingen worden opgeslagen...";
      else
        status="";
      break;
  }
}


var prevEl = null;
function doPotentialFocusChange(evt)
{
  var box = document.getElementById("limeButtons");
  if (!box)
    return;

  if (componentToolbar.isInsideUI(evt.subject))
    return;

  var el = evt.subject;
  if (el == prevEl)
    return;

  var wasEditable = prevEl && prevEl.isContentEditable;
  prevEl = el;

  var box = document.getElementById("limeButtons");
  var btns = box.getElementsByTagName("a");

  if (wasEditable)
  {
    for (var i=0; i<btns.length; i++)
    {
      var btn = btns[i];
      if (Spif.ClassNameAbstraction.contains(btn, "lime-action"))
        Spif.ClassNameAbstraction.replace(btn, "enabled", "disabled");
    }
  }

  if (!el.isContentEditable)
    return;

  var isRichEdit = false;
  for (var tmp = el; tmp; tmp = tmp.parentNode)
    if (Spif.ClassNameAbstraction.contains(tmp, "lime-text-richtext"))
    {
      isRichEdit = true;
      break;
    }

  if (isRichEdit)
  {
    for (var i=0; i<btns.length; i++)
    {
      var btn = btns[i];
      if (Spif.ClassNameAbstraction.contains(btn, "lime-action"))
        Spif.ClassNameAbstraction.replace(btn, "disabled", "enabled");
    }
  }
  cms.isRichEdit = isRichEdit;
}


var cms = new CMS();

Spif.DOMEvents.attach(document.documentElement, "click", doPotentialFocusChange);
Spif.DOMEvents.attach(document.documentElement, "keyup", doPotentialFocusChange);

function Reaction()
{    
};

Reaction.prototype = 
{ 
  lastRating : null,

  setReactionUrl : function(reactionSort, id, tab)
  {
    if (!id || !reactionSort)
      return;
    
    Iframe = document.getElementById("reactionFrame");
    var IframeUrl = Iframe.src.split("?");
    
    //variable to prevent cache 
    var now = new Date();
    
    if (IframeUrl[0])
    {
      if (tab == 1)
        Iframe.src = IframeUrl[0] + "?sort="+ reactionSort + "&id="+ id + "&start=0&numberofrows=0&antiCache="+now;
      else if (tab == 2)
        Iframe.src = IframeUrl[0] + "?sort="+ reactionSort + "&id="+ id + "&start=0&numberofrows=0&beoordeling=mijn&antiCache="+now;
    }
      
    //open dialog
    var reactionDialog = document.getElementById("reactionDialog");
    Spif.ClassNameAbstraction.replace(reactionDialog, "hidden", "shown");
  },
  
  checkReactionForm : function()
  {
    var name = null;
    var email = null;
    
    if (document.getElementById("reaction_name") != null)
      name = document.getElementById("reaction_name").value;
     
    if (document.getElementById("reaction_email") != null)
      email = document.getElementById("reaction_email").value; 
    
    var error = proxies.Validation.checkReactionForm(name, email);
    if (error == "" || error == null || error == "\n")
    {
      return true
    }
    else
    {
      alert(error);
      return false 
    }
  },
  
  getRating : function (evt) 
  {
    el = document.getElementById("giveRating");
    var percentage = (evt.clientX - findPos(el)[0]) / el.offsetWidth;
    return Math.ceil(percentage * 5);
  },
  
  setRating : function (evt)
  {
    el = document.getElementById("giveRating");
    //get rating
    var rating = this.getRating(evt)
    //set right class
    el.className = "ratingBox rated-"+(rating*2);
    //rumble the alement, otherwise className change won't have effect on layout
    el.parentNode.appendChild(el);
    document.getElementById("rating").value = rating*2;
  },
  
  getLastRating : function()
  {
    if (!this.mouseIn)
    {
      el = document.getElementById("giveRating");
      var className = el.className;
      this.lastRating = className.split("-")[1];
//document.title = this.lastRating;
      this.mouseIn = true;
    }
  },
  
  getPotentialRating : function(evt)
  {
    this.getLastRating();
    this.setRating(evt);
  },
  
  setOldRating : function ()
  {
    //el = document.getElementById("giveRating");
    //el.className = "ratingBox rated-"+this.lastRating;
  }
}
  
var reaction = new Reaction();  
    


﻿
function doShownPropertiesDialog()
{
  dialog.drawProperties();
}




function Dialog()
  {    
  };

  Dialog.prototype =
  {
    colorNumberEl: null,

    userInEditmode: function() {
      return Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode");
    },

    changePageLayout: function() {
      var el = getElementsByTagNameAttributeValue(document.getElementById("pickLayouts"), "div", "class", "selected")[0];

      //check of er wel op een layout is geklikt
      if (el == null)
        return;

      //check of user rechten heeft
      if (!this.userInEditmode())
        return;

      //check of id gevuld is
      if (el.id == null)
        el.id = "layout-basic";

      //ok; haal layoutnaam op
      var layoutnaam = el.id.substr(7, el.id.length);
      var pageId = document.getElementById("pageId").value;

      //haal op toepassigsgebied op
      var apply = "";
      var applyToAll = document.getElementById("applyToAll").checked;
      if (applyToAll)
        apply = "all";
      else
        apply = "this"

      var error = proxies.EditMode.ChangeLayoutOfPage(pageId, layoutnaam, apply);
      if (error == "")
        window.location.reload();
      else {
        alert(error);
        window.location.reload();
      }
    },

    changePageStyle: function() {
      var el = getElementsByTagNameAttributeValue(document.getElementById("styleBox"), "img", "class", "selected")[0];
      var advancedSettingsEl = document.getElementById("advancedStyleSettingsTab");
      var pageId = document.getElementById("pageId").value;
      var stylenaam = "basic";

      //check of user rechten heeft
      if (!this.userInEditmode())
        return;

      //check of er wel op een layout is geklikt
      if (el == null && Spif.ClassNameAbstraction.contains(advancedSettingsEl, "collapsed-tab"))
        return;
      else
        stylenaam = "personalized";

      //haal op toepassigsgebied op
      var apply = "";
      var applyToAll = document.getElementById("styleApplyToAll").checked;
      if (applyToAll)
        apply = "all";
      else
        apply = "this"

      //haal stylenaam op
      if (el && el.id != null)
        stylenaam = el.id.substr(6, el.id.length);

      //opslaan nieuwe stijl
      var error = proxies.EditMode.ChangePageStyle(pageId, stylenaam, apply);
      if (error == "")
        window.location.reload();
      else {
        alert(error);
        window.location.reload();
      }
    },

    openColorPicker: function(colorNumberId) {
      this.colorNumberEl = document.getElementById(colorNumberId);
    },

    returnPickedColor: function(el) {
      if (Spif.ClassNameAbstraction.contains(document.getElementById("colorpickerDialog"), "shown"))
        Spif.ClassNameAbstraction.replace(document.getElementById("colorpickerDialog"), "shown", "hidden")

      var value;
      if (el.style.backgroundColor == null || el.style.backgroundColor == "")
        value = "Transparent";
      else
        value = el.style.backgroundColor;

      this.colorNumberEl.value = value;
      this.colorNumberEl.parentNode.firstChild.style.backgroundColor = el.style.backgroundColor;

      this.saveStyleChange(this.colorNumberEl.id, value)
    },

    styleselectbox: function(el) {
      this.saveStyleChange(el.id, el.value)
    },

    stylecheckbox: function(el) {
      var checked = "no-repeat";
      if (el.checked)
        checked = "repeat";

      this.saveStyleChange(el.id, checked)
    },

    saveStyleChange: function(name, value) {
      //save change with service
      var pageId = document.getElementById("pageId").value;
      var error = proxies.EditMode.savePageStyleChange(pageId, name, value)
      if (error != "")
        alert(error);
      else
        setTimeout(this.resetCss, 500);

      this.deletebuttonActivator();
    },

    resetCss: function() {
      var pageId = document.getElementById("pageId").value;

      var currentCss = document.getElementById("personalizedCss");
      if (currentCss != null)
        currentCss.parentNode.removeChild(currentCss);

      var link = document.createElement("link");
      link.id = "personalizedCss";
      link.setAttribute("type", "text/css");
      link.setAttribute("rel", "stylesheet");
      link.setAttribute("href", "/_css/skins/personalized2.aspx?pageId=" + pageId + "&" + new Date());
      document.getElementsByTagName("head")[0].appendChild(link);
    },

    setPickedColors: function() {
      //pickedColor
      var els = getElementsByTagNameAttributeValue(document.getElementById("styleDialog"), "span", "class", "pickedColor")
      for (i = 0; i < els.length; i++) {
        var el = els[i];
        el.style.backgroundColor = el.nextSibling.value;
      }

      this.deletebuttonActivator();
    },

    deletebuttonActivator: function() {
      var els = getElementsByTagNameAttributeValue(document.getElementById("styleDialog"), "div", "class", "clearRule")
      for (i = 0; i < els.length; i++) {
        el = els[i];
        var valueId = el.className.split(" ")[1].replace("deletefor-", "");
        var valueEl = document.getElementById(valueId);

        if (Spif.ClassNameAbstraction.contains(valueEl, "colorNumber")) {
          if (valueEl.value == "")
            Spif.ClassNameAbstraction.add(el, "hidden")
          else
            Spif.ClassNameAbstraction.remove(el, "hidden")
        }
        if (Spif.ClassNameAbstraction.contains(valueEl, "placeholder")) {
          if (valueEl.innerHTML == "")
            Spif.ClassNameAbstraction.add(el, "hidden")
          else
            Spif.ClassNameAbstraction.remove(el, "hidden")
        }
      }
    },

    deleteStyleSetting: function(evt) {
      el = evt.srcElement || evt.target;

      if (Spif.ClassNameAbstraction.contains(el, "clearRule")) {
        var pageId = document.getElementById("pageId").value;
        var nameToDelete = el.className.split(" ")[1].replace("deletefor-", "");
        proxies.EditMode.removePageStyle(pageId, nameToDelete)
        this.emptyStyleSetting(document.getElementById(nameToDelete));
      }

      this.deletebuttonActivator();
    },

    emptyStyleSetting: function(el) {
      if (el) {
        if (Spif.ClassNameAbstraction.contains(el, "colorNumber")) {
          el.value = "";
          el.parentNode.firstChild.style.background = "none";
        }
        if (Spif.ClassNameAbstraction.contains(el, "placeholder")) {
          el.innerHTML = "";
        }

      }
      setTimeout(this.resetCss, 500);
    },

    openAssetManager: function() {
      var assetEl = document.getElementById("assetmanagerDialog");
      var styleEl = document.getElementById("styleDialog");

      //position dialogs
      styleEl.style.top = "98px";
      styleEl.style.left = "10px";
      assetEl.style.top = "98px";
      assetEl.style.left = "420px";
    },


    /*send a message functions*/
    setMessageSettings: function(userId) {
      //if not a loggedin user, show extra inputfields
      bodyEl = document.getElementById("body") | document.getElementById("body")
      if (!Spif.ClassNameAbstraction.contains(bodyEl, "loggedIn"))
        Spif.ClassNameAbstraction.remove(document.getElementById("sendMessageBox").firstChild, "hideSendersInfo");

      this.sendMessageToId = userId;
      this.openMessageDialog();
    },

    setGuestbookMessage: function(reactionId) {
    bodyEl = window.parent.document.getElementById("body");
      if (!Spif.ClassNameAbstraction.contains(bodyEl, "loggedIn"))
        Spif.ClassNameAbstraction.remove(window.parent.document.getElementById("sendMessageBox").firstChild, "hideSendersInfo");

      window.parent.dialog.sendMessageToReactionId = reactionId;
      window.parent.dialog.sendMessageType = "guestbook";
      var el = window.parent.document.getElementById("sendAMessageDialog");
      if (Spif.ClassNameAbstraction.contains(el, "hidden"))
        Spif.ClassNameAbstraction.replace(el, "hidden", "shown");
    },

    openMessageDialog: function() {
      var el = document.getElementById("sendAMessageDialog");
      if (Spif.ClassNameAbstraction.contains(el, "hidden"))
        Spif.ClassNameAbstraction.replace(el, "hidden", "shown");
    },

    closeMessageDialog: function() {
      var el = document.getElementById("sendAMessageDialog");
      document.getElementById("messageText").innerHTML = "";

      if (Spif.ClassNameAbstraction.contains(el, "shown"))
        Spif.ClassNameAbstraction.add(el, "hidden");
    },

    sendMessage: function() {
      try {
        var message = document.getElementById("messageText").value;
        var subject = "Je hebt een bericht ontvangen";
        bodyEl = document.getElementById("body") | document.getElementById("admin")
        if (!Spif.ClassNameAbstraction.contains(bodyEl, "loggedIn")) {
          var email = document.getElementById("sendersEmail").value;
          if (email.indexOf("@") == -1 || email.indexOf(".") == -1) {
            alert("Emailadres is incorrect");
            return;
          }
          else if (this.sendMessageType == "guestbook") {
            proxies.ContactManager.sendEmailToContactHandler(subject, message, this.sendMessageType, this.sendMessageToReactionId);
          }
          else
            proxies.ContactManager.sendEmailToUserWithEmailadres(this.sendMessageToId, subject, message, email);
        }
        else
          proxies.ContactManager.sendEmailToUser(this.sendMessageToId, subject, message);

        this.closeMessageDialog()
      }
      catch (err) {
        alert(err.message)
      }
    },

    /*PROPERTY FUNCTIONS*/
    drawProperties: function() {
      this.groups = proxies.EditMode.getAllGroupInformation(CURRENT_PAGE_ID);
      if (this.groups != null) {
        try {
          var el = document.getElementById("propertiesContentDialog");
          transformXml(this.groups, "propertyDialog.xsl", el);
        }
        catch (err) {
          alert(err.message)
        }
      }
    },

    /*this.contacts = proxies.ContactManager.getAllContacts();
    if (this.contacts != null)
    {
    var el = document.getElementById("contactFolderBox");
    transformXml(this.contacts, this.xsl, el);
    }*/

    savePageSettings: function() {
      try {
        var accesLevel = 0;
        var groupId = 0;
        var showWidwbar;
        if (document.getElementById("accesPublic").checked)
          accesLevel = 2;
        else if (document.getElementById("accesFriends") && document.getElementById("accesFriends").checked) {
          accesLevel = 1;
          groupId = document.getElementById("selectedSecurityGroup").value
          if (groupId == -1)
            throw ("U heeft geen groep gekozen");
        }

        showWidwbar = document.getElementById("showWidwbar").checked;

        //call save function
        proxies.EditMode.savePageSettings(accesLevel, groupId, showWidwbar, CURRENT_PAGE_ID);

        //close dialog
        Spif.ClassNameAbstraction.replace(document.getElementById("propertiesDialog"), "shown", "hidden")
      }
      catch (err) {
        if (err.message != null)
          alert(err.message);
        else
          alert(err);
      }
    },


    /*REACTION FUNCTIONS*/
    openReactiondialog: function(url) {
      var el = document.getElementById("reactionDialog");
      Spif.ClassNameAbstraction.replace(el, "hidden", "shown");

      var frame = document.getElementById("reactionFrame");
      frame.src = url;
      //alert("open")
    },

    /*EVENT FUNCTIONS*/
    doEditEvent: function(el, eventid, componentId) {
      //open dialog
      this.drawEvents(componentId);
      if (eventid)
        this.drawEvent(eventid);
      this.showEventDialog(true);
      cms.reloadComponent(componentId);
    },

    drawEvents: function(componentId) {
      eventSettings = proxies.EditMode.getEvents(componentId);
      if (eventSettings != null) {
        try {
          var el = document.getElementById("allEvents");
          transformXml(eventSettings, "eventDialog.xsl?ac="+new Date(), el);
        }
        catch (err) {
          alert(err.message)
        }
      }
    },

    drawEvent: function(eventid) {
      eventSettings = proxies.EditMode.getEventSettings(eventid);
      if (eventSettings != null) {
        try {
          var date = new Date();
          var params = new Array({ name: "year", value: date.getFullYear() });

          var el = document.getElementById("specEvent");
          transformXml(eventSettings, "eventDialog.xsl?ac=" + new Date(), el, params);

          //set data
          this.setEventData(eventSettings);
        }
        catch (err) {
          alert(err.message)
        }
      }
    },

    setEventData: function(eventSettings) {
      var startDate = eventSettings.selectSingleNode("/specSetting/@start").value;
      document.getElementById("startDay").value = startDate.substr(8, 2);
      document.getElementById("startMonth").value = startDate.substr(5, 2);
      document.getElementById("startYear").value = startDate.substr(0, 4);
      document.getElementById("startHour").value = startDate.substr(11, 2);
      document.getElementById("startMinute").value = startDate.substr(14, 2);

      var endDate = eventSettings.selectSingleNode("/specSetting/@end").value;
      if (endDate) {
        document.getElementById("endDay").value = endDate.substr(8, 2);
        document.getElementById("endMonth").value = endDate.substr(5, 2);
        document.getElementById("endYear").value = endDate.substr(0, 4);
        document.getElementById("endHour").value = endDate.substr(11, 2);
        document.getElementById("endMinute").value = endDate.substr(14, 2);
      }
    },

    createNewEvent: function(componentId) {
      try {
        var eventId = proxies.EditMode.createNewEvent(componentId);
        this.doEditEvent("", eventId, componentId);
      }
      catch (err) {
        alert(err.message)
      }
    },

    showEventDialog: function(open) {
      el = document.getElementById("eventDialog");
      if (open)
        Spif.ClassNameAbstraction.replace(el, "hidden", "shown");
      else
        Spif.ClassNameAbstraction.replace(el, "shown", "hidden");
    },

    doDeleteEvent: function(componentid, eventid) {
      if (!confirm("Weet u zeker dat u deze gebeurtenis wilt verwijderen?")) return false;
      proxies.EditMode.DeleteEvent(componentid, eventid);
      this.doEditEvent("", eventid, componentid);
    },

    showEndDate: function(checkEl) {
      var parentEl = document.getElementById("endDateTimeBox");
      if (checkEl.checked)
        Spif.ClassNameAbstraction.replace(parentEl, "noEndDate", "aEndDate"); //show
      else
        Spif.ClassNameAbstraction.replace(parentEl, "aEndDate", "noEndDate"); //hide  
    },

    showWidwInfo: function() {
      Spif.ClassNameAbstraction.replace(document.getElementById("widwInfoDialog"), "hidden", "shown");
    },

    toggleActivityMailDialog: function(open) {
      var el = document.getElementById("emailDialog");
      if (open)
        Spif.ClassNameAbstraction.replace(el, "hidden", "shown");
      else
        Spif.ClassNameAbstraction.replace(el, "shown", "hidden");
    },

    toggleActivityEditDialog: function(open) {
      var el = document.getElementById('activityEditDialog');
      if (open)
        Spif.ClassNameAbstraction.replace(el, "hidden", "shown");
      else
        Spif.ClassNameAbstraction.replace(el, "shown", "hidden");

      var rolesBox = document.getElementById('activityEditRoles');
      var startDate = document.getElementById('startDate').innerHTML;
      var endDate = document.getElementById('endDate').innerHTML;
      var lastDate = document.getElementById('lastSignupDate').innerHTML;
      var activityRoles = document.getElementById('activityRoles');

      // dirty hack: copy data about the event to the new dialog    
      if (open) {
        rolesBox.innerHTML = activityRoles.innerHTML;

        document.getElementById('startDateDay').value = startDate.substring(0, 2);
        document.getElementById('startDateMonth').value = startDate.substring(3, 5);
        document.getElementById('startDateYear').value = "20" + startDate.substring(6, 8);

        var startTimeHour = startDate.substring(9, 11);
        var startTimeMinute = startDate.substring(12, 14);
        if (startTimeHour != "00" && startTimeMinute != "00") {
          document.getElementById('startTimeHour').value = startTimeHour;
          document.getElementById('startTimeMinute').value = startTimeMinute;
        }

        document.getElementById('endDateDay').value = endDate.substring(0, 2);
        document.getElementById('endDateMonth').value = endDate.substring(3, 5);
        document.getElementById('endDateYear').value = "20" + endDate.substring(6, 8);

        var endTimeHour = endDate.substring(9, 11);
        var endTimeMinute = endDate.substring(12, 14);
        if (endTimeHour != "00" && endTimeMinute != "00") {
          document.getElementById('endTimeHour').value = endTimeHour;
          document.getElementById('endTimeMinute').value = endTimeMinute;
        }

        if (lastDate == "01-01-01 00:00" || lastDate == endDate) {
          document.getElementById('lastSignupDateContainer').style.display = 'none';
        }
        else {
          document.getElementById('signupDateDay').value = lastDate.substring(0, 2);
          document.getElementById('signupDateMonth').value = lastDate.substring(3, 5);
          document.getElementById('signupDateYear').value = "20" + lastDate.substring(6, 8);
        }

        var comps1 = document.getElementById('activityAddRoleComp1');
        var comps2 = document.getElementById('activityAddRoleComp2');
        var comps3 = document.getElementById('activityAddRoleComp3');
        var hcomps = document.getElementById('hiddenCompetenciesSelect').options;
        for (var i = 1; i < hcomps.length; i++) {
          // add comps to the popup
          comps1.options.add(new Option(hcomps[i].innerHTML, hcomps[i].value));
          comps2.options.add(new Option(hcomps[i].innerHTML, hcomps[i].value));
          comps3.options.add(new Option(hcomps[i].innerHTML, hcomps[i].value));
        }

        var privacy = document.getElementById('activityPrivacy').innerHTML;
        var showGroups = document.getElementById('showActivityAddRoleUser');
        if (privacy == 'group') {
          // add contacts to the popup
          showGroups.style.display = 'block';
          var hgroups = document.getElementById('hiddenGroupsSelect');
          var friends = document.getElementById('activityAddRoleUser');

          friends.innerHTML = "";
          friends.innerHTML = hgroups.innerHTML.replace("<FRIENDS>", "").replace("</FRIENDS>", "");
        }

      }

    }
  }
  
  
  

var dialog = new Dialog();  


/*




*/

var ContextMenu = {
  __cm: null,
  __content:
  {
       
  },
  __init: function()
  {
    Spif.DOMEvents.attach(window, "load", ContextMenu.__doLoadWindow, ContextMenu);
    Spif.DOMEvents.attach(window, "scroll", ContextMenu.__hide, ContextMenu);
    Spif.DOMEvents.attach(document.documentElement, "mousewheel", ContextMenu.__hide, ContextMenu);
    Spif.DOMEvents.attach(window, "resize", ContextMenu.__hide, ContextMenu);
  },
  __doLoadWindow: function(evt)
  {
    Spif.DOMEvents.attach(document, "mousedown", ContextMenu.__doMouseDownDocument, ContextMenu);
    Spif.DOMEvents.attach(document, "click", ContextMenu.__doClickDocument, ContextMenu);

    this.__cm = document.createElement("div");
    this.__cmTab = document.createElement("div");
    this.__cmTabContent = document.createElement("div");
    this.__cmMenu = document.createElement("div");

    this.__cm.id = "contextmenu";
    this.__cm.className = "hidden";
    this.__cmTab.className = "contextmenuTab";
    this.__cmTabContent.className = "contextmenuTabcontent nowrap";
    this.__cmMenu.className = "contextmenuMenu";

    document.body.appendChild(this.__cm);
    this.__cm.appendChild(this.__cmTab);
    this.__cmTab.appendChild(this.__cmTabContent);
    this.__cm.appendChild(this.__cmMenu);
  },
  __doMouseDownDocument: function(evt)
  {
    var activatorEl = Spif.HtmlDomUtils.getAncestorWithClassName(evt.subject, "contextmenuActivator");
    var itemEl      = Spif.HtmlDomUtils.getAncestorWithClassName(evt.subject, "contextmenuItem");

    if (!activatorEl && !itemEl)
      this.__hide();
  },
  __doClickDocument: function(evt)
  {
    var activatorEl = Spif.HtmlDomUtils.getAncestorWithClassName(evt.subject, "contextmenuActivator");
    var itemEl      = Spif.HtmlDomUtils.getAncestorWithClassName(evt.subject, "contextmenuItem");

    if (!activatorEl && !itemEl)
    {
      this.__hide();
      return;
    }

    if (itemEl)
      this.__doClickContextmenuItem(itemEl);
    else
    {
      this.__show(activatorEl);
      evt.cancel();
    }
  },
  __doClickContextmenuItem: function(itemEl)
  {
    if (Spif.ClassNameAbstraction.contains(itemEl, "disabled"))
      return;

    this.__hide();
  },
  __show: function(activatorEl)
  {
    this.__hide();

    var labelWidth = 0;

    var labelEl = activatorEl.previousSibling;
    if (!Spif.ClassNameAbstraction.contains(labelEl, "contextmenuLabel"))
      labelEl = null;
    if (labelEl)
    {
      labelWidth = Spif.StyleUtils.getComputedStyleProperty(labelEl, "width");
      if (isNaN(labelWidth))
        labelWidth = labelEl.offsetWidth;
      labelWidth += 8;
      this.__cmTabContent.innerHTML = labelEl.innerHTML;
      this.__cmTabContent.style.color = "#0060C2";
      this.__cmTabContent.style.fontSize = Spif.StyleUtils.getRawComputedStyleProperty(labelEl, "fontSize");
      this.__cmTabContent.style.fontWeight = Spif.StyleUtils.getRawComputedStyleProperty(labelEl, "fontWeight");
    }
    else
    {
      this.__cmTabContent.innerHTML = "";
      labelEl = activatorEl;
    }


    this.__cmTabContent.style.width = labelWidth + "px";

    var box = getBoxObjectFor(labelEl);

    var menuWidth = Math.min(400, Math.max(200, labelWidth + 70));
    var leftAlign = (box.x + box.width + menuWidth < document.body.offsetWidth);

    this.__cm.style.top = box.y + "px";

    if (leftAlign)
{
      this.__cm.style.left = box.x + "px";
this.__cmTabContent.parentNode.style.left = "";
}
    else
{
      this.__cm.style.left = box.x + document.documentElement.scrollLeft - menuWidth + labelWidth + 20 + "px";
this.__cmTabContent.parentNode.style.left = menuWidth - labelWidth - (Spif.isIE?26:28) + "px";
}

    var a = activatorEl.className.match(/contextmenuType-(.+)\b/)[1].split("-");
    this.__cmType = a[0];
    this.__cmId = a[1];
    this.__extra = a[2];

    Spif.ClassNameAbstraction.replace(this.__cm, "hidden", "contextmenuType-" + this.__cmType);

    // MOET EIGENLIJK MET MINWIDTH EN NOG WAT...
    this.__cmMenu.style.width = menuWidth + "px";
    this.__cmMenu.innerHTML = this.__generateMenuHTML(this.__cmType);
  },
  __hide: function()
  {
  //alert(this.__cmType)
    if (!this.__cmType)
      return;

    Spif.ClassNameAbstraction.replace(this.__cm, "contextmenuType-" + this.__cmType, "hidden");
  },
  __generateMenuHTML: function(cmType)
  {
    var data = this.__getMenuFor(cmType, this.__cmId);
    
    var html = ['<div class="items">'];
    for (var i=0; i<data.length; i++)
    {
      var item = data[i];
      
      if (item.target != "_blank")
        item.target = "_self";
      
      if (item.label)
        html.push(
          '<a href="',
          item.href.replace(/\$id/g, this.__cmId).replace(/\$type/g, this.__cmType),
          '" class="contextmenuItem ',
          (item.enabled?'enabled':'disabled'),
          ' nowrap"',
          'target="'+item.target+'">',
          item.label,
          '</a>'
        );
      else
        html.push('<div class="separator"></div>');
    }

    return html.join("");
  },
  
  __getMenuFor: function(cmType, param1)
  {
    //alert(cmType)
    switch (cmType)
    { 
      case "image":
        return
          [
            {
            label:"Voeg toe aan mijn media, voor later gebruik",
            href:"#",
            enabled:true
            },
            {},
            {
            label:"Lokatie",
            href:"/_actions/Redirect.aspx?type=user&id="+param1,
            enabled:false
            },
            {
            label:"Persoon",
            href:"/_actions/Redirect.aspx?type=user&id="+param1,
            enabled:false
            },
            {
            label:"Evenement",
            href:"/bewoners/"+param1,
            enabled:false
            },
            {},
            {
            label:"Wis",
            href:"/delete/"+param1,
            enabled:true
            },
            {},
            {
            label:"Eigenschappen",
            href:"/properties/"+param1,
            enabled:true
            }
          ];
    case "user":
      return [
        {
          label:"Bekijk profiel",
          href:"/_actions/Redirect.aspx?type=user&id="+param1,
          enabled:true
        },
        {},
        {
          label:"Stuur een bericht",
          href:"javascript:dialog.setMessageSettings("+param1+")",
          enabled:true
        }
      ];
    case "portal":
      return [
        {
          label:"Aanmelden",
          href:"/_wizards/UserRegistration",
          enabled:true
        },
        {},
        {
          label:"Informatie",
          href:"javascript:dialog.showWidwInfo()",
          enabled:true
        },
        {
          label:"Bugmelding doorgeven",
          href:"http://support.q42.net/default.asp?pg=pgPublicEdit&ixProject=21&sTitle=Webindewijk%20bugmelding&sEvent=-%20wat%20gebeurt%20er:%0D-%20wat%20deed%20ik:%0D-%20wat%20had%20er%20moeten%20gebeuren:%0D-%20afzender:%0D-%20wijk%20:%0D-%20emailadres%20(niet%20verplicht):",
          target:"_blank",
          enabled:true
        }
      ];
    case "portalAdmin":
      return [
        {
          label:"Aanmelden",
          href:"/_wizards/UserRegistration",
          enabled:true
        },
        {
          label:"Naar admin scherm",
          href:"/_admin",
          enabled:true
        },
        {},
        {
          label:"Informatie",
          href:"javascript:dialog.showWidwInfo()",
          enabled:true
        },
        {
          label:"Bugmelding doorgeven",
          href:"http://support.q42.net/default.asp?pg=pgPublicEdit&ixProject=21&sTitle=Webindewijk%20bugmelding&sEvent=-%20wat%20gebeurt%20er:%0D-%20wat%20deed%20ik:%0D-%20wat%20had%20er%20moeten%20gebeuren:%0D-%20afzender:%0D-%20wijk%20:%0D-%20emailadres%20(niet%20verplicht):",
          target:"_blank",
          enabled:true
        }
      ];
    case "weblogentry":
      var objId = param1.split('_')[0];
      var compId = param1.split('_')[1];
      return [
        {
          label:"Verwijder dit Artikel",
          href:"javascript:cms.doRemoveItem('weblogentry',"+compId+","+objId+")",
          enabled:true
        }
      ];
    case "loggedinuser":
      return [
        {
          label:"Uitloggen",
          href:"javascript:userauthenticate.logout()",
          enabled:true
        },
        {
          label:"Ga naar mijn profiel",
          href:"/_actions/Redirect.aspx?type=user&id="+param1,
          enabled:true
        }
      ]; 
    case "assetactions":
      var assetPos = document.getElementById("asset-" + param1).className.match(/\bposition-(\d+)\b/)[1];
      return [
        {
          label:"Bekijken",
          href:"javascript:assetmanager.doSelectAsset(" + assetPos + ", "+param1+")",
          enabled:true
        },
        {
          label:"Downloaden",
          href:"javascript:assetmanager.downloadAsset(" + param1 + ")",
          enabled:true
        },
        {
          label:"Hernoemen",
          href:"javascript:assetmanager.doRename("+param1+")",
          enabled:true
        },
        {
          label:"Verwijderen",
          href:"javascript:assetmanager.doDelete("+param1+")",
          enabled:true
        }
      ];
    case "topfolderactions":
      return [
        {
          label:"Maak subfolder",
          href:"javascript:assetmanager.doCreateFolder("+param1+")",
          enabled:true
        },
        {
          label:"Verwijder alle bestanden",
          href:"javascript:assetmanager.doDeleteFolder("+param1+")",
          enabled:true
        }
      ];
    case "folderactions":
      return [
        {
          label:"Maak subfolder",
          href:"javascript:assetmanager.doCreateFolder("+param1+")",
          enabled:true
        },
        {
          label:"Hernoemen",
          href:"javascript:assetmanager.doRenameFolder("+param1+")",
          enabled:true
        },
        {
          label:"Verwijderen",
          href:"javascript:assetmanager.doDeleteFolder("+param1+")",
          enabled:true
        }
      ];
      case "singleContactActions":
      return [
        {
          label:"Verwijder contact",
          href: "javascript:contactmanager.deleteSingleContact('" + param1 + "', '" + this.__extra + "')",
          enabled:true
        }
      ];
    case "contactHeaderActions":
      return [
        {
          label:"Hernoem groep",
          href:"javascript:contactmanager.activateRenameGroup('"+param1+"')",
          enabled:true
        },
        {
          label:"Verwijder groep",
          href:"javascript:contactmanager.deleteGroup('"+param1+"')",
          enabled:true
        }
      ];
    /* generiek component context menu */
    case"component":
      var curComp = componentToolbar.__currentActiveComponent;
      var compId = curComp.id;
      var componentType = "unknown";
      try {componentType=curComp.className.match(/(\w+)-component /)[1];} catch (e) {}
      var menu = [];
      
      switch (componentType)
      {
        case "weblog": menu = [
          {
            label:"Voeg nieuw Artikel toe",
            href:"javascript:cms.doCreateNewItem("+compId+")",
            enabled:true
          },
          {},
          {
            label:"Knip deze Component",
            href:"javascript:cms.doCutComponent("+compId+",'"+componentType+"')",
            enabled:true
          }];
          break;
        case "richtext": menu = [
          {
            label:"Knip deze Component",
            href:"javascript:cms.doCutComponent("+compId+",'"+componentType+"')",
            enabled:true
          }
        ];
          break;
        case "gastenboek": menu = [
          {
            label:"Knip deze Component",
            href:"javascript:cms.doCutComponent("+compId+",'"+componentType+"')",
            enabled:true
          }
        ];
          break;
        case "event": menu = [
          {
            label:"Knip deze Component",
            href:"javascript:cms.doCutComponent("+compId+",'"+componentType+"')",
            enabled:true
          }
        ];
          break;
        case "multimedia": menu = [
          {
            label:"Knip deze Component",
            href:"javascript:cms.doCutComponent("+compId+",'"+componentType+"')",
            enabled:true
          }
        ];
          break;
        case "menu": menu = [{
          label:"Voeg nieuwe Pagina toe",
          href:"/_wizards/CreatePageWizard/Default.aspx?pageId="+CURRENT_PAGE_ID,
          enabled:true
        },
        {
          label:"Pas navigatie aan",
          href:"javascript:menu.initNavigation('"+CURRENT_PAGE_ID+"')",
          enabled:true
        },
        {}
        ];
      }

      // dit geldt voor elk component:
      menu.push( 
        {
        label:"Verwijder deze Component",
        href:"javascript:cms.doRemoveComponent("+compId+",'"+componentType+"')",
        enabled:true
       }); 
       return menu;
     }
   }
};

ContextMenu.__init();

function ComponentToolbar()
{    
  Spif.DOMEvents.attach(document.documentElement, "click", this.doClickBody, this);

  //create Toolbar
  this.__toolbar = this.CreateComponentToolbar();
};
  
ComponentToolbar.prototype = 
{
  // op dit moment nog geen component active.
  __currentActiveComponent: null,

  doClickBody: function(evt)
  {
    if (!this.isInEditmode())
      return;

    if (this.isInsideUI(evt.subject))
      return;

    var el = this.getComponentElement(evt.subject);

    if (this.__currentActiveComponent && this.__currentActiveComponent != el)
      this.__doDeactivateComponent();

    if (!el)
      return;

    this.__doActivateComponent(el);
  },
  
  __doActivateComponent: function (el)
  {
    // place toolbar
    el.appendChild(this.__toolbar);

    // make active component look active
    Spif.ClassNameAbstraction.add(el, "activatedComponent");

    this.__currentActiveComponent = el;
  },
  
  __doDeactivateComponent: function ()
  {
    // remove 
    if (!this.__toolbar.parentNode)
      return
      
    this.__toolbar.parentNode.removeChild(this.__toolbar);

    // stop active component from looking active 
    if (this.__currentActiveComponent)
      Spif.ClassNameAbstraction.remove(this.__currentActiveComponent, "activatedComponent");

    this.__currentActiveComponent = null;
  },
  
  // functions gets the component element if someone clicked within the component
  getComponentElement: function(el) {
    for (;el; el = el.parentNode)
      if (Spif.ClassNameAbstraction.contains(el, "componentBox") && Spif.ClassNameAbstraction.contains(el.parentNode, "placeholder"))
        return el;
    return null;
  },

  isInEditmode: function()
  {
    return Spif.ClassNameAbstraction.contains(document.getElementById("body"), "editMode");
  },

  isInsideUI: function(el)
  {
    for (;el; el = el.parentNode)
      if (Spif.ClassNameAbstraction.contains(el, "ui"))
        return true;
    return false;
  },
  
  // functions returns the HTML for the component toolbar    
  CreateComponentToolbar: function()
  {
    var componentToolbar = document.createElement("div");
    componentToolbar.id = "componentToolbar";
    componentToolbar.className = "componentToolbarBar ui dragger";
    
    var settingsButton = document.createElement("div");
    settingsButton.className = "dragging-disabled componentSettings";
    settingsButton.innerHTML = "<img src='/_img/component-selector-propertie.gif'/>";
    settingsButton.onclick = function(){settings.getComponentSettings(this);};
    componentToolbar.appendChild(settingsButton);

    // title
    /*var titleEl = document.createElement('span');
    titleEl.className = "contextmenuTitle";
    titleEl.innerHTML = "";
    componentToolbar.appendChild(titleEl);*/
    
    // context menu
    var ctxmenu = document.createElement('a');
    ctxmenu.setAttribute('href','#');
    ctxmenu.className = "dragging-disabled contextmenuActivator contextmenuType-component-";
    
    componentToolbar.appendChild(ctxmenu);

    return componentToolbar;
  }
};
  
var componentToolbar = new ComponentToolbar();
﻿
function ComponentDialog()
  {    
  };
  
  ComponentDialog.prototype = 
  {
    __initialized: false,
    deletedComponents : null,
    cutComponents : null,
  
    //tabkinds are copied and deleted
    initComponentTab : function (tabkind) {
    if (!this.__initialized)
    {
      this.__initialized = true;
      if (this.xsl==null)
        this.xsl = "components.xsl";
    }

    if (tabkind == "copied")
      this.drawCopiedTab();
    else if (tabkind == "deleted")
      this.drawDeletedTab();
    
    },
    
    drawCopiedTab : function () {
      this.cutComponents = proxies.ComponentManager.getAllCutComponents();
      if (this.cutComponents != null)
      {
        try
        {
          var params = new Array( {name:"componentSort", value:"cut"});
          var el = document.getElementById("cutComponentsBox");
          transformXml(this.cutComponents, this.xsl, el, params);
        }
        catch (err)
        {
          alert(err.message);
        }
      }
    },
    
    drawDeletedTab : function () {
      this.deletedComponents = proxies.ComponentManager.getAllDeletedComponents();
      if (this.deletedComponents != null)
      {
        try
        {
          var params = new Array( {name:"componentSort", value:"deleted"});
          var el = document.getElementById("deletedComponentsBox");
          transformXml(this.deletedComponents, this.xsl, el, params);
        }
        catch (err)
        {
          alert(err.message);
        }
      }
    }
  }

var componentdialog = new ComponentDialog();  


function MapHandler(mapId, view) {

  if (typeof (GUnload) == 'undefined' || !maps)
    return;
  this.mapId = mapId;
  this.view = view;
  maps.list[mapId + ""] = this;
}

MapHandler.prototype = {
  /* click vanuit een google map */
  onClick: function(marker, position) {

    if (!EDITMODE) return;

    if (!marker && position) {

      // we willen een nieuwe marker aanmaken.
      var newLoc = proxies.Maps.CreateLocation(this.mapId, position.lat(), position.lng());
      if (newLoc && newLoc.documentElement) {
        marker = maps.doShowLocation(newLoc.documentElement, true);
      }
      //return;
    }

    if (marker) {
      var el = document.getElementById('map-' + this.mapId);
      if (el) {
        Lime.scanContent(el);
      }
    }
  }
};

function Maps() {
  this.list = {};
  this.mapsById = {};
  this.allMarkers = {};

  Spif.DOMEvents.attach(window, "load", doOnloadMaps);
}

function doOnloadMaps() {
  maps.doOnload();
}

// async return method
proxies.Maps.GetLocations.func = function(soapResult) {
  if (soapResult && soapResult.documentElement) {
    maps.doShowLocations(soapResult.documentElement);
  }
  maps.doOnload(); // process possible next locations for other maps
}


Maps.prototype = {
  doOnload: function() {
    for (var mapid in this.list) {
      // start webservice call voor elke kaart
      // async!
      var maph = this.list[mapid + ""];
      if (!maph.loaded) {
        this.initializeMap('map-' + maph.mapId, maph.mapId, maph);
        maph.loaded = true;
        proxies.Maps.GetLocations(maph.mapId, 0, 0, 0, 0);
        break;
      }
    }
  },

  initializeMap: function(htmlElId, componentId, mapHandler) {
    if (GBrowserIsCompatible()) {
      var map = new GMap2(document.getElementById(htmlElId));

      if (mapHandler.view != 'small') {
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
      }

      map.setCenter(new GLatLng(DEFAULTMAPLOCATION.lng, DEFAULTMAPLOCATION.lat), 13);

      var maph = this.list[componentId + ""];
      GEvent.bind(map, "click", maph, maph.onClick);

      map.widwId = componentId;

      // store js object also
      this.mapsById[componentId] = map;
      return map;
    }
    return null;
  },

  /* wordt aangeroepen vanuit de proxies api */
  doShowLocations: function(xmlEl) {
    var nodes = xmlEl.childNodes;
    for (var i = 0; i < nodes.length; i++)
      this.doShowLocation(nodes[i], i == nodes.length - 1); // laatste altijd openen

  },

  doShowLocation: function(xmlEl, showPanel) {
    var mapId = xmlEl.getAttribute("component_id");
    var map = this.mapsById[mapId];
    var lng = xmlEl.getAttribute("lng").replace(",", ".") * 1
    var lat = xmlEl.getAttribute("lat").replace(",", ".") * 1
    var title = xmlEl.getAttribute("title");
    if (title == null) title = "";

    if (map == null)
      return;

    // create editable lime content if needed
    var html = title + "";
    if (EDITMODE) {
      var locid = xmlEl.getAttribute("id");
      html = '<span style="width:200px;" ' + (EDITMODE ? 'contenteditable="true" ' : '') + 'limeid="/location[@id=\'' + locid + '\']/@title" limetype="text-plain" class="lime-text-plain">' + title + '</span><a class="location-delete-button" href="#" onclick="maps.doDeleteLocation(' + mapId + ',' + locid + '); return false;"></a>';
    }
    else {
      html = '<div style="width:200px;">' + title + '</div>';
    }

    // Our info window content
    var infoTabs = [
      new GInfoWindowTab("Lokatie", html)
    ];

    // Place a marker in the center of the map and open the info window
    // automatically
    var marker = new GMarker(new GLatLng(lat, lng));
    GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowTabsHtml(infoTabs);
    });
    map.addOverlay(marker);
    if (showPanel) {
      marker.openInfoWindowTabsHtml(infoTabs);
    }
    this.allMarkers[mapId + '-' + locid] = marker;
    return marker;
  },



  doDeleteLocation: function(mapid, locid) {
    if (EDITMODE) {
      if (!confirm("Weet u zeker dat u deze lokatie wilt verwijderen?")) return;

      proxies.Maps.DeleteLocation(locid);
      var map = this.mapsById[mapid];

      // kan slimmer; maar removeOverlay werkte even niet goed, dit werkt ook, is alleen suboptimaal. (kars)
      map.clearOverlays();
      proxies.Maps.GetLocations(mapid, 0, 0, 0, 0);
    }
  }



};

var maps = new Maps();




/**
 * Web in de Wijk
 *
 * (C) 2006, Q42 Internet BV - http://q42.nl
 */
 
// check which browser is running
var userAgent    = navigator.userAgent.toLowerCase();
var appVersion   = navigator.appVersion.toLowerCase();
var appName      = navigator.appName.toLowerCase();

// operating system and browser information
var isWin        = (appVersion.indexOf('windows') != -1);
var isOpera      = (userAgent.indexOf('opera') != -1);
var isIE         = (appName.indexOf('internet explorer') != -1) && !isOpera;
var isSafari     = (userAgent.indexOf('applewebkit') != -1);
var isMozilla    = (appName.indexOf('netscape') != -1) && !isSafari;

// build versionString
if (isSafari)
  var versionString = appVersion.substr(appVersion.lastIndexOf("safari/") + 7, 3);
else if (isIE || isOpera)
  var versionString = appVersion.substring(appVersion.indexOf('msie') + 5);
else if (isMozilla)
  var versionString = userAgent.substring(userAgent.indexOf('rv:')+3, userAgent.indexOf('rv:') + 6);
else
  var versionString = appVersion;

// cast version to numeric
var version = parseFloat(versionString);
var ie50 = isWin && isIE && (version <= 5.01);

function getBoxObjectFor(el)
{
  if (el.getBoundingClientRect)
  {
    var bcr = el.getBoundingClientRect();
    return {
      x: bcr.left + document.documentElement.scrollLeft,
      y: bcr.top + document.documentElement.scrollTop,
      width: bcr.right - bcr.left,
      height: bcr.bottom - bcr.top
    };
  }
  else if (el.ownerDocument.getBoxObjectFor)
  {
    var box = el.ownerDocument.getBoxObjectFor(el);
    var bcr = {
      x:box.x,
      y:box.y,
      width:box.width,
      height:box.height
    };
    for (var pel = el.parentNode; pel != document.documentElement; pel = pel.parentNode)
    {
      bcr.x -= pel.scrollLeft;
      bcr.y -= pel.scrollTop;
    }
    return bcr;
  }
  else
    aler("getBoxObjectFor is not implemented for this browser");
}

function getElementsByTagNameAttributeValue(ancestorEl, tagName, attrName, attrValue)
 {
  if (typeof(attrValue) == "undefined")
    attrValue = null;

  var els = [];
  var a = ancestorEl.getElementsByTagName(tagName);
  for (var i=0; i<a.length; i++)
  {
    var el = a[i];
    switch (attrName)
    {
      case "className":
      case "class":
        //if (el.className.indexOf(attrValue) != -1)
        if (Spif.ClassNameAbstraction.contains(el,attrValue))
          els.push(el);
        break;
      default:
        var val = el.getAttribute(attrName);
        if ((val != null) && ((attrValue == null) || (val == attrValue)))
          els.push(el);
    }
  }
  return els;
};

function getParentElementByTagNameAttributeValue(el, tagName, attrName, attrValue)
 {
  if (typeof(attrValue) == 'undefined')
    attrValue = null;

  tagName = tagName.toLowerCase();

  while (el && el.getAttribute && el.parentNode)
  {
    if (el.tagName && (el.tagName.toLowerCase() == tagName))
    {
      switch (attrName)
      {
        case "className":
        case "class":
          if (Spif.ClassNameAbstraction.contains(el,attrValue))
            return el;
        default:
          var val = el.getAttribute(attrName);
          if ((val != null) && ((attrValue == null) || (val == attrValue)))
            return el;
      }
    }
    el = el.parentNode;
  }

  return null;
};

function getParametersFromElement(el)
{
  // Will extract a hashTable of name/value pairs from a className:
  // class="... params-name1_value1-name2_value2... ..."

  var params = {};
  var matches = el.className.match(/params-(.+[^\s$])/);
  if (matches)
  {
    var s = matches[1];
    var a = s.split("-");
    for (var i=0; i<a.length; i++)
    {
      var nv = a[i].split("_");
      params[nv[0]] = nv[1];
    }
  }
  
  return params;
}

Function.prototype.closure = function(obj)
{
  // Init object storage.
  if (!window.__objs)
  {
    window.__objs = [];
    window.__funs = [];
  }

  // For symmetry and clarity.
  var fun = this;

  // Make sure the object has an id and is stored in the object store.
  var objId = obj.__objId;
  if (!objId)
    __objs[objId = obj.__objId = __objs.length] = obj;

  // Make sure the function has an id and is stored in the function store.
  var funId = fun.__funId;
  if (!funId)
    __funs[funId = fun.__funId = __funs.length] = fun;

  // Init closure storage.
  if (!obj.__closures)
    obj.__closures = [];

  // See if we previously created a closure for this object/function pair.
  var closure = obj.__closures[funId];
  if (closure)
    return closure;

  // Clear references to keep them out of the closure scope.
  obj = null;
  fun = null;

  // Create the closure, store in cache and return result.
  return __objs[objId].__closures[funId] = function ()
  {
    return __funs[funId].apply(__objs[objId], arguments);
  };
};

function getXMLDOM(url)
{
  var xmlDoc;

  if (window.ActiveXObject)
    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  else
    xmlDoc = document.implementation.createDocument("text/xml", "", null);

  xmlDoc.async=false;
  xmlDoc.load(url);

  return xmlDoc;
};

function getXSLTStylesheet(xslFileName)
{
  //ophalen van alle verschillende soorten websites.
  if (window.ActiveXObject)
  {
    var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
    xslDoc.async = false;
    xslDoc.resolveExternals = true;
    xslDoc.load(xslFileName);

    var xslt = new ActiveXObject("Msxml2.XSLTemplate");
    xslt.stylesheet = xslDoc;

    return xslt.createProcessor();
  }
  else
  {
    var xslDoc = getXMLDOM(xslFileName);
    var xsltProc = new XSLTProcessor();
    xsltProc.importStylesheet(xslDoc);

    return xsltProc;
  }
};

function initXML(xmlString)
{
  if (window.ActiveXObject)
  {
    var doc=new ActiveXObject("Microsoft.XMLDOM");
    doc.async="false";
    doc.loadXML(xmlString);
    return doc;
  }
  else
  {
    var parser=new DOMParser();
    var doc=parser.parseFromString(xmlString,"text/xml");
    return doc;
  }
};

function loadXMLFile (file)
{
  var xmlDoc;
  //ophalen van alle verschillende soorten websites.
  if (document.implementation && document.implementation.createDocument)
    xmlDoc = document.implementation.createDocument("", "", null);
  else if (window.ActiveXObject)
  {
    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async="false";
  }
  xmlDoc.load(file);
  
  return xmlDoc;
}

function XmlHttp(){}
XmlHttp.prototype =
{
  request: function(url, send)
  {
    if (window.XMLHttpRequest)
      req = new XMLHttpRequest();
    else if (window.ActiveXObject)
      req = new ActiveXObject("Microsoft.XMLHTTP");
    if (req == null)
      return;        
    req.open("GET", url, false);
    req.send(send);
    return req;
  }
}
var xmlhttp = new XmlHttp();

function removeDoubles(array)
{
  var newArray = new Array();
  var aantal = 0;
  for (i=0; i<array.length; i++)
  {
    var vergelijk = array[i];

    for (y=0; y<newArray.length; y++)
    {
      var vergelijkmet = newArray[y];
      if (vergelijk == vergelijkmet)
        aantal++
    }

    if (aantal == 0)
      newArray.push(vergelijk)
    aantal = 0;
  }
  return newArray;
}


function setFocus(el)
{
  if (el)
    setTimeout(function() {el.select(); },20)
}

function findPos(obj)
 {
  var curleft = curtop = 0;
  if (obj.offsetParent)
   {
    curleft = obj.offsetLeft
    curtop = obj.offsetTop
    while (obj = obj.offsetParent)
     {
      curleft += obj.offsetLeft
      curtop += obj.offsetTop
    }
  }
  return [curleft,curtop];
}

// only IE probably!
// transforms xmlDom using xslTemplate and parameters
// define params as var params = new Array( {name:"currentAssetId", value:currentAssetId} );
function transformXml(xmlDoc, xslProc, destEl, parameters) {

  var preXslPath = "/_xslt/";
  if (isMozilla)
  {
    //create processor
    var processor = new XSLTProcessor();
    
    //get and import xsl
    var xslDom = xmlhttp.request(preXslPath + xslProc).responseXML;
    processor.importStylesheet(xslDom);
    
    //add parameters if there are any
    if (parameters)
      for (var i = 0; i < parameters.length; i++)
        processor.setParameter("", parameters[i]["name"], parameters[i]["value"]);
        
    
    //transform and show result
    var result = processor.transformToDocument(xmlDoc);
    if(result.documentElement)
    {
      destEl.innerHTML = "";

      //needed like this for event dialog
      while (result.documentElement.firstChild)
        destEl.appendChild(result.documentElement.firstChild);
        
      return;
    } 
  } 
  else if (isIE)
  {
    xslProc = getXSLTStylesheet(preXslPath+xslProc);
    var endResult = null;
    if (xslProc.transformToDocument)
    {
      if (parameters)
        for (var i = 0; i < parameters.length; i++)
          xslProc.setParameter("", parameters[i].name, parameters[i].value);

      var result = xslProc.transformToDocument(xmlDoc);

      if (parameters)
        for (var i = 0; i < parameters.length; i++)
          xslProc.removeParameter("", parameters[i].name);

      endResult = result;
    }
    else
    {
      xslProc.input = xmlDoc;
      if (parameters)
        for (var i = 0; i < parameters.length; i++)
          xslProc.addParameter(parameters[i].name, parameters[i].value);

      xslProc.transform();
      endResult = xslProc.output;
    }
    
    //draw endresult
    destEl.innerHTML = "";
    destEl.innerHTML = serializeXMLDoc(endResult);
  }
}

function serializeXMLDoc(xmlDoc)
{
  if (window.XMLSerializer)
    var html = new XMLSerializer().serializeToString(xmlDoc);
  else
    var html = "" + xmlDoc;

  html = html.replace(/(<iframe[^>]+)\/>/gi, "$1></iframe>");

  return html;
}
  
function selectSingleNode(node, xpath)
{
  if (typeof(node.selectSingleNode) != "undefined")
    return node.selectSingleNode(xpath);
  else
  {
    var xpe = new XPathEvaluator();
    return xpe.evaluate(xpath, node, xpe.createNSResolver(node), XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  }
}

// check for XPath implementation 
if( document.implementation.hasFeature("XPath", "3.0") ) 
{ 
  // prototying the XMLDocument 
  XMLDocument.prototype.selectSingleNode = function(cXPathString, xNode) 
  { 
    if( !xNode ) { xNode = this; }
    var xItems = this.selectNodes(cXPathString, xNode);
    
    if( xItems.length > 0 )  
      return xItems[0];
    else 
      return null;
  } 
  
  // prototying the Element 
  Element.prototype.selectSingleNode = function(cXPathString) 
  {
    if(this.ownerDocument.selectSingleNode) 
      return this.ownerDocument.selectSingleNode(cXPathString, this); 
    else
      throw "For XML Elements Only";
  } 
} 

if( document.implementation.hasFeature("XPath", "3.0") ) 
{ 
  // prototying the XMLDocument 
  XMLDocument.prototype.selectNodes = function(cXPathString, xNode) 
  { 
    if( !xNode ) { xNode = this; }
    var oNSResolver = this.createNSResolver(this.documentElement) 
    var aItems = this.evaluate(cXPathString, xNode, oNSResolver,
                 XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) 
    var aResult = [];
    for( var i = 0; i < aItems.snapshotLength; i++) 
    { 
      aResult[i] = aItems.snapshotItem(i);
    } 
    return aResult;
  } 

  // prototying the Element 
  Element.prototype.selectNodes = function(cXPathString) 
  { 
    if(this.ownerDocument.selectNodes) 
    { 
      return this.ownerDocument.selectNodes(cXPathString, this);
    } 
    else{throw "For XML Elements Only";} 
  } 
} 
 /**
 * Web in de Wijk
 *
 * (C) 2006, Q42 Internet BV - http://q42.nl
 */
function userAuthentication() {}
userAuthentication.prototype =
{
  login : function ()
  {
    //ophalen van username/emailadres en password
    var username = document.getElementById("loginUsername").value;
    var password = document.getElementById("loginPassword").value;
    var remember = document.getElementById("rememberMe").checked;
    
    //controleer password dmv service
    var result = proxies.userAuthentication.Login(username,password,remember);

    if (result != "")
    {
      alert(result);
      document.getElementById('loginUsername').select();
      Spif.ClassNameAbstraction.replace(document.getElementById('forgotPassword'),"collapsed", "expanded");
    }
    else {
      var res = proxies.userAuthentication.isEmailAdressValidated();
      if (res != "") 
        window.location.href = "/_wizards/UserRegistration/ValidateEmail.aspx?code="+res;
      else {
        //reload page
        window.location.reload();
      } 
    }
  },
  
  changePassword : function ()
  {
    //ophalen password
    var username = document.getElementById('forgotPassUsername').value;
    
    //check of username bestaat
    if (!proxies.userAuthentication.userNameExists(username))
    {
      alert("Deze gebruikersnaam bestaat niet.\nProbeer het nog eens.")
      return;
    }
    
    //send email
    proxies.userAuthentication.sendPasswordForgottenMail(username);
    alert("Er is een email verzonden naar uw emailadres");
  },
  
  logout : function ()
  {
    //legen van de sessie
    proxies.userAuthentication.Logout();
    window.location.reload()
  },
  
  startEditing : function()
  {
    //zet in een sessie dat er gewijzigd mag worden
    proxies.userAuthentication.setEditingSession();
    //reload page
    window.location.reload();
  },
  
  stopEditing : function()
  {
    //zet de sessie om te wijzigen uit
    proxies.userAuthentication.removeEditingSession();
    //reload page
    window.location.reload();
  },
  
  inlogTriggerAction : function (keycode, evt)
  {
    var keyCode = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
    if (keyCode == 13) 
      this.login();
  }
  
}

var userauthenticate = new userAuthentication();

﻿/**
 * Web in de Wijk
 *
 * (C) 2006, Q42 Internet BV - http://q42.nl
 */
 
 
/*Functie is begonnnen om emailadres in profiel te kunnen wijzigen dit is nog niet het geval in R1*/ 
/* proxies.Validation.ValidateUserRegistration.func = function(soapResult)
{
    inputEl = document.getElementById("gebruikersnaam");
    document.getElementById("username-error").innerHTML = soapResult;
    
    if (soapResult != "")
      Spif.ClassNameAbstraction.add(inputEl, "error");
    else
      Spif.ClassNameAbstraction.remove(inputEl, "error");
}


function Profile() {}
Profile.prototype =
{
  checkChangedEmailadres : function (el)
  {
    var profileUserId = parseInt(document.getElementById("profileUserId").value);
    if (typeof(profileUserId) != "number" || isNaN(profileUserId))   
      profileUserId = -1;
      
      alert(el.className);
      return;
      
    clearTimeout();
    setTimeout(function() {proxies.Validation.ValidateEmailRegistration(el.value, profileUserId)},1500);
  }
}

var profile = new Profile();

*/

function openContactDialog()
{
  Spif.ClassNameAbstraction.replace(document.getElementById("contactDialog"), "hidden", "shown");
}

function deleteProfilePhoto()
{
  try 
  {
     proxies.EditMode.deleteProfilePhoto();
     document.getElementById("headPhoto").innerHTML = " ";
  }
  catch (err)
  {
    alert(err.message);
  }
}

function doDropProfileHeadImage(droppedEl, oldParent, oldNextSibling, newParent, newNextSibling)
{
  if (!EDITMODE)
  {
    alert("You're not in editmode");
    newParent.innerHTML = "";
    return;
  }

  newParent.innerHTML = "";
  var assetId = oldParent.id.replace("asset-","");
  if (!assetId || assetId < 0)
   return;
   
  var link = "/_services/AssetServer.ashx/"+assetId+"?multimediacomponent-profile";
  newParent.innerHTML = "<img src='"+link+"' /><div class=\"removePhoto\" onclick=\"deleteProfilePhoto()\">&#160;</div>";
      
  //save image in db
  try {
    proxies.EditMode.saveProfileHeadImage(assetId)
  }
  catch(err) {
    alert(err.message);
  }
}

function loadProfileSlideShow(componentId)
{
  //check
  if (!componentId || componentId < 1) return;
  
  //anti cache
  var now = new Date();
  var currentView = "profileShow";
  var componentEl = document.getElementById(componentId);
  componentEl.innerHTML = "";
  
  //get content (xmlhttp)
  var contentXML = xmlhttp.request("/_fragments/Fragment.aspx?componentId="+componentId+"&view="+currentView+"&xml=true&now="+now).responseXML;
  contentXML = contentXML.selectSingleNode("//*[@id = '"+componentId+"-content']");
  
  if (isMozilla && contentXML)
  {
    componentEl.appendChild(contentXML)
  }
  else if (contentXML && contentXML.childNodes)
  {
    var newXML = "";
    for (var q = 0; q < contentXML.childNodes.length; q++)
    {
      newXML += contentXML.childNodes[q].xml;
    }
    componentEl.innerHTML = newXML
  }
  else if(contentXML)
  {
    componentEl.innerHTML = contentXML.xml
  }
  else
  {
    alert("stuk!")
  }
}

function createProfileQuestion()
{
  try { 
    proxies.EditMode.createProfileQuestion(); 
    window.location.reload();
  }
  catch(err) { alert(err.message); }
}

function deleteProfileQuestion(qaId)
{
  try { 
    proxies.EditMode.deleteProfileQuestion(qaId); 
    window.location.reload();
  }
  catch(err) { alert(err.message); }
}


function ToggleCompPrivacy(checked)
{
  try {
    proxies.EditMode.ToggleCompPrivacy(checked);
  }
  catch(err) { alert(err.message); } 
}

function deleteWebsite(id)
{
  var a = confirm("Weet u zeker dat u de website (inclusief subpagina's) wilt weggooien?")
  if (a)
  {
    try 
    {
      proxies.EditMode.deleteWebsite(id);
      
      //hide row
      var el = document.getElementById("myWebsite-"+id);
      el.parentNode.removeChild(el);
    }
    catch(err) 
    {
      alert(err.message);
    } 
  }
}
﻿var classREs = "prev3Img\\b|\\bprev2Img\\b|\\bprev1Img\\b|\\bcurImg\\b|\\bnext1Img\\b|\\bnext2Img\\b|\\bnext3Img";
function doSlide(actorEl, acteeEl)
{
  doLoadImages(actorEl.parentNode, acteeEl);

  var captionEl = document.getElementById("caption" + acteeEl.id.substring(9));
  var showCaption = false;
  if (document.getElementById("showDescr") && document.getElementById("showDescr").value == "on")
    showCaption = true;
  
  var curImg = getCurImage(acteeEl);

  if (curImg && showCaption)
    captionEl.innerHTML = curImg.title;
}

function doLoadImages(actorEl, acteeEl)
{
  for (var cEl = acteeEl.firstChild; cEl; cEl = cEl.nextSibling)
  {
    if (cEl.nodeType == 1)
    {
      if (
        Spif.ClassNameAbstraction.contains(cEl, classREs)
        &&
        cEl.getAttribute("nosrc")
      )
      {
        cEl.setAttribute("src", cEl.getAttribute("nosrc"));
        cEl.removeAttribute("nosrc", null);
      }
    }
  }
}

function autoSlideShowStarter(componentId)
{
  var playButton = document.getElementById("slideshow"+componentId);
  Spif.ClassShifter.play(playButton);
}

var classRE2s = "prev2Img\\b|\\bprev1Img\\b|\\bcurImg\\b|\\bnext1Img\\b|\\bnext2Img";
function doBeforeChangeSlideshow(el)
{
  for (var i=0; i<el.childNodes.length; i++)
  {
    var cEl = el.childNodes[i];
    if (cEl.nodeType == 1 && Spif.ClassNameAbstraction.contains(cEl, classRE2s) && (cEl.naturalWidth == 0 || (cEl.readyState && cEl.readyState != "complete")))
      return false;
  }
}

function doSwapPrevInSlideshow(el, parentEl, componentId)
{
  var curImg = getCurImage(el);

  var prevImg = curImg.previousSibling.previousSibling;
  if (!prevImg || prevImg.nodeName != "IMG")
    return;

  // Send to server
  var curAssetId = curImg.src.match(/\/([0-9]+)\?/)[1];
  var prevAssetId = prevImg.src.match(/\/([0-9]+)\?/)[1];

  try 
  { 
    proxies.AssetServer.doSwapPrevInSlideshow(curAssetId, prevAssetId, componentId) 
    var src = curImg.src;
    curImg.src = prevImg.src;
    prevImg.src = src;
  }
  catch (err) { alert(err.message) }
}

function doSwapNextInSlideshow(el, parentEl, componentId)
{
  var curImg = getCurImage(el);

  var nextImg = curImg.nextSibling.nextSibling;
  
  if (!nextImg || nextImg.tagName != "IMG")
    return;
    
  // Send to server
  var curAssetId = curImg.src.match(/\/([0-9]+)\?/)[1];
  var nextAssetId = nextImg.src.match(/\/([0-9]+)\?/)[1];
  
  try 
  { 
    proxies.AssetServer.doSwapPrevInSlideshow(curAssetId, nextAssetId, componentId) 
    var src = curImg.src;
    curImg.src = nextImg.src;
    nextImg.src = src;
  }
  catch (err) { alert(err.message) }
}

function doDeleteFromSlideshow(el, parentEl, componentId)
{
  var curImg = getCurImage(el);
  // Send to server
  var assetId = curImg.src.match(/\/([0-9]+)\?/)[1];
  try 
  { 
    proxies.AssetServer.deleteImageFromSlideshow(assetId, componentId) 
    var deleteEl = curImg;
    var newClassName = deleteEl.className;
    var nextSlide = deleteEl.nextSibling
    deleteEl.parentNode.removeChild(deleteEl);
    Spif.ClassShifter.reset(parentEl);
    
    for (nextSlide; nextSlide; nextSlide = nextSlide.nextSibling)
    {
      if (Spif.ClassNameAbstraction.contains(nextSlide, "slide"))
      {
        var oldClassName = nextSlide.className;
        Spif.ClassNameAbstraction.replace(nextSlide, oldClassName, newClassName)
        newClassName = oldClassName;
      } 
    }
  }
  catch (err) { alert(err.message) }
}

function getCurImage(el)
{
  while (!Spif.ClassNameAbstraction.contains(el, "classChain"))
    el = el.parentNode;

  for (var cel = el.firstChild; cel; cel = cel.nextSibling)
    if (Spif.ClassNameAbstraction.contains(cel, "curImg"))
      return cel;
}

function doLoadSlideshowImage(img)
{
  var cn = img.className;
  img.className = "";
  var cssText = null;
  if (img.style.cssText)
  {
    cssText = img.style.cssText;
    img.style.cssText = "";
  }
  img.setAttribute("style", "");
  if (img.offsetWidth < img.offsetHeight)
    cn = cn.replace("landscape", "portret");
  if (cssText)
    img.style.cssText = cssText;
  img.className = cn;
}
﻿function doShownSettingsDialog()
{
  settings.init();
}


function Settings()
  {    
  };
  
  Settings.prototype = 
  {
    init : function() {
      var xsl = "settingsDialog.xsl?ac="+new Date();
      var html = null;
      var settingsXML = null;
      
      try { settingsXML = proxies.EditMode.getAllSettingsByComponentId(this.componentId); }
      catch (err) { alert(err.message) }
     
      if (settingsXML != null)
      {
        var el = document.getElementById("settingsDialogMainContent");
        transformXml(settingsXML, xsl, el);
      }
      else
      {
        html = "Er is geen component gevonden waarvan de settings weergegeven kunnen worden. Sluit het venster en probeer het nog eens"
        document.getElementById("settingsDialogMainContent").innerHTML = html;
      }
        
    },
  
    getComponentSettings : function (el)
    {
      //get componentId
      this.componentId = el.parentNode.parentNode.id;
      var componentIdForFrame = document.getElementById("componentIdForIframe");
      componentIdForFrame.value = this.componentId;
      
      //set src for iframe
      document.getElementById("saveSettingsForm").src = "/_actions/settings.aspx";
      
      //open dialog
      settingsDialoog = document.getElementById("settingsDialog");
      Spif.ClassNameAbstraction.replace(settingsDialoog, "hidden", "shown");
    }

  }

var settings = new Settings();  


/*	Unobtrusive Flash Objects (UFO) v3.20 <http://www.bobbyvandersluis.com/ufo/>
	Copyright 2005, 2006 Bobby van der Sluis
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var UFO = {
	req: ["movie", "width", "height", "majorversion", "build"],
	opt: ["play", "loop", "menu", "quality", "scale", "salign", "wmode", "bgcolor", "base", "flashvars", "devicefont", "allowscriptaccess", "seamlesstabbing"],
	optAtt: ["id", "name", "align"],
	optExc: ["swliveconnect"],
	ximovie: "ufo.swf",
	xiwidth: "215",
	xiheight: "138",
	ua: navigator.userAgent.toLowerCase(),
	pluginType: "",
	fv: [0,0],
	foList: [],
		
	create: function(FO, id) {
		if (!UFO.uaHas("w3cdom") || UFO.uaHas("ieMac")) return;
		UFO.getFlashVersion();
		UFO.foList[id] = UFO.updateFO(FO);
		UFO.createCSS("#" + id, "visibility:hidden;");
		UFO.domLoad(id);
	},

	updateFO: function(FO) {
		if (typeof FO.xi != "undefined" && FO.xi == "true") {
			if (typeof FO.ximovie == "undefined") FO.ximovie = UFO.ximovie;
			if (typeof FO.xiwidth == "undefined") FO.xiwidth = UFO.xiwidth;
			if (typeof FO.xiheight == "undefined") FO.xiheight = UFO.xiheight;
		}
		FO.mainCalled = false;
		return FO;
	},

	domLoad: function(id) {
		var _t = setInterval(function() {
			if ((document.getElementsByTagName("body")[0] != null || document.body != null) && document.getElementById(id) != null) {
				UFO.main(id);
				clearInterval(_t);
			}
		}, 4500);
		if (typeof document.addEventListener != "undefined") {
			document.addEventListener("DOMContentLoaded", function() { UFO.main(id); clearInterval(_t); } , null); // Gecko, Opera 9+
		}
	},

	main: function(id) {
		var _fo = UFO.foList[id];
		if (_fo.mainCalled) return;
		UFO.foList[id].mainCalled = true;
		document.getElementById(id).style.visibility = "hidden";
		if (UFO.hasRequired(id)) {
			if (UFO.hasFlashVersion(parseInt(_fo.majorversion, 10), parseInt(_fo.build, 10))) {
				if (typeof _fo.setcontainercss != "undefined" && _fo.setcontainercss == "true") UFO.setContainerCSS(id);
				UFO.writeSWF(id);
			}
			else if (_fo.xi == "true" && UFO.hasFlashVersion(6, 65)) {
				UFO.createDialog(id);
			}
		}
		document.getElementById(id).style.visibility = "visible";
	},
	
	createCSS: function(selector, declaration) {
		var _h = document.getElementsByTagName("head")[0]; 
		var _s = UFO.createElement("style");
		if (!UFO.uaHas("ieWin")) _s.appendChild(document.createTextNode(selector + " {" + declaration + "}")); // bugs in IE/Win
		_s.setAttribute("type", "text/css");
		_s.setAttribute("media", "screen"); 
		_h.appendChild(_s);
		if (UFO.uaHas("ieWin") && document.styleSheets && document.styleSheets.length > 0) {
			var _ls = document.styleSheets[document.styleSheets.length - 1];
			if (typeof _ls.addRule == "object") _ls.addRule(selector, declaration);
		}
	},
	
	setContainerCSS: function(id) {
		var _fo = UFO.foList[id];
		var _w = /%/.test(_fo.width) ? "" : "px";
		var _h = /%/.test(_fo.height) ? "" : "px";
		UFO.createCSS("#" + id, "width:" + _fo.width + _w +"; height:" + _fo.height + _h +";");
		if (_fo.width == "100%") {
			UFO.createCSS("body", "margin-left:0; margin-right:0; padding-left:0; padding-right:0;");
		}
		if (_fo.height == "100%") {
			UFO.createCSS("html", "height:100%; overflow:hidden;");
			UFO.createCSS("body", "margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");
		}
	},

	createElement: function(el) {
		return (UFO.uaHas("xml") && typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", el) : document.createElement(el);
	},

	createObjParam: function(el, aName, aValue) {
		var _p = UFO.createElement("param");
		_p.setAttribute("name", aName);	
		_p.setAttribute("value", aValue);
		el.appendChild(_p);
	},

	uaHas: function(ft) {
		var _u = UFO.ua;
		switch(ft) {
			case "w3cdom":
				return (typeof document.getElementById != "undefined" && typeof document.getElementsByTagName != "undefined" && (typeof document.createElement != "undefined" || typeof document.createElementNS != "undefined"));
			case "xml":
				var _m = document.getElementsByTagName("meta");
				var _l = _m.length;
				for (var i = 0; i < _l; i++) {
					if (/content-type/i.test(_m[i].getAttribute("http-equiv")) && /xml/i.test(_m[i].getAttribute("content"))) return true;
				}
				return false;
			case "ieMac":
				return /msie/.test(_u) && !/opera/.test(_u) && /mac/.test(_u);
			case "ieWin":
				return /msie/.test(_u) && !/opera/.test(_u) && /win/.test(_u);
			case "gecko":
				return /gecko/.test(_u) && !/applewebkit/.test(_u);
			case "opera":
				return /opera/.test(_u);
			case "safari":
				return /applewebkit/.test(_u);
			default:
				return false;
		}
	},
	
	getFlashVersion: function() {
		if (UFO.fv[0] != 0) return;  
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") {
			UFO.pluginType = "npapi";
			var _d = navigator.plugins["Shockwave Flash"].description;
			if (typeof _d != "undefined") {
				_d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				var _m = parseInt(_d.replace(/^(.*)\..*$/, "$1"), 10);
				var _r = /r/.test(_d) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
				UFO.fv = [_m, _r];
			}
		}
		else if (window.ActiveXObject) {
			UFO.pluginType = "ax";
			try { // avoid fp 6 crashes
				var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			}
			catch(e) {
				try { 
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
					UFO.fv = [6, 0];
					_a.AllowScriptAccess = "always"; // throws if fp < 6.47 
				}
				catch(e) {
					if (UFO.fv[0] == 6) return;
				}
				try {
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				}
				catch(e) {}
			}
			if (typeof _a == "object") {
				var _d = _a.GetVariable("$version"); // bugs in fp 6.21/6.23
				if (typeof _d != "undefined") {
					_d = _d.replace(/^\S+\s+(.*)$/, "$1").split(",");
					UFO.fv = [parseInt(_d[0], 10), parseInt(_d[2], 10)];
				}
			}
		}
	},

	hasRequired: function(id) {
		var _l = UFO.req.length;
		for (var i = 0; i < _l; i++) {
			if (typeof UFO.foList[id][UFO.req[i]] == "undefined") return false;
		}
		return true;
	},
	
	hasFlashVersion: function(major, release) {
		return (UFO.fv[0] > major || (UFO.fv[0] == major && UFO.fv[1] >= release)) ? true : false;
	},

	writeSWF: function(id) {
		var _fo = UFO.foList[id];
		var _e = document.getElementById(id);
		if (UFO.pluginType == "npapi") {
			if (UFO.uaHas("gecko") || UFO.uaHas("xml")) {
				while(_e.hasChildNodes()) {
					_e.removeChild(_e.firstChild);
				}
				var _obj = UFO.createElement("object");
				_obj.setAttribute("type", "application/x-shockwave-flash");
				_obj.setAttribute("data", _fo.movie);
				_obj.setAttribute("width", _fo.width);
				_obj.setAttribute("height", _fo.height);
				var _l = UFO.optAtt.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[UFO.optAtt[i]] != "undefined") _obj.setAttribute(UFO.optAtt[i], _fo[UFO.optAtt[i]]);
				}
				var _o = UFO.opt.concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") UFO.createObjParam(_obj, _o[i], _fo[_o[i]]);
				}
				_e.appendChild(_obj);
			}
			else {
				var _emb = "";
				var _o = UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") _emb += ' ' + _o[i] + '="' + _fo[_o[i]] + '"';
				}
				_e.innerHTML = '<embed type="application/x-shockwave-flash" src="' + _fo.movie + '" width="' + _fo.width + '" height="' + _fo.height + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + _emb + '></embed>';
			}
		}
		else if (UFO.pluginType == "ax") {
			var _objAtt = "";
			var _l = UFO.optAtt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.optAtt[i]] != "undefined") _objAtt += ' ' + UFO.optAtt[i] + '="' + _fo[UFO.optAtt[i]] + '"';
			}
			var _objPar = "";
			var _l = UFO.opt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.opt[i]] != "undefined") _objPar += '<param name="' + UFO.opt[i] + '" value="' + _fo[UFO.opt[i]] + '" />';
			}
			var _p = window.location.protocol == "https:" ? "https:" : "http:";
			_e.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + _objAtt + ' width="' + _fo.width + '" height="' + _fo.height + '" codebase="' + _p + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + _fo.majorversion + ',0,' + _fo.build + ',0"> <param name="wmode" value="transparent" /><param name="movie" value="' + _fo.movie + '" />' + _objPar + '</object>';
		}
	},
		
	createDialog: function(id) {
		var _fo = UFO.foList[id];
		UFO.createCSS("html", "height:100%; overflow:hidden;");
		UFO.createCSS("body", "height:100%; overflow:hidden;");
		UFO.createCSS("#xi-con", "position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");
		UFO.createCSS("#xi-dia", "position:absolute; left:50%; top:50%; margin-left: -" + Math.round(parseInt(_fo.xiwidth, 10) / 2) + "px; margin-top: -" + Math.round(parseInt(_fo.xiheight, 10) / 2) + "px; width:" + _fo.xiwidth + "px; height:" + _fo.xiheight + "px;");
		var _b = document.getElementsByTagName("body")[0];
		var _c = UFO.createElement("div");
		_c.setAttribute("id", "xi-con");
		var _d = UFO.createElement("div");
		_d.setAttribute("id", "xi-dia");
		_c.appendChild(_d);
		_b.appendChild(_c);
		var _mmu = window.location;
		if (UFO.uaHas("xml") && UFO.uaHas("safari")) {
			var _mmd = document.getElementsByTagName("title")[0].firstChild.nodeValue = document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0, 47) + " - Flash Player Installation";
		}
		else {
			var _mmd = document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		}
		var _mmp = UFO.pluginType == "ax" ? "ActiveX" : "PlugIn";
		var _uc = typeof _fo.xiurlcancel != "undefined" ? "&xiUrlCancel=" + _fo.xiurlcancel : "";
		var _uf = typeof _fo.xiurlfailed != "undefined" ? "&xiUrlFailed=" + _fo.xiurlfailed : "";
		UFO.foList["xi-dia"] = { movie:_fo.ximovie, width:_fo.xiwidth, height:_fo.xiheight, majorversion:"6", build:"65", flashvars:"MMredirectURL=" + _mmu + "&MMplayerType=" + _mmp + "&MMdoctitle=" + _mmd + _uc + _uf };
		UFO.writeSWF("xi-dia");
	},

	expressInstallCallback: function() {
		var _b = document.getElementsByTagName("body")[0];
		var _c = document.getElementById("xi-con");
		_b.removeChild(_c);
		UFO.createCSS("body", "height:auto; overflow:auto;");
		UFO.createCSS("html", "height:auto; overflow:auto;");
	},

	cleanupIELeaks: function() {
		var _o = document.getElementsByTagName("object");
		var _l = _o.length
		for (var i = 0; i < _l; i++) {
			_o[i].style.display = "none";
			for (var x in _o[i]) {
				if (typeof _o[i][x] == "function") {
					_o[i][x] = null;
				}
			}
		}
	}

};

if (typeof window.attachEvent != "undefined" && UFO.uaHas("ieWin")) {
	window.attachEvent("onunload", UFO.cleanupIELeaks.closure(window));
}

﻿// JScript File

function generatePlayer (id, file, size, extension, autostart)
{
  var width;
  var height;
  
  if (size=="small")
    { 
      width = "170px";
      height = "145px";
    }
  
  if (size=="large")
  {
    width = "504px";
    height = "375px";
  }

  if (size == "fullwidth")
  {
    width = "924px";
    height = "740px";
  }
  
  if (size=="audio")
  {
    width = "100%";
    height = "20px";
  }
  
  if (size=="slideshow")
  {
    width = "260px";
    height = "190px";
  }
  
  var FO = { movie:"/flvplayer.swf",width:width,height:height,majorversion:"7",build:"0",bgcolor:"#FFFFFF",flashvars:"file=/_services/AssetServer.ashx/" 
             + file + "?player-workaround=." + extension + "&amp;overstretch=fit&amp;showdigits=false&amp;showicons=false&amp;"
             + "autostart=" + autostart + "&amp;showfsbutton=true&amp;repeat=false" };
  UFO.create(	FO, "flvPlayer" + id);
}

﻿
var Events = {

  // CREATING AN EVENT

  deleteRole: function(el)
  {
    var rolesBox = document.getElementById('rolesBox');
    rolesBox.removeChild(el);
    return;
  },
    
  addRole: function()
  {
    var rolesBox = document.getElementById('rolesBox');
    var divs = rolesBox.getElementsByTagName('div');
    var newRole = null;
    
    for (var i = divs.length - 1; i >= 0; i--) {
      if (divs[i].className == "role") {
        newRole = divs[i].cloneNode(true);
        break;
      }
    }
    
    var oldId = parseInt(newRole.id.replace("role",""));
    var title = newRole.getElementsByTagName('div')[0];
    var roleName = newRole.getElementsByTagName('input')[0];
    var selects = newRole.getElementsByTagName('select');
    
    newRole.id = newRole.id.replace(oldId, oldId+1);
    title.innerHTML = title.innerHTML.replace(oldId, oldId+1);
    newRole.getElementsByTagName('input')[0].value = '';
    roleName.name = roleName.name.replace(oldId, oldId+1);
    
    for (var i = 0; i < selects.length; i++)
    {
      var s = selects[i];
      s.name = s.name.replace("role"+oldId, "role"+parseInt(oldId+1));
      s.selectedIndex = 0;
    }
    
    rolesBox.appendChild(newRole);
    return;
  },
  
  selectPrivacy: function(el)
  {
    var type = el.value;
    var rb = document.getElementById('rolesBox');
    var smb = document.getElementById('sendMailBox');
    switch (type)
    {
      case "open":
        if (!Spif.ClassNameAbstraction.contains(rb, "hidePeople"))
          Spif.ClassNameAbstraction.add(rb, "hidePeople");
        if (!Spif.ClassNameAbstraction.contains(smb, "hide"))
          Spif.ClassNameAbstraction.add(smb, "hide");
        smb.getElementsByTagName('input')[0].checked = false;
        break;  
      case "group":
        Spif.ClassNameAbstraction.remove(rb, "hidePeople");
        Spif.ClassNameAbstraction.remove(smb, "hide");
        break;
    }
  },
    
  toggleSignupDate: function()
  {
    var signupDates = document.getElementById('signupDates');
    if (Spif.ClassNameAbstraction.contains(signupDates, "hideSignupDate"))
      Spif.ClassNameAbstraction.remove(signupDates, "hideSignupDate");
    else
      Spif.ClassNameAbstraction.add(signupDates, "hideSignupDate");
  },
  
  cleanRoleName: function(el)
  {
    el.value = el.value.replace(/[;\|,]/g,"");
  },
  
  
  
  // FOR THE ACTUAL EVENT PAGE
  registerUser: function(activityId)
  {
    var signupDefault = document.getElementById('signupDefault');
    var specificRole = document.getElementById('specificRole');
    var signupSpecific = document.getElementById('signupSpecific');
    var role = "";
    
    if (signupDefault != null && signupDefault.checked)
      role = signupDefault.value;
    else if (signupSpecific != null && signupSpecific.checked)
      role = specificRole.value;
      
    if (role == "")
    {
      alert("Je moet een rol selecteren om je in te schrijven.");
      return;
    }
    
    proxies.ActivityManager.RegisterUser(activityId, role);
    Events.refreshPage();
  },
  
  unregisterUser: function(activityId)
  {
    proxies.ActivityManager.UnregisterUser(activityId);
    Events.refreshPage();
  },
  
  toggleShowSignups: function(bool, activityId)
  {
    proxies.ActivityManager.toggleShowSignups(bool, activityId);
  },
  
  saveChanges: function(activityId)
  {
    var newRoleId = document.getElementById('newRole').value;
    if (newRoleId == "")
    {
      alert("U moet een rol selecteren.");
      return false;
    }
    
    proxies.ActivityManager.updateRole(newRoleId, activityId);
    Events.refreshPage();
  },
  
  toggleComp: function(compId, activityId, el)
  {
    var username = el.parentNode.parentNode.getElementsByTagName('td')[0].innerHTML;
    compId = compId.replace(compId.substring(0, compId.indexOf("_") + 1), "").replace("comp","");
    proxies.ActivityManager.toggleComp(compId, username, activityId, el.checked);    
  },
  
  setSignupSpecific : function ()
  {
    document.getElementById("signupSpecific").checked = true;
  },
  
  refreshPage: function()
  {
    window.location.href = window.location.href;
    window.location.reload();
  },
  
  sendActivityMail: function()
  {
    var activityId = document.getElementById('activityId').innerHTML;
    var subject = document.getElementById('activityEmailTitle').value;
    var body = document.getElementById('activityEmailBody').value;
    
    proxies.ActivityManager.EmailParticipants(activityId, subject, body);
    
    alert("De ingeschreven bewoners zijn op de hoogte gebracht.");
    dialog.toggleActivityMailDialog(false);
  },
  
  saveActivity: function()
  {
    var activityId = document.getElementById('activityId').innerHTML;
  
    var startDateDay = document.getElementById('startDateDay').value;
    var startDateMonth = document.getElementById('startDateMonth').value;
    var startDateYear = document.getElementById('startDateYear').value;
    var startTimeHour = document.getElementById('startTimeHour').value;
    var startTimeMinute = document.getElementById('startTimeMinute').value;
    var endDateDay = document.getElementById('endDateDay').value;
    var endDateMonth = document.getElementById('endDateMonth').value;
    var endDateYear = document.getElementById('endDateYear').value;
    var endTimeHour = document.getElementById('endTimeHour').value;
    var endTimeMinute = document.getElementById('endTimeMinute').value;
    var signupDateDay = document.getElementById('signupDateDay').value;
    var signupDateMonth = document.getElementById('signupDateMonth').value;
    var signupDateYear = document.getElementById('signupDateYear').value;
  
    var roleUpdates = [];
    var roles = document.getElementById('activityEditRoles');
    var inputs = roles.getElementsByTagName('input');
    for (var i = 0; i < inputs.length; i++)
    {
      var input = inputs[i];
      if (input.value == "")
      {
        alert("U kunt geen rollen van een lege naam voorzien.\nVul a.u.b. een naam in voor alle rollen.");
        return false;
      }
      roleUpdates.push("id=" + input.name.replace("role_","") + ";value=" + input.value);
    }
    
    proxies.ActivityManager.saveActivity(
      activityId,
      startDateDay, startDateMonth, startDateYear, startTimeHour, startTimeMinute,
      endDateDay, endDateMonth, endDateYear, endTimeHour, endTimeMinute,
      signupDateDay, signupDateMonth, signupDateYear,
      roleUpdates.join("|")
    );
    
    alert("De wijzigingen zijn opgeslagen.");
    Events.refreshPage();
    
  },
  
  // for adding a new role to an existing event from within the edit activity popup
  addNewRole: function()
  {
    var activityId = document.getElementById('activityId').innerHTML;
    var newName = document.getElementById('activityAddRoleName').value;
    var comp1 = document.getElementById('activityAddRoleComp1').value;
    var comp2 = document.getElementById('activityAddRoleComp2').value;
    var comp3 = document.getElementById('activityAddRoleComp3').value;
    var privacy = document.getElementById('activityPrivacy').innerHTML;
    var group = document.getElementById('activityAddRoleUserSelect');
    
    if (newName == '')
    {
      alert('U moet een naam voor de rol selecteren.');
      return;
    }
    
    if (privacy == 'group' && group.value == '')
    {
      alert('U moet een persoon of groep uitnodigen.');
      return;
    }
    
    proxies.ActivityManager.addNewRole(activityId, newName, comp1, comp2, comp3, group);
    
    alert("De rol '" + newName + "' is toegevoegd.");
    window.location.href = window.location.href;
  }
  
  
};
