Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // function showPanel() {
- //alert("fdghfd");
- // }
- function myFunction() {
- var e = document.getElementById("demo");
- var c = window.getComputedStyle(e).backgroundColor;
- if (c === "rgb(0, 0, 0)") {
- document.getElementById("demo").style.background = "#ff77ee";
- } else{
- document.getElementById("demo").style.background = "#000";
- }
- }
- function changeColor(id) {
- if( document.getElementById(id).style.backgroundColor == "lightblue") {document.getElementById(id).style.backgroundColor = "blue";}
- else if( document.getElementById(id).style.backgroundColor == "blue"){ document.getElementById(id).style.backgroundColor = "lightblue";}
- //if( document.getElementById(id).style.backgroundColor == "lightblue") {document.getElementById(id).style.backgroundColor = "blue";} // backcolor
- //else if( document.getElementById(id).style.backgroundColor == "blue"){ document.getElementById(id).style.backgroundColor = "lightblue";}
- //}
- }
- function changeColorPanelpon() {
- // backcolor
- var c = document.getElementById("pon").children
- if( c[0].children[0].style.backgroundColor!="grey") {
- document.getElementById("pon").style.backgroundColor = "grey";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "grey";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "grey";
- }
- }
- }else{
- document.getElementById("pon").style.backgroundColor = "lightblue";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- function changeColorPanelwt() {
- var c = document.getElementById("wt").children
- if( c[0].children[0].style.backgroundColor!="grey") {
- document.getElementById("wt").style.backgroundColor = "grey";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "grey";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "grey";
- }
- }
- }else{
- document.getElementById("wt").style.backgroundColor = "lightblue";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- function changeColorPanelsr() {
- var c = document.getElementById("sr").children
- if( c[0].children[0].style.backgroundColor!="grey") {
- document.getElementById("sr").style.backgroundColor = "grey";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "grey";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "grey";
- }
- }
- }else{
- document.getElementById("sr").style.backgroundColor = "lightblue";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- function changeColorPanelczw() {
- var c = document.getElementById("czw").children
- if( c[0].children[0].style.backgroundColor!="grey") {
- document.getElementById("czw").style.backgroundColor = "grey";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "grey";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "grey";
- }
- }
- }else{
- document.getElementById("czw").style.backgroundColor = "lightblue";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- function changeColorPanelpt() {
- var c = document.getElementById("pt").children
- if( c[0].children[0].style.backgroundColor!="grey") {
- document.getElementById("pt").style.backgroundColor = "grey";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "grey";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "grey";
- }
- }
- }else{
- document.getElementById("pt").style.backgroundColor = "lightblue";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- function changeColorPanelsob() {
- var c = document.getElementById("sob").children
- if( c[0].children[0].style.backgroundColor!="grey") {
- document.getElementById("sob").style.backgroundColor = "grey";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "grey";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "grey";
- }
- }
- }else{
- document.getElementById("sob").style.backgroundColor = "lightblue";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- function changeColorPanelndz() {
- var c = document.getElementById("ndz").children
- if( c[0].children[0].style.backgroundColor!="grey") {
- document.getElementById("ndz").style.backgroundColor = "grey";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "grey";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "grey";
- }
- }
- }else{
- document.getElementById("ndz").style.backgroundColor = "lightblue";
- for (i = 0; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- function pocz() {
- var c = document.getElementById("tabcontainer").children;
- for (i = 3; i < c.length; i++) {
- c[i].style.backgroundColor = "lightblue";
- var d = c[i].children;
- for (j = 0; j < d.length; j++) {
- d[j].style.backgroundColor = "lightblue";
- var x=d[j].children;
- for (z= 0; z < x.length;z++) {
- x[z].style.backgroundColor = "lightblue";
- }
- }
- }
- }
- pocz();
- var password = document.getElementById("password")
- , confirm_password = document.getElementById("confirm_password");
- function validatePassword(){
- if(password.value != confirm_password.value) {
- confirm_password.setCustomValidity("Hasła się nie zgadzają");
- } else {
- confirm_password.setCustomValidity('');
- }
- }
- password.onchange = validatePassword;
- confirm_password.onkeyup = validatePassword;
- function validatedate(inputText)
- {
- var dateformat = /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/;
- // Match the date format through regular expression
- if(inputText.value.match(dateformat))
- {
- document.form1.text1.focus();
- //Test which seperator is used '/' or '-'
- var opera1 = inputText.value.split('/');
- var opera2 = inputText.value.split('-');
- lopera1 = opera1.length;
- lopera2 = opera2.length;
- // Extract the string into month, date and year
- if (lopera1>1)
- {
- var pdate = inputText.value.split('/');
- }
- else if (lopera2>1)
- {
- var pdate = inputText.value.split('-');
- }
- var dd = parseInt(pdate[0]);
- var mm = parseInt(pdate[1]);
- var yy = parseInt(pdate[2]);
- // Create list of days of a month [assume there is no leap year by default]
- var ListofDays = [31,28,31,30,31,30,31,31,30,31,30,31];
- if (mm==1 || mm>2)
- {
- if (dd>ListofDays[mm-1])
- {
- alert('Invalid date format!');
- return false;
- }
- }
- if (mm==2)
- {
- var lyear = false;
- if ( (!(yy % 4) && yy % 100) || !(yy % 400))
- {
- lyear = true;
- }
- if ((lyear==false) && (dd>=29))
- {
- alert('Invalid date format!');
- return false;
- }
- if ((lyear==true) && (dd>29))
- {
- alert('Invalid date format!');
- return false;
- }
- }
- }
- else
- {
- alert("Invalid date format!");
- document.form1.text1.focus();
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement