
var stop_scroll = true;
var lastTextID	= "intro";
var selectedIds = "";
var curpos = 0;

var limittop = 0;
var limitbottom = -380;


function GetDomItem(id)
{
	if(document.getElementById)
	{
		return document.getElementById(id);
	} // end if(document.getElementById)
	else if(document.all)
	{
		return document.all[id];
	} // end else if(document.all)
}

function showContact()
{
	ShowDomObject("chain", "hidden")
	ShowDomObject(lastTextID, "hidden")
	lastTextID = "contact";
	ShowDomObject(lastTextID, "visible")
}

function showDates()
{
	ShowDomObject("chain", "hidden")
	ShowDomObject(lastTextID, "hidden")
	lastTextID = "dates";
	ShowDomObject(lastTextID, "visible")
}

function showMySchmuck()
{
	ShowDomObject("chain", "hidden")
	ShowDomObject(lastTextID, "hidden")
	lastTextID = "MySchmuck";
	ShowDomObject(lastTextID, "visible")
}

function ShowDomObject(id, visibility)
{
	var domObject = null;
	domObject = GetDomItem(id);
	if(domObject)
	{
		domObject.style.visibility = visibility;
	}
}

function ToggleMarbleOut(id)
{
	ToggleMarble(id, id);
}; // end function ToggleMarbleOut(id)

function ToggleMarble(id, imageName)
{
	var domImage = null;
	domImage = GetDomItem("img_" + id);
	if(domImage)
	{
		if(selectedIds.indexOf(id) >= 0)
		{
			return;
		}
		if(imageName)
		{
			domImage.src = "images/marble_bold.gif";
		}
		else
		{
			domImage.src = "images_small/" + id + "_k.jpg";
		}
	}
}


function ShowChain(id)
{
	var domObject = null;

	if(selectedIds.indexOf(id) < 0)
	{
		selectedIds = selectedIds + id + ";";
	}
	domObject = GetDomItem('chain');
	if(domObject)
	{
		domObject.src ="images_large/" + id + ".jpg";
		domObject.style.visibility = "visible";
	}
	ShowDomObject(lastTextID, "hidden")
	lastTextID = "txt" + id;
	ShowDomObject(lastTextID, "visible")
}

function stopscroll()
{
	stop_scroll = true;
};

function startscroll()
{
	stop_scroll = false;
};

function scrolldown()
{
	if(stop_scroll)
	{
		return;
	}
	if(curpos > limitbottom)
	{
		curpos--;
		document.getElementById('MySchmuckTxt').style.top = curpos + "px";
		timer = setTimeout("scrolldown()", 15);
	}

};

function scrollup()
{
	if(stop_scroll)
	{
		return;
	}
	if(curpos < limittop)
	{
		curpos++;
		document.getElementById('MySchmuckTxt').style.top = curpos + "px";
		timer = setTimeout("scrollup()", 15);
	}
};

