var aktiv;
var opening=false;
var closing=false;
var strop=100;
var txtop=0;
var toURL="";
var times1;
var times2;
var times3;
var times4;

function navTOurl()
{
	navelementstr = document.getElementById('flyOutMenuStrImg');
	navelementtxt = document.getElementById('flyOutMenuTextImg');
	closing=true;
	opening=false;
	times3=0;//100-txtop;
	for(dc=times3;dc<=10;dc++)
		window.setTimeout('if(closing==true && txtop > ' + (100-dc*10) + '){ txtop = ' + (100-dc*10) + '; navelementtxt.style.filter = "Alpha(opacity=' + (100 - dc*10) + ')"; navelementtxt.style.opacity = ' + (1 - dc*10 / 100) + ';}',(dc-times3)*10*4);
	$('flyOutNav').set('tween',
	{
		onComplete: function()
		{
		times4=Math.floor(strop/4);
		for(dc=times4;dc<=25;dc++)
			window.setTimeout('if(closing==true && strop < ' + (dc*4) + '){ strop = ' + (dc*4) + '; navelementstr.style.filter = "Alpha(opacity=' + (dc*4) + ')"; navelementstr.style.opacity = ' +  (dc*4 / 100) + ';}',(dc-times4)*4*7);
		window.setTimeout('if(toURL!=""){ document.location.href="' + toURL + '"; }',(dc*4-times4)*7);
		}
	}).tween('width', '70px');
}

window.addEvent('domready', function(){

	$('flyOutNav').addEvents({
		'mouseenter': function(){
navelementstr = document.getElementById('flyOutMenuStrImg');
navelementtxt = document.getElementById('flyOutMenuTextImg');
			opening=true;
			closing=false;
halt=1;
times1=10-Math.floor(strop/10);
			for(dc=times1;dc<=10;dc++)
				window.setTimeout('if(opening==true && strop > ' + (100-dc*10) + '){ strop = ' + (100-dc*10) + '; navelementstr.style.filter = "Alpha(opacity=' + (100 - dc*10) + ')"; navelementstr.style.opacity = ' + (1 - dc*10 / 100) + ';}',(dc-times1)*10*4);
			this.set('tween', {
				duration: 700,
				transition: Fx.Transitions.Bounce.easeOut,
				onComplete: function(){
times2=0;//txtop;
					for(dc=times2;dc<=50;dc++)
						window.setTimeout('if(opening==true && txtop < ' + (dc*2) + '){ txtop = ' + (dc*2) + '; navelementtxt.style.filter = "Alpha(opacity=' + (dc*2) + ')"; navelementtxt.style.opacity = ' +  (dc*2 / 100) + ';}',(dc-times2)*2*14);
				}
			}).tween('width', '248px');
			window.clearInterval(aktiv);
		},
		'mouseleave': function(){
navelementstr = document.getElementById('flyOutMenuStrImg');
navelementtxt = document.getElementById('flyOutMenuTextImg');
			closing=true;
			opening=false;
times3=0;//100-txtop;
			for(dc=times3;dc<=10;dc++)
				window.setTimeout('if(closing==true && txtop > ' + (100-dc*10) + '){ txtop = ' + (100-dc*10) + '; navelementtxt.style.filter = "Alpha(opacity=' + (100 - dc*10) + ')"; navelementtxt.style.opacity = ' + (1 - dc*10 / 100) + ';}',(dc-times3)*10*4);
			this.set('tween', {
				onComplete: function(){
halt=0;
times4=Math.floor(strop/4);
					for(dc=times4;dc<=25;dc++)
						window.setTimeout('if(closing==true && strop < ' + (dc*4) + '){ strop = ' + (dc*4) + '; navelementstr.style.filter = "Alpha(opacity=' + (dc*4) + ')"; navelementstr.style.opacity = ' +  (dc*4 / 100) + ';}',(dc-times4)*4*7);
					window.setTimeout('if(toURL!=""){ document.location.href="' + toURL + '"; }',(dc*4-times4)*7);
				}
			}).tween('width', '70px');
    		}
	});
});


function look_at_me_slideOut ()
{
	$('flyOutNav').set('tween',
	{
		duration: 400,
		transition: Fx.Transitions.Bounce.easeOut
	}).tween('width', '73px');
      
	window.setTimeout("look_at_me_slideIn()", 300);
}
function look_at_me_slideIn ()
{
	$('flyOutNav').set('tween', {
		duration: 700,
		transition: Fx.Transitions.Bounce.easeOut
	}).tween('width', '70px');
}