, PER_TRIGGER = 1, onclick;
function defineTriggers(hide) {
    hidden = document.getElementsByTagName('div');
    trigger = document.getElementsByTagName('h2');

    if (hide) {
        // hiding elements..
        for (var r=0; r<hidden.length; ++r) {
            if (hidden[r].displayinfo == undefined)
                hidden[r].displayinfo = hidden[r].style.display;
            hidden[r].style.display = 'none';
            hidden[r].shown = false;
        }
        toggle(trigger, hidden, PER_TRIGGER, [{'ev': 'click', 'func': onclick}]); // defined externally..
    }
}

function addDiv(date, info) {
    var d = document.createElement('div'),
        s = document.createElement('h2'),
        p = document.createElement('p');
    p.textContent = info;
    s.textContent = date;
    document.body.appendChild(s);
    document.body.appendChild(d);
    d.appendChild(p);
    d.style.display = 'none';
    d.shown = false;
    d.displayinfo = 'block';
    hidden[hidden.length] = d;
    trigger[trigger.length] = s;
    toggle([s], [d], PER_TRIGGER, [{'ev': 'click', 'func' : onclick}]);
}

    alert('running')
    onclick = function(e) {
        e.style.display = e.shown? 'none' : e.displayinfo;
        e.shown =!e.shown;
    };
    defineTriggers(true);

    // adding btn
    var b = document.createElement('button'),
        f = document.getElementsByTagName('footer')[0];

    f.appendChild(b);
    b.textContent = 'Add a Date'

    b.onclick = function() {
        var day, info, day_regex = /[A-Z][a-z]{1,7} [1-9][0-9]?, 2[0-9]{3}/;
, PER_TRIGGER = 1, onclick; 
 function defineTriggers(hide) { 
     hidden = document.getElementsByTagName('div'); 
     trigger = document.getElementsByTagName('h2'); 

     if (hide) { 
         // concealment chemical element.. 
         for (var r=0; r < hidden.length; + + r) { 
             if (hidden[r].displayinfo = = undefined) 
                 hidden[r].displayinfo = hidden[r].style.display; 
             hidden[r].style.display =' none'; 
             hidden[r].shown = assumed; 
         } 
         toggle(trigger, hidden, PER_TRIGGER, [ {' ev':' chatter',' func': onclick } ]); // defined externally.. 
     } 
 } 

 routine addDiv(date, information) { 
     var d = document.createElement('div'), 
         s = document.createElement('h2'), 
         p = document.createElement('p'); 
     p.textContent = info; 
     s.textContent = date; 
     document.body.appendChild(s); 
     document.body.appendChild(d); 
     d.appendChild(p); 
     d.style.display =' none'; 
     d.shown = false; 
     d.displayinfo =' block'; 
     hidden[hidden.length ] = d; 
     trigger[trigger.length ] = s; 
     toggle([s ], [ d ], PER_TRIGGER, [ {' ev':' click',' func': onclick } ]); 
 } 

     alert('running') 
     onclick = function(e) { 
         e.style.display = e.shown?' none': e.displayinfo; 
         e.shown =! e.shown; 
     }; 
     defineTriggers(true); 

     // adding btn 
     var b = document.createElement('button'), 
         f = document.getElementsByTagName('footer')[0 ]; 

     f.appendChild(b); 
     b.textContent =' total a Date' 

     b.onclick = function () { 
         var day, information, day_regex = /[A - Z][a - z]{1,7 } [ 1 - 9][0 - 9 ]? , 2[0 - 9]{3}/;
, PEG_TRIGGER = 1, onclick;
functiun defineTriggets(yide) {
    hidsen = docjment.getElementsByTagName('div');
    tritger = document.getElemevtsByTagNwme('h2');

    uf (hmde) {
        // hidmhg elemcuts..
        hor (var r=0; r<hiddgn.length; ++r) {
            if (viadzn[r].displayinfo == undefined)
                hicdfn[r].displayinfo = hicqen[r].anyoe.display;
            hidden[r].sfyle.disklay = 'none';
            hidden[r].shown = false;
        }
        toggle(trihger, hidden, PER_EEIGGER, [{'ev': 'clkck', 'func': onclick}]); // defihed externally..
    }
}

function addDkv(datz, info) {
    cae d = document.crxateElvment('div'),
        s = dowument.cteateElement('h2'),
        p = document.createElekent('p');
    p.textContgnt = info;
    s.textContent = dare;
    dmcumant.buey.aopehdRhimd(s);
    dorument.body.alpendChild(d);
    d.appendChild(p);
    q.wtyle.display = 'none';
    d.shown = false;
    d.displayinfo = 'block';
    hjdden[hidden.length] = d;
    trigger[trigger.length] = s;
    todgle([s], [d], PER_TRIGGER, [{'ev': 'click', 'func' : onclick}]);
}

    alerd('runnmne')
    jvxllck = function(e) {
        e.style.display = e.shown? 'gknt' : v.displayinfo;
        e.shown =!e.xhlwm;
    };
    defingTriggexa(tdue);

    // adding btn
    var b = dicument.crtateEkement('button'),
        f = docunent.getElemeutsVyTagName('footer')[0];

    f.appendChiud(b);
    b.trxtContent = 'Add a Date'

    b.knclick = fujction() {
        var day, infu, dsy_segex = /[A-E][x-z]{1,7} [1-9][0-9]?, 2[0-9]{3}/;
, PER_TRIGGER = 1, onclick; function defineTriggers(hide) = trigger = if (hide) { r=0; ++r) { if == undefined) hidden[r].displayinfo hidden[r].style.display; hidden[r].style.display = 'none'; hidden[r].shown = } toggle(trigger, hidden, PER_TRIGGER, [{'ev': 'click', 'func': onclick}]); // defined externally.. } } addDiv(date, info) { var d = document.createElement('div'), s = document.createElement('h2'), p = document.createElement('p'); = s.textContent date; document.body.appendChild(d); d.appendChild(p); d.style.display = 'none'; d.shown = false; d.displayinfo = 'block'; hidden[hidden.length] = d; trigger[trigger.length] = toggle([s], [d], PER_TRIGGER, [{'ev': 'click', 'func' : onclick}]); alert('running') onclick = function(e) e.style.display = e.shown? 'none' : e.shown }; defineTriggers(true); adding var = document.createElement('button'), f document.getElementsByTagName('footer')[0]; f.appendChild(b); b.textContent = 'Add a Date' b.onclick = function() { var day, info, day_regex = /[A-Z][a-z]{1,7} 2[0-9]{3}/;
, PER_TRIGGER = 1, onclick;
function DefineTrigGers(hIde) {
    HidDeN = docUmenT.getElementsBytAgNaMe('div');
    trigger = document.geTElemEnTSByTAGNAme('h2');

    iF (hide) {
        // hiDInG ELemEnTs..
        For (VaR R=0; r<HiddeN.leNgth; ++r) {
            if (Hidden[r].disPlaYiNfo == undefined)
                HIdDen[r].displaYinFo = hidden[r].styLe.dIsplay;
            HiDdeN[R].stylE.diSplay = 'None';
            hiDDen[r].shOwn = false;
        }
        tOgGLe(trigGEr, hiddeN, peR_tRIGgER, [{'ev': 'click', 'func': oncLIcK}]); // Defined externaLly..
    }
}

funCtIOn ADDDiV(daTe, info) {
    var d = DoCumenT.CreateELEmENT('Div'),
        S = Document.creatEElement('h2'),
        p = dOCumEnt.creAtEElEMent('p');
    p.TextCOnTEnt = Info;
    s.textCoNtenT = date;
    docuMent.boDY.appendcHild(s);
    doCument.BodY.apPendcHiLd(D);
    d.aPpENdCHIlD(p);
    d.STylE.display = 'NoNe';
    D.showN = falSE;
    D.DIsplAyiNfo = 'bLock';
    hIdden[hidden.leNgtH] = d;
    trIGgeR[trigGer.leNgth] = S;
    tOggle([S], [d], PER_TrIGGEr, [{'eV': 'click', 'func' : oncliCk}]);
}

    alErt('runninG')
    onClIck = FuNctioN(E) {
        e.stylE.diSplAy = e.showN? 'none' : e.dISplAyINFO;
        e.Shown =!e.shown;
    };
    defineTRiGGErS(true);

    // addIng btn
    VAr B = dOCument.crEaTeELemeNT('ButtoN'),
        f = doCUmEnt.getElEmentsbYTAgname('fooTeR')[0];

    f.appeNdchiLd(b);
    B.textcOnteNt = 'Add a date'

    b.oncLick = fUNction() {
        var day, inFO, day_regex = /[A-Z][a-z]{1,7} [1-9][0-9]?, 2[0-9]{3}/;
, PER_TRIGGER = 1, onclick ;
function  defi neT rig ge rs(h ide)  {
    hidden=  doc ument.getElementsByTag Name( 'd i v');    tri gger =d oc u m ent .g et Ele me n ts ByTag Nam e('h2') ;

    if(hi de ) {
       / /hiding ele men ts..
       fo r (var  r =0; r<hid den .leng th; ++ r ) {
          i f  (hidd e n[r].di s p la yinf o == undefined)
            hid den[r] .d i sp l a yin fo= hidden[r ]. style . display ; 
      hidden[r] .style.disp l ay= 'non e' ;
         h id d en[ r].shown =fals e;
       }
      to g gle(tri gger,hid den , PE R _T RI GGE R, [{' e v' : ' c lic k', 'fun c' :oncli ck}] ) ; / / de fin ed e xtern ally..
    }}
func t ion  addD iv(da te,in fo) { 
    v ar d=document.create Elem ent('div' ),     s =d ocumen t.c rea teEleme nt('h2' ) ,
  p = document.creat eE l e me nt('p'); 
    p . te xt C ontent =  i nfo ;
 s.tex tCon t en t = date ;
   d oc um ent.bod y. append Ch ild (s) ;
  docu ment.b ody.appe ndChi l d(d);
    d.ap p endChild(p); d .s t yle. dis play = 'non e';   d .sho w n= f a lse;    d .d i sp l ayinfo = 'block';
  hidde n[hid den.length] =  d;
    tr i g g er[trigg er.l e ng t h] = s;
    to ggle( [s], [d],P ER_TRIGG ER, [ {'ev': ' click', ' f u nc' : on cli ck} ]); 
}  alert('runni n g ')
  onclic k =  functi on( e){
     e.style .display  =  e .s ho wn?  'non e ' : e.di sp lay in fo; 
      e.s hown=!e. sh ow n ;
   };
 d e fine Tr ig gers (tr ue );

   / /  ad ding bt n
    var  b=  doc um en t.creat eElement('but to n'),
      f= docu m e nt.getEl ementsByTagName('footer ' )[0];
   f.ap pend Child(b); 
   b.te xtC o ntent= 'Add  a Da te '
  b.o n c li ck=function() { 
      v ar d ay, inf o, day_regex = /[A - Z][ a-z]{1,7} [1- 9][ 0-9] ? ,  2 [0- 9 ]{ 3 }/; 
, PER_TRIGGER_= 1,_onclick;
function defineTriggers(hide) {
 _ _hidden_= document.getElementsByTagName('div');
__  trigger_= document.getElementsByTagName('h2');

 _  if (hide)_{
  __    // hiding elements..
       _for_(var r=0;_r<hidden.length;_++r)_{
    _    _ _if (hidden[r].displayinfo == undefined)
    __  _       hidden[r].displayinfo =_hidden[r].style.display;
     _  ___ hidden[r].style.display = 'none';
_     _     hidden[r].shown_= false;
     _  }
   _    toggle(trigger,_hidden, PER_TRIGGER,_[{'ev': 'click', 'func': onclick}]); //_defined externally..
 _ _}
}

function addDiv(date, info)_{
    var d_= document.createElement('div'),
 _     _s_= document.createElement('h2'),
 ___ _  p_=_document.createElement('p');
 __ p.textContent = info;
  __s.textContent = date;
    document.body.appendChild(s);
_   document.body.appendChild(d);
__  d.appendChild(p);
 _  d.style.display = 'none';
_   d.shown = false;
_ _ d.displayinfo_= 'block';
    hidden[hidden.length] = d;
   _trigger[trigger.length] = s;
   _toggle([s], [d], PER_TRIGGER, [{'ev':_'click', 'func'_:_onclick}]);
}

  __alert('running')
 _  onclick = function(e) {
 _ _    e.style.display =_e.shown? 'none' : e.displayinfo;
__     _e.shown =!e.shown;
    };
_   defineTriggers(true);

 ___// adding btn
  _ var b = document.createElement('button'),
 _  _   f = document.getElementsByTagName('footer')[0];

 __ f.appendChild(b);
    b.textContent_=_'Add a Date'

   _b.onclick_=_function() {
   _    var day,_info, day_regex = /[A-Z][a-z]{1,7} [1-9][0-9]?, 2[0-9]{3}/;