// JavaScript Document
( function($) {
		var colores = new Array();
		colores["done"]=new Array();
			colores["done"]["borde"] = '#00bd0d';
			colores["done"]["fondo"] = 'fondo_done.jpg';
			colores["done"]["icono"] = 'tick.png';	
		colores["error"]=new Array();
			colores["error"]["borde"] = '#ff0000';
			colores["error"]["fondo"] = 'fondo_error.jpg';
			colores["error"]["icono"] = 'stop.png';
		colores["warning"]=new Array();
			colores["warning"]["borde"] = '#ffb700';
			colores["warning"]["fondo"] = 'fondo_warning.jpg';
			colores["warning"]["icono"] = 'warning.png';
		
	$.amrAlerts = {		
		msjMostrar:function(contenedor,txt,tipo) {		
			$('<div />', {
				name	: 'msjAmrAux',
				id		: 'msjAmrAux',
				css 	: {
					padding			: '5px',
					backgroundImage	: 'url(images/' + colores[tipo]["fondo"] + ')',
					border			: colores[tipo]["borde"] + ' solid 1px',
					'text-align'	: 'justify',
					color			: '#000',
					marginTop		: '20px'
				}
			}).appendTo("#" + contenedor);
			var tbl = '<table>';
				tbl += '<tr>';
					tbl += '<td><img src="images/' + colores[tipo]["icono"] + '" /></td>';
					tbl += '<td>' + txt + '</td>';
				tbl += '</tr>';
			tbl += '</table>';
			
			$("#" + contenedor).css('overflow','visible');
			$("#msjAmrAux").css('overflow','visible');
			$("#msjAmrAux").append(tbl);
		}
	}
	
	amrMsjError = function(contenedor,txt) {
		$.amrAlerts.msjMostrar(contenedor,txt,'error');
	}
	amrMsjWarning = function(contenedor,txt) {
		$.amrAlerts.msjMostrar(contenedor,txt,'warning');
	}
	amrMsjDone = function(contenedor,txt) {
		$.amrAlerts.msjMostrar(contenedor,txt,'done');
	}
})(jQuery);
