/*---
 Mootools journal
 Author   : David Safar
 
 (c) Copyright Trisoft Technologies. All rights reserved.
---*/

var Journal = new Class({
	//initialization
	initialize:  function() {
	
	  // Email adress
      //---------------------------
      $$('a.email').each(function(el,i) {
        //alert(el.getProperty('title'));
        el.setProperty('title',el.getProperty('title').replace(/ <(.)+> /,'@'));
        el.setProperty('href','mailto:' + el.getProperty('title'));
        el.setText(el.getText().replace(/ <(.)+> /,'@'));
      });
        	
      // Flash integration  
      //---------------------------
        $$('div.flash').each(function(el,i) {
            var params = el['title'].split(':');
            var obj = new Swiff(params[0], {
                id: 'flash' + i,
                width: params[1],
                height: params[2],
	            container: el,
                params: {
                    wmode: 'transparent',
                    bgcolor: '#ffffff'
                    }
	            });
            if ( ! params[3] ) { 
                params[3]=""; 
            }
            el['title']=params[3];
		});
	
      // Table shading  
      //---------------------------
      //add table shading
      $$('table.moo tr').each(function(el,i) {
      	//do regular shading
      	var _class = i % 2 ? 'odd' : 'even'; el.addClass(_class);

      	//do mouseover
      	el.addEvent('mouseenter',function() { if(!el.hasClass('highlight')) { el.addClass('mo').removeClass(_class); } });
      	//do mouseout
      	el.addEvent('mouseleave',function() { if(!el.hasClass('highlight')) { el.removeClass('mo').addClass(_class); } });
      });
      
	}
		
});


