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

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

blom.contact = new Class();

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