﻿		var btnClearId;
		var ValuesMustMatch;
		var CancelBtnText;
		var confirm1;
		var confirm2;
		
		jQuery.noConflict(); var $j = jQuery;
		
		$j(document).ready(function() {
		    var myRules = jQuery.validationAide.getDefaultValidationRules();
		    if (confirm1 != null || confirm2 != null) {
				myRules.add('validator-confirm', ValuesMustMatch, function(fieldValue, fieldObj) {
					if($j(confirm1).val() != $j(confirm2).val()) return false;
					return true; 
				});
			}
			
		    $j("#aspnetForm").validationAideEnable(myRules,{summaryElementId:clientSummary} );

			if ($j('#' + btnClearId).val() == CancelBtnText) {
				$j('#' + btnClearId).click( function() {
					history.go(-1);
					return false;
				})				
			}
			else {
				$j('#' + btnClearId).click( function() {
			   		$j("form").clearForm();
			   		return false;
			   	})
			}			
		});
		
		$j.fn.clearForm = function() {
            return this.each(function() {
                var type = this.type, tag = this.tagName.toLowerCase();
                if (tag == 'form')
                    return $j(':input',this).clearForm();
                if (type == 'text' || type == 'password' || tag == 'textarea')
                    this.value = '';
                else if (type == 'checkbox' || type == 'radio')
                    this.checked = false;
                else if (tag == 'select')
                    this.selectedIndex = 0;
            });
        };