var AjaxContent = function(){
    var container_div = ''; 
	var content_div = ''; 
	var wrap = ''; 
	return {
		getContent : function(url){
			$(container_div).animate({opacity:0}, //Turn the opacity to 0
					function(){ // the callback, loads the content with ajax 
			           $(container_div).html('<p><img src="http://ombuconsulting.com/ob/images/ajax-loader.gif" width="220" height="19" /></p>').show();
						$(container_div).load(url+" "+content_div, //only loads the selected portion
						function(){					
						   $(container_div).animate({opacity:1}); //and finally bring back the opacity back to 1
					
					}
				);        
			});
		},
		ajaxify_links: function(elements){
			$(elements).click(function(){
			     $(container_div).html('<p><img src="http://ombuconsulting.com/ob/images/ajax-loader.gif" width="220" height="19" /></p>').show();
				AjaxContent.getContent(this.href);
				return false; //prevents the link from beign followed
			});
		},
		init: function(params){ //sets the initial parameters
			container_div = params.containerDiv; 
			content_div = params.contentDiv;
			return this; //returns the object in order to make it chainable
		}
	}
}();


var AjaxContent2 = function(){
    var container_div2 = ''; 
	var content_div2 = ''; 
	return {
		getContent : function(url){
			$(container_div2).animate({opacity:0}, //Turn the opacity to 0
					function(){ // the callback, loads the content with ajax
						 $(container_div2).html('<p><img src="http://ombuconsulting.com/ob/images/ajax-loader.gif" width="220" height="19" /></p>').show();
						$(container_div2).load(url+" "+content_div2, //only loads the selected portion
						function(){						   
						   $(container_div2).animate({opacity:1}); //and finally bring back the opacity back to 1
					}
				);        
			});
		},
		ajaxify_links: function(elements){
			$(elements).click(function(){
				$(container_div2).html('<p><img src="http://ombuconsulting.com/ob/images/ajax-loader.gif" width="220" height="19" /></p>').show();
				AjaxContent2.getContent(this.href);
				return false; //prevents the link from beign followed
			});
		},
		init: function(params){ //sets the initial parameters
			container_div2 = params.containerDiv2; 
			content_div2 = params.contentDiv2;
			return this; //returns the object in order to make it chainable
		}
	}
}();

var AjaxContent3 = function(){
    var container_div3 = ''; 
	var content_div3 = ''; 
	return {
		getContent : function(url){
			$(container_div3).animate({opacity:0}, //Turn the opacity to 0
					function(){ // the callback, loads the content with ajax
						 $(container_div3).html('<p><img src="http://ombuconsulting.com/ob/images/ajax-loader.gif" width="220" height="19" /></p>').show();
						$(container_div3).load(url+" "+content_div3, //only loads the selected portion
						function(){						   
						   $(container_div3).animate({opacity:1}); //and finally bring back the opacity back to 1
					}
				);        
			});
		},
		ajaxify_links: function(elements){
			$(elements).click(function(){
				$(container_div3).html('<p><img src="http://ombuconsulting.com/ob/images/ajax-loader.gif" width="220" height="19" /></p>').show();
				AjaxContent3.getContent(this.href);
				return false; //prevents the link from beign followed
			});
		},
		init: function(params){ //sets the initial parameters
			container_div3 = params.containerDiv3; 
			content_div3 = params.contentDiv3;
			return this; //returns the object in order to make it chainable
		}
	}
}();
