var Alert = Class.create(); 
Alert.prototype = { 
	initialize: function(message,title,width,height) 
	{	
		if(message != '' && message != null && message != undefined){  
			
			if( width == null || width == undefined )
				width = 300 ;
				
			if( height == null || height == undefined )
				height = 100 ; 	
				
			if( title == null || title == undefined )	
				title = "Message" ;
				
			Dialog.alert(
			message,
				{	width:width,
					height:height,
					title:title,
					zIndex: 2000, 
					okLabel: "Fermer",
					className: "jeubuzz",
					ok: this.callback	
				});
		}

	},	
	callBack: function(win){
		debug("validate alert panel");
		return true;
	}		
};

var Confirm = Class.create(); 
Confirm.prototype = { 
	initialize: function(options,urlCallback) 
	{	
		this.urlCallback = urlCallback ;
		if(options.message != '' && options.message != null && options.message != undefined){  
			
			if( options.width == null || options.width == undefined )
				options.width = 275 ;
				
			if( options.height == null || options.height == undefined )
				options.height = 75 ; 	
				
			if( options.title == null || options.title == undefined )	
				options.title = "Message" ;
				
			Dialog.confirm(
			'<p id="dohkan_message_confirm">'+options.message+'</p>',
				{	width:options.width,
					height:options.height,
					title:options.title,
					zIndex: 2000, 
					okLabel: "Continuer",
					cancelLabel: "Annuler",
					className: "jeubuzz",
					ok: this.callBack.bind(this)
				});
		}

	},	
	callBack: function(win){
		if(this.urlCallback != undefined)
		{
			document.location.href = this.urlCallback ;
		}
	}		
};		

var WindowBox = Class.create(); 
WindowBox.prototype = { 
	initialize: function(message,options)
	{	
		if(message != '' && message != null && message != undefined){  
			
			if( options.width == null || options.width == undefined )
				options.width = 300 ;
				
			if( options.height == null || options.height == undefined )
				options.height = 350 ; 	
				
			if( options.title == null || options.title == undefined )	
				options.title = "Message" ;	
	
			this.win = new Window({	className: "jeubuzz",
									width:options.width,
									height:options.height,
									zIndex: 2000, 
									resizable: false, 
									title: options.title, 
									showEffect:Effect.BlindDown, 
									hideEffect: Effect.SwitchOff, 
									draggable:true, 
									wiredDrag: true
								}); 
			this.win.setHTMLContent(message);			
			//win.setStatusBar("Status bar info"); 
			if(options.affiche)
				this.win.showCenter();
		}
	},
	
	show:function()
	{
		this.win.showCenter();	
	},
	
	setContent:function(message)
	{
		this.win.setHTMLContent(message);
	}
};