$(document).ready(function() {

	$("#Bilder_Fenster a").bind("click", function(e){
		//alert('asdasd');
		$('#maincontent').html('<div style="margin-top:25%;margin-left:0%;text-align:center;"><img src="fileadmin/images/ajax-loader.gif" title="Inhalt wird geladen" alt="Inhalt wird geladen" /><p class="txt_mengen">Inhalt wird geladen</p></div>');
		var link = $(this).attr("href")+'&type=11';
		$.get(link, function(data){
			var ajaxcontent = data.split('|#|#|');
			document.getElementById('contentright').innerHTML = "";
			$('#maincontent').html(ajaxcontent[0]);
			//alert(ajaxcontent[2]);
			document.getElementById('tempcontainer').innerHTML = ajaxcontent[2];

			/*  im tempcontainer ist jetzt der content drin und muss nur noch extrahiert werden */

			$('#tempcontainer').css({display:'none'});

			//alert($('#tempcontainer div#contentright').html());
			//$('#tempcontainer div.tx-tmsubpagesasdataset-pi2').remove();
			/* 
			$('#contentRight div.mycontent').html( $('#tempcontainer').html() );
			document.getElementById('contentright').innerHTML = $('#tempcontainer div#contentright').html();
			*/
			$('div.replaceRight #contentright').html( $('#tempcontainer div#contentright').html() );
			$('#tempcontainer').empty();

		});
		return false;
	});
});

