var URL_TEACHERS_IN_SCHOOL="/ajax/allTeachers";var URL_STUDENTS_IN_SCHOOL="/ajax/allStudents";var URL_MANAGE_ACCOUNTS="/ajax/manageAccList";var URL_GET_MOVIELIST="/ajax/getMovieList";var URL_GET_COMMENTS="/ajax/getComments";var URL_GET_FEEDS="/ajax/getFeeds";var URL_GALLERY="/ajax/topScoredMovies";function goPreviousPage(E,J,H,I,D,C,F,A){if(I!=-1){I=I-1}else{I=0}var B;var G="/"+E+"/"+J+"/"+H+"/"+I+"/"+D;switch(J){case"allTeachers":B=URL_TEACHERS_IN_SCHOOL+G;break;case"allStudents":B=URL_STUDENTS_IN_SCHOOL+G+"/"+F+"/"+A;break;case"manageStudents":B=URL_MANAGE_ACCOUNTS+G+"/student";break;case"manageTeachers":B=URL_MANAGE_ACCOUNTS+G+"/teacher";break;case"teacherview_movielist":B=URL_GET_MOVIELIST+"/"+C+"/"+E+"/"+J+"/"+H+"/"+I;break;case"public_movielist":B=URL_GET_MOVIELIST+"/"+C+"/"+E+"/"+J+"/"+H+"/"+I;break;case"movie_comment":case"movie_comment_public":B=URL_GET_COMMENTS+"/"+C+"/"+E+"/"+J+"/"+H+"/"+I+"/movie";break;case"user_comment":B=URL_GET_COMMENTS+"/"+C+"/"+E+"/"+J+"/"+H+"/"+I;break;case"user_comment_public":B=URL_GET_COMMENTS+"/"+C+"/"+E+"/"+J+"/"+H+"/"+I;break;case"gallery":B=URL_GALLERY+"/"+D+"/"+I;break}new Ajax.Request(B,{method:"post",onSuccess:function(L){var K=L.responseText;pagingComplete(K,E,I)},onFailure:function(){displayFeedback("1Error contacting the server")}})}function goNextPage(F,K,I,J,D,C,G,A,L,E){if(J!=-1){J=J+1}else{J=0}var B;var H="/"+F+"/"+K+"/"+I+"/"+J+"/"+D;switch(K){case"allTeachers":B=URL_TEACHERS_IN_SCHOOL+H;break;case"allStudents":B=URL_STUDENTS_IN_SCHOOL+H+"/"+G+"/"+A;break;case"manageStudents":B=URL_MANAGE_ACCOUNTS+H+"/student";break;case"manageTeachers":B=URL_MANAGE_ACCOUNTS+H+"/teacher";break;case"teacherview_movielist":B=URL_GET_MOVIELIST+"/"+C+"/"+F+"/"+K+"/"+I+"/"+J;break;case"public_movielist":B=URL_GET_MOVIELIST+"/"+C+"/"+F+"/"+K+"/"+I+"/"+J;break;case"movie_comment":case"movie_comment_public":B=URL_GET_COMMENTS+"/"+C+"/"+F+"/"+K+"/"+I+"/"+J+"/movie";break;case"user_comment":B=URL_GET_COMMENTS+"/"+C+"/"+F+"/"+K+"/"+I+"/"+J;break;case"user_comment_public":B=URL_GET_COMMENTS+"/"+C+"/"+F+"/"+K+"/"+I+"/"+J;break;case"get_feeds":if(jQuery("#group_filter").val()!=undefined){A=jQuery("#group_filter").val()}else{A="all"}if(E==undefined){E="feed_wide"}else{if(E=="feed_public"){E="feed_public"}}B=URL_GET_FEEDS+"/"+F+"/"+L+"/"+I+"/"+J+"/"+C+"/"+A+"/"+E;break;case"gallery":B=URL_GALLERY+"/"+D+"/"+J;break}new Ajax.Request(B,{method:"post",onSuccess:function(N){var M=N.responseText;pagingComplete(M,F,J)},onFailure:function(){displayFeedback("1Error contacting the server")}})}function pagingComplete(A,C,B){parseResponse(A);if(responseArray.code=="0"){$(C).innerHTML=responseArray.html}else{displayFeedback(responseArray.code+responseArray.json.error)}resetResponse()}function goFilterStudents(B,A){var C=jQuery("#group_filter").val();location.href=B+"students/"+A+"/"+C};
