errorPageFunctions.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. function geturlparams( key )
  2. {
  3. key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  4. var regexS = "[\\#&]"+key+"=([^&#]*)";
  5. var regex = new RegExp( regexS );
  6. var results = regex.exec( window.location.href );
  7. if( results == null )
  8. return "";
  9. else
  10. return results[1];
  11. }
  12. function geterrorhex()
  13. {
  14. var signedInt=geturlparams('errorcode');
  15. return "0x" + CvtI32(signedInt).toUpperCase();
  16. }
  17. function bitStr(N, bits)
  18. {
  19. var S = "", Q
  20. while (bits--) { S = (Q=N%2) + S ; N = (N-Q)/2 }
  21. return S;
  22. }
  23. function hex(N, bits)
  24. {
  25. return (0x10000 + N).toString(16).substring(5-bits)
  26. }
  27. function Four(d, c, b, a, bits)
  28. {
  29. return hex(d, bits) + hex(c, bits) + hex(b, bits) + hex(a, bits)
  30. }
  31. function CvtI32(F)
  32. {
  33. var X = F |0, a, b, c, d
  34. var ba = bitStr(a = X & 0xFF, 8)
  35. var bb = bitStr(b = X >> 8 & 0xFF, 8)
  36. var bc = bitStr(c = X >> 16 & 0xFF, 8)
  37. var bd = bitStr(d = X >> 24 & 0xFF, 8)
  38. var hex = Four(d, c, b, a, 2)
  39. return hex;
  40. }
  41. function tryagain()
  42. {
  43. window.location.replace(unescape(geturlparams('url')));
  44. }
  45. function togglemore()
  46. {
  47. var display=document.getElementById("errorMoreInfo").style.display;
  48. if (display == "block") {
  49. document.getElementById("errorMoreInfo").style.display="none";
  50. }
  51. else {
  52. document.getElementById("errorMoreInfo").style.display="block";
  53. }
  54. }
  55. function populatepage()
  56. {
  57. var errorcode = parseInt(geturlparams('errorcode'));
  58. switch (errorcode)
  59. {
  60. case 404:
  61. var errorTitle = errorTitle404;
  62. var errorCode = errorCode404;
  63. var errorDescription = errorDescription404;
  64. break;
  65. case 403:
  66. var errorTitle = errorTitle403;
  67. var errorCode = errorCode403;
  68. var errorDescription = errorDescription403;
  69. break;
  70. case 500:
  71. var errorTitle = errorTitle500;
  72. var errorCode = errorCode500;
  73. var errorDescription = errorDescription500;
  74. break;
  75. case 503:
  76. var errorTitle = errorTitle503;
  77. var errorCode = errorCode503;
  78. var errorDescription = errorDescription503;
  79. break;
  80. case 502:
  81. var errorTitle = errorTitle502;
  82. var errorCode = errorCode502;
  83. var errorDescription = errorDescription502;
  84. break;
  85. case 501:
  86. var errorTitle = errorTitle501;
  87. var errorCode = errorCode501;
  88. var errorDescription = errorDescription501;
  89. break;
  90. case 504:
  91. var errorTitle = errorTitle504;
  92. var errorCode = errorCode504;
  93. var errorDescription = errorDescription504;
  94. break;
  95. case 505:
  96. var errorTitle = errorTitle505;
  97. var errorCode = errorCode505;
  98. var errorDescription = errorDescription505;
  99. break;
  100. case 400:
  101. var errorTitle = errorTitle400;
  102. var errorCode = errorCode400;
  103. var errorDescription = errorDescription400;
  104. break;
  105. case 401:
  106. var errorTitle = errorTitle401;
  107. var errorCode = errorCode401;
  108. var errorDescription = errorDescription401;
  109. break;
  110. case 402:
  111. var errorTitle = errorTitle402;
  112. var errorCode = errorCode402;
  113. var errorDescription = errorDescription402;
  114. break;
  115. case 405:
  116. var errorTitle = errorTitle405;
  117. var errorCode = errorCode405;
  118. var errorDescription = errorDescription405;
  119. break;
  120. case 406:
  121. var errorTitle = errorTitle406;
  122. var errorCode = errorCode406;
  123. var errorDescription = errorDescription406;
  124. break;
  125. case 407:
  126. var errorTitle = errorTitle407;
  127. var errorCode = errorCode407;
  128. var errorDescription = errorDescription407;
  129. break;
  130. case 408:
  131. var errorTitle = errorTitle408;
  132. var errorCode = errorCode408;
  133. var errorDescription = errorDescription408;
  134. break;
  135. case 409:
  136. var errorTitle = errorTitle409;
  137. var errorCode = errorCode409;
  138. var errorDescription = errorDescription409;
  139. break;
  140. case 410:
  141. var errorTitle = errorTitle410;
  142. var errorCode = errorCode410;
  143. var errorDescription = errorDescription410;
  144. break;
  145. case 411:
  146. var errorTitle = errorTitle411;
  147. var errorCode = errorCode411;
  148. var errorDescription = errorDescription411;
  149. break;
  150. case 413:
  151. var errorTitle = errorTitle413;
  152. var errorCode = errorCode413;
  153. var errorDescription = errorDescription413;
  154. break;
  155. case 414:
  156. var errorTitle = errorTitle414;
  157. var errorCode = errorCode414;
  158. var errorDescription = errorDescription414;
  159. break;
  160. case 415:
  161. var errorTitle = errorTitle415;
  162. var errorCode = errorCode415;
  163. var errorDescription = errorDescription415;
  164. break;
  165. case -2146697214:
  166. var errorTitle = errorTitle800c0002;
  167. var errorCode = errorCode800c0002;
  168. var errorDescription = errorDescription800c0002;
  169. break;
  170. case -2146697213:
  171. var errorTitle = errorTitle800c0003;
  172. var errorCode = errorCode800c0003;
  173. var errorDescription = errorDescription800c0003;
  174. break;
  175. case -2146697212:
  176. var errorTitle = errorTitle800c0004;
  177. var errorCode = errorCode800c0004;
  178. var errorDescription = errorDescription800c0004;
  179. break;
  180. case -2146697211:
  181. var errorTitle = errorTitle800c0005;
  182. var errorCode = errorCode800c0005;
  183. var errorDescription = errorDescription800c0005;
  184. break;
  185. case -2146697210:
  186. var errorTitle = errorTitle800c0006;
  187. var errorCode = errorCode800c0006;
  188. var errorDescription = errorDescription800c0006;
  189. break;
  190. case -2146697209:
  191. var errorTitle = errorTitle800c0007;
  192. var errorCode = errorCode800c0007;
  193. var errorDescription = errorDescription800c0007;
  194. break;
  195. case -2146697208:
  196. var errorTitle = errorTitle800c0008;
  197. var errorCode = errorCode800c0008;
  198. var errorDescription = errorDescription800c0008;
  199. break;
  200. case -2146697207:
  201. var errorTitle = errorTitle800c0009;
  202. var errorCode = errorCode800c0009;
  203. var errorDescription = errorDescription800c0009;
  204. break;
  205. case -2146697206:
  206. var errorTitle = errorTitle800c000a;
  207. var errorCode = errorCode800c000a;
  208. var errorDescription = errorDescription800c000a;
  209. break;
  210. case -2146697205:
  211. var errorTitle = errorTitle800c000b;
  212. var errorCode = errorCode800c000b;
  213. var errorDescription = errorDescription800c000b;
  214. break;
  215. case -2146697204:
  216. var errorTitle = errorTitle800c000c;
  217. var errorCode = errorCode800c000c;
  218. var errorDescription = errorDescription800c000c;
  219. break;
  220. case -2146697203:
  221. var errorTitle = errorTitle800c000d;
  222. var errorCode = errorCode800c000d;
  223. var errorDescription = errorDescription800c000d;
  224. break;
  225. case -2146697202:
  226. var errorTitle = errorTitle800c000e;
  227. var errorCode = errorCode800c000e;
  228. var errorDescription = errorDescription800c000e;
  229. break;
  230. case -2146697201:
  231. var errorTitle = errorTitle800c000f;
  232. var errorCode = errorCode800c000f;
  233. var errorDescription = errorDescription800c000f;
  234. break;
  235. case -2146697200:
  236. var errorTitle = errorTitle800c0010;
  237. var errorCode = errorCode800c0010;
  238. var errorDescription = errorDescription800c0010;
  239. break;
  240. case -2146697196:
  241. var errorTitle = errorTitle800c0014;
  242. var errorCode = errorCode800c0014;
  243. var errorDescription = errorDescription800c0014;
  244. break;
  245. case -2146697195:
  246. var errorTitle = errorTitle800c0015;
  247. var errorCode = errorCode800c0015;
  248. var errorDescription = errorDescription800c0015;
  249. break;
  250. case -2146697194:
  251. var errorTitle = errorTitle800c0016;
  252. var errorCode = errorCode800c0016;
  253. var errorDescription = errorDescription800c0016;
  254. break;
  255. case -2146697193:
  256. var errorTitle = errorTitle800c0017;
  257. var errorCode = errorCode800c0017;
  258. var errorDescription = errorDescription800c0017;
  259. break;
  260. case -2146697192:
  261. var errorTitle = errorTitle800c0018;
  262. var errorCode = errorCode800c0018;
  263. var errorDescription = errorDescription800c0018;
  264. break;
  265. case -2146697960:
  266. var errorTitle = errorTitle800c0100;
  267. var errorCode = errorCode800c0100;
  268. var errorDescription = errorDescription800c0100;
  269. break;
  270. case -2146696704:
  271. var errorTitle = errorTitle800c0200;
  272. var errorCode = errorCode800c0200;
  273. var errorDescription = errorDescription800c0200;
  274. break;
  275. case -2146696448:
  276. var errorTitle = errorTitle800c0300;
  277. var errorCode = errorCode800c0300;
  278. var errorDescription = errorDescription800c0300;
  279. break;
  280. default:
  281. var errorTitle = errorTitleUnknown;
  282. var errorCode = errorCodeUnknown;
  283. var errorDescription = errorDescriptionUnknown;
  284. }
  285. document.getElementById("errorTitleText").innerHTML = errorTitle;
  286. document.getElementById("errorCode").innerHTML = errorCode;
  287. document.getElementById("errorDescText").innerHTML = errorDescription;
  288. }