jQuery.fn.bodyObject=function(obj,index,options){this.settings={gsData:{}};this.obj=obj;this.jobj=$(obj);if(options){jQuery.extend(this.settings,options);}
this.gsData={};this.gs=function(name){if(typeof this.gsData[name]!='undefined'){return this.gsData[name];}
return name;}
this.timeFormat=function(time,format){var d=new Date(time*1000);return d.format(format);}
this.currencyMini=function(value){value=value*1;if(value>=100){if(value%100==0){return Math.floor(value/100)+this.gs('currency');}
if(value%100>10){return Math.floor(value/100)+','+(value%100)+this.gs('currency');}
return Math.floor(value/100)+','+this.pad(value%100,2)+this.gs('currency');}
return value+this.gs('hal');}
this.currencyMiniBr=function(value){value=value*1;if(value>=100){if(value%100==0){return Math.floor(value/100)+'<br />'+this.gs('currency');}
if(value%100>10){return Math.floor(value/100)+','+(value%100)+'<br />'+this.gs('currency');}
return Math.floor(value/100)+','+this.pad(value%100,2)+'<br />'+this.gs('currency');}
return value+'<br />'+this.gs('hal');}
this.currency=function(value){return bodyObject.currencyValue(value)+' '+this.gs('currency');}
this.currencyValue=function(value){return((value<0)?('-'):(''))+Math.floor(Math.abs(value/100))+','+this.pad(Math.abs(value%100),2);}
this.pad=function(number,length){var str=''+number;while(str.length<length){str='0'+str;}
return str;}
this.getTime=function(s){var t_s=s%60;var t_s_r=Math.floor(s/60);var t_m=t_s_r%60;var t_m_r=Math.floor(t_s_r/60);var t_h=t_m_r%24;var t_h_r=Math.floor(t_m_r/24);var t_d=t_h_r;if(t_d==0){if((t_h==0)&&(t_m==0)&&(t_s<30)){return this.pad(t_h,2)+':'+this.pad(t_m,2)+':<span class="alert">'+this.pad(t_s,2)+'</span>';}else{return this.pad(t_h,2)+':'+this.pad(t_m,2)+':'+this.pad(t_s,2);}}else{var den='';if(t_d==1){den=this.gs('den');}
if((t_d>1)&&(t_d<5)){den=this.gs('dny');}
if(t_d>4){den=this.gs('dnu');}
return t_d+' '+den+' '+this.pad(t_h,2)+':'+this.pad(t_m,2)+':'+this.pad(t_s,2);}}
this.timestamp2Text=function(time){var d=new Date(time*1000);return d.format('j. n. Y H:i');}
this.init=function(){this.gsData=this.settings.gsData;bodyObject=this;return this;}
return this.init();}
