function initOnload(element){
if(alldone!==true){
var alldone = true;

$('a.confirm').click(function() {
	if (confirm('Sind sie sicher ?')) {
			 window.location = $(this).attr('href');
	}
	return false;
});

$(element+' a.ajax').click(function() {
 var url = $(this).attr('href');
 var title = $(this).attr('title');

 $.ajax({
            url : url,
            type : "GET",
            dataType: "html",

            error : function (xhr, desc, exception) {
			alert('error');},
            success : function (data) {
            if(data.error) {

            } else {
            	$('#'+title).html(data);
            	initOnload('#'+title);
		   }
            }
        });
	return false;

});

	$(element+ ' a.transparent').click(function() {
		$('#overlayDiv').show();
		$('#overlayDiv').prepend('<div class="loadicon">').append('</div>');
		 self.scrollTo(0, 0);
		 $.ajax({
            url : $(this).attr('href'),
            type : "GET",
            dataType: "html",

            error : function (xhr, desc, exception) {
			alert('error');},
            success : function (data) {
            if(data.error) {

            } else {
            	$('#overlayContent').show();
            	$('#overlayContent').html(data);
            	initOnload('#overlayContent');
		   }
            }
        });
		return false;
		});

$(element+' a.hide').click(function() {
 $($(this).attr('href')).hide();
			return false;
});

$(element+' a.show').click(function() {
 $($(this).attr('href')).show();
			return false;
});

$(element+' a.toggle').click(function() {
 if ($($(this).attr('href')).css('display') =='none'){
 	$($(this).attr('href')).show();
	return false;
 }
 $($(this).attr('href')).hide();
	return false;
});
$(element+' a.submit').click(function() {
 $($(this).attr('href')).submit();
			return false;
});
$(element+' a.submitButton').click(function() {
 $($(this).attr('href')).submit();
			return false;
});
$(element+'.ajaxInfo').click(function() {
 $($(this).attr('href')).submit();
			return false;
});

$(element+' a.autoHide').click(function() {
 	$(this).hide();
	return false;
});

$(element+' a.removeOverlay').click(function() {
			$('#overlayDiv').hide();
            	$('#overlayDiv').html('');
             	$('#overlayContent').hide();
            	$('#overlayContent').html('');
			return false;
});				   

};}