/* * More info at: http://phpjs.org * * This is version: 3.16 * php.js is copyright 2010 Kevin van Zonneveld. * * Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld * (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White * (http://getsprink.com), Waldo Malqui Silva, Paulo Ricardo F. Santos, Jonas * Raoni Soares Silva (http://www.jsfromhell.com), Jack, Philip Peterson, Ates * Goral (http://magnetiq.com), Legaev Andrey, Ratheous, Alex, Martijn * Wieringa, Nate, lmeyrick (https://sourceforge.net/projects/bcmath-js/), * Philippe Baumann, Enrique Gonzalez, Webtoolkit.info * (http://www.webtoolkit.info/), travc, Ole Vrijenhoek, Carlos R. L. * Rodrigues (http://www.jsfromhell.com), Jani Hartikainen, Ash Searle * (http://hexmen.com/blog/), Erkekjetter, Johnny Mast * (http://www.phpvrouwen.nl), pilus, marrtins, Rafał Kukawski * (http://blog.kukawski.pl), T.Wild, Michael Grier, stag019, WebDevHobo * (http://webdevhobo.blogspot.com/), GeekFG (http://geekfg.blogspot.com), * Andrea Giammarchi (http://webreflection.blogspot.com), d3x, * http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript, * majak, gettimeofday, Tim de Koning (http://www.kingsquare.nl), Joris, * Martin (http://www.erlenwiese.de/), Steven Levithan * (http://blog.stevenlevithan.com), Marc Palau, Paul Smith, Robin, David, * Imgen Tata (http://www.myipdf.com/), Mailfaker (http://www.weedem.fr/), * mdsjack (http://www.mdsjack.bo.it), felix, Mirek Slugen, Public Domain * (http://www.json.org/json2.js), Chris, Oleg Eremeev, KELAN, Karol Kowalski, * Michael White, Breaking Par Consulting Inc * (http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7), * Josh Fraser * (http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/), * Arpad Ray (mailto:arpad@php.net), Felix Geisendoerfer * (http://www.debuggable.com/felix), Caio Ariede (http://caioariede.com), * Aman Gupta, Thunder.m, Lars Fischer, Sakimori, Tyler Akins * (http://rumkin.com), Alfonso Jimenez (http://www.alfonsojimenez.com), * Kankrelune (http://www.webfaktory.info/), AJ, Steve Hilder, gorthaur, * Pellentesque Malesuada, saulius, Douglas Crockford * (http://javascript.crockford.com), paulo kuong, mktime, john * (http://www.jd-tech.net), noname, Marco, Frank Forte, duncan, Bayron * Guevara, madipta, Nick Kolosov (http://sammy.ru), ger, Mateusz "loonquawl" * Zalega, 0m3r, ReverseSyntax, Sanjoy Roy, Francois, Scott Cariss, Slawomir * Kaniecki, Arno, Nathan, sankai, class_exists, Gilbert, marc andreu, Fox, * josh, Subhasis Deb, nobbler, Steve Clay, David James, Jon Hohle, Pyerre, * merabi, nord_ua, Ozh, echo is bad, Oskar Larsson Högfeldt * (http://oskar-lh.name/), XoraX (http://www.xorax.info), Soren Hansen, * T0bsn, Tim Wiel, Brad Touesnard, MeEtc (http://yass.meetcweb.com), Bryan * Elliott, David Randall, Denny Wardhana, JT, Thomas Beaucourt * (http://www.webapp.fr), Shingo, Der Simon * (http://innerdom.sourceforge.net/), kenneth, Hyam Singer * (http://www.impact-computing.com/), djmix, Lincoln Ramsay, Raphael (Ao * RUDLER), Peter-Paul Koch (http://www.quirksmode.org/js/beat.html), T. Wild, * Ole Vrijenhoek (http://www.nervous.nl/), Paul, lmeyrick * (https://sourceforge.net/projects/bcmath-js/this.), LH, JB, Eugene Bulkin * (http://doubleaw.com/), Stoyan Kyosev (http://www.svest.org/), Francesco, J * A R, Linuxworld, Marc Jansen, Thiago Mata (http://thiagomata.blog.com), * Matt Bradley, date, Kristof Coomans (SCK-CEN Belgian Nucleair Research * Centre), Pierre-Luc Paour, Martin Pool, Brant Messenger * (http://www.brantmessenger.com/), Kirk Strobeck, Saulo Vallory, Christoph, * Wagner B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong * (http://carrot.org/), Daniel Esteban, strftime, Rick Waldron, Mick@el, * Anton Ongson, Simon Willison (http://simonwillison.net), Gabriel Paderni, * Philipp Lenssen, Marco van Oort, Bug?, Blues (http://tech.bluesmoon.info/), * Tomasz Wesolowski, rezna, Eric Nagel, Bobby Drake, Luke Godfrey, Pul, * uestla, Alan C, Ulrich, Yves Sucaet, sowberry, Norman "zEh" Fuchs, hitwork, * Zahlii, johnrembo, Nick Callen, Steven Levithan (stevenlevithan.com), * ejsanders, Aidan Lister (http://aidanlister.com/), Brian Tafoya * (http://www.premasolutions.com/), Philippe Jausions * (http://pear.php.net/user/jausions), Rob, Orlando, HKM, metjay, strcasecmp, * strcmp, Taras Bogach, jpfle, ChaosNo1, Alexander Ermolaev * (http://snippets.dzone.com/user/AlexanderErmolaev), dptr1988, kilops, Le * Torbi, James, DxGx, Pedro Tainha (http://www.pedrotainha.com), * penutbutterjelly, Christian Doebler, baris ozdil, Greg Frazier, Tod * Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M Beedie, * FGFEmperor, gabriel paderni, Atli Þór, Maximusya, daniel airton wermann * (http://wermann.com.br), 3D-GRAF, Yannoo, jakes, T.J. Leahy, FremyCompany, * stensi, Billy, vlado houba, Itsacon (http://www.itsacon.net/), Jalal * Berrami, Matteo, Victor, Tim de Koning, Luis Salazar * (http://www.freaky-media.com/), taith, Manish, fearphage * (http://http/my.opera.com/fearphage/), Cord, davook, Benjamin Lupton, * Garagoth, Andrej Pavlovic, Dino, William, rem, Russell Walker * (http://www.nbill.co.uk/), Jamie Beck (http://www.terabit.ca/), setcookie, * Michael, YUI Library: * http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at * http://hacks.bluesmoon.info/strftime/strftime.js, DtTvB * (http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, meo, * Greenseed, Luke Smith (http://lucassmith.name), Kheang Hok Chin * (http://www.distantia.ca/), Rival, Diogo Resende, Allan Jensen * (http://www.winternet.no), Howard Yeend, Jay Klehr, Amir Habibi * (http://www.residence-mixte.com/), mk.keck, Yen-Wei Liu, Leslie Hoare, Ben * Bryan, Cagri Ekin, booeyOH * * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ // Compression: minified function getenv(varname){if(!this.php_js||!this.php_js.ENV||!this.php_js.ENV[varname]){return false;} return this.php_js.ENV[varname];} function setlocale(category,locale){var categ='',cats=[],i=0,d=this.window.document;var _copy=function _copy(orig){if(orig instanceof RegExp){return new RegExp(orig);} else if(orig instanceof Date){return new Date(orig);} var newObj={};for(var i in orig){if(typeof orig[i]==='object'){newObj[i]=_copy(orig[i]);} else{newObj[i]=orig[i];}} return newObj;};var _nplurals1=function(n){return 0;};var _nplurals2a=function(n){return n!==1?1:0;};var _nplurals2b=function(n){return n>1?1:0;};var _nplurals2c=function(n){return n%10===1&&n%100!==11?0:1;};var _nplurals3a=function(n){return n%10===1&&n%100!==11?0:n!==0?1:2;};var _nplurals3b=function(n){return n===1?0:n===2?1:2;};var _nplurals3c=function(n){return n===1?0:(n===0||(n%100>0&&n%100<20))?1:2;};var _nplurals3d=function(n){return n%10===1&&n%100!==11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2;};var _nplurals3e=function(n){return n%10===1&&n%100!==11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2;};var _nplurals3f=function(n){return n===1?0:n>=2&&n<=4?1:2;};var _nplurals3g=function(n){return n===1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2;};var _nplurals3h=function(n){return n%10===1?0:n%10===2?1:2;};var _nplurals4a=function(n){return n%100===1?0:n%100===2?1:n%100===3||n%100===4?2:3;};var _nplurals4b=function(n){return n===1?0:n===0||(n%100&&n%100<=10)?1:n%100>=11&&n%100<=19?2:3;};var _nplurals5=function(n){return n===1?0:n===2?1:n>=3&&n<=6?2:n>=7&&n<=10?3:4;};var _nplurals6=function(n){return n===0?5:n===1?0:n===2?1:n%100>=3&&n%100<=10?2:n%100>=11&&n%100<=99?3:4;};this.php_js=this.php_js||{};var phpjs=this.php_js;if(!phpjs.locales){phpjs.locales={};phpjs.locales.en={'LC_COLLATE':function(str1,str2){return(str1==str2)?0:((str1>str2)?1:-1);},'LC_CTYPE':{an:/^[A-Za-z\d]+$/g,al:/^[A-Za-z]+$/g,ct:/^[\u0000-\u001F\u007F]+$/g,dg:/^[\d]+$/g,gr:/^[\u0021-\u007E]+$/g,lw:/^[a-z]+$/g,pr:/^[\u0020-\u007E]+$/g,pu:/^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g,sp:/^[\f\n\r\t\v ]+$/g,up:/^[A-Z]+$/g,xd:/^[A-Fa-f\d]+$/g,CODESET:'UTF-8',lower:'abcdefghijklmnopqrstuvwxyz',upper:'ABCDEFGHIJKLMNOPQRSTUVWXYZ'},'LC_TIME':{a:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],A:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],b:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],B:['January','February','March','April','May','June','July','August','September','October','November','December'],c:'%a %d %b %Y %r %Z',p:['AM','PM'],P:['am','pm'],r:'%I:%M:%S %p',x:'%m/%d/%Y',X:'%r',alt_digits:'',ERA:'',ERA_YEAR:'',ERA_D_T_FMT:'',ERA_D_FMT:'',ERA_T_FMT:''},'LC_MONETARY':{int_curr_symbol:'USD',currency_symbol:'$',mon_decimal_point:'.',mon_thousands_sep:',',mon_grouping:[3],positive_sign:'',negative_sign:'-',int_frac_digits:2,frac_digits:2,p_cs_precedes:1,p_sep_by_space:0,n_cs_precedes:1,n_sep_by_space:0,p_sign_posn:3,n_sign_posn:0},'LC_NUMERIC':{decimal_point:'.',thousands_sep:',',grouping:[3]},'LC_MESSAGES':{YESEXPR:'^[yY].*',NOEXPR:'^[nN].*',YESSTR:'',NOSTR:''},nplurals:_nplurals2a};phpjs.locales.en_US=_copy(phpjs.locales.en);phpjs.locales.en_US.LC_TIME.c='%a %d %b %Y %r %Z';phpjs.locales.en_US.LC_TIME.x='%D';phpjs.locales.en_US.LC_TIME.X='%r';phpjs.locales.en_US.LC_MONETARY.int_curr_symbol='USD ';phpjs.locales.en_US.LC_MONETARY.p_sign_posn=1;phpjs.locales.en_US.LC_MONETARY.n_sign_posn=1;phpjs.locales.en_US.LC_MONETARY.mon_grouping=[3,3];phpjs.locales.en_US.LC_NUMERIC.thousands_sep='';phpjs.locales.en_US.LC_NUMERIC.grouping=[];phpjs.locales.en_GB=_copy(phpjs.locales.en);phpjs.locales.en_GB.LC_TIME.r='%l:%M:%S %P %Z';phpjs.locales.en_AU=_copy(phpjs.locales.en_GB);phpjs.locales.C=_copy(phpjs.locales.en);phpjs.locales.C.LC_CTYPE.CODESET='ANSI_X3.4-1968';phpjs.locales.C.LC_MONETARY={int_curr_symbol:'',currency_symbol:'',mon_decimal_point:'',mon_thousands_sep:'',mon_grouping:[],p_cs_precedes:127,p_sep_by_space:127,n_cs_precedes:127,n_sep_by_space:127,p_sign_posn:127,n_sign_posn:127,positive_sign:'',negative_sign:'',int_frac_digits:127,frac_digits:127};phpjs.locales.C.LC_NUMERIC={decimal_point:'.',thousands_sep:'',grouping:[]};phpjs.locales.C.LC_TIME.c='%a %b %e %H:%M:%S %Y';phpjs.locales.C.LC_TIME.x='%m/%d/%y';phpjs.locales.C.LC_TIME.X='%H:%M:%S';phpjs.locales.C.LC_MESSAGES.YESEXPR='^[yY]';phpjs.locales.C.LC_MESSAGES.NOEXPR='^[nN]';phpjs.locales.fr=_copy(phpjs.locales.en);phpjs.locales.fr.nplurals=_nplurals2b;phpjs.locales.fr.LC_TIME.a=['dim','lun','mar','mer','jeu','ven','sam'];phpjs.locales.fr.LC_TIME.A=['dimanche','lundi','mardi','mercredi','jeudi','vendredi','samedi'];phpjs.locales.fr.LC_TIME.b=['jan','f\u00E9v','mar','avr','mai','jun','jui','ao\u00FB','sep','oct','nov','d\u00E9c'];phpjs.locales.fr.LC_TIME.B=['janvier','f\u00E9vrier','mars','avril','mai','juin','juillet','ao\u00FBt','septembre','octobre','novembre','d\u00E9cembre'];phpjs.locales.fr.LC_TIME.c='%a %d %b %Y %T %Z';phpjs.locales.fr.LC_TIME.p=['',''];phpjs.locales.fr.LC_TIME.P=['',''];phpjs.locales.fr.LC_TIME.x='%d.%m.%Y';phpjs.locales.fr.LC_TIME.X='%T';phpjs.locales.fr_CA=_copy(phpjs.locales.fr);phpjs.locales.fr_CA.LC_TIME.x='%Y-%m-%d';} if(!phpjs.locale){phpjs.locale='en_US';var NS_XHTML='http://www.w3.org/1999/xhtml';var NS_XML='http://www.w3.org/XML/1998/namespace';if(d.getElementsByTagNameNS&&d.getElementsByTagNameNS(NS_XHTML,'html')[0]){if(d.getElementsByTagNameNS(NS_XHTML,'html')[0].getAttributeNS&&d.getElementsByTagNameNS(NS_XHTML,'html')[0].getAttributeNS(NS_XML,'lang')){phpjs.locale=d.getElementsByTagName(NS_XHTML,'html')[0].getAttributeNS(NS_XML,'lang');}else if(d.getElementsByTagNameNS(NS_XHTML,'html')[0].lang){phpjs.locale=d.getElementsByTagNameNS(NS_XHTML,'html')[0].lang;}}else if(d.getElementsByTagName('html')[0]&&d.getElementsByTagName('html')[0].lang){phpjs.locale=d.getElementsByTagName('html')[0].lang;}} phpjs.locale=phpjs.locale.replace('-','_');if(!(phpjs.locale in phpjs.locales)){if(phpjs.locale.replace(/_[a-zA-Z]+$/,'')in phpjs.locales){phpjs.locale=phpjs.locale.replace(/_[a-zA-Z]+$/,'');}} if(!phpjs.localeCategories){phpjs.localeCategories={'LC_COLLATE':phpjs.locale,'LC_CTYPE':phpjs.locale,'LC_MONETARY':phpjs.locale,'LC_NUMERIC':phpjs.locale,'LC_TIME':phpjs.locale,'LC_MESSAGES':phpjs.locale};} if(locale===null||locale===''){locale=this.getenv(category)||this.getenv('LANG');}else if(locale instanceof Array){for(i=0;i1;r/=10){x=pad.toString()+x;} return x.toString();};var locale=phpjs.localeCategories.LC_TIME;var locales=phpjs.locales;var lc_time=locales[locale].LC_TIME;var _formats={a:function(d){return lc_time.a[d.getDay()];},A:function(d){return lc_time.A[d.getDay()];},b:function(d){return lc_time.b[d.getMonth()];},B:function(d){return lc_time.B[d.getMonth()];},C:function(d){return _xPad(parseInt(d.getFullYear()/100,10),0);},d:['getDate','0'],e:['getDate',' '],g:function(d){return _xPad(parseInt(this.G(d)/100,10),0);},G:function(d){var y=d.getFullYear();var V=parseInt(_formats.V(d),10);var W=parseInt(_formats.W(d),10);if(W>V){y++;} else if(W===0&&V>=52){y--;} return y;},H:['getHours','0'],I:function(d){var I=d.getHours()%12;return _xPad(I===0?12:I,0);},j:function(d){var ms=d-new Date(''+d.getFullYear()+'/1/1 GMT');ms+=d.getTimezoneOffset()*60000;var doy=parseInt(ms/60000/60/24,10)+1;return _xPad(doy,0,100);},k:['getHours','0'],l:function(d){var l=d.getHours()%12;return _xPad(l===0?12:l,' ');},m:function(d){return _xPad(d.getMonth()+1,0);},M:['getMinutes','0'],p:function(d){return lc_time.p[d.getHours()>=12?1:0];},P:function(d){return lc_time.P[d.getHours()>=12?1:0];},s:function(d){return Date.parse(d)/1000;},S:['getSeconds','0'],u:function(d){var dow=d.getDay();return((dow===0)?7:dow);},U:function(d){var doy=parseInt(_formats.j(d),10);var rdow=6-d.getDay();var woy=parseInt((doy+rdow)/7,10);return _xPad(woy,0);},V:function(d){var woy=parseInt(_formats.W(d),10);var dow1_1=(new Date(''+d.getFullYear()+'/1/1')).getDay();var idow=woy+(dow1_1>4||dow1_1<=1?0:1);if(idow===53&&(new Date(''+d.getFullYear()+'/12/31')).getDay()<4){idow=1;} else if(idow===0){idow=_formats.V(new Date(''+(d.getFullYear()-1)+'/12/31'));} return _xPad(idow,0);},w:'getDay',W:function(d){var doy=parseInt(_formats.j(d),10);var rdow=7-_formats.u(d);var woy=parseInt((doy+rdow)/7,10);return _xPad(woy,0,10);},y:function(d){return _xPad(d.getFullYear()%100,0);},Y:'getFullYear',z:function(d){var o=d.getTimezoneOffset();var H=_xPad(parseInt(Math.abs(o/60),10),0);var M=_xPad(o%60,0);return(o>0?'-':'+')+H+M;},Z:function(d){return d.toString().replace(/^.*\(([^)]+)\)$/,'$1');},'%':function(d){return'%';}};var _date=((typeof(timestamp)=='undefined')?new Date():(typeof(timestamp)=='object')?new Date(timestamp):new Date(timestamp*1000));var _aggregates={c:'locale',D:'%m/%d/%y',F:'%y-%m-%d',h:'%b',n:'\n',r:'locale',R:'%H:%M',t:'\t',T:'%H:%M:%S',x:'locale',X:'locale'};while(fmt.match(/%[cDFhnrRtTxX]/)){fmt=fmt.replace(/%([cDFhnrRtTxX])/g,function(m0,m1){var f=_aggregates[m1];return(f==='locale'?lc_time[m1]:f);});} var str=fmt.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,function(m0,m1){var f=_formats[m1];if(typeof f==='string'){return _date[f]();}else if(typeof f==='function'){return f(_date);}else if(typeof f==='object'&&typeof(f[0])==='string'){return _xPad(_date[f[0]](),f[1]);}else{return m1;}});return str;}