function confirmdelete() { if (!confirm('Are you sure you want to delete?')) { return false; } else { return true; } } function sendpass() { var email = prompt("Enter you e-mailaddress and we will send you a reminder.", ""); if (email) { document.location.href='start.php?action=sendpass&email='+email; } } function checkregform() { var iform = document.regform; if (!iform.username.value) { alert('You must enter a username!'); return false; } //kontrollera så att användarnamnet bara innehåller a-z och 0-9 eller . och -_ if (!iform.password.value) { alert('You must enter a password!'); return false; } if (iform.password.value != iform.password2.value) { alert('You must enter the same password twice!'); return false; } if (!iform.firstname.value) { alert('You must enter your firstname!'); return false; } if (!iform.lastname.value) { alert('You must enter you lastname!'); return false; } if (iform.genderid.value == 0) { alert('You must choose a gender!'); return false; } if (!iform.year.value || !iform.month.value || !iform.day.value) { alert('You must enter your birthdate!'); return false; } if (!iform.countryid.value) { alert('You must choose a country!'); return false; } if (iform.countryid.value == '171' && !iform.cityid.value) { alert('You must choose a city!'); return false; } return true; } function checkpwdform() { var iform = document.passwordform; if (!iform.oldpassword.value) { alert('You must enter your current password!'); return false; } if (!iform.newpassword.value) { alert('You must enter a new password!'); return false; } if (iform.newpassword.value != iform.newpassword2.value) { alert('You must enter the same password twice!'); return false; } return true; } function checkuserform() { var iform = document.regform; if (!iform.firstname.value) { alert('You must enter your firstname!'); return false; } if (!iform.lastname.value) { alert('You must enter you lastname!'); return false; } if (iform.genderid.value == 0) { alert('You must choose a gender!'); return false; } if (!iform.year.value || !iform.month.value || !iform.day.value) { alert('You must enter your birthdate!'); return false; } if (!iform.countryid.value) { alert('You must choose a country!'); return false; } if (iform.countryid.value == '171' && !iform.cityid.value) { alert('You must choose a city!'); return false; } return true; } function movecategory() { document.delform.action='edit_categories.php?action=movecategory'; document.delform.submit(); } function delgroup(groupid) { if (!confirmdelete()) { return false; } document.location.href='edit_categories.php?action=delgroup&groupid='+groupid; } function newgroup() { var groupname = prompt("Add a new group:", "Groupname"); if (groupname) { document.location.href='edit_categories.php?action=newgroup&groupname=' + escape(groupname); } } function newcategory(groupid) { var category = prompt("Add a new category:", "Categoryname"); if (category) { document.location.href='edit_categories.php?action=newcategory&groupid=' + groupid + '&category=' + escape(category); } } function editgroup(groupid,oldgroup) { var groupname = prompt("Edit group:", oldgroup); if (groupname) { document.location.href='edit_categories.php?action=renamegroup&groupid=' + groupid + '&groupname=' + escape(groupname); } } function checkall(thestate) { var theform=document.forms.delform; for (c=0;c