AndrewHaxalot

Untitled

Mar 29th, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. var b_u=0;
  4. var maintenance=false;
  5. var ua = window.navigator.userAgent.toLowerCase();
  6. var is_chrome_firefox = document.location.protocol === 'chrome:' && document.location.host === 'mega';
  7. var page = document.location.hash;
  8.  
  9. function isMobile()
  10. {
  11.     if (is_chrome_firefox) return false;
  12.     mobile = ['iphone','ipad','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile','mobile safari','bb10; touch'];
  13.     for (var i in mobile) if (ua.indexOf(mobile[i]) > 0) return true;
  14.     return false;
  15. }
  16.  
  17.  
  18. function geoIP()
  19. {
  20.     return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent('geoip').replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || false;
  21. }
  22.  
  23.  
  24. function geoStaticpath(eu)
  25. {
  26.     if (!eu && !sessionStorage.skipcdn && geoIP() && 'FR DE NL ES PT DK CH IT UK GB NO SE FI PL CZ SK AT GR RO HU IE TR VA MC SM LI AD JE GG UA BG LT LV EE AX IS MA DZ LY TN EG RU BY HR SI AL ME RS KO EU FO CY IL LB SY SA JO IQ BA CV PS EH GI GL IM LU MK SJ BF BI BJ BW CF CG CM DJ ER ET GA GH GM GN GN GW KE KM LR LS MG ZA AE ML MR MT MU MV MW MZ NA NE QA RW SD SS SL SZ TD TG TZ UG YE ZA ZM ZR ZW'.indexOf(geoIP()) == -1) return 'https://g.cdn1.mega.co.nz/';
  27.     else return 'https://eu.static.mega.co.nz/';
  28. }
  29.  
  30.  
  31. if (ua.indexOf('chrome') > -1 && ua.indexOf('mobile') == -1 && parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10) < 22) b_u = 1;
  32. else if (ua.indexOf('firefox') > -1 && typeof DataView == 'undefined') b_u = 1;
  33. else if (ua.indexOf('opera') > -1 && typeof window.webkitRequestFileSystem == 'undefined') b_u = 1;
  34. var myURL = window.URL || window.webkitURL;
  35. if (!myURL) b_u=1;
  36.  
  37. var firefoxv = '2.0.0';
  38.  
  39. if (b_u) document.location = 'update.html';
  40.  
  41. try
  42. {
  43.     if (is_chrome_firefox)
  44.     {
  45.         var Cc = Components.classes, Ci = Components.interfaces, Cu = Components.utils;
  46.  
  47.         Cu['import']("resource://gre/modules/Services.jsm");
  48.         Cu['import']("resource://gre/modules/NetUtil.jsm");
  49.  
  50.         (function(global) {
  51.             global.loadSubScript = function(file,scope) {
  52.                 Services.scriptloader.loadSubScript(file,scope||global);
  53.             };
  54.         })(this);
  55.  
  56.         try {
  57.             var mozBrowserID =
  58.             [   Services.appinfo.vendor,
  59.                 Services.appinfo.name,
  60.                 Services.appinfo.platformVersion,
  61.                 Services.appinfo.platformBuildID,
  62.                 Services.appinfo.OS,
  63.                 Services.appinfo.XPCOMABI].join(" ");
  64.  
  65.             loadSubScript('chrome://mega/content/strg.js');
  66.  
  67.             if(!(localStorage instanceof Ci.nsIDOMStorage)) {
  68.                 throw new Error('Initialization failed.');
  69.             }
  70.         } catch(e) {
  71.             alert('Error setting up DOM Storage instance:\n\n'
  72.                 + e + '\n\n' + mozBrowserID);
  73.  
  74.             throw new Error("FxEx");
  75.         }
  76.     }
  77.     if (typeof localStorage == 'undefined')
  78.     {
  79.       b_u = 1;
  80.       var staticpath = 'https://eu.static.mega.co.nz/';
  81.     }
  82.     else
  83.     {
  84.         if (localStorage.dd) localStorage.staticpath = location.protocol + "//" + location.host + location.pathname.replace(/[^/]+$/,'');
  85.         var staticpath = localStorage.staticpath || geoStaticpath();
  86.         var apipath = localStorage.apipath || 'https://eu.api.mega.co.nz/';
  87.         var contenterror = 0;
  88.         var nocontentcheck = localStorage.dd;
  89.     }
  90. }
  91. catch(e)
  92. {
  93.     if(e.message != 'FxEx')
  94.     {
  95.         alert('Your browser does not allow data to be written. Please make sure you use default browser settings.');
  96.     }
  97.     b_u = 1;
  98.     var staticpath = 'https://eu.static.mega.co.nz/';
  99. }
  100. var bootstaticpath = staticpath;
  101. var urlrootfile = '';
  102.  
  103. if (document.location.href.substr(0,19) == 'chrome-extension://')
  104. {
  105.     bootstaticpath = chrome.extension.getURL("mega/");
  106.     urlrootfile = 'mega/secure.html';
  107. }
  108.  
  109. if (is_chrome_firefox)
  110. {
  111.     bootstaticpath = 'chrome://mega/content/';
  112.     urlrootfile = 'secure.html';
  113.     nocontentcheck=true;
  114.     staticpath = 'https://eu.static.mega.co.nz/';
  115.     if(!b_u) try
  116.     {
  117.         loadSubScript(bootstaticpath + 'fileapi.js');
  118.     }
  119.     catch(e)
  120.     {
  121.         b_u = 1;
  122.         Cu.reportError(e);
  123.         alert('Unable to initialize core functionality:\n\n' + e + '\n\n' + mozBrowserID);
  124.     }
  125. }
  126.  
  127. window.URL = window.URL || window.webkitURL;
  128.  
  129. var ln ={}; ln.en = 'English'; ln.cn = '简体中文';  ln.ct = '中文繁體'; ln.ru = 'Pусский'; ln.es = 'Español'; ln.fr = 'Français'; ln.de = 'Deutsch'; ln.it = 'Italiano'; ln.br = 'Português Brasil'; ln.mi = 'Māori'; ln.vn = 'Tiếng Việt'; ln.nl = 'Nederlands'; ln.kr = '한국어';   ln.ar = 'العربية'; ln.jp = '日本語'; ln.pt = 'Português'; ln.he = 'עברית'; ln.pl = 'Polski'; ln.ca = 'Català'; ln.eu = 'Euskara'; ln.sk = 'Slovenský'; ln.af = 'Afrikaans'; ln.cz = 'Čeština'; ln.ro = 'Română'; ln.fi = 'Suomi'; ln.no = 'Norsk'; ln.se = 'Svenska'; ln.bs = 'Bosanski'; ln.hu = 'Magyar'; ln.sr = 'српски'; ln.dk = 'Dansk'; ln.sl = 'Slovenščina'; ln.tr = 'Türkçe';  ln.id = 'Bahasa Indonesia';  ln.hr = 'Hrvatski';  ln.el = 'ελληνικά'; ln.uk = 'Українська'; ln.gl = 'Galego'; ln.sr = 'српски'; ln.lt = 'Lietuvos'; ln.th = 'ภาษาไทย'; ln.lv = 'Latviešu'; ln.bg = 'български';  ln.mk = 'македонски'; ln.hi = 'हिंदी'; ln.fa = 'فارسی '; ln.ee = 'Eesti'; ln.ms = 'Bahasa Malaysia'; ln.cy = 'Cymraeg'; ln.be = 'Breton'; ln.tl = 'Tagalog'; ln.ka = 'ქართული';
  130.  
  131. var ln2 ={}; ln2.en = 'English'; ln2.cn = 'Chinese';  ln2.ct = 'Traditional Chinese'; ln2.ru = 'Russian'; ln2.es = 'Spanish'; ln2.fr = 'French'; ln2.de = 'German'; ln2.it = 'Italian'; ln2.br = 'Brazilian Portuguese'; ln2.mi = 'Maori'; ln2.vn = 'Vietnamese'; ln2.nl = 'Dutch'; ln2.kr = 'Korean';   ln2.ar = 'Arabic'; ln2.jp = 'Japanese'; ln2.pt = 'Portuguese'; ln2.he = 'Hebrew'; ln2.pl = 'Polish'; ln2.ca = 'Catalan'; ln2.eu = 'Basque'; ln2.sk = 'Slovak'; ln2.af = 'Afrikaans'; ln2.cz = 'Czech'; ln2.ro = 'Romanian'; ln2.fi = 'Finnish'; ln2.no = 'Norwegian'; ln2.se = 'Swedish'; ln2.bs = 'Bosnian'; ln2.hu = 'Hungarian'; ln2.sr = 'Serbian'; ln2.dk = 'Danish'; ln2.sl = 'Slovenian'; ln2.tr = 'Turkish'; ln2.id = 'Indonesian'; ln2.hr = 'Croatian'; ln2.el = 'Greek'; ln2.uk = 'Ukrainian'; ln2.gl = 'Galician'; ln2.sr = 'Serbian'; ln2.lt = 'Lithuanian'; ln2.th = 'Thai'; ln2.lv = 'Latvian'; ln2.bg = 'Bulgarian'; ln2.mk = 'Macedonian'; ln2.hi = 'Hindi'; ln2.fa = 'Farsi'; ln2.ee = 'Estonian';  ln2.ms = 'Malaysian'; ln2.cy = 'Welsh'; ln2.be = 'Breton'; ln2.tl = 'Tagalog'; ln2.ka = 'Georgian';
  132.  
  133.  
  134. var sjcl_sha_js = 'var sjcl_sha={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};if(typeof module!="undefined"&&module.exports)module.exports=sjcl_sha;sjcl_sha.bitArray={bitSlice:function(a,b,c){a=sjcl_sha.bitArray.g(a.slice(b/32),32-(b&31)).slice(1);return c===undefined?a:sjcl_sha.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(a.length===0||b.length===0)return a.concat(b);var c=a[a.length-1],d=sjcl_sha.bitArray.getPartial(c);return d===32?a.concat(b):sjcl_sha.bitArray.g(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;if(b===0)return 0;return(b-1)*32+sjcl_sha.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(a.length*32<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;b&=31;if(c>0&&b)a[c-1]=sjcl_sha.bitArray.partial(b,a[c-1]&2147483648>>b-1,1);return a},partial:function(a,b,c){if(a===32)return b;return(c?b|0:b<<32-a)+a*0x10000000000},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl_sha.bitArray.bitLength(a)!==sjcl_sha.bitArray.bitLength(b))return false;var c=0,d;for(d=0;d<a.length;d++)c|=a[d]^b[d];return c===0},g:function(a,b,c,d){var e;e=0;if(d===undefined)d=[];for(;b>=32;b-=32){d.push(c);c=0}if(b===0)return d.concat(a);for(e=0;e<a.length;e++){d.push(c|a[e]>>>b);c=a[e]<<32-b}e=a.length?a[a.length-1]:0;a=sjcl_sha.bitArray.getPartial(e);d.push(sjcl_sha.bitArray.partial(b+a&31,b+a>32?c:d.pop(),1));return d},i:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}};sjcl_sha.codec.utf8String={fromBits:function(a){var b="",c=sjcl_sha.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++){if((d&3)===0)e=a[d/4];b+=String.fromCharCode(e>>>24);e<<=8}return decodeURIComponent(escape(b))},toBits:function(a){var b=[],c,d=0,e;for(c=0;c<a.length;c++){e=a.charCodeAt(c);if(e&-256)return false;d=d<<8|e;if((c&3)===3){b.push(d);d=0}}c&3&&b.push(sjcl_sha.bitArray.partial(8*(c&3),d));return b}};sjcl_sha.hash.sha256=function(a){this.d[0]||this.h();if(a){this.c=a.c.slice(0);this.b=a.b.slice(0);this.a=a.a}else this.reset()};sjcl_sha.hash.sha256.hash=function(a){return(new sjcl_sha.hash.sha256).update(a).finalize()};sjcl_sha.hash.sha256.prototype={blockSize:512,reset:function(){this.c=this.f.slice(0);this.b=[];this.a=0;return this},update:function(a){if(typeof a==="string"&&!(a=sjcl_sha.codec.utf8String.toBits(a)))return[];var b,c=this.b=sjcl_sha.bitArray.concat(this.b,a);b=this.a;a=this.a=b+sjcl_sha.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)this.e(c.splice(0,16));return this},finalize:function(){var a,b=this.b,c=this.c;b=sjcl_sha.bitArray.concat(b,[sjcl_sha.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.a/4294967296));for(b.push(this.a|0);b.length;)this.e(b.splice(0,16));this.reset();return c},f:[],d:[],h:function(){function a(e){return(e-Math.floor(e))*0x100000000|0}var b=0,c=2,d;a:for(;b<64;c++){for(d=2;d*d<=c;d++)if(c%d===0)continue a;if(b<8)this.f[b]=a(Math.pow(c,0.5));this.d[b]=a(Math.pow(c,1/3));b++}},e:function(a){var b,c,d=a.slice(0),e=this.c,n=this.d,l=e[0],f=e[1],h=e[2],j=e[3],g=e[4],k=e[5],i=e[6],m=e[7];for(a=0;a<64;a++){if(a<16)b=d[a];else{b=d[a+1&15];c=d[a+14&15];b=d[a&15]=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+d[a&15]+d[a+9&15]|0}b=b+m+(g>>>6^g>>>11^g>>>25^g<<26^g<<21^g<<7)+(i^g&(k^i))+n[a];m=i;i=k;k=g;g=j+b|0;j=h;h=f;f=l;l=b+(f&h^j&(f^h))+(f>>>2^f>>>13^f>>>22^f<<30^f<<19^f<<10)|0}e[0]=e[0]+l|0;e[1]=e[1]+f|0;e[2]=e[2]+h|0;e[3]=e[3]+j|0;e[4]=e[4]+g|0;e[5]=e[5]+k|0;e[6]=e[6]+i|0;e[7]=e[7]+m|0}}; function sha256(d) { h = new sjcl_sha.hash.sha256(); for (var i = 0; i < d.length; i += 131072) h = h.update(d.substr(i,131072)); return h.finalize(); }';
  135.  
  136. function evalscript(text)
  137. {
  138.     var script = document.createElement('script');
  139.     script.type = "text/javascript";
  140.     document.getElementsByTagName('head')[0].appendChild(script);
  141.     script.text = text;
  142. }
  143.  
  144. function evalscript_url(jarray)
  145. {
  146.     try
  147.     {
  148.         var blob = new Blob(jarray, { type: "text/javascript" });
  149.     }
  150.     catch(e)
  151.     {
  152.         window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
  153.         var bb = new BlobBuilder();
  154.         for (var i in jarray) bb.append(jarray[i]);
  155.         var blob = bb.getBlob('text/javascript');
  156.     }
  157.     var script = document.createElement('script');
  158.     script.type = "text/javascript";
  159.     document.getElementsByTagName('head')[0].appendChild(script);
  160.     var url = window.URL.createObjectURL(blob);
  161.     script.src = url;
  162.     return url;
  163. }
  164.  
  165. if (!nocontentcheck)
  166. {
  167.     if (window.URL) evalscript_url([sjcl_sha_js]);
  168.     else evalscript(sjcl_sha_js);
  169. }
  170.  
  171. var sh = [];
  172. var sh1 = [];
  173. var lv = [];
  174. sh1['lang/af_15.json'] = [398647591,1257062769,-647520083,1797499428,199670487,-851393907,-667337516,287975523];
  175. sh1['lang/ar_16.json'] = [1658413726,208626278,2095883684,1980041096,-755711151,694032665,1725000177,-1878583557];
  176. sh1['lang/bg_15.json'] = [-1599711385,-1535028444,2123007982,545682480,1904565878,-145593555,-2063739139,-680152801];
  177. sh1['lang/br_18.json'] = [-1184369680,-2144412124,2004869375,-315790054,-292432250,-1937136873,-696663339,-121429027];
  178. sh1['lang/bs_15.json'] = [922333638,-1837521920,-616581891,-608096854,832100679,-688851383,-298694091,36543292];
  179. sh1['lang/ca_18.json'] = [-1783525976,88179462,-1140683182,-1100290103,-2009601017,-518135290,-392903643,-121946319];
  180. sh1['lang/cn_16.json'] = [275447199,-1956800057,-1868233330,396243168,1193703888,1139484875,-434728055,-98257921];
  181. sh1['lang/ct_17.json'] = [420386297,-2096135634,640087558,177911421,439345669,-325541608,-703125583,-899279075];
  182. sh1['lang/cz_20.json'] = [-986583486,-645974949,-1197023017,1071468295,1266259580,-343546676,1080587345,-658347783];
  183. sh1['lang/de_17.json'] = [-1357778360,18510411,1577653486,1122184823,-1564175396,-627650516,-1362724228,-1637580366];
  184. sh1['lang/dk_16.json'] = [1889280544,-1410532923,-95872528,-1596583347,1150885812,704111450,1084629601,-568081429];
  185. sh1['lang/el_17.json'] = [1344464454,-2071555758,496783257,-1917450767,772634483,1562023321,1463837855,-568177609];
  186. sh1['lang/en_15.json'] = [1906569249,-272110279,-1952670369,-1401332988,-1759334859,807930837,1254164647,-1162246921];
  187. sh1['lang/es_19.json'] = [1883951293,1252277476,442575954,1512937804,463793543,-1370475134,-665278330,-1214913650];
  188. sh1['lang/et_6.json'] = [-1386253430,-1815591574,-2027271927,1196259179,424175306,-391563292,1532984108,-1592187965];
  189. sh1['lang/eu_16.json'] = [-1076838060,1022453572,863451897,395472292,-1974829030,733019840,-1642174100,-440041190];
  190. sh1['lang/fi_18.json'] = [-1966183541,-1513976511,-1455020394,-1943686680,2106167024,854069222,-1289019997,-2033187111];
  191. sh1['lang/fr_20.json'] = [-189341050,-157264573,-869775150,-697798530,-623897463,-140213966,-826091486,-1756370087];
  192. sh1['lang/gl_17.json'] = [11209635,1431048666,-126455318,-919945127,1910508967,-662232691,-1230504675,76611579];
  193. sh1['lang/he_16.json'] = [-973333270,1991721489,-1346226441,-1493607817,907964573,1118840813,1230667550,1185217362];
  194. sh1['lang/hr_18.json'] = [-1209585047,699282343,314453387,1325934353,1946590615,1625091793,1105368842,813426208];
  195. sh1['lang/hu_18.json'] = [-1700626934,-535703554,124179710,-1267784336,1639052581,1156463416,-829027310,-1532289683];
  196. sh1['lang/id_17.json'] = [-125847946,-1709422006,-843975350,316163388,-573754118,437892570,1530524820,483327070];
  197. sh1['lang/it_19.json'] = [-964842998,1022607087,2119409585,-1790102238,393149684,1043028139,-1261226872,-2101772889];
  198. sh1['lang/jp_18.json'] = [1019573633,1524218793,1777800410,354416213,-1091115119,-208744075,551899723,1912423032];
  199. sh1['lang/kr_19.json'] = [1971531875,-1636034925,-349809839,1399973920,614643912,1703652605,2040246822,-437736464];
  200. sh1['lang/lt_15.json'] = [-208841720,48632809,-2086385450,-1354207086,1407176173,-642084566,215023362,2122863530];
  201. sh1['lang/lv_19.json'] = [-1511132750,-1297218080,-917894915,-1414097812,1685066731,185145351,1503519084,248150356];
  202. sh1['lang/mi_17.json'] = [-1986721988,-1972656932,-186773186,-1529601464,460828380,1473395445,-812777301,926710166];
  203. sh1['lang/nl_17.json'] = [-1722885372,1446730289,-2049705913,-460035946,1235224338,-364111592,-529274065,1731204315];
  204. sh1['lang/no_18.json'] = [-704890463,1739404984,-2013332790,1516157536,-1556792543,-1979953435,759097270,1475820392];
  205. sh1['lang/pl_19.json'] = [1260606713,-817912484,942623457,-2021304928,1079553800,-226984482,992766151,835945420];
  206. sh1['lang/pt_16.json'] = [145351154,-1784672368,625396498,1140733372,369498547,-507319711,-1559998681,-1788007343];
  207. sh1['lang/ro_19.json'] = [256018795,1237570998,-1553703011,1273518251,-1379955771,196047626,649858290,-149258928];
  208. sh1['lang/ru_17.json'] = [2110057097,-403199232,1278813363,1911136047,1778485326,-1692319055,1416274790,-729167956];
  209. sh1['lang/se_17.json'] = [-555567794,-206807207,-648538753,1715844536,2002880529,1611810063,-447696854,-272798823];
  210. sh1['lang/sk_18.json'] = [-567072757,1334999957,-715198900,-1406569714,-433278,-1295508328,175631372,-460884573];
  211. sh1['lang/sl_17.json'] = [-1272445506,-120792781,1777023280,1276534219,216676272,404489647,-1910217775,-888167781];
  212. sh1['lang/sq_7.json'] = [-1849239858,287738873,794189580,-1784508224,1291353269,-3390521,167038675,456939219];
  213. sh1['lang/sr_17.json'] = [-1348364706,-1322805792,1981348335,-1550460793,-157123344,1649360104,2114134033,-886068699];
  214. sh1['lang/th_16.json'] = [2099423252,41940716,-314895116,-610060917,-183775799,-1311842404,881371190,266874602];
  215. sh1['lang/tr_14.json'] = [-762116241,-953075049,-2065820141,1561458115,499551417,-38789982,1386087229,310466782];
  216. sh1['lang/uk_16.json'] = [-487566202,-605845422,-2134474496,541981377,-2110757446,-429098012,460347280,-169055298];
  217. sh1['lang/vn_17.json'] = [1482220387,-341191428,1283579041,-454528243,1027091872,-1263951835,211198168,1663642225];
  218. sh1['js/crypto_30.js'] = [1039300274,-501101102,-107828047,115668202,-1390091670,-1627715078,-629722940,-1726951455];
  219. sh1['js/hex_1.js'] = [-536915967,1050992997,-349767130,933847197,-1115174222,701434549,2060891637,583948869];
  220. sh1['js/functions_11.js'] = [1838134993,-1030201856,-637756494,-1945660026,-944127547,1753683419,1221777074,-1420723402];
  221. sh1['sjcl_1.js'] = [-171772505,-264193555,357626960,-1993441797,930271978,2002120912,114344546,1757807051];
  222. sh1['js/rsa_1.js'] = [2001167291,-526423915,1610203002,735871105,-288977147,281057591,529538147,-1392450329];
  223. sh1['js/keygen_2.js'] = [-1349397697,309820851,-1883828537,-2108460985,1844071992,-1092911935,-306880641,-393178596];
  224. sh1['js/mouse_3.js'] = [-130192215,-1927913515,120340524,-965464529,2127430753,-1435216593,-1902893397,1666143644];
  225. sh1['js/jquery-min-1_1.8_1.1_1.js'] = [325457984,-43550062,2044894907,922904144,-1468381584,445981752,-632967819,-1006647006];
  226. sh1['js/jquery-ui_1.js'] = [1462813645,450465327,-1041974747,-1180593380,866136131,842776979,1980446596,73731112];
  227. sh1['js/base64_1.js'] = [1377965723,-820855789,-623852925,-619566876,-131428866,-1938828440,320381032,94642301];
  228. sh1['js/filedrag_5.js'] = [2134753773,1716818571,-62001464,-1016510821,2113115617,184964464,89874642,-1121907724];
  229. sh1['js/jquery_1.mousewheel_1.js'] = [419443382,498952370,-461812839,-1430788648,-1729264621,-733690579,-26655758,-1219979266];
  230. sh1['js/jquery_1.jscrollpane_1.min_1.js'] = [583598005,462966044,1887098753,-1983543464,-242256649,-1811511069,-672958697,539968991];
  231. sh1['js/mDB_9.js'] = [-794211485,1003223232,-1245775582,459324847,245553629,369985137,726807708,-68956450];
  232. sh1['js/cleartemp_3.js'] = [776052259,-1660988694,-1199544564,-2002741443,-766764565,-138106928,819138998,-1816262256];
  233. sh1['js/download_26.js'] = [2010167226,1579744164,-579253750,1136249046,755600324,1693832419,-447302663,-334140437];
  234. sh1['js/upload_17.js'] = [1315210678,562783983,-979442341,1327890685,909535055,-2092371326,-871767833,605969397];
  235. sh1['js/thumbnail_9.js'] = [1457911270,388408527,1686799463,2079032489,1742940957,-448523401,1053725130,-1170436857];
  236. sh1['js/exif_1.js'] = [2127927006,1524719511,1400765672,1465825710,200238308,-1521506870,-1440098631,1093047888];
  237. sh1['js/megapix_1.js'] = [-2074411783,2020004429,1567898609,1572790112,1765406939,1129455141,-1408675606,376735130];
  238. sh1['js/user_6.js'] = [849630806,-143491229,1263851802,1908588791,1432855929,-1250571221,1884315885,-12599600];
  239. sh1['js/mega_48.js'] = [1878879764,388213386,892918444,-1972067868,835443609,-972945265,-916135970,830168374];
  240. sh1['js/fm_51.js'] = [1222805118,1856282227,116699750,1395635946,-1394497499,-256284098,-1966461036,-1469074577];
  241. sh1['js/filetypes_3.js'] = [-1620017073,-1104767013,-798616390,1927803772,162366706,653392871,531454710,-1549014690];
  242. sh1['index_27.js'] = [-1213587124,1700942061,950279919,1671871313,1325781070,429882555,1201213236,1417429319];
  243. sh1['html/start_2.html'] = [-1240172984,-90991953,-733219269,-667054430,971855224,1645204596,95143717,1646098883];
  244. sh1['html/megainfo_1.html'] = [1283161678,-378542460,-1112156493,-1449961420,-1938669644,1416380795,-1948258844,296655369];
  245. sh1['html/js/start_2.js'] = [-592492848,375152620,-791072191,910951958,-436683953,-391896453,723058460,-1878099312];
  246. sh1['html/bottom2_3.html'] = [-1001287451,1610995174,-2010425145,457233808,-1308275053,-1995904954,-65392988,-720221557];
  247. sh1['html/key_1.html'] = [2073871108,-1170173593,-1681422239,-1612935810,292954242,1935183806,1529842427,-1432697760];
  248. sh1['html/js/key_1.js'] = [-189079361,-607572500,-1700213714,-1617472324,978540679,412066146,-1558174918,-1753270867];
  249. sh1['html/pro_2.html'] = [854823061,-1460397308,-1096249573,525392674,1328205941,-828110322,-1229861903,-2047293783];
  250. sh1['html/js/pro_6.js'] = [1135624048,1488536828,-734028145,-827907417,1203731040,-1914544004,-1620140440,-1077223210];
  251. sh1['html/login_1.html'] = [-323140112,2000331877,549652845,1191881735,-1414747763,-1634455397,-2027137434,192521104];
  252. sh1['html/js/login_1.js'] = [705215750,1492569094,316818685,1730603368,-1401228850,1022674831,1488664594,-276404406];
  253. sh1['html/fm_16.html'] = [-305304269,1188137876,-1981442323,478508377,-857482825,1370788486,1268909073,1824669008];
  254. sh1['html/top_7.html'] = [1103910714,-27781382,1094014997,1928144661,-1109318813,1062852105,-1899835157,-1508827806];
  255. sh1['js/notifications_9.js'] = [45850416,-1507274091,-1456405768,-1900615231,1138261385,337581248,-1644257329,1456502084];
  256. sh1['js/json_1.js'] = [260740289,1366618322,-425421514,1426645344,1815060041,-1445234843,-570158005,-1264018126];
  257. sh1['css/style_38.css'] = [1562878657,-116327202,-1299770145,-1296178097,-2121349490,50288650,-1531300901,983224576];
  258. sh1['js/avatar_2.js'] = [750148219,282183943,-583076708,810613429,1535288862,295436910,-1599455014,-411830628];
  259. sh1['js/countries_2.js'] = [1973408522,-1885123014,1906882822,1317148523,-429735077,79175436,-407854214,1471385004];
  260. sh1['html/dialogs_13.html'] = [-1899352898,-878046631,1763847289,-1500265314,-937116253,-508910067,716324602,-1666061772];
  261. sh1['html/transferwidget_1.html'] = [-216975656,-1571397997,-554252428,-1729669574,-889100419,-1745475319,-1947087299,913285129];
  262. sh1['js/checkboxes_1.js'] = [-195352914,863026783,-2091572807,-1241952814,1783587100,-1585752649,789053172,-1960773071];
  263. sh1['js/zip_1.js'] = [-1618111477,-1761114523,-343688170,1955237114,-58685565,-323072713,-1209908562,1215236581];
  264. sh1['html/about_3.html'] = [-1517965332,-653983972,-502825562,-476560258,-1245468056,-1900744413,-1523410324,1453043426];
  265. sh1['html/blog_1.html'] = [1453324238,23247104,-274962730,2125218305,-1007634292,-1966696579,1809666485,2006232635];
  266. sh1['html/js/blog_12.js'] = [-1379621265,151131459,485785738,1396576031,-1479519138,-1096146931,1697648109,-1325224146];
  267. sh1['html/blogarticle_1.html'] = [514255285,-305518940,-736361270,-1089096585,807920439,-1691607347,-1360211852,331878126];
  268. sh1['html/js/blogarticle_1.js'] = [1749908144,268653485,1111265580,-1918305290,-1989480138,-275610585,-258647333,-1927257643];
  269. sh1['html/register_1.html'] = [-1153226879,789196380,513797998,-1455035350,-1267405269,-1114290361,-510053649,1808415441];
  270. sh1['html/js/register_6.js'] = [1110836736,268522552,-1578258078,-2009895103,-1281747760,-1657126921,924478393,147213787];
  271. sh1['html/android_35.html'] = [-474954686,-1728308204,-1694763832,-1720731356,665731556,1687917388,-1533699813,2018687061];
  272. sh1['html/forgotpassword_4.html'] = [-474954686,-1728308204,-1694763832,-1720731356,665731556,1687917388,-1533699813,2018687061];
  273. sh1['html/js/forgotpassword_4.js'] = [-474954686,-1728308204,-1694763832,-1720731356,665731556,1687917388,-1533699813,2018687061];
  274. sh1['html/resellers_2.html'] = [-999964763,101863191,1332861546,967598187,-1759566181,1424163260,895328359,-1115153998];
  275. sh1['html/download_15.html'] = [1753425207,-1594389607,1863229046,-2012981748,-237805523,1507178346,-1861868637,-183004043];
  276. sh1['html/js/download_17.js'] = [-697244832,-1071559529,333695490,1880494257,154181756,1859606043,-189316387,2035702558];
  277. sh1['html/copyright_1.html'] = [-1356115298,204388844,1433799516,1808859064,1547511974,1218829359,791662145,330338831];
  278. sh1['html/copyrightnotice_2.html'] = [2145667044,-154231214,2034877807,-1128384234,-1416518879,-436127618,1781667026,1515564098];
  279. sh1['html/js/copyrightnotice_2.js'] = [1978066529,1099090367,438577069,114535868,870324926,112812650,-1579419217,-1759310418];
  280. sh1['html/privacy_2.html'] = [1897378284,1008109560,2108490944,1697170950,-890017675,-118647761,-1146992302,-2101151802];
  281. sh1['html/terms_3.html'] = [138857988,793906324,-357864766,-2083639901,-1488532351,382214150,592075324,9570926];
  282. sh1['html/credits_2.html'] = [-93209830,1787816001,1947296144,-993677008,-864037760,265442585,717054271,1195813928];
  283. sh1['html/takedown_15.html'] = [-726561667,-1926213916,848899878,63779943,611610501,-320217973,1122395462,461715169];
  284. sh1['html/dev_2.html'] = [790850452,1611377865,-120368206,887377572,-945564514,1089293525,1862223895,1056654491];
  285. sh1['js/arkanoid_1.js'] = [1142088038,-111380889,1851124971,-135552288,979716897,-676254465,-315264165,-6027613];
  286. sh1['html/js/dev_2.js'] = [1183517663,-1026524563,-545378254,-1522366779,1526308364,337847807,-516970990,-1229370896];
  287. sh1['html/sdkterms_2.html'] = [115086262,2084811853,-108390712,-709175966,1912996738,-2092263968,715676630,-133038981];
  288. sh1['html/help_2.html'] = [2066204390,-413739664,1589428645,1824384517,965340062,1865788082,1539272539,1450051920];
  289. sh1['html/js/help_10.js'] = [-1537268597,478808004,-1678021008,-1595305423,-1789709861,1227246170,-257092792,985559990];
  290. sh1['html/firefox_1.html'] = [1269940382,-2014144920,485363891,-726217767,-1040783327,1453164378,-554814229,1924716537];
  291. sh1['html/sync_4.html'] = [-1991120458,893995605,251961957,-1459601929,701149386,-1930067392,-2123978073,-1256906658];
  292. sh1['html/mobile_5.html'] = [-839546591,-901512771,-1722331526,1892895769,-2120545970,1853479890,1773572861,120575216];
  293. sh1['html/affiliates_1.html'] = [336401600,1693520652,1735292706,-1209900216,563312832,-1571723333,-1431169166,1080433821];
  294. sh1['html/js/affiliate_1.js'] = [-2083445994,-813363093,1773568937,-2058604050,-2131904228,1402769154,442423551,-1045573347];
  295. sh1['html/affiliateterms_2.html'] = [-336111994,-363804782,-1893348109,-1568998179,-1731255350,-1052779666,610534760,-12000880];
  296. sh1['html/affiliatesignup_1.html'] = [734026302,197767156,1436683326,449956816,-1415964264,-1601297598,1776887966,-1299476598];
  297. sh1['html/js/affiliatesignup_2.js'] = [807679721,315974434,850198292,1674715703,1463540950,-220117206,1365358182,-1931413985];
  298. sh1['html/affiliatemember_1.html'] = [1601808811,313776287,1596829015,1134644154,1269202501,-1157161540,-663590146,-1738922501];
  299. sh1['html/js/affiliatemember_2.js'] = [-1203628785,1866158285,-1640419606,307428798,1256446057,218724150,1055559639,1303573948];
  300. sh1['html/contact_1.html'] = [-1382742274,1300319458,206728859,-1170995210,1198771720,-445698841,1486152712,830617221];
  301. sh1['html/privacycompany_1.html'] = [1175830790,-1413085504,1468710126,-2063138483,-1243958029,1190665830,-910909719,-1573573964];
  302. sh1['html/resellerapp_1.html'] = [-1289875384,1112459579,493352325,1495092512,1830359644,920857722,-260020038,-694209961];
  303. sh1['html/js/resellerapp_1.js'] = [690390514,1402692817,-1160749280,1578639149,-1734342779,-1387045497,-755540821,-1791697279];
  304. sh1['html/resellerintro_1.html'] = [-1439407084,313440834,2041007158,-443877117,1071363056,-2021618866,1989604434,-1138587370];
  305. sh1['html/chrome_4.html'] = [-1571185206,-1733835191,1312510880,-1142790382,2111255176,2113841813,540550033,1965671360];
  306. sh1['js/zxcvbn_1.js'] = [1907398498,1848592788,1411956507,1246445933,2076594788,857342092,1344967799,-1627795893];
  307. sh1['js/stacktrace_1.js'] = [-1025805761,-1999209892,-1583561296,-1745892906,2039612691,-450812105,620387593,1803216222];
  308. sh1['js/contrib/Int64_1.js'] = [-474954686,-1728308204,-1694763832,-1720731356,665731556,1687917388,-1533699813,2018687061];
  309. sh1['js/zip64_4.js'] = [1193702851,11083877,433286971,-1884500837,985647488,1381341145,-964473312,1396099398];
  310. sh1['js/Int64_1.js'] = [330399955,-280329828,1808976155,959951348,854614113,-953413151,2112686117,86892661];
  311. sh1['js/asmcrypto_1.js'] = [-1626991304,213881994,1607188890,-1207496249,-252250938,-107531777,44197009,-1657190118];
  312. sh1['js/chat_1.js'] = [-530761357,-479983433,1161136007,-330293447,288040049,31111983,2000670769,368857520];
  313. sh1['lang/be_11.json'] = [-430457150,803125401,349669778,-753512409,2072080271,32788607,-1141966552,1320737996];
  314. sh1['lang/cy_11.json'] = [1689038836,1865906614,317668373,1385511941,1446605794,1025793312,1238264313,801839315];
  315. sh1['lang/ee_11.json'] = [-2053074399,-673822793,-1857193536,-1019764097,1044441236,-69338850,-1714610147,1016443173];
  316. sh1['lang/fa_10.json'] = [671363228,-190710075,-970442119,1996509210,414254370,-1586731800,-1967241622,1168932954];
  317. sh1['lang/hi_12.json'] = [-293100664,-1349577913,-532509550,224568879,131572773,-1700582125,119829272,-2035564808];
  318. sh1['lang/ka_12.json'] = [-1124277947,586920307,-1918428705,-311838360,-1032561036,-322392532,-1763935670,659257756];
  319. sh1['lang/mk_12.json'] = [186910417,-871157084,-178395314,-627919008,1807828051,-1319253444,-246229609,-838122553];
  320. sh1['lang/ms_12.json'] = [-977533227,1067216602,5116935,398500107,-2138811569,813478111,2009433592,-687148006];
  321. sh1['lang/tl_12.json'] = [-293100664,-1349577913,-532509550,224568879,131572773,-1700582125,119829272,-2035564808];
  322. sh1['js/ads_1.js'] = [-579811670,-1864671254,1963111764,1959565923,174521760,-1941887310,-1194974463,1135111867];
  323. sh1['js/baboom_1.js'] = [-579811670,-1864671254,1963111764,1959565923,174521760,-1941887310,-1194974463,1135111867];
  324. sh1['js/events_2.js'] = [-462835008,-2115352221,2038059527,-903582027,-1395017287,-337794634,-1418257127,1744521768];
  325. sh1['js/queue_5.js'] = [-1846129536,-421133978,-2059822060,465930411,-150402219,-842410602,587019641,-1455817346];
  326. sh1['js/downloadChrome_4.js'] = [1560624953,-172613758,103111963,-1706099608,1439277588,2132389968,22082783,1195057908];
  327. sh1['js/downloadBlobBuilder_2.js'] = [841259530,-752248672,-708625032,-73901870,1464977513,-1155759925,1911443792,1251713919];
  328. sh1['js/downloadMemory_2.js'] = [-773036250,-769730490,126197380,-1430597140,-1753848764,1656449880,-1274557283,-1327533756];
  329. sh1['js/downloadFlash_2.js'] = [317082511,801192985,244301979,587399911,551706551,1159128826,-403852312,1227106856];
  330. sh1['js/downloader_11.js'] = [-508166633,1195466099,386136296,337099253,1563418654,797112988,1366222546,-1759367011];
  331. sh1['js/download2_8.js'] = [-159943378,-792397607,1303047667,741049420,-1821288420,-2131279462,-972491638,-1900671789];
  332. sh1['js/jquery_1.remove_1.js'] = [-1133738330,699073660,1744429269,2109081157,1448961206,-465529361,-1855289939,457831947];
  333. sh1['js/upload2_2.js'] = [200195037,1030965092,280071028,1828927627,1882907684,-673748888,595265809,1362209572];
  334. sh1['html/backup_1.html'] = [-1764798913,1988129157,-175893354,-1012574826,-1606954265,1833452308,1068125739,2070632769];
  335. sh1['html/js/backup_1.js'] = [-392162365,880126564,301345638,677098636,-1541237319,85788697,-380150757,-1286491618];
  336. sh1['html/reset_1.html'] = [-1665827434,-1702942772,1087117099,-1643355204,-476608196,-184272180,-707540728,373919359];
  337. sh1['html/js/reset_1.js'] = [1512925505,44422982,-373493721,-221380442,200012793,1800577727,885995798,-398225069];
  338. sh1['js/filesaver_1.js'] = [-346485659,1444968102,-517517838,555034131,609518468,144540355,300502605,-1333688574];
  339. sh1['html/recovery_1.html'] = [-771884893,-1382352245,-1660766423,-1770549994,2017392089,-1266188113,-1148853408,-728973957];
  340. sh1['html/js/recovery_1.js'] = [-854868952,-406167482,1362503063,95374051,596214921,1141552558,-1873379792,1906500067];
  341. sh1['js/mads_2.js'] = [1258773753,-144550032,1177962438,-1831051408,714660521,-607137022,1391825767,1931275410];
  342. lv['af'] = 15;
  343. lv['ar'] = 16;
  344. lv['bg'] = 15;
  345. lv['br'] = 18;
  346. lv['bs'] = 15;
  347. lv['ca'] = 18;
  348. lv['cn'] = 16;
  349. lv['ct'] = 17;
  350. lv['cz'] = 20;
  351. lv['de'] = 17;
  352. lv['dk'] = 16;
  353. lv['el'] = 17;
  354. lv['en'] = 15;
  355. lv['es'] = 19;
  356. lv['et'] = 6;
  357. lv['eu'] = 16;
  358. lv['fi'] = 18;
  359. lv['fr'] = 20;
  360. lv['gl'] = 17;
  361. lv['he'] = 16;
  362. lv['hr'] = 18;
  363. lv['hu'] = 18;
  364. lv['id'] = 17;
  365. lv['it'] = 19;
  366. lv['jp'] = 18;
  367. lv['kr'] = 19;
  368. lv['lt'] = 15;
  369. lv['lv'] = 19;
  370. lv['mi'] = 17;
  371. lv['nl'] = 17;
  372. lv['no'] = 18;
  373. lv['pl'] = 19;
  374. lv['pt'] = 16;
  375. lv['ro'] = 19;
  376. lv['ru'] = 17;
  377. lv['se'] = 17;
  378. lv['sk'] = 18;
  379. lv['sl'] = 17;
  380. lv['sq'] = 7;
  381. lv['sr'] = 17;
  382. lv['th'] = 16;
  383. lv['tr'] = 14;
  384. lv['uk'] = 16;
  385. lv['vn'] = 17;
  386. lv['be'] = 11;
  387. lv['cy'] = 11;
  388. lv['ee'] = 11;
  389. lv['fa'] = 10;
  390. lv['hi'] = 12;
  391. lv['ka'] = 12;
  392. lv['mk'] = 12;
  393. lv['ms'] = 12;
  394. lv['tl'] = 12;
  395.  
  396. function cmparrays(a,b)
  397. {
  398.     if (a.length != b.length) return false;
  399.     for (var i = a.length; i--; ) if (a[i] != b[i]) return false;
  400.     return true;
  401. }
  402.  
  403. var androidsplash = false;
  404. var m = false;
  405. var seqno = Math.ceil(Math.random()*1000000000);
  406. if (isMobile() || (typeof localStorage !== 'undefined' && localStorage.mobile))
  407. {
  408.     var tag=document.createElement('meta');
  409.     tag.name = "viewport";
  410.     tag.content = "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0";
  411.     document.getElementsByTagName('head')[0].appendChild(tag);
  412.     var tag=document.createElement('meta');
  413.     tag.name = "apple-mobile-web-app-capable";
  414.     tag.content = "yes";
  415.     document.getElementsByTagName('head')[0].appendChild(tag);
  416.     var tag=document.createElement('meta');
  417.     tag.name = "apple-mobile-web-app-status-bar-style";
  418.     tag.content = "black";
  419.     document.getElementsByTagName('head')[0].appendChild(tag);
  420.     var tag=document.createElement('link');
  421.     tag.rel = "apple-touch-icon-precomposed";
  422.     tag.sizes = "144x144";
  423.     tag.href = staticpath + "images/mobile/App_ipad_144x144.png";
  424.     document.getElementsByTagName('head')[0].appendChild(tag);
  425.     var tag=document.createElement('link');
  426.     tag.rel = "apple-touch-icon-precomposed";
  427.     tag.sizes = "114x114";
  428.     tag.href = staticpath + "images/mobile/App_iphone_114x114.png";
  429.     document.getElementsByTagName('head')[0].appendChild(tag);
  430.     var tag=document.createElement('link');
  431.     tag.rel = "apple-touch-icon-precomposed";
  432.     tag.sizes = "72x72";
  433.     tag.href = staticpath + "images/mobile/App_ipad_72X72.png";
  434.     document.getElementsByTagName('head')[0].appendChild(tag);
  435.     var tag=document.createElement('link');
  436.     tag.rel = "apple-touch-icon-precomposed";
  437.     tag.href = staticpath + "images/mobile/App_iphone_57X57.png"
  438.     document.getElementsByTagName('head')[0].appendChild(tag);
  439.     var tag=document.createElement('link');
  440.     tag.rel = "shortcut icon";
  441.     tag.type = "image/vnd.microsoft.icon";
  442.     tag.href = "https://mega.co.nz/favicon.ico";
  443.     document.getElementsByTagName('head')[0].appendChild(tag);
  444.     m=true;
  445. }
  446. var silent_loading=false;
  447.  
  448.  
  449. if (m)
  450. {
  451.     var app,mobileblog,android;
  452.     var link = document.createElement('link');
  453.     link.setAttribute('rel', 'stylesheet');
  454.     link.type = 'text/css';
  455.     link.href = staticpath + 'css/mobile-app.css';
  456.     document.head.appendChild(link);
  457.     document.body.innerHTML = '<div class="main-scroll-block"> <div class="main-content-block"> <div class="free-green-tip"></div><div class="main-centered-bl"><div class="main-logo"></div><div class="main-head-txt" id="m_title"></div><div class="main-txt" id="m_desc"></div><a href="" class="main-button" id="m_appbtn"></a><div class="main-social hidden"><a href="https://www.facebook.com/MEGAprivacy" class="main-social-icon facebook"></a><a href="https://www.twitter.com/MEGAprivacy" class="main-social-icon twitter"></a><div class="clear"></div></div></div> </div><div class="scrolling-content"><div class="mid-logo"></div> <div class="mid-gray-block">MEGA provides free cloud storage with convenient and powerful always-on privacy </div> <div class="scrolling-block-icon encription"></div> <div class="scrolling-block-header"> End-to-end encryption </div> <div class="scrolling-block-txt">Unlike other cloud storage providers, your data is encrypted & decrypted during transfer by your client devices only and never by us. </div> <div class="scrolling-block-icon access"></div> <div class="scrolling-block-header"> Secure Global Access </div> <div class="scrolling-block-txt">Your data is accessible any time, from any device, anywhere. Only you control the keys to your files.</div> <div class="scrolling-block-icon colaboration"></div> <div class="scrolling-block-header"> Secure Collaboration </div> <div class="scrolling-block-txt">Share folders with your contacts and see their updates in real time. Online collaboration has never been more private and secure.</div> <div class="bottom-menu full-version"><div class="copyright-txt">Mega Limited ' + new Date().getFullYear() + '</div><div class="language-block"></div><div class="clear"></div><iframe src="" width="1" height="1" frameborder="0" style="width:1px; height:1px; border:none;" id="m_iframe"></iframe></div></div></div>';
  458.     if (window.location.hash.substr(1,4) == 'blog') mobileblog=1;
  459.     if (ua.indexOf('android') > -1)
  460.     {
  461.         app='https://play.google.com/store/apps/details?id=com.flyingottersoftware.mega';
  462.         document.body.className = 'android full-mode supported';
  463.         android=1;
  464.     }
  465.     else if (ua.indexOf('bb10') > -1)
  466.     {
  467.         app='http://appworld.blackberry.com/webstore/content/46810890/';
  468.         document.body.className = 'blackberry full-mode supported';
  469.         document.getElementById('m_desc').innerHTML = 'Free 50 GB - End-to-end encryption';
  470.     }
  471.     else if (ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1)
  472.     {
  473.         app='https://itunes.apple.com/app/mega/id706857885';
  474.         document.body.className = 'ios full-mode supported';
  475.         document.getElementById('m_desc').innerHTML = 'Free 50 GB - End-to-end encryption';
  476.     }
  477.     else document.body.className = 'another-os full-mode unsupported';
  478.  
  479.     if (app)
  480.     {
  481.         document.getElementById('m_appbtn').href = app;
  482.         document.getElementById('m_title').innerHTML = 'Install the free MEGA app';
  483.     }
  484.     else
  485.     {
  486.         document.getElementById('m_title').innerHTML = 'A dedicated app for your device will be available soon.';
  487.         document.getElementById('m_desc').innerHTML = 'Follow us on Twitter or Facebook for updates.';
  488.     }
  489.     if (window.location.hash.substr(1,1) == '!')
  490.     {
  491.         if (app) document.getElementById('m_title').innerHTML = 'Install the free MEGA app to access this file from your mobile';
  492.         if (ua.indexOf('chrome') > -1)
  493.         {
  494.             setTimeout(function()
  495.             {
  496.                 if (confirm('Do you already have the MEGA app installed?')) document.location = 'mega://' + window.location.hash;
  497.             },2500);
  498.         }
  499.         else document.getElementById('m_iframe').src = 'mega://' + window.location.hash;
  500.     }
  501.     else if (window.location.hash.substr(1,7) == 'confirm')
  502.     {
  503.         var i=0;
  504.         if (ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1) i=1;
  505.         if (ua.indexOf('chrome') > -1) window.location ='mega://' + window.location.hash.substr(i);
  506.         else document.getElementById('m_iframe').src = 'mega://' + window.location.hash.substr(i);
  507.     }
  508.     if (mobileblog)
  509.     {
  510.         document.body.innerHTML = '';
  511.         var script = document.createElement('script');
  512.         script.type = "text/javascript";
  513.         document.head.appendChild(script);
  514.         script.src = 'https://mega.co.nz/blog.js';
  515.     }
  516. }
  517. else if (page == '#android')
  518. {
  519.     document.location = 'https://play.google.com/store/apps/details?id=com.flyingottersoftware.mega';
  520. }
  521. else
  522. {
  523.     if (!b_u)
  524.     {
  525.         if (typeof console == "undefined") { this.console = {log: function() {}};}
  526.         var d = localStorage.d || 0;
  527.         var jj = localStorage.jj || 0;
  528.         var languages = {'en':['en','en-'],'es':['es','es-'],'fr':['fr','fr-'],'de':['de','de-'],'it':['it','it-'],'nl':['nl','nl-'],'pt':['pt'],'br':['pt-br'],'dk':['da'],'se':['sv'],'fi':['fi'],'no':['no'],'pl':['pl'],'cz':['cz','cz-'],'sk':['sk','sk-'],'sl':['sl','sl-'],'hu':['hu','hu-'],'jp':['ja'],'cn':['zh','zh-cn'],'ct':['zh-hk','zh-sg','zh-tw'],'kr':['ko'],'ru':['ru','ru-mo'],'ar':['ar','ar-'],'he':['he'],'id':['id'],'ca':['ca','ca-'],'eu':['eu','eu-'],'af':['af','af-'],'bs':['bs','bs-'],'sg':[],'tr':['tr','tr-'],'mk':[],'hi':[],'hr':['hr'],'ro':['ro','ro-'],'uk':['||'],'gl':['||'],'sr':['||'],'lt':['||'],'th':['||'],'lv':['||'],'fa':['||'],'ee':['et'],'ms':['ms'],'cy':['cy'],'bg':['bg'],'be':['br'],'tl':['en-ph'],'ka':['||']};
  529.  
  530.         function detectlang()
  531.         {
  532.             return 'en';
  533.             if (!navigator.language) return 'en';
  534.             var bl = navigator.language.toLowerCase();
  535.             var l2 = languages;
  536.             for (var l in l2) for (b in l2[l]) if (l2[l][b] == bl) return l;
  537.             for (var l in l2) for (b in l2[l]) if (l2[l][b].substring(0,3)==bl.substring(0,3)) return l;
  538.             return 'en';
  539.         }
  540.         var init_f = [];
  541.         var lang = detectlang();
  542.         if ((typeof localStorage != 'undefined') && (localStorage.lang)) if (languages[localStorage.lang]) lang = localStorage.lang;
  543.         var langv = '';
  544.         if (typeof lv != 'undefined') langv = '_' + lv[lang];
  545.         var jsl = []
  546.  
  547.         jsl.push({f:'lang/' + lang + langv + '.json', n: 'lang', j:3});
  548.         jsl.push({f:'js/crypto_30.js', n: 'crypto_js', j:1,w:5});
  549.         jsl.push({f:'js/user_6.js', n: 'user_js', j:1});
  550.         jsl.push({f:'js/hex_1.js', n: 'hex_js', j:1});
  551.         jsl.push({f:'js/functions_11.js', n: 'functions_js', j:1});
  552.         jsl.push({f:'sjcl_1.js', n: 'sjcl_js', j:1});
  553.         jsl.push({f:'js/rsa_1.js', n: 'rsa_js', j:1});
  554.         jsl.push({f:'js/keygen_2.js', n: 'keygen_js', j:1});
  555.         jsl.push({f:'js/mouse_3.js', n: 'mouse_js', j:1});
  556.         jsl.push({f:'js/jquery-min-1_1.8_1.1_1.js', n: 'jquery', j:1,w:9});
  557.         jsl.push({f:'js/jquery-ui_1.js', n: 'jqueryui_js', j:1,w:12});
  558.         jsl.push({f:'js/base64_1.js', n: 'base64_js', j:1});
  559.         jsl.push({f:'js/filedrag_5.js', n: 'filedrag_js', j:1});
  560.         jsl.push({f:'js/jquery_1.remove_1.js', n: 'jqueryremove_js', j:1});
  561.         jsl.push({f:'js/jquery_1.mousewheel_1.js', n: 'jquerymouse_js', j:1});
  562.         jsl.push({f:'js/jquery_1.jscrollpane_1.min_1.js', n: 'jscrollpane_js', j:1});
  563.         jsl.push({f:'js/mDB_9.js', n: 'mDB_js', j:1});
  564.         jsl.push({f:'js/cleartemp_3.js', n: 'cleartemp_js', j:1});
  565.         jsl.push({f:'js/thumbnail_9.js', n: 'thumbnail_js', j:1});
  566.         jsl.push({f:'js/exif_1.js', n: 'exif_js', j:1,w:3});
  567.         jsl.push({f:'js/megapix_1.js', n: 'megapix_js', j:1});
  568.         jsl.push({f:'js/mega_48.js', n: 'mega_js', j:1,w:7});
  569.         jsl.push({f:'js/chat_1.js', n: 'chat_js', j:1,w:7});
  570.         jsl.push({f:'js/fm_51.js', n: 'fm_js', j:1,w:12});
  571.         jsl.push({f:'js/filetypes_3.js', n: 'filetypes_js', j:1});
  572.         /* better download */
  573.         jsl.push({f:'js/events_2.js', n: 'events', j:1,w:4});
  574.         jsl.push({f:'js/queue_5.js', n: 'queue', j:1,w:4});
  575.         jsl.push({f:'js/downloadChrome_4.js', n: 'dl_chrome', j:1,w:3});
  576.         jsl.push({f:'js/downloadBlobBuilder_2.js', n: 'dl_blobbuilder', j:1,w:3});
  577.         jsl.push({f:'js/downloadMemory_2.js', n: 'dl_memory', j:1,w:3});
  578.         jsl.push({f:'js/downloadFlash_2.js', n: 'dl_flash', j:1,w:3});
  579.         jsl.push({f:'js/downloader_11.js', n: 'dl_downloader', j:1,w:3});
  580.         jsl.push({f:'js/download2_8.js', n: 'dl_js', j:1,w:3});
  581.         jsl.push({f:'js/upload2_2.js', n: 'upload_js', j:1,w:2});
  582.         /* end better download */
  583.         jsl.push({f:'index_27.js', n: 'index', j:1,w:4});
  584.         jsl.push({f:'html/start_2.html', n: 'start', j:0});
  585.         jsl.push({f:'html/megainfo_1.html', n: 'megainfo', j:0});
  586.         jsl.push({f:'html/js/start_2.js', n: 'start_js', j:1});
  587.         jsl.push({f:'html/bottom2_3.html', n: 'bottom2',j:0});
  588.         jsl.push({f:'html/key_1.html', n: 'key', j:0});
  589.         jsl.push({f:'html/js/key_1.js', n: 'key_js', j:1});
  590.         jsl.push({f:'html/pro_2.html', n: 'pro', j:0});
  591.         jsl.push({f:'html/js/pro_6.js', n: 'pro_js', j:1});
  592.         jsl.push({f:'html/login_1.html', n: 'login', j:0});
  593.         jsl.push({f:'html/js/login_1.js', n: 'login_js', j:1});
  594.         jsl.push({f:'html/fm_16.html', n: 'fm', j:0,w:3});
  595.         jsl.push({f:'html/top_7.html', n: 'top', j:0});
  596.         jsl.push({f:'js/notifications_9.js', n: 'notifications_js', j:1});
  597.         jsl.push({f:'css/style_38.css', n: 'style_css', j:2,w:30,c:1,d:1,cache:1});
  598.         jsl.push({f:'js/avatar_2.js', n: 'avatar_js', j:1,w:3});
  599.         jsl.push({f:'js/countries_2.js', n: 'countries_js', j:1});
  600.         jsl.push({f:'html/dialogs_13.html', n: 'dialogs', j:0,w:2});
  601.         jsl.push({f:'html/transferwidget_1.html', n: 'transferwidget', j:0});
  602.         jsl.push({f:'js/checkboxes_1.js', n: 'checkboxes_js', j:1});
  603.         jsl.push({f:'js/Int64_1.js', n: 'int64_js', j:1});
  604.         jsl.push({f:'js/zip64_4.js', n: 'zip_js', j:1});
  605.         jsl.push({f:'js/asmcrypto_1.js',n:'asmcrypto_js',j:1});
  606.         var jsl2 =
  607.         {
  608.             'about': {f:'html/about_3.html', n: 'about', j:0},
  609.             'blog': {f:'html/blog_1.html', n: 'blog', j:0},
  610.             'blog_js': {f:'html/js/blog_12.js', n: 'blog_js', j:1},
  611.             'blogarticle': {f:'html/blogarticle_1.html', n: 'blogarticle', j:0},
  612.             'blogarticle_js': {f:'html/js/blogarticle_1.js', n: 'blogarticle_js', j:1},
  613.             'register': {f:'html/register_1.html', n: 'register', j:0},
  614.             'register_js': {f:'html/js/register_6.js', n: 'register_js', j:1},
  615.             'resellers': {f:'html/resellers_2.html', n: 'resellers', j:0},
  616.             'download': {f:'html/download_15.html', n: 'download', j:0},
  617.             'download_js': {f:'html/js/download_17.js', n: 'download_js', j:1},
  618.             'copyright': {f:'html/copyright_1.html', n: 'copyright', j:0},
  619.             'copyrightnotice': {f:'html/copyrightnotice_2.html', n: 'copyrightnotice', j:0},
  620.             'copyrightnotice_js': {f:'html/js/copyrightnotice_2.js', n: 'copyrightnotice_js', j:1},
  621.             'privacy': {f:'html/privacy_2.html', n: 'privacy', j:0},
  622.             'terms': {f:'html/terms_3.html', n: 'terms', j:0},
  623.             'backup': {f:'html/backup_1.html', n: 'backup', j:0},
  624.             'backup_js': {f:'html/js/backup_1.js', n: 'backup_js', j:1},
  625.             'reset': {f:'html/reset_1.html', n: 'reset', j:0},
  626.             'reset_js': {f:'html/js/reset_1.js', n: 'reset_js', j:1},
  627.             'filesaver': {f:'js/filesaver_1.js', n: 'filesaver', j:1},
  628.             'recovery': {f:'html/recovery_1.html', n: 'recovery', j:0},
  629.             'recovery_js': {f:'html/js/recovery_1.js', n: 'recovery_js', j:1},
  630.             'credits': {f:'html/credits_2.html', n: 'credits', j:0},
  631.             'takedown': {f:'html/takedown_15.html', n: 'takedown', j:0},
  632.             'dev': {f:'html/dev_2.html', n: 'dev', j:0},
  633.             'arkanoid_js': {f:'js/arkanoid_1.js', n: 'arkanoid_js', j:1},
  634.             'dev_js': {f:'html/js/dev_2.js', n: 'dev_js', j:1},
  635.             'sdkterms': {f:'html/sdkterms_2.html', n: 'sdkterms', j:0},
  636.             'help': {f:'html/help_2.html', n: 'help', j:0},
  637.             'help_js': {f:'html/js/help_10.js', n: 'help_js', j:1},
  638.             'firefox': {f:'html/firefox_1.html', n: 'firefox', j:0},
  639.             'sync': {f:'html/sync_4.html', n: 'sync', j:0},
  640.             'mobile': {f:'html/mobile_5.html', n: 'mobile', j:0},
  641.             'affiliates': {f:'html/affiliates_1.html', n: 'affiliates', j:0},
  642.             'affiliate_js': {f:'html/js/affiliate_1.js', n: 'affiliate_js', j:0},
  643.             'affiliateterms': {f:'html/affiliateterms_2.html', n: 'affiliateterms', j:0},
  644.             'affiliatesignup': {f:'html/affiliatesignup_1.html', n: 'affiliatesignup', j:0},
  645.             'affiliatesignup_js': {f:'html/js/affiliatesignup_2.js', n: 'affiliatesignup_js', j:1},
  646.             'affiliatemember': {f:'html/affiliatemember_1.html', n: 'affiliatemember', j:0},
  647.             'affiliatemember_js': {f:'html/js/affiliatemember_2.js', n: 'affiliatemember_js', j:1},
  648.             'contact': {f:'html/contact_1.html', n: 'contact', j:0},
  649.             'privacycompany': {f:'html/privacycompany_1.html', n: 'privacycompany', j:0},
  650.             'chrome': {f:'html/chrome_4.html', n: 'chrome', j:0},
  651.             'zxcvbn_js': {f:'js/zxcvbn_1.js', n: 'zxcvbn_js', j:1},
  652.             'mads_js': {f:'js/mads_2.js', n: 'mads_js', j:1}
  653.         };
  654.         var subpages =
  655.         {
  656.             'about': ['about'],
  657.             'terms': ['terms'],
  658.             'credits': ['credits'],
  659.             'backup': ['backup','backup_js','filesaver'],          
  660.             'recovery': ['recovery','recovery_js'],
  661.             'reset': ['reset','reset_js'],
  662.             'blog': ['blog','blog_js','blogarticle','blogarticle_js'],
  663.             'register': ['register','register_js'],
  664.             'android': ['android'],
  665.             'resellers': ['resellers'],
  666.             '!': ['download','download_js'],
  667.             'copyright': ['copyright'],
  668.             'key':['arkanoid_js'],
  669.             'copyrightnotice': ['copyrightnotice','copyrightnotice_js'],
  670.             'privacy': ['privacy','privacycompany'],
  671.             'takedown': ['takedown'],
  672.             'firefox': ['firefox'],
  673.             'mobile': ['mobile'],
  674.             'sync': ['sync'],
  675.             'contact': ['contact'],
  676.             'dev': ['dev','dev_js','sdkterms'],
  677.             'sdk': ['dev','dev_js','sdkterms'],
  678.             'doc': ['dev','dev_js','sdkterms'],
  679.             'help': ['help','help_js'],
  680.             'chrome': ['chrome'],
  681.             'plugin': ['chrome','firefox'],
  682.             'affiliate': ['affiliates','affiliateterms','affiliatesignup','affiliatesignup_js','affiliatemember','affiliatemember_js','affiliate_js'],
  683.             'recover': ['reset','reset_js']
  684.         };
  685.  
  686.  
  687.  
  688.  
  689.         if (page && page.indexOf('%21') > -1) document.location.hash = page.replace('%21','!').replace('%21','!');
  690.         if (page) page = page.replace('#','');
  691.  
  692.  
  693.         for (var p in subpages)
  694.         {
  695.             if (page && page.substr(0,p.length) == p)
  696.             {
  697.                 for (i in subpages[p]) jsl.push(jsl2[subpages[p][i]]);
  698.             }
  699.         }
  700.         var downloading = false;
  701.         var ul_uploading = false;
  702.         var lightweight=false;
  703.         var njsl = [];
  704.         var fx_startup_cache = is_chrome_firefox && nocontentcheck;
  705.         if ((typeof Worker != 'undefined') && (typeof window.URL != 'undefined') && !fx_startup_cache)
  706.         {
  707.             var hashdata = ['self.postMessage = self.webkitPostMessage || self.postMessage;',sjcl_sha_js,'self.onmessage = function(e) { try { e.data.hash = sha256(e.data.text);  self.postMessage(e.data); } catch(err) { e.data.error = err.message; self.postMessage(e.data);  } };'];
  708.             try  { var blob = new Blob(hashdata, { type: "text/javascript" }); }
  709.             catch(e)
  710.             {
  711.                 window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
  712.                 var bb = new BlobBuilder();
  713.                 for (var i in hashdata) bb.append(hashdata[i]);
  714.                 var blob = bb.getBlob('text/javascript');
  715.             }
  716.             var hash_url = window.URL.createObjectURL(blob);
  717.             var hash_workers = [];
  718.             var i =0;
  719.             while (i < 2)
  720.             {
  721.                 try
  722.                 {
  723.                     hash_workers[i] = new Worker(hash_url);
  724.                     hash_workers[i].postMessage = hash_workers[i].webkitPostMessage || hash_workers[i].postMessage;
  725.                     hash_workers[i].onmessage = function(e)
  726.                     {
  727.                         if (e.data.error)
  728.                         {
  729.                             console.log('error',e.data.error);
  730.                             console.log(e.data.text);
  731.                             alert('error');
  732.                         }
  733.                         if (!nocontentcheck && !cmparrays(e.data.hash,sh1[jsl[e.data.jsi].f]))
  734.                         {
  735.                             if (bootstaticpath.indexOf('cdn') > -1)
  736.                             {
  737.                                 sessionStorage.skipcdn=1;
  738.                                 document.location.reload();
  739.                             }
  740.                             else alert('An error occurred while loading MEGA. The file ' + bootstaticpath+jsl[e.data.jsi].f + ' is corrupt. Please try again later. We apologize for the inconvenience.');
  741.  
  742.                             contenterror=1;
  743.                         }
  744.                         if (!contenterror)
  745.                         {
  746.                             jsl_current += jsl[e.data.jsi].w || 1;
  747.                             jsl_progress();
  748.                             if (++jslcomplete == jsl.length) initall();
  749.                             else jsl_load(e.data.xhri);
  750.                         }
  751.                     };
  752.                 }
  753.                 catch(e)
  754.                 {
  755.                     hash_workers = undefined;
  756.                 }
  757.                 i++;
  758.             }
  759.         }
  760.         var pages = [];
  761.         function getxhr()
  762.         {
  763.             return (typeof XDomainRequest != 'undefined' && typeof ArrayBuffer == 'undefined') ? new XDomainRequest() : new XMLHttpRequest();
  764.         }
  765.  
  766.         var xhr_progress,xhr_stack,jsl_fm_current,jsl_current,jsl_total,jsl_perc,jsli,jslcomplete;
  767.  
  768.         if(fx_startup_cache && d > 1)
  769.         {
  770.             console.log('*** Invalidating startup cache ***');
  771.             Services.obs.notifyObservers(null, "startupcache-invalidate", null);
  772.         }
  773.  
  774.         function jsl_start()
  775.         {
  776.             jslcomplete = 0;
  777.             xhr_progress = [0,0];
  778.             xhr_stack = Array(xhr_progress.length);
  779.             jsl_fm_current = 0;
  780.             jsl_current = 0;
  781.             jsl_total = 0;
  782.             jsl_perc = 0;
  783.             jsli=0;
  784.             for (var i = jsl.length; i--;) if (!jsl[i].text) jsl_total += jsl[i].w || 1;
  785.             if (fx_startup_cache)
  786.             {
  787.                 var step = function(jsi)
  788.                 {
  789.                     jsl_current += jsl[jsi].w || 1;
  790.                     jsl_progress();
  791.                     if (++jslcomplete == jsl.length) initall();
  792.                     else
  793.                     {
  794.                         // mozRunAsync(next.bind(this, jsli++));
  795.                         next(jsli++);
  796.                     }
  797.                 };
  798.                 var next = function(jsi)
  799.                 {
  800.                     var file = bootstaticpath + jsl[jsi].f;
  801.  
  802.                     if (jsl[jsi].j == 1)
  803.                     {
  804.                         try
  805.                         {
  806.                             loadSubScript(file);
  807.                         }
  808.                         catch(e)
  809.                         {
  810.                             Cu.reportError(e);
  811.  
  812.                             alert('An error occurred while loading MEGA.\n\nFilename: '
  813.                                 + file + "\n" + e + '\n\n' + mozBrowserID);
  814.                         }
  815.                         step(jsi);
  816.                     }
  817.                     else
  818.                     {
  819.                         var ch = NetUtil.newChannel(file);
  820.                         ch.contentType = jsl[jsi].j == 3
  821.                             ? "application/json":"text/plain";
  822.  
  823.                         NetUtil.asyncFetch(ch, function(is, s)
  824.                         {
  825.                             if (!Components.isSuccessCode(s))
  826.                             {
  827.                                 alert('An error occurred while loading MEGA.' +
  828.                                     ' The file ' + file + ' could not be loaded.');
  829.                             }
  830.                             else
  831.                             {
  832.                                 jsl[jsi].text = NetUtil.readInputStreamToString(is, is.available());
  833.                                 if (jsl[jsi].j == 3) l = JSON.parse(jsl[jsi].text);
  834.                                 step(jsi);
  835.                             }
  836.                         });
  837.                     }
  838.                 };
  839.                 next(jsli++);
  840.             }
  841.             else
  842.             {
  843.                 for (var i = xhr_progress.length; i--; ) jsl_load(i);
  844.             }
  845.         }
  846.  
  847.         var xhr_timeout=5000;
  848.  
  849.         function xhr_error()
  850.         {
  851.             xhr_timeout+=1000;
  852.             console.log(xhr_timeout);
  853.             if (bootstaticpath.indexOf('cdn') > -1)
  854.             {
  855.                 bootstaticpath = geoStaticpath(1);
  856.                 staticpath = geoStaticpath(1);
  857.             }
  858.             xhr_progress[this.xhri] = 0;
  859.             xhr_load(this.url,this.jsi,this.xhri);
  860.         }
  861.  
  862.         function xhr_load(url,jsi,xhri)
  863.         {
  864.               xhr_stack[xhri] = getxhr();
  865.               xhr_stack[xhri].onload = function()
  866.               {
  867.                 jsl[this.jsi].text = this.response || this.responseText;
  868.  
  869.                 if (typeof hash_workers != 'undefined' && !nocontentcheck)
  870.                 {
  871.                     hash_workers[this.xhri].postMessage({'text':jsl[this.jsi].text,'xhr':'test','jsi':this.jsi,'xhri':this.xhri});
  872.                 }
  873.                 else
  874.                 {
  875.                     if (!nocontentcheck && !cmparrays(sha256(jsl[this.jsi].text),sh1[jsl[this.jsi].f]))
  876.                     {
  877.                         alert('An error occurred while loading MEGA. The file ' + bootstaticpath+jsl[this.jsi].f + ' is corrupt. Please try again later. We apologize for the inconvenience.');
  878.                         contenterror=1;
  879.                     }
  880.                     if (!contenterror)
  881.                     {
  882.                         jsl_current += jsl[this.jsi].w || 1;
  883.                         jsl_progress();
  884.                         if (++jslcomplete == jsl.length) initall();
  885.                         else jsl_load(this.xhri);
  886.                     }
  887.                 }
  888.               }
  889.               xhr_stack[xhri].onreadystatechange = function()
  890.               {
  891.                 try
  892.                 {
  893.                     if (this.readyState == 1) this.timeout=0;
  894.                 }
  895.                 catch(e)
  896.                 {
  897.                
  898.                 }              
  899.               }
  900.               xhr_stack[xhri].onerror = xhr_error;
  901.               xhr_stack[xhri].ontimeout = xhr_error;
  902.               if (jsl[jsi].text)
  903.               {
  904.                 if (++jslcomplete == jsl.length) initall();
  905.                 else jsl_load(xhri);
  906.               }
  907.               else
  908.               {
  909.                   xhr_stack[xhri].url = url;
  910.                   xhr_stack[xhri].jsi = jsi;
  911.                   xhr_stack[xhri].xhri = xhri;
  912.                   if (localStorage.dd) url += '?t=' + Date.now();
  913.                   xhr_stack[xhri].open("GET", bootstaticpath + url, true);
  914.                   xhr_stack[xhri].timeout = xhr_timeout;
  915.                   if (is_chrome_firefox) xhr_stack[xhri].overrideMimeType('text/plain');
  916.                   xhr_stack[xhri].send(null);                
  917.               }
  918.         }
  919.         window.onload = function ()
  920.         {
  921.             if (!maintenance && !androidsplash) jsl_start();
  922.         }
  923.         function jsl_load(xhri)
  924.         {
  925.             if (jsl[jsli]) xhr_load(jsl[jsli].f, jsli++,xhri);
  926.         }
  927.         function jsl_progress()
  928.         {
  929.             if (d) console.log('done',(jsl_current+jsl_fm_current));
  930.             if (d) console.log('total',jsl_total);
  931.             var p = Math.floor((jsl_current+jsl_fm_current)/jsl_total*100);
  932.             if ((p > jsl_perc) && (p <= 100))
  933.             {
  934.                 jsl_perc = p;
  935.                 if ((document.location.href.substr(0,19) == 'chrome-extension://') || is_chrome_firefox) p=100;
  936.                 document.getElementById('loadinganim').className = 'loading-progress-bar percents-'+p;
  937.             }
  938.         }
  939.         var jsl_loaded={};
  940.         function initall()
  941.         {
  942.             var jsar = [];
  943.             var cssar = [];
  944.             for(var i in localStorage) if (i.substr(0,6) == 'cache!') delete localStorage[i];
  945.             for (var i in jsl)
  946.             {
  947.               jsl_loaded[jsl[i].n]=1;
  948.               if ((jsl[i].j == 1) && (!jj))
  949.               {
  950.                 if (!fx_startup_cache)
  951.                 {
  952.                     if (window.URL) jsar.push(jsl[i].text + '\n\n');
  953.                     else evalscript(jsl[i].text);
  954.                 }
  955.               }
  956.               else if ((jsl[i].j == 2) && (!jj))
  957.               {
  958.                 if (document.getElementById('bootbottom')) document.getElementById('bootbottom').style.display='none';
  959.                 if (window.URL)
  960.                 {
  961.                     cssar.push(jsl[i].text.replace(/\.\.\//g,staticpath).replace(new RegExp( "\\/en\\/", "g"),'/' + lang + '/'));
  962.                 }
  963.                 else
  964.                 {
  965.                     var css = document.createElement('style');
  966.                     css.type = "text/css";
  967.                     css.rel = 'stylesheet';
  968.                     document.getElementsByTagName('head')[0].appendChild(css);
  969.                     css.innerHTML = jsl[i].text.replace(/\.\.\//g,staticpath).replace(new RegExp( "\\/en\\/", "g"),'/' + lang + '/');
  970.                 }
  971.               }
  972.               else if (jsl[i].j == 3) l = JSON.parse(jsl[i].text);
  973.               else if (jsl[i].j == 0) pages[jsl[i].n] = jsl[i].text;
  974.             }
  975.             if (window.URL)
  976.             {
  977.                 try
  978.                 {
  979.                     var blob = new Blob(cssar, { type: "text/css" });
  980.                 }
  981.                 catch(e)
  982.                 {
  983.                     window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
  984.                     var bb = new BlobBuilder();
  985.                     for (var i in cssar) bb.append(cssar[i]);
  986.                     var blob = bb.getBlob('text/css');
  987.                 }
  988.                 var link = document.createElement('link');
  989.                 link.setAttribute('rel', 'stylesheet');
  990.                 link.type = 'text/css';
  991.                 link.href = window.URL.createObjectURL(blob);
  992.                 document.head.appendChild(link);
  993.                 cssar=undefined;
  994.                 jsar.push('jsl_done=true; boot_done();');
  995.                 evalscript_url(jsar);
  996.                 jsar=undefined;
  997.             }
  998.             else
  999.             {
  1000.                 jsl_done=true;
  1001.                 boot_done();
  1002.             }
  1003.         }
  1004.     }
  1005.     if (ua.indexOf('android') > 0 && !sessionStorage.androidsplash && document.location.hash.indexOf('#confirm') == -1)
  1006.     {
  1007.         if (document.location.hash == '#android')
  1008.         {
  1009.             document.location = 'https://play.google.com/store/apps/details?id=com.flyingottersoftware.mega';
  1010.         }
  1011.         else
  1012.         {
  1013.             document.write('<link rel="stylesheet" type="text/css" href="' + staticpath + 'resources/css/mobile-android.css" /><div class="overlay"></div><div class="new-folder-popup" id="message"><div class="new-folder-popup-bg"><div class="new-folder-header">MEGA for Android</div><div class="new-folder-main-bg"><div class="new-folder-descr">Do you want to install the latest<br/> version of the MEGA app for Android?</div><a class="new-folder-input left-button" id="trashbinYes"> <span class="new-folder-bg1"> <span class="new-folder-bg2" id="android_yes"> Yes </span> </span></a><a class="new-folder-input right-button" id="trashbinNo"> <span class="new-folder-bg1"> <span class="new-folder-bg2" id="android_no">No </span> </span></a><div class="clear"></div></div></div></div></div>');
  1014.             document.getElementById('android_yes').addEventListener("click", function ()
  1015.             {
  1016.                 document.location = 'https://play.google.com/store/apps/details?id=com.flyingottersoftware.mega';
  1017.             }, false);
  1018.             document.getElementById('android_no').addEventListener("click", function ()
  1019.             {
  1020.                 sessionStorage.androidsplash=1;
  1021.                 document.location.reload();
  1022.             }, false);
  1023.             androidsplash=true;
  1024.         }
  1025.     }
  1026.     else
  1027.     {
  1028.         var istaticpath = staticpath;
  1029.         if (document.location.href.substr(0,19) == 'chrome-extension://')  istaticpath = '../';
  1030.         else if (is_chrome_firefox) istaticpath = 'chrome://mega/content/';
  1031.  
  1032.         document.write('<style type="text/css">.div, span, input {outline: none;}.hidden {display: none;}.clear {clear: both;margin: 0px;padding: 0px;display: block;}.loading-main-block {width: 100%;height: 100%;overflow: auto;font-family:Arial, Helvetica, sans-serif;}.loading-mid-white-block {height: 100%;width:100%;}.mid-centered-block {position: absolute;width: 494px;min-height: 158px;top: 50%;left: 50%;margin: -95px 0 0 -247px;}.loading-main-bottom {max-width: 940px;width: 100%;position: absolute;bottom: 20px;left: 50%;margin: 0 0 0 -470px;text-align: center;}.loading-bottom-button {height: 29px;width: 29px;float: left;background-image: url(' + istaticpath + 'images/mega/loading-sprite.png);background-repeat: no-repeat;cursor: pointer;}.loading-bottom-button.st-facebook-button {float: right;background-position: -40px -2376px;margin-left: 11px;}.loading-bottom-button.st-facebook-button:hover {background-position: -40px -2336px;}.loading-bottom-button.st-twitter-button {float: right;background-position: -1px -2376px;margin-left: 11px;}.loading-bottom-button.st-twitter-button:hover {background-position: -1px -2336px;}.loading-cloud {width: 222px;height: 158px;background-image: url(' + istaticpath + 'images/mega/loading-sprite.png);background-repeat: no-repeat;background-position: 0 -2128px;margin: 0 auto;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;-ms-box-sizing: border-box;box-sizing: border-box;padding-top: 55px;}.loading-progress-bar, .loading-progress-bar div {width: 80px;height: 80px;margin: 0 0 0 71px;background-image: url(' + istaticpath + 'images/mega/loading-sprite.png);background-repeat: no-repeat;background-position: 0 top;}.loading-progress-bar div {background-position: -71px -2183px;margin: 0;}.maintance-block {position: absolute;width: 484px;min-height: 94px;border: 2px solid #d9d9d9;-moz-border-radius: 7px;-webkit-border-radius: 7px;border-radius: 7px;padding: 10px;color: #333333;font-size: 13px;line-height: 30px;padding: 15px 15px 15px 102px;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;-ms-box-sizing: border-box;box-sizing: border-box;background-image: url(' + istaticpath + 'images/mega/loading-sprite.png);background-repeat: no-repeat;background-position: -60px -2428px;margin-top: 45px;}.loading-progress-bar.percents-0 {background-position: 0 0;}.loading-progress-bar.percents-1, .loading-progress-bar.percents-2, .loading-progress-bar.percents-3 {background-position: -130px 0;}.loading-progress-bar.percents-4, .loading-progress-bar.percents-5, .loading-progress-bar.percents-6 {background-position: 0 -100px;}.loading-progress-bar.percents-7, .loading-progress-bar.percents-8, .loading-progress-bar.percents-9 {background-position: -130px -100px;}.loading-progress-bar.percents-10, .loading-progress-bar.percents-11, .loading-progress-bar.percents-12 {background-position: 0 -200px;}.loading-progress-bar.percents-13, .loading-progress-bar.percents-14, .loading-progress-bar.percents-15 {background-position: -130px -200px;}.loading-progress-bar.percents-16, .loading-progress-bar.percents-17, .loading-progress-bar.percents-18 {background-position: 0 -300px;}.loading-progress-bar.percents-19, .loading-progress-bar.percents-20, .loading-progress-bar.percents-21 {background-position: -130px -300px;}.loading-progress-bar.percents-22, .loading-progress-bar.percents-23, .loading-progress-bar.percents-24 {background-position: 0 -400px;}.loading-progress-bar.percents-25, .loading-progress-bar.percents-26, .loading-progress-bar.percents-27 {background-position: -130px -400px;}.loading-progress-bar.percents-28, .loading-progress-bar.percents-29, .loading-progress-bar.percents-30 {background-position: 0 -500px;}.loading-progress-bar.percents-31, .loading-progress-bar.percents-32, .loading-progress-bar.percents-33 {background-position: -130px -500px;}.loading-progress-bar.percents-34, .loading-progress-bar.percents-35 {background-position: 0 -600px;}.loading-progress-bar.percents-36, .loading-progress-bar.percents-37 {background-position: -130px -600px;}.loading-progress-bar.percents-38, .loading-progress-bar.percents-39 {background-position: 0 -700px;}.loading-progress-bar.percents-40, .loading-progress-bar.percents-41 {background-position: -130px -700px;}.loading-progress-bar.percents-42, .loading-progress-bar.percents-43 {background-position: 0 -800px;}.loading-progress-bar.percents-44, .loading-progress-bar.percents-45 {background-position: -130px -800px;}.loading-progress-bar.percents-46, .loading-progress-bar.percents-47 {background-position: 0 -900px;}.loading-progress-bar.percents-48, .loading-progress-bar.percents-49 {background-position: -130px -900px;}.loading-progress-bar.percents-50 {background-position: 0 -1000px;}.loading-progress-bar.percents-51, .loading-progress-bar.percents-52, .loading-progress-bar.percents-53 {background-position: -130px -1000px;}.loading-progress-bar.percents-54, .loading-progress-bar.percents-55, .loading-progress-bar.percents-56 {background-position: 0 -1100px;}.loading-progress-bar.percents-57, .loading-progress-bar.percents-58, .loading-progress-bar.percents-59 {background-position: -130px -1100px;}.loading-progress-bar.percents-60, .loading-progress-bar.percents-61, .loading-progress-bar.percents-62 {background-position: 0 -1200px;}.loading-progress-bar.percents-63, .loading-progress-bar.percents-64, .loading-progress-bar.percents-65 {background-position: -130px -1200px;}.loading-progress-bar.percents-66, .loading-progress-bar.percents-67, .loading-progress-bar.percents-68 {background-position: 0 -1300px;}.loading-progress-bar.percents-69, .loading-progress-bar.percents-70, .loading-progress-bar.percents-71 {background-position: -130px -1300px;}.loading-progress-bar.percents-72, .loading-progress-bar.percents-73, .loading-progress-bar.percents-74 {background-position: 0 -1400px;}.loading-progress-bar.percents-75, .loading-progress-bar.percents-76, .loading-progress-bar.percents-77 {background-position: -130px -1400px;}.loading-progress-bar.percents-78, .loading-progress-bar.percents-79, .loading-progress-bar.percents-80 {background-position: 0 -1500px;}.loading-progress-bar.percents-81, .loading-progress-bar.percents-82, .loading-progress-bar.percents-83 {background-position: -130px -1500px;}.loading-progress-bar.percents-84, .loading-progress-bar.percents-85, .loading-progress-bar.percents-86 {background-position: 0 -1600px;}.loading-progress-bar.percents-87, .loading-progress-bar.percents-88, .loading-progress-bar.percents-89 {background-position: -130px -1600px;}.loading-progress-bar.percents-90, .loading-progress-bar.percents-91, .loading-progress-bar.percents-92 {background-position: 0 -1800px;}.loading-progress-bar.percents-93, .loading-progress-bar.percents-94, .loading-progress-bar.percents-95 {background-position: -130px -1800px;}.loading-progress-bar.percents-96, .loading-progress-bar.percents-97 {background-position: 0 -1900px;}.loading-progress-bar.percents-98, .loading-progress-bar.percents-99 {background-position: -130px -1900px;}.loading-progress-bar.percents-100 {background-position: 0 -2000px;}.follow-txt {text-decoration:none; line-height: 28px; float:right; color:#666666; font-size:12px;}@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {.maintance-block, .loading-progress-bar, .loading-progress-bar div, .loading-cloud, .loading-bottom-button {background-image: url(' + istaticpath + 'images/mega/loading-sprite@2x.png);    background-size: 222px auto;    }}</style><div class="loading-main-block" id="loading"><div class="loading-mid-white-block"><div class="mid-centered-block"><div class="loading-cloud"><div class="loading-progress-bar percents-1" id="loadinganim"><div></div></div></div><div class="maintance-block hidden">Scheduled System Maintenance - Expect Disruptions<br/>Sunday 04:00 - 10:00 UTC </div></div><div class="loading-main-bottom" id="bootbottom"><a href="https://www.facebook.com/MEGAprivacy" target="_blank" class="loading-bottom-button st-facebook-button"></a><a href="https://twitter.com/MEGAprivacy" class="loading-bottom-button st-twitter-button"></a><a href="https://www.twitter.com/MEGAprivacy" target="_blank" class="follow-txt" target="_blank">follow us</a><div class="clear"></div></div></div></div>');
  1033.     }
  1034.     var u_storage,loginresponse,u_sid,jsl_done,dlresponse,dl_res;
  1035.     if (localStorage.sid) u_storage = localStorage;
  1036.     else u_storage = sessionStorage;
  1037.     if (u_sid = u_storage.sid)
  1038.     {
  1039.         loginresponse = true;
  1040.         var lxhr = getxhr();
  1041.         lxhr.onload = function()
  1042.         {
  1043.             if (this.status == 200)
  1044.             {
  1045.                 try
  1046.                 {
  1047.                     loginresponse = this.response || this.responseText;
  1048.                     if (loginresponse && loginresponse[0] == '[') loginresponse = JSON.parse(loginresponse);
  1049.                     else loginresponse = false;
  1050.                     boot_done();
  1051.                 }
  1052.                 catch (e)
  1053.                 {
  1054.                     loginresponse= false;
  1055.                     boot_done();
  1056.                 }
  1057.             }
  1058.             else
  1059.             {
  1060.                 loginresponse= false;
  1061.                 boot_done();
  1062.             }
  1063.         }
  1064.         lxhr.onerror = function()
  1065.         {
  1066.             loginresponse= false;
  1067.             boot_done();
  1068.         }
  1069.         lxhr.open("POST", apipath + 'cs?id=0&sid='+u_storage.sid, true);
  1070.         lxhr.send(JSON.stringify([{'a':'ug'}]));
  1071.     }
  1072.     function boot_auth(u_ctx,r)
  1073.     {
  1074.         u_type = r;
  1075.         u_checked=true;
  1076.         startMega();
  1077.     }
  1078.     function boot_done()
  1079.     {
  1080.         lxhr, dxhr = undefined;
  1081.         if (loginresponse === true || dl_res === true || !jsl_done) return;
  1082.         else if (loginresponse)
  1083.         {
  1084.             api_setsid(u_sid);
  1085.             u_checklogin3a(loginresponse[0],{checkloginresult:boot_auth});
  1086.         }
  1087.         else u_checklogin({checkloginresult:boot_auth},false);
  1088.     }
  1089.     if (page.substr(0,1) == '!' && page.length > 1)
  1090.     {
  1091.         var dlxhr = getxhr(),dl_res = true;
  1092.         dlxhr.onload = function()
  1093.         {
  1094.             if (this.status == 200)
  1095.             {
  1096.                 try
  1097.                 {
  1098.                     dl_res = this.response || this.responseText;
  1099.                     if (dl_res[0] == '[') dl_res = JSON.parse(dl_res);
  1100.                     if (dl_res[0]) dl_res = dl_res[0];
  1101.                     boot_done();
  1102.                 }
  1103.                 catch (e)
  1104.                 {
  1105.                     dl_res = false;
  1106.                     boot_done();
  1107.                 }
  1108.             }
  1109.             else
  1110.             {
  1111.                 dl_res = false;
  1112.                 boot_done();
  1113.             }
  1114.         }
  1115.         dlxhr.onerror = function()
  1116.         {
  1117.             dl_res= false;
  1118.             boot_done();
  1119.         }
  1120.         dlxhr.open("POST", apipath + 'cs?id=0', true);
  1121.         dlxhr.send(JSON.stringify([{'a':'g',p:page.substr(1,8)}]));
  1122.     }
  1123. }
Add Comment
Please, Sign In to add comment