var isNN = (navigator.appName.indexOf("Netscape") != -1); var isIE = (navigator.appName.indexOf("Microsoft") != -1); function isInt(x) { var y=parseInt(x); if (isNaN(y)) return false; return x==y && x.toString()==y.toString(); } function showHideDiv(obj) { var s; if(isIE) { s = document.all[obj].style.display; if(s == 'block') { s = 'none'; }else{ s = 'block'; } document.all[obj].style.display = s; }else{ obj = document.getElementById(obj); s = obj.style.display; if(s == 'block') { s = 'none'; }else{ s = 'block'; } obj.setAttribute('style','display:'+s); } } function deleteConfirmation(url) { var answer = confirm("Are you sure you want to delete this?") if (answer){ window.location = url; } } function fillCal(obj) { obj = document.getElementById(obj); obj2 = document.getElementById('calendar_entry'); cal = obj.innerHTML; obj2.innerHTML = cal; } function subgroupFill(id,action) { obj = document.getElementById('subgroup'+id); var title = obj.innerHTML; f = document.subgroups; f.id.value = id; f.title.value = title; f.action.value = action; f.actionbutton.value = "Update"; } function subgroupConfirmation(url) { var answer = confirm("Are you sure you want to delete this subgroup? It will cause all events for this group to be uncategorized.") if (answer){ window.location = url; } } function calendarFill(id,action) { // get content obj = document.getElementById('id'+id); var calendar_id = obj.innerHTML; obj = document.getElementById('date'+id); var date = obj.innerHTML; obj = document.getElementById('title'+id); var title = obj.innerHTML; obj = document.getElementById('subgroup_id'+id); var subgroup_id = obj.innerHTML; obj = document.getElementById('description'+id); var description = obj.innerHTML; obj = document.getElementById('distance'+id); var distance = obj.innerHTML; // place content var f = document.calendar_entry; f.calendar_id.value = calendar_id; f.date.value = date; f.title.value = title; for (var i=0; i < f.subgroup_id.length; i++) { if (f.subgroup_id[i].value == subgroup_id) { f.subgroup_id[i].selected = true; } } f.description.value = description; f.distance.value = distance; if(action == 'edit') { f.action.value = 'update'; f.actionbutton.value = "Update"; }else{ f.action.value = 'create'; f.actionbutton.value = "Save"; } } function calendarAdminFill(id,action) { // get content obj = document.getElementById('id'+id); var calendar_id = obj.innerHTML; obj = document.getElementById('date'+id); var date = obj.innerHTML; obj = document.getElementById('title'+id); var title = obj.innerHTML; obj = document.getElementById('group_id'+id); var group_id = obj.innerHTML; //obj = document.getElementById('subgroup_id'+id); //var subgroup_id = obj.innerHTML; obj = document.getElementById('description'+id); var description = obj.innerHTML; obj = document.getElementById('coaches_notes'+id); var coaches_notes = obj.innerHTML; obj = document.getElementById('distance'+id); var distance = obj.innerHTML; obj = document.getElementById('plan_settings'+id); var plan_settings = obj.innerHTML; eval(plan_settings); // place content var f = document.calendar_entry; f.calendar_id.value = calendar_id; f.date.value = date; f.title.value = title; for(var i=0;i 0) { alert("Please enter the following information: \n\n" + errors); errors = ""; return false; } return true; } function validateGroupFundraisingSettings(form) { var errors = ""; if(!isInt(form.goal.value)) { errors += " - Goal value must be a number greater than zero\n"; } if(form.active[form.active.selectedIndex].value == 1 && form.goal.value < 1) { errors += " - Goal value must be a number greater than zero\n"; } if (errors.length > 0) { alert("Please enter the following information: \n\n" + errors); errors = ""; return false; } return true; }