function LoginBoxPhp(){this.getUrls=function(){if(document.location.hostname=="localhost"){$(".forgot").attr("href","/public/requestPasswordReset");
$("#signupBtn").attr("href","/public/initRegistration");
$("#access").attr("action","/j_security_check?loginPulicPage=true")
}else{var g=document.location.host;
$(".forgot").attr("href","https://"+g+"/public/requestPasswordReset");
$("#signupBtn").attr("href","https://"+g+"/public/initRegistration");
$("#access").attr("action","https://"+g+"/j_security_check?loginPulicPage=true")
}};
this.bindValidate=function c(){var g=$("#access").validate({rules:{j_username:{required:true,email:true},j_password:{required:true,minlength:5}},messages:{j_username:{required:"Please enter your email",email:"Please enter a valid email"},j_password:{required:"Please enter your new password",minlength:"Please enter at least 5 characters"}},errorPlacement:function(h,i){h.appendTo($("#messageBox"))
},errorElement:"span"})
};
this.callLoguinMobile=function(){$.ajax({type:"POST",url:"/j_security_check",data:{j_username:$("#email_").val(),j_password:$("#password").val()},success:function(g,i,h){if(typeof g.errorMessage!="undefined"){login_box_php.jqmSimpleMessage(g.errorMessage,4000)
}else{document.location.replace(g.redirectTo)
}},error:function(){login_box_php.jqmSimpleMessage("This user can not enter the backoffice from a phone",4000)
}})
};
this.jqmSimpleMessage=function e(g,h,i){$("#simplemodal-container").hide("explode");
$("#simplemodal-overlay").hide();
$("<div style='display:none;' class='ui-loader ui-overlay-shadow ui-body-b ui-corner-all' ><h1>"+g+"</h1></div>").css({opacity:2.8,top:window.pageYOffset+200}).appendTo("body").show("bounce").delay(h).fadeOut(600,function(){$(this).remove();
$("#simplemodal-overlay").show();
$("#simplemodal-container").show("show");
if(typeof(i)=="function"){i()
}})
};
this.binderEvents=function b(){$("#forgotYourPass").unbind().click(function(){$("#messageContainer").html("");
ajaxProxy.doAjaxRequest({url:"/public/requestPasswordReset",session:false,success:function(g){$("#fullWidthPanel").html(g)
}});
return false
});
$("#signUpStartId").unbind().click(function(){$("#messageContainer").html("");
ajaxProxy.doAjaxRequest({url:"/public/signUpStart",session:false,success:function(g){$("#fullWidthPanel").html(g)
}});
return false
});
$("html body div#mainWrap div#wrapper div#header div#helpBox map area#Help").die().live("click",function(g){window.open("http://www.doughmain.com/help/index.htm#creating_your_dough-main.htm");
g.preventDefault();
return false
})
};
this.isMobileClientBrowser=function f(){return navigator.userAgent.match(/Mobile/)!=null&&navigator.platform!="iPad"
};
this.setupRollOver=function d(h,g,i){$(h).attr({src:g});
$("").attr({src:i});
$(h).hover(function(){$(this).attr({src:i})
},function(){$(this).attr({src:g})
})
};
this.callLoguinNormal=function a(){var g=document.location.host;
if(document.location.hostname=="localhost"){u="/j_security_check"
}else{u="https://"+g+"/j_security_check"
}$.ajax({type:"POST",url:u,data:{j_username:$("#email_").val(),j_password:$("#password").val()},success:function(h){login_box_php.managementRedirect(h)
}})
};
this.managementRedirect=function(g){if(g.indexOf("alertBoxError")==-1){if(g.match(/odmAdmin/)){window.location="/backoffice/userHome"
}else{if(g.match(/currentAdult/)){window.location="/adult/userHome"
}else{window.location="/kid/userHome"
}}}}
}var login_box_php=new LoginBoxPhp();
