Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.70 KB | None | 0 0
  1.  
  2. // function showPanel() {
  3. //alert("fdghfd");
  4. // }
  5.  
  6. function myFunction() {
  7. var e = document.getElementById("demo");
  8. var c = window.getComputedStyle(e).backgroundColor;
  9. if (c === "rgb(0, 0, 0)") {
  10. document.getElementById("demo").style.background = "#ff77ee";
  11. } else{
  12. document.getElementById("demo").style.background = "#000";
  13. }
  14. }
  15.  
  16.  
  17. function changeColor(id) {
  18.  
  19. if( document.getElementById(id).style.backgroundColor == "lightblue") {document.getElementById(id).style.backgroundColor = "blue";}
  20. else if( document.getElementById(id).style.backgroundColor == "blue"){ document.getElementById(id).style.backgroundColor = "lightblue";}
  21.  
  22. //if( document.getElementById(id).style.backgroundColor == "lightblue") {document.getElementById(id).style.backgroundColor = "blue";} // backcolor
  23. //else if( document.getElementById(id).style.backgroundColor == "blue"){ document.getElementById(id).style.backgroundColor = "lightblue";}
  24. //}
  25. }
  26. function changeColorPanelpon() {
  27.  
  28.  
  29. // backcolor
  30. var c = document.getElementById("pon").children
  31. if( c[0].children[0].style.backgroundColor!="grey") {
  32. document.getElementById("pon").style.backgroundColor = "grey";
  33. for (i = 0; i < c.length; i++) {
  34.  
  35. c[i].style.backgroundColor = "grey";
  36. var d = c[i].children;
  37. for (j = 0; j < d.length; j++) {
  38.  
  39. d[j].style.backgroundColor = "grey";
  40. }
  41. }
  42. }else{
  43. document.getElementById("pon").style.backgroundColor = "lightblue";
  44. for (i = 0; i < c.length; i++) {
  45.  
  46. c[i].style.backgroundColor = "lightblue";
  47. var d = c[i].children;
  48. for (j = 0; j < d.length; j++) {
  49.  
  50. d[j].style.backgroundColor = "lightblue";
  51. }
  52. }
  53. }
  54. }
  55. function changeColorPanelwt() {
  56.  
  57. var c = document.getElementById("wt").children
  58. if( c[0].children[0].style.backgroundColor!="grey") {
  59. document.getElementById("wt").style.backgroundColor = "grey";
  60. for (i = 0; i < c.length; i++) {
  61.  
  62. c[i].style.backgroundColor = "grey";
  63. var d = c[i].children;
  64. for (j = 0; j < d.length; j++) {
  65.  
  66. d[j].style.backgroundColor = "grey";
  67. }
  68. }
  69. }else{
  70. document.getElementById("wt").style.backgroundColor = "lightblue";
  71. for (i = 0; i < c.length; i++) {
  72.  
  73. c[i].style.backgroundColor = "lightblue";
  74. var d = c[i].children;
  75. for (j = 0; j < d.length; j++) {
  76.  
  77. d[j].style.backgroundColor = "lightblue";
  78. }
  79. }
  80. }
  81.  
  82. }
  83.  
  84. function changeColorPanelsr() {
  85. var c = document.getElementById("sr").children
  86. if( c[0].children[0].style.backgroundColor!="grey") {
  87. document.getElementById("sr").style.backgroundColor = "grey";
  88. for (i = 0; i < c.length; i++) {
  89.  
  90. c[i].style.backgroundColor = "grey";
  91. var d = c[i].children;
  92. for (j = 0; j < d.length; j++) {
  93.  
  94. d[j].style.backgroundColor = "grey";
  95. }
  96. }
  97. }else{
  98. document.getElementById("sr").style.backgroundColor = "lightblue";
  99. for (i = 0; i < c.length; i++) {
  100.  
  101. c[i].style.backgroundColor = "lightblue";
  102. var d = c[i].children;
  103. for (j = 0; j < d.length; j++) {
  104.  
  105. d[j].style.backgroundColor = "lightblue";
  106. }
  107. }
  108. }
  109. }
  110.  
  111. function changeColorPanelczw() {
  112. var c = document.getElementById("czw").children
  113. if( c[0].children[0].style.backgroundColor!="grey") {
  114. document.getElementById("czw").style.backgroundColor = "grey";
  115. for (i = 0; i < c.length; i++) {
  116.  
  117. c[i].style.backgroundColor = "grey";
  118. var d = c[i].children;
  119. for (j = 0; j < d.length; j++) {
  120.  
  121. d[j].style.backgroundColor = "grey";
  122. }
  123. }
  124. }else{
  125. document.getElementById("czw").style.backgroundColor = "lightblue";
  126. for (i = 0; i < c.length; i++) {
  127.  
  128. c[i].style.backgroundColor = "lightblue";
  129. var d = c[i].children;
  130. for (j = 0; j < d.length; j++) {
  131.  
  132. d[j].style.backgroundColor = "lightblue";
  133. }
  134. }
  135. }
  136. }
  137.  
  138. function changeColorPanelpt() {
  139. var c = document.getElementById("pt").children
  140.  
  141. if( c[0].children[0].style.backgroundColor!="grey") {
  142. document.getElementById("pt").style.backgroundColor = "grey";
  143. for (i = 0; i < c.length; i++) {
  144.  
  145. c[i].style.backgroundColor = "grey";
  146. var d = c[i].children;
  147. for (j = 0; j < d.length; j++) {
  148.  
  149. d[j].style.backgroundColor = "grey";
  150. }
  151. }
  152. }else{
  153. document.getElementById("pt").style.backgroundColor = "lightblue";
  154. for (i = 0; i < c.length; i++) {
  155.  
  156. c[i].style.backgroundColor = "lightblue";
  157. var d = c[i].children;
  158. for (j = 0; j < d.length; j++) {
  159.  
  160. d[j].style.backgroundColor = "lightblue";
  161. }
  162. }
  163. }
  164. }
  165.  
  166. function changeColorPanelsob() {
  167.  
  168. var c = document.getElementById("sob").children
  169. if( c[0].children[0].style.backgroundColor!="grey") {
  170. document.getElementById("sob").style.backgroundColor = "grey";
  171. for (i = 0; i < c.length; i++) {
  172.  
  173. c[i].style.backgroundColor = "grey";
  174. var d = c[i].children;
  175. for (j = 0; j < d.length; j++) {
  176.  
  177. d[j].style.backgroundColor = "grey";
  178. }
  179. }
  180. }else{
  181. document.getElementById("sob").style.backgroundColor = "lightblue";
  182. for (i = 0; i < c.length; i++) {
  183.  
  184. c[i].style.backgroundColor = "lightblue";
  185. var d = c[i].children;
  186. for (j = 0; j < d.length; j++) {
  187.  
  188. d[j].style.backgroundColor = "lightblue";
  189. }
  190. }
  191. }
  192. }
  193.  
  194. function changeColorPanelndz() {
  195. var c = document.getElementById("ndz").children
  196. if( c[0].children[0].style.backgroundColor!="grey") {
  197. document.getElementById("ndz").style.backgroundColor = "grey";
  198. for (i = 0; i < c.length; i++) {
  199.  
  200. c[i].style.backgroundColor = "grey";
  201. var d = c[i].children;
  202. for (j = 0; j < d.length; j++) {
  203.  
  204. d[j].style.backgroundColor = "grey";
  205. }
  206. }
  207. }else{
  208. document.getElementById("ndz").style.backgroundColor = "lightblue";
  209. for (i = 0; i < c.length; i++) {
  210.  
  211. c[i].style.backgroundColor = "lightblue";
  212. var d = c[i].children;
  213. for (j = 0; j < d.length; j++) {
  214.  
  215. d[j].style.backgroundColor = "lightblue";
  216. }
  217. }
  218. }
  219. }
  220. function pocz() {
  221.  
  222. var c = document.getElementById("tabcontainer").children;
  223.  
  224.  
  225. for (i = 3; i < c.length; i++) {
  226. c[i].style.backgroundColor = "lightblue";
  227. var d = c[i].children;
  228. for (j = 0; j < d.length; j++) {
  229. d[j].style.backgroundColor = "lightblue";
  230. var x=d[j].children;
  231. for (z= 0; z < x.length;z++) {
  232. x[z].style.backgroundColor = "lightblue";
  233. }
  234. }
  235. }
  236. }
  237. pocz();
  238.  
  239. var password = document.getElementById("password")
  240. , confirm_password = document.getElementById("confirm_password");
  241.  
  242. function validatePassword(){
  243. if(password.value != confirm_password.value) {
  244. confirm_password.setCustomValidity("Hasła się nie zgadzają");
  245. } else {
  246. confirm_password.setCustomValidity('');
  247. }
  248. }
  249.  
  250. password.onchange = validatePassword;
  251. confirm_password.onkeyup = validatePassword;
  252.  
  253. function validatedate(inputText)
  254. {
  255. var dateformat = /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/;
  256. // Match the date format through regular expression
  257. if(inputText.value.match(dateformat))
  258. {
  259. document.form1.text1.focus();
  260. //Test which seperator is used '/' or '-'
  261. var opera1 = inputText.value.split('/');
  262. var opera2 = inputText.value.split('-');
  263. lopera1 = opera1.length;
  264. lopera2 = opera2.length;
  265. // Extract the string into month, date and year
  266. if (lopera1>1)
  267. {
  268. var pdate = inputText.value.split('/');
  269. }
  270. else if (lopera2>1)
  271. {
  272. var pdate = inputText.value.split('-');
  273. }
  274. var dd = parseInt(pdate[0]);
  275. var mm = parseInt(pdate[1]);
  276. var yy = parseInt(pdate[2]);
  277. // Create list of days of a month [assume there is no leap year by default]
  278. var ListofDays = [31,28,31,30,31,30,31,31,30,31,30,31];
  279. if (mm==1 || mm>2)
  280. {
  281. if (dd>ListofDays[mm-1])
  282. {
  283. alert('Invalid date format!');
  284. return false;
  285. }
  286. }
  287. if (mm==2)
  288. {
  289. var lyear = false;
  290. if ( (!(yy % 4) && yy % 100) || !(yy % 400))
  291. {
  292. lyear = true;
  293. }
  294. if ((lyear==false) && (dd>=29))
  295. {
  296. alert('Invalid date format!');
  297. return false;
  298. }
  299. if ((lyear==true) && (dd>29))
  300. {
  301. alert('Invalid date format!');
  302. return false;
  303. }
  304. }
  305. }
  306. else
  307. {
  308. alert("Invalid date format!");
  309. document.form1.text1.focus();
  310. return false;
  311. }
  312. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement