/*

Version:	0.2
Date:		17-06-2009
Author:		Martin Dubbelman - Xtra	Active Advertising B.V.

Changelog
	V 0.2: 
		- Element: width and height renamed to setWidth ans setHeight due to IE issues
		

 */
Element.implement({
	alert: function() {
		alert(this.innerHTML);
	},
	alertHTML: function() {
		alert(this.innerHTML);
	},
	alertText: function() {
		alert(this.text);
	},
	log: function() {
		try 
		{
		  console.log(this);
		} 
		catch(e) 
		{ 
			alert(this.outerHTML);
		}
	},
	show: function()
	{
	   this.setStyle('display', 'block');
	},
	
	hide: function()
	{
	   this.setStyle('display', 'none');
	},
	setWidth: function( width ){
		this.setStyle( 'width', width );	
	},
	setHeight: function( height ){
		this.setStyle( 'height', height );	
	},
	css: function( property, value ){
		this.setStyle( property, value );
	},
	clicked: function(fn) {
		this.addEvent('click',fn); 
	},
	text: function( text ){
		this.set( 'text', text );
	},
	appendText: function( text ){
		this.set( 'text', this.get('text') + text );
	},
	
	/*
	Hover element; example:
	/* fade in and out on hover event 
	$('hover-me').hover(function(e) {
		this.fade('out');
	}, function(e) {
		this.fade('in');
	});	
	*/
	
	'hover': function(fn1,fn2) {
		this.addEvents({
			'mouseenter': function(e) {
				fn1.attempt(e,this);
			},
			'mouseleave': function(e) {
				fn2.attempt(e,this);
			}
		})
	}
});

Array.implement({
	show : function(){
		try 
		{
		  console.log( '[ ' +this.flatten() + ' ]');
		} 
		catch(e) 
		{ 
			alert( '[ ' +this.flatten() + ' ]');
		}
	}
	
				
});

var XtraDebug = new Class({ 
	
	
		log: function(text) {
		try 
		{
		  console.log(text);
		} 
		catch(e) 
		{ 
			alert(text);
		}
	}
});