/**
 * 
 */
$(document).ready( function() {
	$('a.nav').bind("mouseover", function() {
		if(this.className.split(/\s+/).length > 1) return; //active navigation nicht betroffen
		var theLink = $(this);
		theLink.stop();
		//theLink.css({height:'96px'});
		theLink.animate( {  height:'120px', marginTop: '8px'}, 
			500, 'easeOutQuad', function() { 
				theLink.css({height:'115px'});
			}
		);
	});
	$('a.nav').bind("mouseout", function() {	
		if(this.className.split(/\s+/).length > 1) return; //active navigation nicht betroffen
		var theLink = $(this);
		theLink.stop();
		//theLink.css({height:'118px'});
		theLink.animate({ height:'100px', marginTop: '30px'}, 
			500, 'easeOutQuad', function() { 
				theLink.css({height:'93px'});
			} 
		);
	});
});




function LadeIntro(secondLoad) 
{

	
    //alert('go');
    var home = $('#home');
	var homebildcontainer;
    homebildcontainer = $('#homebildcontainer');
    home.css({
        width:'900px', 
        height:'479px',
        backgroundColor:'white'
    });
    homebildcontainer.css({
        width: '900px', 
        overflow:'hidden'
    });



        setTimeout(function() {
				LadeIntroAnimation(); 
			}, 3000);


    //width:'372px',
    //alert('x');
}

document.write('<link rel="stylesheet" type="text/css" href="styles/basisboxen.css">');


function LadeIntroAnimation() 
{
    var contentContainerStartseite = $('#contentContainerStartseite');
    contentContainerStartseite.css({ display: 'block', opacity: 0 });    
    /*homebildcontainer.animate({
            'width': '372px'
        }, 1500, 'easeOutQuad', function() {
            //$('#contentStartseite').fadeIn(1000); //, callback)
            
        }
    );*/
    contentContainerStartseite.animate({ left:'372px' }, { queue: false, duration: 1900, easing: 'easeOutBounce' } ); //1500,easeOutQuad
    contentContainerStartseite.animate({ opacity: 1.0 }, { queue: false, duration: 1600, easing: 'easeOutQuad' });
    
    //window.setTimeout('LadeVideo()',1900);
    //width:528px;
    /* , "easing": "easein" */
	
	window.status = "LadeIntroZ";
}

//function LadeVideo()
//{ 
//	alert('Lade1');
//	$('#ladeVideoLink').unbind("click");
//	$('#ladeVideoLink').click(LadeVideo2)
//}
//function LadeVideo2()
//{
//	alert('Lade2');
//	$('#ladeVideoLink').unbind("click");
//	$('#ladeVideoLink').click(LadeVideo)
//}
function LadeVideo()
{ 	
	//debugger;
	//initialScale: 'orig', //'scale' ,videoHeight: '219',
	$('#home').animate({opacity:0.6},500,'easeOutQuad', function() {
		$('#film').show();
		flashembed("video", "/FlowPlayerLight.swf", { config: { 
			//splashImageFile: '/video_snapshot.jpg',
			showFullScreenButton: false,
			showMenu: false,
			loop: false,
			autoBuffering:true,
		    autoPlay: true, 
		    videoFile: '/gall.flv', 
		    showPlayButton: true,
		    usePlayOverlay: true
		}});
	});
	
	$('#ladeVideoLink').unbind("click");
	$('#ladeVideoLink').bind("click", SchliesseVideo);
	return false;
}
function SchliesseVideo()
{
//	debugger;
	$('#film').html('');
//	setTimeout(function(){
		//debugger;
			$('#film').html('<div id="video" style="height:237px;width:372px;"></div>');
			$('#home').animate({opacity:1},500,'easeOutQuad');
			
			$('#ladeVideoLink').unbind("click");
			$('#ladeVideoLink').bind("click", LadeVideo);
//			setTimeout(function(){$('#ladeVideoLink')[0].onclick = null;$('#ladeVideoLink').bind("click", LadeVideo);},500);
//		}, 1000);
	return false;
}

function LadeBild(bildUrl)
{
	var vorladen = new Image();
	vorladen.src = bildUrl;
	
	var row1 = $('#row1');
	var img = $('#row1').children("img");
	row1.css({backgroundColor:'white'});
	/*img.fadeOut(1000, function() {
		img[0].src = bildUrl;
		img.fadeIn(1000);
	});*/
	img.css({opacity:1});
	img.animate({opacity:0}, 1000, 'easeOutQuad', function() {
		vorladen.src = null;
		
		vorladen.onload = function() {
			img[0].src = bildUrl;
			img.animate({opacity:1}, 1000, 'easeInQuad');
		};
		vorladen.src = bildUrl;
		
	});
}

function SwitchLanguageEnglish()
{
	if(document.location.href.search(/\.htm$/) == -1)
	{
		document.location.href = 'startseite_en.htm';
	}
	else
	{
		if(document.location.href.search(/_en\.htm$/) != -1)
		{
			return false;
		}
		document.location.href = document.location.href.replace(/\.htm$/, '_en.htm');
	}
	
	return false;
}

function SwitchLanguageGerman()
{
	if (document.location.href.search(/\.htm$/) == -1) 
	{
		document.location.href = 'startseite.htm';
	}
	else 
	{
		if(document.location.href.search(/_en\.htm$/) == -1)
		{
			return false;
		}
		document.location.href = document.location.href.replace(/_en\.htm$/, '.htm');
	}
	
	return false;
}



