function loadContent(srcURL)
{
	// Video ausblenden wenn läuft
	if($('#nonverblaster').get(0)){
		cleanupVideo();
		$('div#videoWrapper').css({height: '0px', width: '0px'});
		}
	if($('video').get(0)){
		$('div#videoWrapper').css({height: '0px', width: '0px'});
		$('video').remove();
		}
	
	$('div#content-holder').fadeOut(500);
	$('div#loading').css({width : '100%', height: '100%'});
	$("div#loading").animate({opacity : 1.0}, 500,function()
	{
		$.ajax({method: "get", url: srcURL, 
		success: function(data)
		{
			$('div#content-holder').html(data);
			
			setPlayButtons();
			setAjaxLinksInLoader();
			
			$('div#content-holder').css({width : '100%', height: '100%'});
			$('div#content-holder').fadeIn(1000, function(){
				$('div#loading').css({width : '0px', height: '0px'});
				});
		}});
	});
}


function closeContent()
{
	$('div#content-holder').fadeOut(500, function(){
		$('div#content-holder').html('');
		$('div#content-holder').css({width : '0px', height: '0px'});
		$('div#loading').css({'opacity' : '0'});
		});
	return;
}


$(document).ready(function()
{
	if( load != "" )
	{	
		loadContent("./ajax/"+load+".html");
	}
	
	
	// Suche Schließen Buttons und setzte Events
	if( $("[rel='closecontent']").get(0) ) // Wenn mindestens einer da ist
	{
		var closebuttons = $("[rel='closecontent']").get();
		for( var i = 0; i < closebuttons.length; i++ )
		{
			$(closebuttons).eq(i).click(function()
			{
				closeContent();
				return false;
			});
		}
	}
	
});
