function Form( Name, Holder ) {
	
	this.Formname	= Name;
	this.Formobject = document.getElementById( Name );
	this.Formholder = Holder;
	this.LoadURL 	= AbsPath + 'includes/SpecialPages/Vouchers/Submit.php';
	
	if ( this.Formobject === null )
		throw 'Form not found!';
	
	this.Validtypes = new Array( 'text', 'checkbox' );	
}

Form.prototype.validate = function() {	
	var Elements = this.Formobject.elements;
	if ( Elements === null )
		throw 'No elements found!';
	this.submit( Elements );
}

Form.prototype.submit = function( Elements ) {
	
	var Formholder = this.Formholder;	
	var Form = $( this.Formobject ).serialize(); 
	
	$.ajax({
		type: "POST",
		url: this.LoadURL,
		data: {Elements: Form, Holder: Formholder},
		contentType: "application/x-www-form-urlencoded; charset=UTF-8;",
		timeout: 5000,
		error: function(){
	        alert( 'Error loading XML document' );
	    },
		success: function( R ){
	    	
			if ( R == 'true' ) {
		    	//Response checken, succesvol
				var Step1 = document.getElementById( Formholder + 'Step1' );
				var Step2 = document.getElementById( Formholder + 'Step2' );
				
				if( Step1 && Step2 ){
					Step1.className = 'Hide';
					Step2.className = 'Show';
				}
			} else {
				//Response checken, met fouten
				var response = eval( '(' + R + ')' );
				
				if ( typeof( response ) != 'undefined' ) {
					
					//Errors
					var TD = document.getElementById( 'CheckedError' );
					if ( typeof( response[ 'Checked' ] ) != 'undefined' ) {
						if ( TD != null ) {
							TD.innerHTML = response[ 'Checked' ];
						}
					} else {
						TD.innerHTML = '';
					}
					
					var TD = document.getElementById( 'FullNameError' );
					if ( typeof( response[ 'FullName' ] ) != 'undefined' ) {
						if ( TD != null ) {
							TD.innerHTML = response[ 'FullName' ];
						}
					} else {
						TD.innerHTML = '';
					}
					
					var TD = document.getElementById( 'EmailError' );					
					if ( typeof( response[ 'Email' ] ) != 'undefined' ) {
						if ( TD != null ) {
							TD.innerHTML = response[ 'Email' ];
						}
					} else {
						TD.innerHTML = '';
					}
					
				} else {
					throw 'Form can not be validated';
				}
			}
		}
	});
}
