/* =============================================================================
Description:
	A simple tracking function that utilizes the FireBug console:
		http://getfirebug.com/console.html

	The function uses a variable called 'itmCommonLog'. Unless it set to 'true',
	no messages are logged into the console.

	This function should be linked in all v16 UK IT Manager pages via
	the following include file:
		./itsolutions/ssi-v16/head-itsolutions-v2.shtml

	The link should be placed before all UK IT Manager jQuery extensions (i.e.
	any itmCommon functions). However, as a failsafe, the following failsafe
	check should be included in all UK IT Manager jQuery extensions:

	if(typeof(jQuery().itmCommonLog)!=="function")
	{
		jQuery.fn.extend({itmCommonLog: function(method,msg){return(this);}});
		jQuery.extend({
			itmCommonLogInitCheck: function(){return(false);},
			itmCommonLogToggle: function(){}
		});
	}
================================================================================
Author:
	Jan Mac/Slovakia/IBM

Version:
	- v1.0, 2009-07-29: initial release into production
	- v0.1, 2009-04-01: initial development version
================================================================================
Requires:
	//www.ibm.com/common/js/ibmcommon.js
	https://addons.mozilla.org/firefox/addon/1843

Default location:
	//www.ibm.com/itsolutions/uk/js/itmcommon-log.js

	Please do not link directly to the default location outside of
	ibm.com/itsolutions/uk - create a local copy of the script instead.
================================================================================
Sample usage:
	Put the following code into your Javascript code or into Firebug console:
		jQuery.itmCommonLogToggle();

============================================================================= */

jQuery.fn.extend({itmCommonLog:function(B,A){if(jQuery.itmCommonLogInitCheck()){jQuery.fn.itmCommonLog.config.storage.method=B;jQuery.fn.itmCommonLog.config.storage.message=A;obj=this.each(function(C,D){B=jQuery.fn.itmCommonLog.config.storage.method;A=jQuery.fn.itmCommonLog.config.storage.message;switch(jQuery.fn.itmCommonLog.config.storage.method){case"log":console.log("%o %s",jQuery(this),A);break;case"debug":console.debug("%o %s",jQuery(this),A);break;case"info":console.info("%o %s",jQuery(this),A);
break;case"warn":console.warn("%o %s",jQuery(this),A);break;case"error":console.error("%o %s",jQuery(this),A);break;case"group":console.group(A);break;case"groupCollapsed":console.groupCollapsed(A);break;case"groupEnd":console.groupEnd();break;case"time":console.time(A);break;case"timeEnd":console.timeEnd(A);break;case"count":console.count(A);break;default:console.warn("%s","itmCommon: method not supported")}return(jQuery(this))});jQuery.fn.itmCommonLog.config.storage.method="";jQuery.fn.itmCommonLog.config.storage.message="";
return(obj)}else{return(this)}}});jQuery.fn.itmCommonLog.config={enabled:false,storage:{method:"",message:""}};jQuery.extend({itmCommonLogInitCheck:function(){if((jQuery.fn.itmCommonLog.config.enabled===true)&&(typeof (console)=="object")&&(typeof (console.groupCollapsed)=="function")){return(true)}else{return(false)}},itmCommonLogToggle:function(){if((typeof (jQuery.fn.itmCommonLog)=="function")&&(typeof (jQuery.fn.itmCommonLog.config)=="object")){if(jQuery.fn.itmCommonLog.config.enabled===true){jQuery.fn.itmCommonLog.config.enabled=false
}else{jQuery.fn.itmCommonLog.config.enabled=true}return(jQuery.fn.itmCommonLog.config.enabled)}else{return(false)}}});