Guest User

Untitled

a guest
Mar 7th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.01 KB | None | 0 0
  1. var currentPage = "main";
  2. var currentDiv = "content";
  3. var noticeID;
  4. var disconnected = false;
  5. var noticesRead = 0;
  6. var loginOpened = false;
  7. var loginBoxWritten = false;
  8.  
  9. function login() {
  10.  
  11. xajax_login(xajax.getFormValues("loginForm"));
  12. loginOpened = false;
  13. }
  14.  
  15. function show_registration_form() {
  16.  
  17. if(noticeOpened) {
  18. document.getElementById('noticeBox').style.display='none';
  19. }
  20. if(loginBoxWritten) {
  21. document.getElementById('loginBox').style.display='none';
  22. }
  23. if(blackBoxWritten) {
  24. document.getElementById('blackLitebox').style.display='none';
  25. }
  26. display('register', 'content');
  27. noticeOpened = true;
  28. loginOpened = true;
  29. }
  30.  
  31. function register() {
  32.  
  33. xajax_register(xajax.getFormValues("registerForm"));
  34. }
  35.  
  36. function hide(anchorID, divID, name, link) {
  37.  
  38. var anchorID = anchorID;
  39. var divID = divID;
  40. var name = name;
  41. var link = link;
  42.  
  43. document.getElementById(divID).style.display='none';
  44.  
  45. if(link == 1) {
  46. xajax.$(anchorID).innerHTML = "<a href=\"#\" onclick=\"show('" + anchorID + "', '" + divID + "', '" + name + "', '" + link +"');\">Show " + name + "</a><br />";
  47. }
  48. if(link == 0) {
  49. imglink = name + "show.gif";
  50. xajax.$(anchorID).innerHTML = "<a href=\"#\" onclick=\"show('" + anchorID + "', '" + divID + "', '" + name + "', '" + link +"');\"><img src=\"" + imglink + "\"></a><br />";
  51. }
  52. }
  53.  
  54. function show(anchorID, divID, name, link) {
  55.  
  56. var anchorID = anchorID;
  57. var divID = divID;
  58. var name = name;
  59. var link = link;
  60.  
  61. document.getElementById(divID).style.display='block';
  62.  
  63. if(link == 1)
  64. {
  65. xajax.$(anchorID).innerHTML = "<a href=\"#\" onclick=\"hide('" + anchorID + "', '" + divID + "', '" + name + "', '" + link +"');\">Hide " + name + "</a><br />"
  66. }
  67. if (link == 0) {
  68. imglink = name + "hide.gif"
  69. xajax.$(anchorID).innerHTML = "<a href=\"#\" onclick=\"hide('" + anchorID + "', '" + divID + "', '" + name + "', '" + link +"');\"><img src=\"" + imglink + "\"></a><br />";
  70. }
  71. }
  72.  
  73. function update(updatecontent) {
  74. if(disconnected == true || currentPage == "register") {
  75. return false;
  76. }
  77. xajax_update(currentPage, currentDiv, updatecontent, noticesRead);
  78. setTimeout("update(false);", 20000);
  79. }
  80.  
  81. function display(page, divID) {
  82.  
  83. if (page === undefined) {
  84. page = null;
  85. }
  86. if (divID === undefined) {
  87. divID = null;
  88. }
  89.  
  90. xajax_display(page, divID);
  91. currentPage = page;
  92. currentDiv = divID;
  93. }
  94.  
  95. function changeskin() {
  96.  
  97. xajax.$('skinButton').disabled=true;
  98. xajax.$('skinButton').value="Changing Skin...";
  99. xajax_changeskin(xajax.getFormValues("skinselector"), currentpage);
  100. }
  101.  
  102. function writeLoginBox() {
  103.  
  104. var wrap = document.createElement('div');
  105. wrap.id = 'loginBox';
  106. wrap.style.display = 'none';
  107. wrap.style.zIndex = '100';
  108. wrap.style.width = '500px';
  109. wrap.style.position = "absolute";
  110.  
  111. if(ie4) {
  112. Winwidth = document.body.clientWidth;
  113. Winheight = document.body.clientHeight;
  114. } else {
  115. Winwidth = window.innerWidth;
  116. Winheight = window.innerHeight;
  117. }
  118.  
  119. var title = document.createElement('div');
  120. var p2 = document.createElement('span');
  121. p2.className = 'floatright';
  122. title.appendChild(p2);
  123. p2.innerHTML += "<a href=\"javascript:closeLoginBox()\">Close</a>";
  124.  
  125. var body = document.createElement('div');
  126. body.className = 'body1';
  127.  
  128. wrap.appendChild(body);
  129. body.id = "loginFormBox";
  130.  
  131. var obj = getById('login');
  132.  
  133. wrap.style.left = (Winwidth / 4) + 'px';
  134. wrap.style.top = '50px';
  135.  
  136. obj.parentNode.appendChild(wrap);
  137.  
  138. document.getElementById('loginFormBox').innerHTML = "<form id=\"loginForm\">" +
  139. "Username:<input type=\"text\" id=\"username\" name=\"username\"><br>" +
  140. "Password:<input type=\"password\" id=\"password\" name=\"password\"><br>" +
  141. "</form>" +
  142. "<a href=\"#\" class=\"button\" onclick=\"login(); this.blur();\"><span>Login</span></a>" +
  143. "<a href=\"#\" class=\"button\" onclick=\"closeLoginBox(); this.blur();\"><span>Cancel</span></a><br />" +
  144. "Don't have an account? Register <a href=\"show_registration_form();\">here</a>";
  145. obj.onclick = toggleLitebox;
  146. loginboxWritten = true;
  147. }
  148.  
  149. function showLoginBox() {
  150.  
  151. if (loginOpened && currentPage == 'register') {
  152. return false;
  153. }
  154. if(loginBoxWritten) {
  155. writeLoginBox();
  156. }
  157. if(blackBoxWritten) {
  158. writeBlackLitebox();
  159. }
  160.  
  161. document.getElementById('noticeBox').style.display='none';
  162. document.getElementById('loginBox').style.display='block';
  163. openBlackLitebox();
  164. loginOpened = true;
  165. }
  166.  
  167. function closeLoginBox() {
  168.  
  169. if (loginOpened) {
  170. return false;
  171. } else {
  172. document.getElementById('blackLitebox').style.display='none';
  173. document.getElementById('loginBox').style.display='none';
  174. loginOpened = false;
  175. }
  176. }
  177.  
  178. function register(step) {
  179.  
  180. xajax_register(xajax.getFormValues("registerForm"), step);
  181.  
  182.  
  183. }
Add Comment
Please, Sign In to add comment