function msgBox(title,message,width,height,type,speed) {
	this.title = title;
	this.message = message;
	this.width = width;
	this.height= height;
	this.type = type;
	this.speed = speed;
	this.buttonClicked = "";
	this.createBox = createBox;
	this.createBox();
};

function createBox(){

	
	this.type = 0;
	
	
	
	
	var wwidth = "";
	if(window.ie){
			wwidth = document.body.clientWidth.toInt();
	}else{
			wwidth =  window.innerWidth.toInt();
		}
		
	wwidth = (wwidth-this.width)/2;
	
	// Add the title line	
	var LineWidth = this.width - 10;
	var titleLine = new Element('div', {
		'styles': {
			'width': LineWidth,
			'height':'14px',
			'padding':'3px 5px',
			'line-height':'14px',
			'background':'#000',
			'color':'#FFF',
			'font-size':'12px',
			'font-weight':'bold'
			
		}
	});
	// Add the container messageBox
	var	container = new Element('div',{
		'styles': {
			'cursor':'pointer',
			'width':this.width,
			'height':'auto',
			'display':'block',
			'position':'absolute',
			'background':'#000',
			'opacity':'0.99',
			'left':wwidth,
			'top':'120px',
			'color':'#FFF',
			'z-index':'11'
		}
	})

	container.setAttribute('id','myContainer');
	
	// Add the message in the inside container
	var innerContent = new Element('div',{
		'styles': {
				'padding':'4px 2px 2px 3px',
		}
	});
	
	// Add the close button top right
	var closeBtn = new Element('img',{		
		'styles':{
			'position':'absolute',
			'right':'2px',
			'top':'2px',
			'width':'18px',
			'height':'18px'
		}
	});
	
	closeBtn.addEvent('click',function(){
		container.dispose();
		return true;
	})
	 


	closeBtn.src = "images/closebtn.png";
	innerContent.innerHTML = this.message;
	titleLine.innerHTML = this.title;
	container.injectInside(document.body);
	closeBtn.injectInside(titleLine);
	titleLine.injectInside(container);

	
	 	var myEffect = new Fx.Morph(container, { duration: this.speed, wait:true, transition:Fx.Transitions.linear}).chain(function(){
				innerContent.injectInside(container); 
			});
			
			
			myEffect.start({ 
				'opacity':['0.0','0.99']
			});	

    new Drag(container);

}
