// ps_focus('focus');
//ps_fade('ps_fade');
swami_Tabs.init();
//swami_Ruler.init('pstr1', 'pstr2', 'pstrr');


// if admin/index
// $$('ul.ps_icons a').each(function(el,i){
$$('a.infobar').each(function(el,i){
  //if (el.rel.count > 0) {
    el.addEvent('mouseover', function(){
      $(this.rel).set('html', this.title);
      this.orgti = this.title;
      this.title = "";
    });
    el.addEvent('mouseout', function(){
      $(this.rel).set('html', '');
      this.title = this.orgti;
    });
  //}
});


/**
 *
**/
function fade_destroy(el, xhrlink)
{
//    $('row:<?=$item['ikey'];?>').addClass('deleting');

  if (confirm('Are you sure?')){
    var rq = new Request({
      onSuccess:function(t,x){
        if (t == 'OK'){
          $(el).fade();
          (function(){$(el).destroy();}).delay(800);
        }
      },
      url: xhrlink
    }).send();
  }
//  $('row:<?=$item['ikey'];?>').removeClass('deleting');
};


/*
// CORRECT USAGE
var myMorph = new Fx.Morph(element, {duration: 1000});

element.addEvent('click', function(){
    myMorph.start({height: 200, width: 200});
});



// $().style.height=($('curmsg').style.height=='60px')?$('curmsg').getScrollSize().y+'px':'60px';
var myFx = new Fx.Tween('curmsg').start('height', $('curmsg').getScrollSize().y+'px');
//myFx.start('height', '60px', $('curmsg').getScrollSize().y+'px');
//myFx.start('height', $('curmsg').getScrollSize().y+'px', '60px');

*/

var swReveal = new Class({

    initialize: function(els){
        els.each(function(el,i){
            el.isbig = false;
            el.targ = $(el.get('rel'));
            el.smallsize = el.targ.style.height.toInt();
            el.fullsize  = el.targ.getScrollSize().y;

            el.addEvent('click', function(ev){
                this.targ.tween('height', (this.isbig) ? this.smallsize : this.fullsize);
                this.isbig = !this.isbig;
                this.toggleClass('up');
            });
/**/
        });
    }

});

var pr = new swReveal($$('.sw_reveal'));


/*
CHECK ALL BOXES
$('ucuc').addEvent('click',function(){
    do_check = $(this).checked;
    $$('.check-me').set('checked',do_check);
});

BODY
var bodyElement = $$('body')[0];

http://davidwalsh.name/mootools-12-class-template
    should add notes on "bind"

http://davidwalsh.name/mootools-image-preloading-progress-bar
    may be useful

*/

(function(){$$('.swami_fade').fade(0.3)}).delay(1000);
