$(function(){
	$("#demoForm").formwizard({ //wizard settings
	historyEnabled : true, 
	formPluginEnabled: true, 
	validationEnabled : true
	},
	{
	//validation settings
	messages: {	email: "Felaktig email (localized into Swedish)"}																
	},
	{
	// form plugin settings
	success:    function() { Sexy.alert('<h1>Thank you</ h1><br/><br/><p>Your submission was successful. Please <a href = \'http://www.factoringcompare.com/login.asp\'>login</a></ p>', { onComplete:  function(returnvalue) {if (returnvalue) {window.location.href= 'http://www.factoringcompare.com/login.asp';} }}); return false;} ,
	url: 'Sitefiles-N/jquery.formwizard-0.9.8/FormProcessor.asp',
	target: '#Formposted',
	resetForm: false,
	clearForm: true
	}
 
    );
	

$("#password").rules("add", {
 minlength: 4
});
$("#username").rules("add", {
 minlength: 4
});
//validation tick box allready factoring
$("#F_NameOfFactor").rules("add", {
    required: "#F_CurrentlyFactor:checked"  
});
$("#F_CurrentlyFactor").click(function() {
  $("#F_NameOfFactor").valid();
});

//validation tick box leasehold
$("#CM_IfLeaseHold").rules("add", {
    required: "#CM_TypeProperty:unchecked"  
});
$("#CM_TypeProperty").click(function() {
  $("#CM_IfLeaseHold").valid();
});




	
	
});
