/*
(c) 2007-2008 Jean Luc Biellmann
*/

function Alert () {
	objAlert=this;
}
Alert.prototype = {
	showWarning : function () {
		var div=$('div_warning');
		div.style.visibility='hidden';
		div.style.display='block';
		div.style.left = Math.round((_window.innerWidth()-div.offsetWidth)/2)+'px';
		div.style.top = Math.round((_window.innerHeight()-div.offsetHeight)/2)+'px';
		div.style.visibility='visible';
	},
	warn : function (warning) {
		$('div_warning_message').innerHTML = warning;
		objAlert.showWarning();
	},
	showInfo : function () {
		var div=$('div_info');
		div.style.visibility='hidden';
		div.style.display='block';
		div.style.left = Math.round((_window.innerWidth()-div.offsetWidth)/2)+'px';
		div.style.top = Math.round((_window.innerHeight()-div.offsetHeight)/2)+'px';
		div.style.visibility='visible';
	},
	info : function (information) {
		$('div_info_message').innerHTML = information;
		objAlert.showInfo();
	},
	init : function () {
		if ($('div_warning_message')) 
			if ($('div_warning_message').innerHTML.length)
				objAlert.showWarning();
		if ($('div_info_message')) 
			if ($('div_info_message').innerHTML.length)
				objAlert.showInfo();
	}
}

var _alert=new Alert();
