if (typeof(jQuery) !== 'undefined') {
	jQuery.noConflict();
	
	jQuery.fn.toast = function(text) {
		jQuery("body").append('<div class="toast">'+text+'</div>');
		jQuery(".toast").delay(500).fadeOut(3000);
	}
	
	jQuery.fn.loaderAdd = function() {
		jQuery("#loader").fadeIn();
	}
	jQuery.fn.loaderRemove = function() {
		jQuery("#loader").fadeOut(0);
	}
/* 	jQuery(document).ready(function(){
  	var processUrl = null;
  	jQuery(".whoViewQuickEdit").editable(processUrl, {
  		type				: "select",
  		loadurl			: "http://www.example.com/load.php",
  		cancel			: "'.Yii::t('cms.element', 'Cancel').'",
  		submit			: "'.Yii::t('cms.element', 'Save').'",
  		event				: "dblclick",
  		placeholder	: "<span style=\"color: white; text-shadow: 1px 1px 1px #444;\">'.Yii::t('cms.element', 'empty').'</span>",
  		callback		: function(data) {
  			//jQuery().toast("<?php echo Yii::t('config', 'Configuration saved!').'");
  		}
  	});
  }); */
	jQuery(document).ready(function(){
		
		
		
		// TABS Start ----------------------------->
		//When page loads...
		jQuery(".tabs").each(function(key, value) {
  		jQuery(".tab_"+jQuery(this).attr("rel")).hide(); //Hide all content jQuery(".tab_content").hide()
  		jQuery("ul.tabs_"+jQuery(this).attr("rel")+" li:first").addClass("active").show(); //Activate first tab
  		jQuery(".tab_"+jQuery(this).attr("rel")+":first").show(); //Show first tab content
		});
		
		//On Click Event
		jQuery("ul.tabs li").click(function() {
			jQuery("ul.tabs_"+jQuery(this).parent().attr("rel")+" li").removeClass("active"); //Remove any "active" class
			jQuery(this).addClass("active"); //Add "active" class to selected tab
			jQuery(".tab_"+jQuery(this).attr("rel")).hide(); //Hide all tab content
			var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
			jQuery(activeTab).fadeIn(); //Fade in the active ID content
			return false;
		});
		// <----------------------------- TABS End
	});
}













