function login(){ document.Main.theAction.value = "login"; document.Main.submit(); } function logout(){ setCookie("email", "", 0, "/", "", 0); setCookie("session","", 0, "/", "", 0); list(); } function list(){ document.Main.theAction.value = "list"; document.Main.submit(); } function signUp(){ document.Main.theAction.value = "signUp"; document.Main.submit(); } function projSignUp(id){ document.Main.theAction.value = "projSignUp"; document.Main.id.value = id; document.Main.submit(); } function addComment(){ document.Main.theAction.value = "addComment"; document.Main.submit(); } function addReview(id){ document.Main.theAction.value = "addReview"; document.Main.id.value = id; document.Main.submit(); } function homepage(){ document.Main.theAction.value = "homepage"; document.Main.submit(); } function admin01(){ window.location.href = '/admin/applications/index.php'; } function addEvent(){ document.Main.theAction.value = "addEvent"; document.Main.submit(); } function editEvent(id){ document.Main.theAction.value = "editEvent"; document.Main.id.value = id; document.Main.submit(); } function addProject(){ document.Main.theAction.value = "addProject"; document.Main.submit(); } function editProject(id){ document.Main.theAction.value = "editProject"; document.Main.id.value = id; document.Main.submit(); } function save(){ document.Main.submit(); } function saveReview(){ if (document.Main.photo1.value=="" || document.Main.photo2.value=="" || document.Main.photo3.value==""){ alert("You must upload 3 photos as part of your review."); return false; } else { document.Main.submit(); } } function showDetail(eventID){ document.Main.theAction.value = "showDetail"; document.Main.id.value = eventID; document.Main.submit(); } function showReview(eventID){ document.Main.theAction.value = "showReview"; document.Main.id.value = eventID; document.Main.submit(); return true; } function showProjDetail(projID, projVersion){ document.Main.theAction.value = "showProjDetail"; document.Main.id.value = projID; document.Main.projVersion.value = projVersion; document.Main.submit(); } function showProjReview(projID){ document.Main.theAction.value = "showProjReview"; document.Main.id.value = projID; document.Main.submit(); return true; } function changePassword(){ document.Main.theAction.value = "changePassword"; document.Main.submit(); } function setCookie(name,value,expires,path,domain,secure) { document.cookie = name + "=" +escape(value) + ( (expires) ? ";expires=" + expires : "") + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ( (secure) ? ";secure" : ""); } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else begin += 2; var end = document.cookie.indexOf(";", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin + prefix.length, end)); } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } function deleteEvent(id){ if (confirm("Are you sure you want to delete this event? This action cannot be undone!")) { if (confirm("Are you really sure?")) { document.Main.theAction.value = "delete"; document.Main.id.value = id; document.Main.submit(); } } } function setStatusApprove(id, approvedBy){ if (confirm("Are you sure you want to approve this event? This action cannot be undone!")) { document.Main.theAction.value = "approve"; if (approvedBy != '' && approvedBy != ' ') document.Main.approvedBy.value = approvedBy; document.Main.id.value = id; document.Main.submit(); } } function setStatusHold(id){ if (confirm("Are you sure you want to hold this event?")) { document.Main.theAction.value = "hold"; document.Main.id.value = id; document.Main.submit(); } } function setStatusDecline(id){ if (confirm("Are you sure you want to decline this event? This action cannot be undone!")) { document.Main.theAction.value = "decline"; document.Main.id.value = id; document.Main.submit(); } } function popWindow(url, height, width, xpos, ypos, title) { winOptions = 'toolbar=0,location=0,directories=0,screenx=' + xpos + ',screeny='+ ypos + ',top='+ ypos +',left=' + xpos + ',status=0,menubar=0,scrollbars=1,resizable=1,width=' + width + ',height=' + height; var temp = window.open(url, title, winOptions); temp.focus(); } function popAddUserWindow(url, height, width, xpos, ypos, title) { winOptions = 'toolbar=0,location=0,directories=0,screenx=' + xpos + ',screeny='+ ypos + ',top='+ ypos +',left=' + xpos + ',status=0,menubar=0,scrollbars=1,resizable=1,width=' + width + ',height=' + height; var temp = window.open(url, title, winOptions); temp.focus(); } function submitTest(theField) { var MaxLength = 32000; var TestVar = theField.value; if(TestVar.length > MaxLength) { theField.value = Left(theField.value, MaxLength); alert("Please limit the length of your description to " + MaxLength +" characters."); return(false) } else { return(true) } } function Left(str, n) { if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0,n); } function confirmDelete( url ) { if( confirm("Are you sure you want to delete this record? (This action cannot be undone.)" ) ) { document.location = url; } } function pBoxCursorWait(boxID) { return true; } function pBoxCursorPoint(boxID) { return true; } function pBoxOpen(boxID) { pBoxCursorWait(boxID); if (document.getElementById(''+boxID+'Shell')) { document.getElementById(''+boxID+'Shell').style.display='inline'; } if (document.getElementById(''+boxID+'ShellClosed')) { document.getElementById(''+boxID+'ShellClosed').style.display='none'; } setTimeout("pBoxCursorPoint("+boxID+")", 500); return true; } function pBoxClose(boxID) { pBoxCursorWait(boxID); if (document.getElementById(''+boxID+'Shell')) { document.getElementById(''+boxID+'Shell').style.display='none'; } if (document.getElementById(''+boxID+'ShellClosed')) { document.getElementById(''+boxID+'ShellClosed').style.display='inline'; } setTimeout("pBoxCursorPoint("+boxID+")", 500); return true; } var cmsObj = { showBlogImage:function(url){ var ourImage = $(''); $.blockUI({ message:ourImage }); $('.blockOverlay').attr('title','Click to Close').click($.unblockUI); var imgWidth = $('.blockUI img').width(); var imgHeight = $('.blockUI img').height(); var imgRatio = imgWidth/imgHeight; var winWidth = $(window).width(); var winHeight = $(window).height(); var winRatio = winWidth/winHeight; if(imgRatio > winRatio){ $('#cmsBlogImgDisplay').width(winWidth*.8); } else{ $('#cmsBlogImgDisplay').height(winHeight*.8); } var top = (winHeight - $('#cmsBlogImgDisplay').height() ) /2 + 'px'; var left = (winWidth - $('#cmsBlogImgDisplay').width() ) /2 + 'px'; $('.blockMsg').css({top:top,left:left, border:"0px none"}); //setTimeout("$.unblockUI();",4000); } }