function loadScript(sScriptSrc,callbackfunction)   
	{  		
	    //gets document head element  
	    var oHead = document.getElementsByTagName('head')[0];  
	    if(oHead)  
	    {  
	        //creates a new script tag        
	        var oScript = document.createElement('script');  
	                  
	        //adds src and type attribute to script tag  
	        oScript.setAttribute('src',sScriptSrc);  
	        oScript.setAttribute('type','text/javascript');  
	  
	        //calling a function after the js is loaded (IE)  
	        var loadFunction = function()  
	            {  
	                if (this.readyState == 'complete' || this.readyState == 'loaded')  
	                {  
	                    callbackfunction();   
	                }  
	            };  
	        oScript.onreadystatechange = loadFunction;  
	  
	        //calling a function after the js is loaded (Firefox)  
	        oScript.onload = callbackfunction;  
	          
	        //append the script tag to document head element          
	        oHead.appendChild(oScript);  
	    }  
	}
	

function change(loc){
    $.ajax({
      url: loc,
      type: 'GET',
      success: function( neueDaten ) {
        $('#ajaxcontent').html( neueDaten );
      },
      complete: function(){
        $('#ajaxcontent').fadeIn(300);
        loadScript('/playerscripts/swfobject_modified.js',successCallBack);
		$(".dropit").bind("mouseover", function(e){
		   $(this).addClass("display_none");
		});
		$(".clip").bind("mouseout", function(e){
			$('.dropit').removeClass("display_none");
		});
		$('#1991').click(function () {
				$('.timecontent').hide("fast");
				$('#content_1991').fadeIn("slow");
			});
			
		$('#1997').click(function () {
				$('.timecontent').hide("fast");
				$('#content_1997').fadeIn("slow");
			});
		
		$('#2007').click(function () {
				$('.timecontent').hide("fast");
				$('#content_2007').fadeIn("slow");
			});
		
		$('#showdisclaimer').click(function () {
				$('#uid').hide("fast");
				$('#disclaimer').fadeIn("slow");
			});
		
		function handleSliderChange(e, ui)
			{
			  var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width();
			  $("#content-scroll").animate({scrollLeft: ui.value * (maxScroll / 100) }, 1000);
			}
			
		function handleSliderSlide(e, ui)
			{
			  var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width();
			  $("#content-scroll").attr({scrollLeft: ui.value * (maxScroll / 100) });
		}
		$("#content-slider").slider({
			animate: true,
			handle: ".content-slider-handle",
			change: handleSliderChange,
			slide: handleSliderSlide
		});
		eval(Shadowbox.setup());
      }
    });
}

function setNaviForPage(page) {
	var thisel = $('#'+page);
	var thisnavid = thisel.parent().attr("id");
	var thisnav = $("#"+thisnavid);
	//Select the correct element in the current navigation level
	thisel.addClass("redclass");
	//Make the navigation level visible
	thisnav.show();
	
	if(thisnav.hasClass("subsubnavi")) {
		//Find the corresponding subnavi element and select the corresponding entry
		//The title of the corresponding subnavi is hidden in the id of this subsubnavi
		var subnavel_id = thisnavid.substring(thisnavid.indexOf('_')+1);
		var thissubnav = $("#"+subnavel_id).parent();
		//Select the correct element in this subnavi
		$("#"+subnavel_id).addClass("redclass");
		//Show the subnav
		thissubnav.show();
		
		//Select the correct entry in the top navigation
		var subnavid = $("#"+subnavel_id).parent().attr("id");
		var topnavel_id = subnavid.substring(subnavid.indexOf('_')+1);
		$("#"+topnavel_id).addClass("redclass");
	} else if(thisnav.hasClass("subnavi")) {
		//Select the correct entry in the top navigation
		var topnavel_id = thisnavid.substring(thisnavid.indexOf('_')+1);
		$("#"+topnavel_id).addClass("redclass");
	}
}
function isDefined(variable){
	return (typeof(window[variable]) == 'undefined')? false : true;
}

