function Loader(id){
	id = id || "loader";
	return {
		message : function(html){
			if(isString(html)){
				$(id).innerHTML = html;
			}
			return this;
		}
		,show : function(){
			$(id).style.visibility = "visible";
			return this;
		}
		,hide : function(){
			$(id).style.visibility = "hidden";
			return this;
		}
		,is_loading : function(){
			return "loading" == $(id).getAttribute("rel");
		}
		,lock : function(){
			$(id).setAttribute("rel", "loading");
			return this;
		}
		,free : function(){
			$(id).setAttribute("rel", "");
			return this;
		}
	};
}
var View = {
	update : function(target){
		return {
			set : function(render){
				var t = (isFunction(target)) ? target() : target;
				var c = (isFunction(render)) ? render() : render;
				if( isArray(t) ){
					t.each(function(i){ $(i).innerHTML = c });
				}else{
					$(t).innerHTML = c;
				}
			}
		};
	}
};

