<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>ClientExec Login</title>
  <link rel="Shortcut Icon" href="../favicon.ico"/>
  <link href="../templates/admin/style/login.css" rel="stylesheet" type="text/css"/>
  <script type="text/javascript" src="../javascript/ext/adapter/jquery/jquery-min.js"></script>
  <script type="text/javascript" src="../javascript/jquery.validate.min.js"></script>
  <script type="text/javascript">
    $(document).ready(function(){
        $("#login_form").validate({
            invalidHandler: function(form, validator) {
              $('#ceerrors').hide();
              $('#cenotices').hide();
            },
            errorContainer: "#errorbox",
            errorLabelContainer: "#errorbox-inside ul",
            wrapper: "li",
            rules: {
                email: {
                    required: true,
                    email: true
                },
                passed_password: "required"
            },
            messages: {
                email :{
                    required: "E-Mail field may not be left blank",
                    email: "You must enter a valid E-Mail address"
                },
                passed_password :{
                    required: "Password field may not be left blank"
                }
            }
        });
        
        
        $('input[type="text"]').addClass("idleField");
        $('input[type="text"]').focus(function() {
            $(this).removeClass("idleField").addClass("focusField");
            if (this.value == this.defaultValue){ 
                this.value = '';
            }
            if(this.value != this.defaultValue){
                this.select();
            }
        });
        $('input[type="text"]').blur(function() {
            $(this).removeClass("focusField").addClass("idleField");
            if ($.trim(this.value) == ''){
                this.value = (this.defaultValue ? this.defaultValue : '');
            }
        });
        
    });
        
    function pwdFocus() {
        $('#fakepassword').hide();
        $('#passed_password').show().focus();
    }

    function pwdBlur() {
        if ($('#passed_password').attr('value') == '') {
            $('#passed_password').hide();
            $('#fakepassword').show().blur();
        }
    }

 </script>
</head>

<body>

  <div id="wrapper">
  
    <img src="../templates/admin/images/login/logo.png" alt="ClientExec" border="0" class="logo" />
    
    <div id="errorbox" class="notice notice-red">
        <div id="errorbox-inside" class="inside">
            <ul></ul>        
        </div>
    </div>
    <?php if (count($this->gErrorMessages)>0) { ?>
        <div id="ceerrors" class="notice notice-red">
            <div class="inside">            
                <ul>
                <?php foreach ($this->gErrorMessages as $message) {
                        echo "<li>".$message."</li>";
                } ?>
                </ul>
            </div>
        </div>
    <?php } ?>

    <?php if (count($this->gMessages)>0) { ?>
        <div id="cenotices" class="notice notice-gray">
            <div class="inside">            
                <ul>
                <?php foreach ($this->gMessages as $message) {
                        echo "<li>".$message."</li>";
                } ?>
                </ul>
            </div>
        </div>
    <?php } ?>    
        
    <form class="login" id="login_form" action="index.php?fuse=admin&amp;action=Login" method="post">
      <input name="email" id="email" type="text" value="E-Mail" /><br />
      <input type="text" name="fakepassword" id="fakepassword" value="Password" onfocus="pwdFocus()" />
      <input style="display: none" type="password" name="passed_password" id="passed_password" value="" onblur="pwdBlur()" />

      <input type="submit" value="Login" class="submit" />
    </form>
    
    <div class="footer">Copyright &copy; 2002 - <?php echo $this->currentYear;?> <a class="celink" href="http://www.clientexec.com">ClientExec LLC</a>. All Rights Reserved.</div>
    
  </div>
  
</body>

</html>
