var URL_USER_LOGIN="/ajax/loginUser";var URL_RESET_PASSWORD_SCHOOL_ACCOUNT="/ajax/resetSchoolAccPassword";var URL_STUDIO_AFTER_SAVE="/movie/<movieId>/1";var URL_SEND_CONTACT_EMAIL="/ajax/sendContactEmail";function schoolLogin(){$("site_login_button").hide();$("site_login_button_dis").show();new Ajax.Request(URL_USER_LOGIN,{method:"post",parameters:$("loginform").serialize(),onSuccess:function(B){var A=B.responseText;schoolLoginComplete(A)},onFailure:function(){displayFeedback("1"+GT.gettext("Error contacting the server"))}})}function schoolLoginComplete(A){parseResponse(A);$("loginform").enable();switch(responseArray.code){case"0":if(typeof pageTracker!="undefined"&&pageTracker){pageTracker._trackPageview("/pageTracker/ajax/login/postComplete")}on_signup_or_login_complete_handler();resetResponse();break;case"1":$("loginErr").innerHTML=responseArray.json["error"];$("site_login_button_dis").hide();$("site_login_button").show();break;default:$("loginErr").innerHTML=GT.gettext("We could not find a match for the given email and password. Please try again.");$("site_login_button_dis").hide();$("site_login_up_button").show();break}}function bookmark_us(A,B){if(window.sidebar){displayFeedback("1"+GT.gettext("Sorry, your browser doesn't support this function.  Please bookmark manually."))}else{if(window.external){window.external.AddFavorite(A,B)}else{if(window.opera&&window.print){displayFeedback("1"+GT.gettext("Sorry, your browser doesn't support this function.  Please bookmark manually."))}}}}function showOG(A){jQuery("#tracker_id").html(A);jQuery.blockUI({message:jQuery("#overlayGeneral"),css:{padding:0,margin:0,width:"500",top:"25%",left:"30%",textAlign:"left",color:"#000",border:"none",backgroundColor:"transparent",cursor:"normal"},overlayCSS:{backgroundColor:"#000",opacity:0.6}});resizeSchoolGlobal()}function hideOG(){jQuery.unblockUI()}function resizeSchoolGlobal(C){var A=getResizeLeft();var B=$("blockUIBox");if(typeof B!="undefined"&&B!=null){if(C==undefined){B.style.left=A>0?(A+"px"):"0px"}else{A+=C;B.style.left=A>0?(A+"px"):"0px"}}}function getResizeLeft(){if(Prototype.Browser.IE){var A=document.body.offsetWidth}else{var A=window.innerWidth}return(A-$("overlayGeneral").clientWidth)/2}function resetAccPassword(B,A){new Ajax.Request(URL_RESET_PASSWORD_SCHOOL_ACCOUNT,{method:"post",parameters:"enc_user_id="+B+"&accType="+A+"&display=Y",onSuccess:function(D){var C=D.responseText;resetAccPasswordComplete(C)},onFailure:function(){displayFeedback("1"+GT.gettext("Error contacting the server"))}})}function resetAccPasswordComplete(A){parseResponse(A);if(responseArray.code==0){jQuery("#OG_content").html(responseArray.html);showOG()}else{if(responseArray.code==1){displayFeedback(responseArray.code+responseArray.json.error)}}}function confirmResetPassword(B,A){password=$("reset_password").value;new Ajax.Request(URL_RESET_PASSWORD_SCHOOL_ACCOUNT,{method:"post",parameters:"enc_user_id="+B+"&password="+password+"&accType="+A+"&display=N&confirm=Y",onSuccess:function(D){var C=D.responseText;confirmResetPasswordComplete(C)},onFailure:function(){displayFeedback("1"+GT.gettext("Error contacting the server"))}})}function confirmResetPasswordComplete(A){parseResponse(A);if(responseArray.code==0){jQuery("#OG_content").html(responseArray.html)}else{if(responseArray.code==1){$("deleteAccErr").innerHTML=responseArray.json.error}}}var sendContactEmailTrigger=false;function sendContactEmail(A){if(!sendContactEmailTrigger){sendContactEmailTrigger=true;new Ajax.Request(URL_SEND_CONTACT_EMAIL,{method:"post",parameters:$(A).serialize(),onSuccess:function(C){var B=C.responseText;sendContactEmailComplete(B)},onFailure:function(){displayFeedback(GT.gettext("Error contacting the server"))}})}}function sendContactEmailComplete(A){parseResponse(A);if(responseArray.code==0){jQuery("#contactus_form").hide();jQuery("#contactus_sent").show();sendContactEmailTrigger=false}else{if(responseArray.code==1){jQuery("#contact_form_err").html(responseArray.json.error);jQuery("#contact_form_err").show();sendContactEmailTrigger=false}}}function waitForStudio(){if(!jQuery("#init_studio").length){return }setTimeout("showWaitForStudio()",2000)}function showWaitForStudio(){jQuery.blockUI({message:jQuery("#init_studio"),css:{padding:0,margin:0,width:"auto",top:"150px",left:"35%",textAlign:"center",color:"#000",border:"none",backgroundColor:"transparent",cursor:"auto"},overlayCSS:{cursor:"auto"}})};
