<?php /* Smarty version 2.6.25, created on 2012-06-25 20:07:57
         compiled from validation.tpl */ ?>
<?php echo '
<script type="text/javascript">
jQuery(function($) {
	$(document).ready(function(){
		'; ?>

			<?php $_from = $this->_tpl_vars['validation_messages']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['i']):
?>
				<?php if ($this->_tpl_vars['k'] == 'maxlength' || $this->_tpl_vars['k'] == 'minlength' || $this->_tpl_vars['k'] == 'rangelength' || $this->_tpl_vars['k'] == 'range' || $this->_tpl_vars['k'] == 'max' || $this->_tpl_vars['k'] == 'min'): ?>
					jQuery.validator.messages.<?php echo $this->_tpl_vars['k']; ?>
 = $.format("<?php echo $this->_tpl_vars['i']; ?>
");
				<?php else: ?>
					jQuery.validator.messages.<?php echo $this->_tpl_vars['k']; ?>
 = "<?php echo $this->_tpl_vars['i']; ?>
";
				<?php endif; ?>
			<?php endforeach; endif; unset($_from); ?>
		<?php echo '
		
		function fireEvent(obj, evt) {
            var fireOnThis = obj;
            if (document.createEvent) {
              var evObj = document.createEvent(\'MouseEvents\');
                evObj.initEvent(evt, true, false);
                fireOnThis.dispatchEvent(evObj);
            } else if (document.createEventObject) {
                fireOnThis.fireEvent(\'on\'+evt);
            }
        }
		
		//valid obj isntantiated in header.tpl
                valid_obj.'; ?>
<?php echo $this->_tpl_vars['form_id']; ?>
<?php echo ' = {
				debug: false,
				onKeyUp: true,
                onfocusout: false,
				errorElement: "span",
				errorClass: "errForm",
				submitHandler: function(form) {
					// do other stuff for a valid form
					if ($("#'; ?>
<?php echo $this->_tpl_vars['form_id']; ?>
<?php echo '").valid()) {
						form.submit();
					}
				},
				
				'; ?>
<?php echo $this->_tpl_vars['validators']; ?>
<?php echo '
		};

        $("#'; ?>
<?php echo $this->_tpl_vars['form_id']; ?>
<?php echo '").validate(valid_obj.'; ?>
<?php echo $this->_tpl_vars['form_id']; ?>
<?php echo ');

                var selects = $("#'; ?>
<?php echo $this->_tpl_vars['form_id']; ?>
<?php echo '").find("select");
                var crt;
                $.each(selects, function() {
                    crt = this.id;
                    if(typeof(valid_obj.'; ?>
<?php echo $this->_tpl_vars['form_id']; ?>
<?php echo '.rules[crt]) !== \'undefined\') {
                        $("#"+crt).change(function() {
                          $(this).valid();
                        });
                    }
                });
    });
});
</script>
'; ?>