//****** Functional Code(3.75 - 6.16K) - NO NEED to Change.
function zxcExpandPanel(o){
 var mde=typeof(o.Mode)=='string'&&o.Mode.charAt(0).toUpperCase()=='V'?['top','left','width','offsetHeight','offsetTop','offsetWidth']:['left','top','height','offsetWidth','offsetLeft','offsetHeight'],obj=document.getElementById(o.ID),nme=o.ID+'=',z0=0,z0a,clds=obj.childNodes,clds2,cnt=0,cnt2,max,srt,margin=typeof(o.Margin)=='number'?o.Margin:0,lft=0,collapse=typeof(o.CollapseDIV)=='number'?o.CollapseDIV:0,nu=typeof(o.ExpandPanel)=='number'?o.ExpandPanel:-1,et=o.EventType,et=(typeof(et)=='string'?et:'').toLowerCase().replace('on',''),et=et=='click'||et=='mousedown'||et=='mouseup'||et=='mouseover'?et:'mouseup',clst=typeof(o.CollapseLast)!='boolean'||o.CollapseLast,days=o.DaysPersistence,s;
 this.panels=[];
 this.pos=[];
 for (var z0=0;z0<clds.length;z0++){
  if (clds[z0].nodeType==1){
   clds[z0].style.position='relative';
   clds[z0].style[mde[0]]=lft+'px';
   lft+=clds[z0][mde[3]]+margin;
   this.pos.push(clds[z0]);
   this.panels[cnt]=[];
   this.addevt(clds[z0],et,'Toggle',cnt);
   if (et=='mouseover'&&clst){
    this.addevt(clds[z0],'mouseout','Toggle',cnt);
   }
   clds2=clds[z0].childNodes;
   for (cnt2=0,max=0,z0a=0;z0a<clds2.length;z0a++){
    if (clds2[z0a].nodeType==1){
     max+=clds2[z0a][mde[5]];
     if (cnt2==collapse){
      this.panels[cnt][1]=new zxcAnimate(mde[2],clds2[z0a],0);
      this.panels[cnt][1].Complete=function(){
        if (this.data[0]==0){
         this.obj.style.display='none';
        }
       }
      this.panels[cnt][2]=clds2[z0a][mde[5]];
      clds2[z0a].style.overflow='hidden';
      clds2[z0a].style[mde[2]]='0px';
      clds2[z0a].style.display='none';
     }
     cnt2++;
    }

   }
   this.panels[cnt][3]=(obj[mde[5]]-max)/2;
   // srt=(obj[mde[5]]-(max-this.panels[cnt][2]))/2;
   srt=(obj[mde[5]]-(max-this.panels[cnt][2]));
   this.panels[cnt][4]=srt;
   clds[z0].style[mde[1]]=srt+'px';
   this.panels[cnt][0]=new zxcAnimate(mde[1],clds[z0],srt);
   this.panels[cnt][5]=true;
   cnt++;
  }

 }
 this.collapselst=clst;
 if (o.AddEvents&&this.AddEvents){
  this.AddEvents(o.AddEvents);
 }
 if (typeof(o.Scroll)=='object'&&this.scroll){
  this.scroll(o.Scroll,obj,mde);
 }
 this.nme=nme;
 if (this.cookie){
  nu=this.cookieget(nme,nu,days);
 }
 this.ms=20;
 this.Toggle(nu);
 this.ms=typeof(o.AnimationSpeed)=='number'?o.AnimationSpeed:1000;
}

zxcExpandPanel.prototype={

 Expand:function(nu){
  var panel=this.panels[nu];
  if (panel){
   panel[5]=true
   this.Toggle(nu);
  }
 },

 Toggle:function(nu,e){
  var panels=this.panels,panel=panels[nu],eobj,z0=0,et=false;
  if (e&&(e.type=='mouseover'||e.type=='mouseout')){
   et=e.type;
   eobj=(e.relatedTarget)?e.relatedTarget:(e.type=='mouseout')?e.toElement:e.fromElement;
   if (eobj){
    while (eobj.parentNode){
     if (eobj==panel[0].obj){
      return false;
     }
     eobj=eobj.parentNode;
    }
   }
   else {
    return false;
   }
  }
  for (;z0<panels.length;z0++){
   if (panels[z0]!=panel&&(this.collapselst||nu==-1)){
    panels[z0][0].animate(panels[z0][0].data[0],panels[z0][4],this.ms,[panels[z0][3],panels[z0][4]]);
    panels[z0][1].animate(panels[z0][1].data[0],0,this.ms,[0,panels[z0][2]]);
    panels[z0][5]=true;
   }
  }
  if (panel){
   if (et){
    panel[5]=et=='mouseover';
   }
   panel[0].animate(panel[0].data[0],panel[panel[5]?3:4],this.ms,[panel[3],panel[4]]);
   panel[1].animate(panel[1].data[0],panel[5]?panel[2]:0,this.ms,[0,panel[2]]);
   panel[1].obj.style.display='block';
   panel[5]=!panel[5];
   if (this.days){
    this.cookieset(nu,panel[5]);
   }
  }
 },

 addevt:function(o,t,f,p){
  var oop=this;
  if (o.addEventListener) o.addEventListener(t,function(e){ return oop[f](p,e);}, false);
  else if (o.attachEvent) o.attachEvent('on'+t,function(e){ return oop[f](p,e); });
 },

// Optional Persistence Code
 cookie:function(nme){
  var re=new RegExp(nme+'[^;]+','i');
  if (document.cookie.match(re)){
   return document.cookie.match(re)[0].split("=")[1];
  }
  return null
 },

 cookieget:function(nme,nu,days){
  this.days=typeof(days)=='number'&&this.cookie?days:false;
  if (this.days&&this.cookie(nme)){
   var s=this.cookie(nme).split('#');
   if (s[1]=='false'){
    nu=s[0];
   }
  }
  return nu;
 },

 cookieset:function(nu,ud){
  document.cookie=this.nme+nu+'#'+ud+';expires='+(new Date(new Date().getTime()+this.days*86400000).toGMTString())+';path=/';
 },


// Optional Add Events Code
 AddEvents:function(ary){
  ary=typeof(ary)=='object'&&ary.constructor==Array?ary:[];
  for (var but,type,z1=0;z1<ary.length;z1++){
   var but=document.getElementById(ary[z1][0]),type=this.evttype(ary[z1][2]);
   if (but&&type&&this[ary[z1][1]]){
    this.addevt(but,type,ary[z1][1],ary[z1][3]);
   }
  }
 },

 evttype:function(et){
  var type=(typeof(et)=='string'?et:'').toLowerCase().replace('on','');
  return type=='click'||type=='mousedown'||type=='mouseup'||type=='mouseover'||type=='mouseout'?type:false;
 },

// Optional Scroll Code
 scroll:function(o,obj,mde){
  var oop=this,p=obj.parentNode,z0=0,ctr=typeof(o.Center)!='boolean'||o.Center,os=typeof(o.Offset)=='number'?o.Offset:0;
  for (;z0<this.pos.length;z0++){
   this.pos[z0]=-this.pos[z0][mde[4]]+(ctr?(p[mde[3]]-this.pos[z0][mde[3]])/2:0)+os;
  }
  this.cnt=0;
  this.to=null;
  p.style.overflow='hidden';
  this.scroll=new zxcAnimate(mde[0],obj,this.pos[0]);
  obj.style.left=this.pos[0]+'px';
  this.sms=typeof(o.ScrollSpeed)=='number'?o.ScrollSpeed:1000;
  this.hold=(typeof(o.HoldDuration)=='number'?o.HoldDuration:2000)+this.sms;
  if (typeof(o.AutoStart)!='boolean'||o.AutoStart){
   this.to=setTimeout(function(){ oop.Auto(); },this.hold);
  }
 },

 Scroll:function(ud,nu){
  this.Pause();
  ud=typeof(ud)=='number'&&ud>0?1:-1;
  if (typeof(nu)=='number'){
   ud=0;
  }
  this.Toggle(-1);
  this.cnt=Math.min(Math.max(this.cnt+ud,0),this.pos.length-1);
  this.scroll.animate(this.scroll.data[0],this.pos[this.cnt],this.sms);
 },

 GoTo:function(nu){
  if (this.cnt!=nu){
   this.Toggle(-1);
   this.cnt=nu;
   this.Scroll(0,this.cnt);
  }
 },

 Auto:function(){
  this.Pause();
  this.cnt=++this.cnt%this.pos.length;
  this.Scroll(0,this.cnt);
  var oop=this;
  this.to=setTimeout(function(){ oop.Auto(); },this.hold);
 },

 Pause:function(){
  clearTimeout(this.to);
 }
}
/*]]>*/

/*<![CDATA[*/
function Init(){
	S1=new zxcExpandPanel({
	 ID:'Example1',
	 Margin:10,
	 CollapseDIV:1,
	 EventType:'mouseover',
	 AnimationSpeed:1000
	});
	
	S2=new zxcExpandPanel({
	 ID:'Example2',
	 Margin:10,
	 CollapseDIV:1,
	 EventType:'mouseover',
	 AnimationSpeed:1000
	});
	
	S3=new zxcExpandPanel({
	 ID:'Example3',
	 Margin:10,
	 CollapseDIV:1,
	 EventType:'mouseover',
	 AnimationSpeed:1000
	});
	
}

if (window.addEventListener){
 window.addEventListener('load',Init, false);
}
else if (window.attachEvent){
 window.attachEvent('onload',Init);
}

/*]]>*/

