
pbx.babel={member:null,session:null,basket:null,albums:new Array,photos:new Array,babelRouteServer:"/babel",babelClientId:'feajax',basket_added_lines:null,autoSignInExpiry:30,aSyncOn:1,channel:null,init:function()
{pbx.babel.basket_linecount=$('span#pbx_menu_basket_count');pbx.babel.initialise(pbx.config);pbx.babel.babelXmlrpcService=pbx.config.babelservice;if(pbx.obj.is_static)
{return false;}
var babel;if(pbx.obj&&pbx.obj.session)
{pbx.babel.session=pbx.obj.session;pbx.babel.session.loggedIn=function()
{if(this.logged_in=='1')
{return true;}
return false;};pbx.babel.session.callBabel=pbx.babel._callBabelInstance;}
else
{try
{babel=pbx.babel.callBabel('Community.Session.FetchFromCode',{code:pbx.babel.getSessionCode()});}
catch(e)
{var meta;if(window.location.protocol!='https:')
{meta='insecure_host,'+window.location.host;}
try
{babel=pbx.babel.callBabel('Community.Session.New',{'browser_language_prefs':navigator.UserLanguage||navigator.language,'host':window.location.host,'meta':meta});var session_key=pbx.babel.get_session_key();document.cookie=session_key+'='+babel.response.code+';path=/;domain='+location.host;}
catch(e)
{alert(e.message);}}
if(babel)
{pbx.babel.session=babel.response;pbx.babel.session.loggedIn=function()
{if(this.logged_in=='1')
{return true;}
return false;};}}
if(pbx.obj&&pbx.obj.member)
{pbx.babel.member=pbx.obj.member;pbx.babel.member.callBabel=pbx.babel._callBabelInstance;pbx.babel.member.prefs=pbx.babel.string2hash(pbx.babel.member.prefs);}
else
{pbx.babel.member=pbx.babel.getMember();}
if(pbx.obj&&pbx.obj.form_validation)
{pbx.form_validation=pbx.obj.form_validation;}},initialise:function(dataObj)
{for(key in dataObj)
{dataObj[$.base64Decode(key)]=$.base64Decode(dataObj[key]);}},callBabel:function(method,params,receive)
{XMLRPC.routeServer=pbx.babel.babelRouteServer;var babelService=XMLRPC.getService(pbx.babel.babelXmlrpcService);babelService.add(method,"makeCall",receive);var objectid;var args;var babel;if(method.search(/Fetch$/)!=-1)
{var objectId=params;var async=0;if(typeof(params)=='object'&&(params['objectid']||params['async']))
{objectId=params['objectid'];async=params['async']>0?1:0;delete params['objectid']
delete params['async']}
else
{params=null;}
babel=babelService.makeCall({'__meta':{'clientid':pbx.babel.babelClientId,'objectid':objectId,'sessioncode':pbx.babel.getSessionCode(),'async':async}},params);}
else
{var async=0;if(typeof(params)=='object'&&(params['async']))
{async=params['async'];delete params['async'];}
babel=babelService.makeCall({'__meta':{'clientid':pbx.babel.babelClientId,'sessioncode':pbx.babel.getSessionCode(),'async':async}},params);}
return babel;},get_session_key:function()
{var host=window.location.host;host=host.replace(/\./g,'_');return'pbx_'+host;},normalise_babel_error:function(e)
{var error={};if(e.number)
{error.code=Number(e.number);error.msg=e.message;}
else
{error.code=Number(e.message);error.msg=e.fileName;}
return error;},getSessionCode:function()
{var cookie=document.cookie;var session_key=pbx.babel.get_session_key();var pos=cookie.indexOf(session_key+'=');if(pos!=-1)
{var start=pos+session_key.length+1;var end=cookie.indexOf(';',start);if(end==-1)end=cookie.length;return unescape(cookie.substring(start,end));}},getBasketId:function()
{return((pbx.babel.session!=null)?pbx.babel.session.basket_id:$.decodeHex(document.cookie.match(/pbx_basket=([^;]+)/)[1]).split(':')[2]);},getBasketCount:function()
{return((pbx.babel.basket!=null)?pbx.babel.basket['item_count']:parseInt($.decodeHex(document.cookie.match(/pbx_basket=([^;]+)/)[1]).split(':')[0]));},getMemberId:function()
{return((pbx.babel.session!=null)?pbx.babel.session.member_id:$.decodeHex(document.cookie.match(/pbx_member=([^;]+)/)[1]).split(':')[4]);},getMemberName:function()
{return((pbx.babel.session!=null)?pbx.babel.session.member.first_name+" "+pbx.babel.session.member.last_name:$.decodeHex(document.cookie.match(/pbx_member=([^;]+)/)[1]).split(':')[0]);},getMember:function()
{if(pbx.babel.session.member_id)
{var babel;try
{babel=pbx.babel.callBabel('Community.Member.Fetch',pbx.babel.session.member_id);}
catch(e)
{alert(e);return;}
babel.response.prefs=pbx.babel.string2hash(babel.response.prefs)
return babel.response;}
return;},string2hash:function(hashString)
{if(!hashString)return;var outHash=new Object();var hashArray=hashString.split(',');var i=0;while(i<hashArray.length)
{outHash[hashArray[i]]=hashArray[i+1];i+=2;}
return outHash;},setAjaxHeaders:function(requestObject)
{requestObject.setRequestHeader("X-Ajax",1);},_callBabelInstance:function(method,params,receive)
{if(this.id)
{XMLRPC.routeServer=pbx.babel.babelRouteServer;var babelService=XMLRPC.getService(pbx.babel.babelXmlrpcService);var methodName=this["class"]+'.'+method;babelService.add(methodName,"makeCall",receive);var async=0;if(params!==null&&typeof(params)=='object'&&(params['async']))
{async=params['async']>0?1:0;delete params['async'];}
return babelService.makeCall({'__meta':{'objectid':this.id,'clientid':pbx.babel.babelClientId,'sessioncode':pbx.babel.getSessionCode(),'async':async}},params);}
else
{throw("Can't call an instance method on an uninstantiated object");}},contentGraphicToUrl:function(obj)
{var assetPath=obj.asset_path.toString();if(location.protocol=='https:')
{return location.protocol+'//'+pbx.config.secureHost+pbx.config.assetUrlPath+assetPath;}
else
{return location.protocol+'//'+pbx.config.assetHost+pbx.config.assetUrlPath+assetPath;}},login:function(email,password,autoSignIn)
{try
{var babel=pbx.babel.session.callBabel('Login',{email:email,password:password});pbx.babel.session=babel.response;var expiry;if(autoSignIn)
{expiry=new Date();expiry.setTime(expiry.getTime()+(1000*60*60*24*pbx.babel.autoSignInExpiry));var expiryMysql=expiry.toMysql();pbx.babel.session.callBabel('Set',{expiry:expiryMysql});pbx.babel.session.expiry=expiryMysql;}
pbx.babel.member=pbx.babel.getMember();var session_key=pbx.babel.get_session_key();document.cookie=session_key+'='+pbx.babel.session.code+';path=/;domain='+location.host+((expiry!=null)?'; expires='+expiry.toGMTString():'');return true;}
catch(e)
{if($.browser.msie)
{switch(e.message)
{case'bademail':return 201;case'badpassword':return 202;case'accountsuspended':return 203;case'member exists on legacy photobox':return 220;}}
return e.message;}},reset_password:function(email)
{try
{var babel=pbx.babel.callBabel('Community.Member.ResetPassword',{email:email,send_only:1});}
catch(e)
{if($.browser.msie)
{switch(e.message)
{case'You must supply a valid email address':return 508;case'Email address: '+email+' not known':return 509;}}
return e.message;}},getSession:function()
{try
{var babel=pbx.babel.callBabel('Community.Session.FetchFromCode',{code:pbx.babel.getSessionCode()});}
catch(e)
{var meta;if(window.location.protocol!='https:')
{meta='insecure_host,'+window.location.host;}
try
{babel=pbx.babel.callBabel('Community.Session.New',{'browser_language_prefs':navigator.UserLanguage||navigator.language,'host':window.location.host,'meta':meta});var session_key=pbx.babel.get_session_key();document.cookie=session_key+'='+babel.response.code+';path=/;domain='+location.host;}
catch(e)
{alert(e.message);}}
return babel.response;},getChannel:function()
{try
{var channel_id=pbx.babel.session.channel_id.toString();var babel=pbx.babel.callBabel('Community.Channel.Fetch',channel_id);}
catch(e)
{alert(e.message);}
pbx.babel.channel=babel.response;return pbx.babel.channel;},getChannelEmail:function()
{if(!pbx.babel.channel)
{pbx.babel.getChannel();}
return pbx.babel.channel.mail_from.toString();},getBasket:function(callback)
{try
{if(pbx.babel.basket===null)
{pbx.babel.callBabel('Shopping.Basket.Fetch',{objectid:pbx.babel.getBasketId(),object_property_filter:{':default':{':standard':'t','total.formatted':'chs'}}},function(babel)
{pbx.babel.basket=babel.response;if(typeof callback=='function')
{callback(pbx.babel.basket);}});}
else
{if(typeof callback=='function')
{callback(pbx.babel.basket);}}}
catch(e)
{alert(e.message);}},getBasketItem:function(item_id,callback)
{try
{pbx.babel.callBabel('Shopping.BasketItem.Fetch',item_id,function(babel)
{var basket_item=babel.response;if(typeof callback=='function')
{callback(basket_item);}
return basket_item;});}
catch(e)
{alert(e.message);}
return;},basketcount_update:function(qty_to_add,qty)
{pbx.babel.basket=null;pbx.babel.getBasket(function()
{var linecount=pbx.babel.basket['item_count'].toString();var total=pbx.babel.basket['total.formatted'].toString()
pbx.babel.basket_linecount.html("("+linecount+")");$('.pbx_menu_basket_count').html(linecount);$('.pbx_menu_basket_total').html(total);document.cookie="pbx_basket="+$.encodeHex(linecount+':'+total+':'+pbx.babel.getBasketId())+";domain="+window.location.hostname+";path=/;expires=";if(linecount>0)
{$('.pbx_action_checkout').removeClass('pbx_disabled');}
else
{$('.pbx_action_checkout').addClass('pbx_disabled');}});},getProduct:function(product_id,callback)
{try
{if(callback)
{pbx.babel.callBabel('Shopping.Product.Fetch',product_id,function(babel)
{callback(babel.response);});}
else
{var babel=pbx.babel.callBabel('Shopping.Product.Fetch',product_id);return babel.response;}}
catch(e)
{alert(e.message);}},getStyle:function(product_id)
{try
{pbx.babel.product=pbx.babel.getProduct(product_id);var product_style=pbx.babel.product.callBabel("GetStyleList",{object_property_filter:['name']}).response;}
catch(e)
{alert(e.message);}
return product_style;},getContact:function(id)
{try
{var babel=pbx.babel.callBabel('Community.Contact.Fetch',id);return babel.response;}
catch(e)
{alert(e.message);}},newContact:function(details)
{try
{details.member_id=pbx.babel.member.id.toString();var babel=pbx.babel.callBabel('Community.Contact.New',details);return babel.response;}
catch(e)
{alert(e.message);}},checkaSync:function(babel,settings,callback)
{if(typeof(settings.failsafe)=='undefined')
{settings.failsafe=500;}
if(typeof(settings.pause)=='undefined')
{settings.pause=500;}
var event=babel.response;if(typeof(settings.status)=='function'&&typeof(event.percentage_complete)!='undefined')
{settings.status(event.percentage_complete.toString());}
if(typeof(event.is_complete)=='undefined'||event.is_complete==1)
{if(settings.fetch==1&&event.is_complete==1)
{event.callBabel('GetResult',null,function(result,e)
{if(result)
{event=result.response;if(typeof callback=='function')
{callback(event);}}
else
{callback(null,pbx.babel.normalise_babel_error(e));}});}
else
{if(typeof callback=='function')
{callback(event);}}}
else if(settings.failsafe>0)
{settings.failsafe--;setTimeout(function()
{pbx.babel.callBabel('Admin.AsyncEvent.Fetch',event.id,function(babel)
{pbx.babel.checkaSync(babel,settings,callback);});},settings.pause);}},_item_ids_html:function(params)
{var item_ids='';if(params.album_id)
{if(typeof(params.album_id)=='object')
{for(var i=0;i<params.album_id.length;i++)
{item_ids+="<input type='hidden' name='album_id' value='"+params.album_id[i]+"'/>";}}
else
{item_ids+="<input type='hidden' name='album_id' value='"+params.album_id+"'/>";}}
if(params.photo_id)
{if(typeof(params.photo_id)=='object')
{for(var i=0;i<params.photo_id.length;i++)
{item_ids+="<input type='hidden' name='photo_id' value='"+params.photo_id[i]+"'/>";}}
else
{item_ids+="<input type='hidden' name='photo_id' value='"+params.photo_id+"'/>";}}
return item_ids;},config_order:function(params)
{$('#pbx_order_config_ids').html(pbx.babel._item_ids_html(params));$('form#pbx_order_prints_popup').attr('action',$('#pbx_order_config_url').val());$('input[name=performAction]').val('temp');$('#pbx_order_prints_popup').unbind('submit').submit();},config_basket:function(params)
{$('#pbx_order_config_ids').html(pbx.babel._item_ids_html(params));$('form#pbx_order_prints_popup').attr('action',$('#pbx_basket_link').attr('href'));$('input[name=performAction]').val('basket');$('#pbx_order_prints_popup').unbind('submit').submit();},addAlbumToBasket:function(aids,pid,sid,qty,callback)
{pbx.babel.getBasket(function()
{basket_linecount=$('span#pbx_menu_basket_count');var added_lines=null;var photo_count=null;var List=new Array();for(var i=0;i<aids.length;i++)
{var album=pbx.babel.callBabel('Community.Album.Fetch',aids[i]).response;photo_count=album.photo_count;added_lines+=(photo_count*1);}
var basketCount=(added_lines*qty);if(!pid)pid='';if(!sid)sid='';if(!qty)qty=1;try
{pbx.babel.basket.callBabel('AddAlbums',{album_ids:aids,product_id:pid,style_id:sid,quantity:qty,async:pbx.babel.aSyncOn},function(babel)
{scrollTo(0,0);pbx.babel.checkaSync(babel,{failsafe:500,status:function(percentage){$('span.pbx_bubble_async_status').html(percentage)}},function()
{pbx.babel.basketcount_update(added_lines*qty);setTimeout("pbx.bubble_hide('a#pbx_basket_link', true)",3000);if(callback)
{callback();}});});}
catch(e)
{pbx.privilege_error();return;}
if(!pbx.basket.loaded)
{pbx.show_loading(false);pbx.show_overlay(false);}
pbx.hide_dropdown();$('span#bubblebasket').each(function()
{pbx.i18nplural('bubblebasket',added_lines*qty);});pbx.ordering=1;pbx.bubble_show('a#pbx_basket_link','200px');pbx.ordering=0;$('div#pbx_popup_cart').removeClass('pbx_disabled');try
{pbx.analytics.addedToBasket(pid,pbx.babel.basket_linecount.html(),'Addition');}
catch(e)
{}});},addCupidToBasket:function(pid,qty)
{if(!qty)
{qty=1;}
pbx.hide_dropdown();$('span#bubblebasket').each(function()
{pbx.i18nplural('bubblebasket',qty);});pbx.ordering=1;pbx.bubble_show('a#pbx_basket_link','200px');pbx.ordering=0;$('span.pbx_bubble_async_status').html('100');pbx.babel.basketcount_update(qty*1);try
{pbx.analytics.addedToBasket(pid,pbx.babel.basket_linecount.html(),'Addition');}
catch(e)
{}},addCreationToBasket:function(cid,qty)
{pbx.babel.getBasket(function()
{basket_linecount=$('span#pbx_menu_basket_count');var List=new Array();if(!qty)qty=1;try
{pbx.babel.basket.callBabel('AddItem',{creation_id:cid,photo_id:0,quantity:qty,async:pbx.babel.aSyncOn},function(babel)
{scrollTo(0,0);pbx.babel.checkaSync(babel,{failsafe:500,status:function(percentage){$('span.pbx_bubble_async_status').html(percentage)}},function()
{pbx.babel.basketcount_update(qty);setTimeout("pbx.bubble_hide('a#pbx_basket_link', true)",3000);});});}
catch(e)
{pbx.privilege_error();return;}
if(!pbx.basket.loaded)
{pbx.show_loading(false);pbx.show_overlay(false);}
pbx.hide_dropdown();$('span#bubblebasket').each(function()
{pbx.i18nplural('bubblebasket',qty);});pbx.ordering=1;pbx.bubble_show('a#pbx_basket_link','200px');pbx.ordering=0;$('div#pbx_popup_cart').removeClass('pbx_disabled');try
{pbx.analytics.addedToBasket(pid,pbx.babel.basket_linecount.html(),'Addition');}
catch(e)
{}});},addToBasket:function(photos_ids,pid,sid,qty)
{pbx.babel.getBasket(function()
{basket_linecount=$('span#pbx_menu_basket_count');var photos_id_hash=null;var added_lines=null;if(typeof(photos_ids)=='object')
{added_lines=photos_ids.length;photos_id_hash=photos_ids;}
else
{added_lines=1;photos_id_hash=[photos_ids];}
if(!pid)pid='';if(!sid)sid='';if(!qty)qty=1;var failSafe=0;try
{var add_args={async:pbx.babel.aSyncOn,photo_id:photos_id_hash,quantity:qty};if(pid){add_args['product_id']=pid}
if(sid){add_args['style_id']=sid}
pbx.babel.basket.callBabel('AddItem',add_args,function(babel)
{scrollTo(0,0);pbx.babel.checkaSync(babel,{failsafe:500,status:function(percentage){$('span.pbx_bubble_async_status').html(percentage)}},function()
{pbx.babel.basketcount_update(added_lines*qty);setTimeout("pbx.bubble_hide('a#pbx_basket_link', true)",3000);});});}
catch(e)
{pbx.privilege_error();return;}
if(!pbx.basket.loaded)
{pbx.show_loading(false);pbx.show_overlay(false);}
pbx.hide_dropdown();$('span#bubblebasket').each(function()
{pbx.i18nplural('bubblebasket',added_lines*qty);});pbx.ordering=1;pbx.bubble_show('a#pbx_basket_link','200px');pbx.ordering=0;$('div#pbx_popup_cart').removeClass('pbx_disabled');try
{pbx.analytics.addedToBasket(pid,pbx.babel.basket_linecount.html(),'Addition');}
catch(e)
{}});},ChangeBasketItems:function(ids,settings,callback)
{settings.item_ids=ids;pbx.babel.getBasket(function()
{pbx.babel.basket.callBabel('ChangeItems',settings,function(babel)
{if(typeof callback=='function')
{callback(babel.response);}});});var addType=settings.asnew?'New Addition':'Modification';try
{pbx.analytics.addedToBasket(settings.product_id,pbx.babel.basket_linecount.html(),addType);}
catch(e)
{}},ChangeBasketProducts:function(pid,sid,settings,callback)
{settings.source_product_id=pid;settings.source_style_id=sid;pbx.babel.getBasket(function()
{settings.async=parseInt(pbx.babel.basket.line_count/pbx.basket.aSyncThresh);pbx.babel.basket.callBabel('ChangeProduct',settings,function(babel)
{pbx.babel.checkaSync(babel,{failsafe:500},callback);});});var addType=settings.asnew?'New Addition':'Modification';try
{pbx.analytics.addedToBasket(settings.destination_product_id,pbx.babel.basket_linecount.html(),addType);}
catch(e)
{}},RemoveFromBasket:function(items_ids,items_quantity,callback)
{pbx.babel.getBasket(function()
{pbx.babel.basket.callBabel('RemoveItem',{item_id:items_ids,async:parseInt(pbx.babel.basket.line_count/pbx.basket.aSyncThresh)},function(babel)
{pbx.babel.checkaSync(babel,{failsafe:500},callback);});});},RemoveProductFromBasket:function(pid,sid,callback)
{pbx.babel.getBasket(function()
{pid=pid*1;sid=sid*1;pbx.babel.basket.callBabel('RemoveProduct',{product_id:pid,style_id:sid,async:parseInt(pbx.babel.basket.line_count/pbx.basket.aSyncThresh)},function(babel)
{pbx.babel.checkaSync(babel,{failsafe:500},callback);});});},EmptyBasket:function(callback)
{var empty_data={performAction:'basket',performActionVersion:2,'basket[empty]':1,layout:'ajax'};$.post(window.location.pathname+window.location.search,empty_data,callback);},validateBasket:function(callback)
{pbx.babel.getBasket(function()
{pbx.babel.basket.callBabel('Validate',{async:parseInt(pbx.babel.basket.line_count/pbx.basket.aSyncThresh)},function(babel)
{pbx.babel.checkaSync(babel,{failsafe:500,fetch:1},callback);});});},AddOffer:function(offercode)
{var offer_message=false;try
{if(pbx.babel.member===null)
{pbx.babel.member=pbx.babel.getMember();}
offer_message=pbx.babel.member.callBabel('AddOffer',{code:offercode}).response;}
catch(e)
{var error=pbx.babel.normalise_babel_error(e);if(error.code==2232||error.code==554)
{pbx.popup.component.open(null,'/content/my/account/offers/incompatible',offercode);}
else
{alert(error.msg);}
offer_message=false;}
return offer_message;},RemoveOffer:function(callback)
{if(pbx.babel.member===null)
{pbx.babel.member=pbx.babel.getMember();}
pbx.babel.member.callBabel('RemoveOffer',null,callback);},setAttributes:function(object,hash)
{try
{var response=object.callBabel('SetAttribute',hash).response;}
catch(e)
{alert(e.message);}
return response;},changeAttributes:function(object,hash)
{try
{var response=object.callBabel('ChangeAttribute',hash).response;}
catch(e)
{alert(e.message);}
return response;},getAlbum:function(id,callback)
{try
{pbx.babel.callBabel('Community.Album.Fetch',id,callback);}
catch(e)
{alert(e);}},getPhotosIdsFromAlbum:function(album,offset,quantity,favourites,callback)
{var method=favourites?'GetFavouritePhotoIdList':'GetPhotoIdList';try
{album.callBabel(method,{offset:offset,quantity:quantity},callback);}
catch(e)
{alert(e);}},getPhotosFromAlbum:function(album,offset,quantity,include_list,exclude_list,callback)
{try
{if(include_list.length>=exclude_list.length)
{album.callBabel('GetPhotoObjectHash',{offset:offset,quantity:quantity,exclude_list:exclude_list,object_property_filter:['attributes','width','height','is_favourite','thumburl','name','filesize']},callback);}
else
{pbx.babel.callBabel('Community.Photo.GetPhotoHash',{ids:include_list},callback);}}
catch(e)
{alert(e);}},getPhoto:function(id,forceFetch)
{if(forceFetch||!(photo=pbx.babel.photos[id]))
{photo=pbx.babel.callBabel('Community.Photo.Fetch',id).response;pbx.babel.photos[id]=photo;}
return photo;},invalidatePhoto:function(id)
{pbx.babel.photos[id]=null;},toMysql:function()
{return this.getFullYear()+'-'+(this.getMonth()+1).pad(2)+'-'+this.getDate().pad(2)+' '+this.getHours().pad(2)+':'+this.getMinutes().pad(2)+':'+this.getSeconds().pad(2);},pad:function(places)
{var numLength=this.toString().length;if(numLength<places)
{var val=this.toString();for(var i=0;i<places-numLength;i++)
{val='0'+val;}
return val;}
return this;},getMeta:function(obj,params)
{var property=(params&&params.property)||'meta';if(!obj['__'+property])
{obj['__'+property]={};var value=obj[property];var meta=value.replace('\\,','||');var metas=meta.split(',');$.each(metas,function(i,n)
{if(!i%2)
{obj['__'+property][n]=metas[i+1].replace('||','\\,');}});}
return obj['__'+property];},get_preference:function(prefName)
{var result=pbx.babel.member.prefs?pbx.babel.member.prefs[prefName]:false;if(!result)
{result=pbx.babel.get_channel_pref(prefName);}
return result;},get_channel:function()
{if(pbx.babel.channel)
{return;}
try
{var babel=pbx.babel.callBabel('Community.Channel.Fetch',pbx.babel.member.channel_id);var channel=babel.response;if(channel.prefs)
{channel.prefs=pbx.babel.string2hash(channel.prefs);}}
catch(e)
{alert(e);return false}
return pbx.babel.channel=babel.response;},get_channel_pref:function(prefName)
{var result=false;if(!pbx.babel.channel)
{pbx.babel.get_channel();}
if(pbx.babel.channel.prefs)
{result=pbx.babel.channel.prefs[prefName]||false;}
return result;},translateToken:function(token,params_hash)
{var babel=pbx.babel.callBabel('Community.ContentTranslation.Translate',{token_id:token,vars:params_hash});return babel.response.toString();}};Date.prototype.toMysql=pbx.babel.toMysql;Number.prototype.pad=pbx.babel.pad;