/**
 * @author Kristofer Forsell
 */
function Class(){
	this.me = "clients";
	
}

Class.prototype = {
	
	// INIT
	init:function(){
		this.initialized = false;
	},
	
	loadClients: function(clientsUrl){
		
		if(blom.clients.initialized == false){
			
			// Show the loader
			$("#loader").show();
			
			$.ajax({
				type: "GET",
				url: clientsUrl,
				success: function(data) {
					
					// Hide the loader
					$("#loader").fadeOut(100);
					// Clear the diary
					$("#content").append( $(data).find('#content').html() );
					blom.clients.openView();
				}
			});
		
			blom.clients.initialized = true;
		
		} else {
			blom.clients.openView();
		}
		
	},
	
	openView: function(){
		$("#clients").fadeIn(400);
		blom.changeIndexTitle( 'Index' );
	},
	
	closeView: function(){
		$("#clients").hide();
	},
	
	// GENERIC
	toString: function() {
  		return this.me;
	},
	
}

blom.clients = new Class();

$(document).ready(function(){
	blom.initClass("clients");
});
