function get(id) {
if (document.getElementById(id)) {
return document.getElementById(id);
}
return false;
}
function changeValue(check,checkValue,insertValue) {
if (get(check)) {
if(get(check).value==checkValue) {
get(check).value=insertValue;
}
return true;
}
return false;
}
function replace(check,checkValue,insertValue) {
if (get(check)) {
get(check).value=get(check).value.replace(checkValue,insertValue);
return true;
}
return false;
}
function change(id,action,insertValue) {
if (get(id)) {
switch (action) {
case 'action': get(id).action=insertValue; break;
case 'style.background': get(id).style.background=insertValue; break;
case 'style.border': get(id).style.border=insertValue; break;
case 'checked': get(id).checked=insertValue; break;
case 'disabled': get(id).disabled=insertValue; break;
case 'html': get(id).innerHTML=insertValue; break;
default: get(id).value=insertValue; break;
}
return true;
}
return false;
}
function style(id,action,insertValue,checkValue) {
if (get(id)) {
if(checkValue==0) {
switch (action) {
case 'display': get(id).style.display=insertValue; break;
}
return true;
}
else {
switch (action) {
case 'display': get(id).style.display==checkValue?style(id,action,insertValue,0):style(id,action,checkValue,0); break;
}
return true;
}
}
return false;
}
function checkAll() {
var i=0;
if(get('check_all').checked==true) {
while(change('check_' + i++,'checked',true));
}
else {
while(change('check_' + i++,'checked',false));
}
}
function alert1() {
alert ("Nie uzupełniono wszystkich wymaganych pól!!!");
}