$j(document).ready(function() { 

$j('form.training').livequery('submit', function(e) { 
    var form = e.target;
	
	$j('form:not(#' + $j(form).attr('id')).triggerHandler('reset');	
	var sTarget = "#" + $j(form).attr('id') + " div.replaceme";
	var options = { 
	    target:     sTarget, 
	    url:        'http://www.voegele.info/de/kundenservice/schulung/seminarangebote/training-buchung.php', 
		// in allen anderen Forms ggf. noch eingeblendete Elemente rauswerfen
	    success:    function(){$j("form:not(#" + $j(form).attr('id') + ") div.replaceme select").parent().parent().trigger("reset")}	
	    }; 
	// submit the form 
    $j(this).ajaxSubmit(options); 
    // return false to prevent normal browser submit and page navigation 
    return false; 
});

$j('form.training').livequery('reset', function(e) { 
    
	var form = e.target;
	var sTarget = "#" + $j(form).attr('id') + " div.replaceme";
		var options = { 
	    target:     sTarget, 
	    url:        'http://www.voegele.info/de/kundenservice/schulung/seminarangebote/training-buchung.php?reset=true', 
	    success:    ''
	    }; 
	// submit the form 
    $j(this).ajaxSubmit(options); 
    return false; 
});

$j('form.training button.addbasket').livequery('click', function(e) { 
    
	$j(this).parent().prepend('<input type="hidden" name="add" value="true" />');
	var form = $j(this).parent().parent();
	var sTarget = "#" + $j(form).attr('id') + " div.replaceme";
	var options = { 
	    target:     sTarget, 
	    url:        'http://www.voegele.info/de/kundenservice/schulung/seminarangebote/training-buchung.php', 
	    success:    function(){window.location.href = 'http://www.voegele.info/de/kundenservice/schulung/warenkorb/Schulungen_-_Warenkorb.php'}
	    }; 
	// submit the form 
    $j(form).ajaxSubmit(options); 	
		
    return false; 
});

$j('div.basket form').livequery('submit', function(e) { 
    
	var form = e.target;
	var sTarget = "#" + $j(form).attr('id') + " div.replaceme";
	var options = { 
	    target:     sTarget, 
	    url:        'http://www.voegele.info/de/kundenservice/schulung/warenkorb/training-check.php?addNames=true', 
	    success:    ''
	    }; 
	// submit the form 
    $j(this).ajaxSubmit(options); 
    // return false to prevent normal browser submit and page navigation 
    return false; 
});

$j('div.basket form').livequery('reset', function(e) { 
    
	var form = e.target;
	var sTarget = "#item_" + $j(form).attr('id');
	var options = { 
	    target:     sTarget, 
	    url:        'http://www.voegele.info/de/kundenservice/schulung/warenkorb/training-check.php?delete=true', 
	    success:    function(){window.location.href = 'http://www.voegele.info/de/kundenservice/schulung/warenkorb/Schulungen_-_Warenkorb.php'}
	    }; 
	// submit the form 
    $j(this).ajaxSubmit(options); 
    // return false to prevent normal browser submit and page navigation 
    return false; 
});

$j('div.seminar_footer form').livequery('submit', function(e) {
	var options = { 
	    target:     'div.seminar_footer form div.replaceme', 
	    url:        'http://www.voegele.info/de/kundenservice/schulung/warenkorb/training-check.php?check=true', 
	    success:    function(){ if( $j('div.seminar_footer form div.replaceme p.error').length == 0 )
								{
									window.location.href = 'http://www.voegele.info/de/kundenservice/schulung/warenkorb/Schulungen_-_Abschluss.php'
								}
							}
	    }; 
	// submit the form 
    $j(this).ajaxSubmit(options); 
    // return false to prevent normal browser submit and page navigation 
    return false; 
});

});