function checkinput(inputname,message,form,type) { thabool = 0; if (type == 'string'){ if (form[inputname].value != '') { thabool = 1; } } if (type == 'email'){ valid = new RegExp("^[a-zA-Z0-9]+([.]?[a-zA-Z0-9_-]+)*[@]([a-zA-Z0-9_-]+[.])+([a-zA-Z]{2,4})$").exec(form[inputname].value); if (valid) { thabool = 1; } } if (thabool == 0) { alert(message); Fat.fade_element(inputname); thisinput = document.getElementsByName(inputname)[0]; form[inputname].focus(); thisinput.className = thisinput.className+' warning'; divje = thisinput.parentNode; divje.className = divje.className+' warning'; return false; } else { return true; } }