
if(!SAPO.Utility||typeof(SAPO.Utility)=='undefined'){SAPO.namespace('Utility');}
SAPO.Utility.Dumper={_tab:'\xA0\xA0\xA0\xA0',_formatParam:function(param)
{var formated='';switch(typeof(param)){case'string':formated='(string) '+param;break;case'number':formated='(number) '+param;break;case'boolean':formated='(boolean) '+param;break;case'object':if(param!=null){if(param.constructor==Array){formated='Array \n{\n'+this._outputFormat(param,0)+'\n}';}else if(param.constructor==Object){formated='Object \n{\n'+this._outputFormat(param,0)+'\n}';}}else{formated='null';}
break;default:formated=false;}
return formated;},_getTabs:function(numberOfTabs)
{var tabs='';for(var _i=0;_i<numberOfTabs;_i++){tabs+=this._tab;}
return tabs;},_outputFormat:function(param,dim)
{var formated='';var _strVal=false;var _typeof=false;for(var key in param){if(param[key]!=null){if(typeof(param[key])=='object'&&(param[key].constructor==Array||param[key].constructor==Object)){if(param[key].constructor==Array){_typeof='Array';}else if(param[key].constructor==Object){_typeof='Object';}
formated+=this._tab+this._getTabs(dim)+'['+key+'] => <b>'+_typeof+'</b>\n';formated+=this._tab+this._getTabs(dim)+'{\n';formated+=this._outputFormat(param[key],dim+1)+this._tab+this._getTabs(dim)+'}\n';}else if(param[key].constructor==Function){continue;}else{formated=formated+this._tab+this._getTabs(dim)+'['+key+'] => '+param[key]+'\n';}}else{formated=formated+this._tab+this._getTabs(dim)+'['+key+'] => null \n';}}
return formated;},printDump:function(param,target)
{if(!target||typeof(target)=='undefined'){document.write('<pre>'+this._formatParam(param)+'</pre>');}else{if(typeof(target)=='string'){document.getElementById(target).innerHTML='<pre>'+this._formatParam(param)+'</pre>';}else if(typeof(target)=='object'){target.innerHTML='<pre>'+this._formatParam(param)+'</pre>';}else{throw"TARGET must be an element or an element ID";}}},returnDump:function(param)
{return this._formatParam(param);},alertDump:function(param)
{alert(this._formatParam(param).replace(/(<b>)(Array|Object)(<\/b>)/g,"$2"));},windowDump:function(param)
{var dumperwindow='dumperwindow_'+(Math.random()*10000);var win=window.open('',dumperwindow,'width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable');win.document.open();win.document.write('<pre>'+this._formatParam(param)+'</pre>');win.document.close();win.focus();}};