function DoorLeftUp(x)
{
	if (x >= -160 && stopLeftUp != 'yes')
	{
		$('#DoorLeft').css('top', x);
		setTimeout("DoorLeftMoveUp()", 1);
	}
}

function DoorLeftMoveUp()
{
	DoorLeftUp( GetTop('#DoorLeft') - slideSpeed);
}

function DoorLeftDown(x)
{
	if (x <= 0 && stopLeftDown != 'yes')
	{
		$('#DoorLeft').css('top', x);
		setTimeout("DoorLeftMoveDown()", 1);
	}
}

function DoorLeftMoveDown()
{
	DoorLeftDown( GetTop('#DoorLeft') + slideSpeed);
}

function DoorRightUp(x)
{
	if (x >= -160 && stopRightUp != 'yes')
	{
		$('#DoorRight').css('top', x);
		setTimeout("DoorRightMoveUp()", 1);
	}
}

function DoorRightMoveUp()
{
	DoorRightUp( GetTop('#DoorRight') - slideSpeed);
}

function DoorRightDown(x)
{
	if (x <= 0 && stopRightDown != 'yes')
	{
		$('#DoorRight').css('top', x);
		setTimeout("DoorRightMoveDown()", 1);
	}
}

function DoorRightMoveDown()
{
	DoorRightDown( GetTop('#DoorRight') + slideSpeed);
}

function GetTop(div)
{
	var top = $(div).css('top');
	top = top.substring(0, (top.length-2));
	return parseInt(top);
}

$(document).ready(function(){

	if ($.browser.safari == true)
		slideSpeed = 3;
	else
		slideSpeed = 5;

	$('#Download').css('z-index', 15);
	$('#Learn').css('z-index', 15);

	$('#DoorLeft, #Download').mouseover(function(){
		stopLeftDown = 'yes';
		stopLeftUp = 'no';
		DoorLeftUp( GetTop('#DoorLeft') );
	});

	$('#DoorLeft, #Download').mouseout(function(){
		stopLeftUp = 'yes';
		stopLeftDown = 'no';
		DoorLeftDown( GetTop('#DoorLeft') );
	});

	$('#DoorRight, #Learn').mouseover(function(){
		stopRightDown = 'yes';
		stopRightUp = 'no';
		DoorRightUp( GetTop('#DoorRight') );
	});
	
	$('#DoorRight, #Learn').mouseout(function(){
		stopRightUp = 'yes';
		stopRightDown = 'no';
		DoorRightDown( GetTop('#DoorRight') );
	});

});
