<?php
$front_validation = __('front_validation', true);
?>
<div id="ml_memberlogin_container" class="ml-container">
	
</div>
<script type="text/javascript">
	var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);
	var getSessionId = function () {
		return sessionStorage.getItem("session_id") == null ? "" : sessionStorage.getItem("session_id");
	};
	var createSessionId = function () {
		if(getSessionId()=="") {
			sessionStorage.setItem("session_id", "<?php echo session_id(); ?>");
		}
	};
	var session_id = "";
	if (isSafari) {
		createSessionId();
		session_id = getSessionId();
	}
	var loginMLObj = new loginML({
		session_id: session_id,
		memberlogin_container: "ml_memberlogin_container",
		login_form_name: "ml_login_form",
		login_form_login_name: "ml_login_form_login",
		forgot_form_name: "ml_forgot_form",
		forgot_form_send_name: "ml_forgot_form_send",

		load_login_form_url: "<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjFront&action=pjActionLoginForm",
		load_forgot_form_url: "<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjFront&action=pjActionForgotForm",
		login_url: "<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjFront&action=pjActionLoginCheck",
		forgot_url: "<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjFront&action=pjActionForgotSend",

		validation: {
			error_email_invalid: "<?php echo pjSanitize::clean($front_validation['email_invalid']); ?>"
		},

		message: {
			success: "<?php echo pjSanitize::clean(__('front_label_login_success', true, false)); ?>",
			error_1: "<?php echo pjSanitize::clean(__('front_label_login_error_1', true, false)); ?>",
			error_2: "<?php echo pjSanitize::clean(__('front_label_login_error_2', true, false)); ?>",
			error_3: "<?php echo pjSanitize::clean(__('front_label_login_error_3', true, false)); ?>",
			error_4: "<?php echo pjSanitize::clean(__('front_label_login_error_4', true, false)); ?>",

			forgot_success: "<?php echo pjSanitize::clean(__('front_label_forgot_success', true, false)); ?>",
			forgot_error_1: "<?php echo pjSanitize::clean(__('front_label_forgot_error_1', true, false)); ?>"
		}
	});
</script>