var current = -1;
var allow_slideshow	= true;
var fademode = "fadeout";

var curpos = 0;
var limittop = 0;
var timer = 0;
var stop_scroll = true;
var isGerman = true;

init = function()
{
	var intro = document.getElementById("content_intro");


	intro.CurrentPos = "-548px";

	setTimeout(scrollIntro,1525);
};


setOpacity = function(obj)
{
	if(obj.xOpacity>.99)
	{
		obj.xOpacity = .99;
		return;
	}

	obj.style.opacity = obj.xOpacity;
	obj.style.MozOpacity = obj.xOpacity;
	obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')';
};

scrollIntro = function()
{
	var newpos;
	var intro = document.getElementById("content_intro");


	newpos = parseInt(intro.CurrentPos) + 1;

	if(newpos >= 0)
	{
		intro.style.backgroundPosition = "0 0";
		setTimeout("showMenu('moarhof_menu')", 1000);
		setTimeout("showMenu('moarhof_menu_en')", 1000);
		setTimeout("showMenu('vacation_menu')", 1200);
		setTimeout("showMenu('vacation_menu_en')", 1200);
		setTimeout("showMenu('rooms_menu')", 1400);
		setTimeout("showMenu('rooms_menu_en')", 1400);
		setTimeout("showMenu('place_menu')", 1600);
		setTimeout("showMenu('place_menu_en')", 1600);
		setTimeout("showMenu('contact_menu')", 1800);
		setTimeout("showMenu('contact_menu_en')", 1800);
	}
	else
	{
		intro.style.backgroundPosition = "0 " + newpos + "px";
		intro.CurrentPos = newpos;
		setTimeout(scrollIntro,23);
	}
};

showMenu = function(menu_id)
{
	document.getElementById(menu_id).style.visibility = "visible";
};

setActiveImage = function(img, file)
{
	img.src = "data/images/" + file;
};

setInActiveImage = function(img, file)
{
	img.src = "data/images/" + file;
};

function stopscroll()
{
	stop_scroll = true;
};

function startscroll()
{
	stop_scroll = false;
};

function scrolldown()
{
	if(stop_scroll)
	{
		return;
	}
	if(curpos > limitbottom)
	{
		curpos--;
		document.getElementById('text').style.top = curpos + "px";
		timer = setTimeout("scrolldown()", 15);
	}

};

function scrollup()
{
	if(stop_scroll)
	{
		return;
	}
	if(curpos < limittop)
	{
		curpos++;
		document.getElementById('text').style.top = curpos + "px";
		timer = setTimeout("scrollup()", 15);
	}
};

setEnglish = function()
{
	if(isGerman)
	{
		isGerman = false;
		document.getElementById("menu").style.display = "none";
		document.getElementById("menu_en").style.display = "block";
		
		document.getElementById("lnk_german").style.cursor = "pointer";
		document.getElementById("lnk_english").style.cursor = "text";
	}
};

setGerman = function()
{
	if(!isGerman)
	{
		isGerman = true;
		document.getElementById("menu").style.display = "block";
		document.getElementById("menu_en").style.display = "none";

		document.getElementById("lnk_german").style.cursor = "text";
		document.getElementById("lnk_english").style.cursor = "pointer";		
	}

};
