//-------------------------------
// Class
//-------------------------------

function AlertView() {

	
	var _self = this;

	//-------------------------------
	// Constants
	//-------------------------------
	
	AlertView.prototype.CLOSE = "close_alert";
	
	//-------------------------------
	// Properties
	//-------------------------------
	
	var _view = $j("<div id='alert'></div>");
	
	//-------------------------------
	// Constructor
	//-------------------------------
	
	$j(function() {
		
	});
	
	//-------------------------------
	// Public Methods
	//-------------------------------
	
	_self.deploy = function(data) {
		var content		= "<li class='top'></li>";
		content			+= "<li class='mid'>";
		content			+= "<a href='#' class='close'>Close Alert</a>";
		content			+= "<div class='type'>" + data.type + "</div>";
		content			+= "<div class='content'>" + data.content + "</div>";
		content			+= "<div class='clear'></div></li>";
		content			+= "<li class='btm'></li>";
		
		_view.html(content);
		$j("#alertContainer").html(_view);
		
		$j(".close", _view).bind("click", onAlertClose);
		
		_self.intro();
	}
	
	_self.intro = function() {
		$j(_view).fadeIn();
	}
	
	_self.exit = function() {
		$j(_view).fadeOut();
	}
	
	//-------------------------------
	// Private Methods
	//-------------------------------
	
	function init() {
		
	}
	
	//-------------------------------
	// Listeners
	//-------------------------------
	
	function onAlertClose(event) {
		$j(_self).trigger(_self.CLOSE);
		return false;
	}
}
