CCI = CCI || {};
CCI["JQ"] = {
  "PAGER": function(bag) {
			bag = bag || {};
			el = bag.el || 0;
			$(el).live("click", function(e){
				e.preventDefault();
				bag.url = $(this)[0].href;
				pagId = $(this).closest("div").attr("id");
				pagId = pagId.split("-pag");
				bag.target = pagId[0];
				if (bag.url && bag.target){
					CCI["JQ"].LOAD(bag);
				}
	});
			
		  },
	"LOAD": function(bag) {
				bag = bag || {};
				url = bag.url || 0;
				target = bag.target || 0;
				if (url && target){
				el = $("#"+target)
					el.addClass("loading").load(url, function(){el.removeClass("loading");});
				}
	
	},
	"TABBER": function(bag) {
				bag = bag || {};
				nav = bag.nav || ".tabNav a";
				if (nav){
					$(nav).click(function(e){
					e.preventDefault();
					target = $(this)[0].hash;
//				console.log(target);
					containerNav = $(this).closest("div").attr("id");
//				console.log(containerNav);
					containerTemp = containerNav.split("-nav");
//				console.log(containerTemp);
					containerDiv = "#"+ containerTemp[0] +" div";
					$(containerDiv).not(".pagination-nav").hide().filter(target).show();
					navs = "#"+ containerTemp + nav;
           		 	$(navs).each(function(e){$(this).removeClass('active');});
   	      		 	$(this).addClass('active');
   	      		 	return false;
				});
				
				}	  
	  },
	  "INPUTVALUE": function(bag) {
				bag = bag || {};
				el = bag.el || 0;
				$(el).each(function(){
				//Load
				if(this.value == '') {
            			this.value = $(this).attr('title');
       			 	}
				//Focus
				$(this).focus(function(){
						if(this.value == $(this).attr('title')){
						this.value='';
       			 	}});
				//Blur
					$(this).blur(function(){
						if(this.value == '') {
            			this.value = $(this).attr('title');
       			 	}});
					       			 });	
 		 
	}	  
	  
}
