/**
 * @author michaeld
 */

		var AFL_JS = new Object();

		AFL_JS.Common = new Object();
		AFL_JS.Common.CancelEvent = function() {
			return false;
		};
		
		AFL_JS.Common.Busyness = new Object();
		AFL_JS.Common.Busyness.Storage = new Object();
		AFL_JS.Common.Busyness.IsBusy = function(name) {
			return AFL_JS.Common.Busyness.Storage[name] || false;
		}
		AFL_JS.Common.Busyness.Set = function(name, value, timeout) {
			var timeout = timeout || false;
			AFL_JS.Common.Busyness.Storage[name] = value;
			if(timeout) {
				setTimeout(function() {
					AFL_JS.Common.Busyness.Set(name, !(value), false);
				}, timeout);
			}
		}
		
		AFL_JS.Common.CountCharacters = function(oInput, oDisplay, iAllowed, sInfo) {
			var Current = oInput.value.length;
			var Value = oInput.value;
			var Left = 0;
			if(Current > iAllowed) {
				Value = Value.substr(0, iAllowed);
				oInput.value = Value;
				if(oInput.tagName == 'TEXTAREA') {
					oInput.innerHTML = Value;
				}
			} else {
				Left = iAllowed - Current;
			}
			if(!Object.isUndefined(sInfo)) {
				oDisplay.innerHTML = sInfo.replace('[%COUNT%]', Left).reaplce('[%MAX%]', iAllowed);
			} else {
				oDisplay.innerHTML = Left;
			}
		}
		
		AFL_JS.Common.IsIE = ((document.all) && (navigator.userAgent.indexOf('Opera')== -1));
		
		AFL_JS.Common.isArray = function(obj) {
   			if (obj.constructor.toString().indexOf("Array") == -1)
      			return false;
   			else
      			return true;
		}