function letsRoll(over,elementID)
{	// highlights / de-highlights an element on rollover /-out
// grun C3DA68 grau c0c0c0

	tmp = document.getElementById(elementID);
	if(over==1)
	{
		tmp.setAttribute("bgcolor","#cedd92","false");
	}
	else
	{
		tmp.removeAttribute("bgcolor","false");
	}
	window.defaultStatus = "Dein Lieblingsgestalter";
}

function thumbOver(over,topPos,leftPos,bwPic,detailPic,fullPic,pURI)
{	// rollover/-out - action for thumbnails

	fromTop = topPos + "px";
	fromLeft = leftPos + "px";
	detail = document.getElementById("dPic");
	if(over==1)
	{
		// swap bw-pic
		detail.setAttribute("src",bwPic,"false");
		//generate layer for border-gif
		borderDiv = document.getElementById("thumb_border");
		try
		{
			borderDiv.style.setAttribute("position","absolute","false");
			borderDiv.style.setAttribute("top",fromTop,"false");
			borderDiv.style.setAttribute("left",fromLeft,"false");
		}
		catch(e)
		{
			borderDiv.setAttribute("style","position:absolute;top:"+topPos+";left:"+leftPos,"false");
		}
		newContent = "<a href=\""+pURI+"\" target=\"_self\"><img src=\"pics/thumb_border.gif\" border=\"0\"></a>";
		borderDiv.innerHTML= newContent;
	}
	else
	{
		dummy=1;
	}
}

function showFullPic(currentPic,fullData,detailData)
{
	// convert incoming data
	splitFULL = fullData.split("+");
	splitDETAIL = detailData.split("+");
	newFULL = splitFULL[currentPic];
	newDETAIL = splitDETAIL[currentPic];

	// swap pics (full / detail)
	tmpFULL = document.getElementById("fPic");
	tmpDETAIL = document.getElementById("dPic");
	tmpFULL.setAttribute("src",newFULL,"false");
	tmpDETAIL.setAttribute("src",newDETAIL,"false");

	// update navigation (previous / next)
	tmpNEXT = document.getElementById("next_pic");
	tmpPREV = document.getElementById("previous_pic");

	next_p = currentPic+1;
	prev_p = currentPic-1;

	if(next_p>splitFULL.length-1)
		next_p = 1;
	if(prev_p<=0)
		prev_p = (splitFULL.length)-1;

	//alert("currentPic = "+currentPic+"  next = "+next_p+"  prev = "+prev_p);
	tmpNEXT.innerHTML = "<a class=\"nav_black_verd\" href=javascript:showFullPic("+next_p+",\""+fullData+"\",\""+detailData+"\") target=\"_self\">next</a>";
	tmpPREV.innerHTML = "<a class=\"nav_black_verd\" href=javascript:showFullPic("+prev_p+",\""+fullData+"\",\""+detailData+"\") target=\"_self\">previous</a>";

}

//*************************

// SCROLLING-functions

var intSize = 100;				// Intervaldauer: Scrolling (Millisekunden)
var intSizeDelay = 1000;		// Intervaldauer: Delay (Millisekunden)

// EDITABLE
var scroll_IN_Delay = 5;		// Wartezeit (Sekunden) bis zum Reinscrollen
var scroll_OUT_Delay = 60;		// Wartezeit (Sekunden) bis zum Reinscrollen
var scrollSpeed = 1;			// Geschwindigkeit (Pixel / Zehntelsekunde)
var scrollMin = -284;			// Startposition
var scrollMax = 0;				// Endposition
// END EDITABLE

var currentDelay = new Number();
var scroll_IN_DelayTime = scroll_IN_Delay*1000;
var scroll_OUT_DelayTime = scroll_OUT_Delay*1000;

function initScroll()
{
	picDiv = document.getElementById("news_pic");
	resetPosition = scrollMin+"px";
	try
	{	picDiv.style.setAttribute("left",resetPosition,"false");	}
	catch(e)
	{	picDiv.setAttribute("style","left:"+resetPosition,"false");	}

	delayInterval = window.setInterval("scrollDelayTimer(\"out\")",intSizeDelay);
}

function scrollDelayTimer(lastScrollAction)
{	// is called when scrolling is done (in or out)
	if(lastScrollAction=="in")
	{
		if(currentDelay<scroll_OUT_DelayTime)
		{
			currentDelay+=intSizeDelay;
		}
		else
		{
			clearInterval(delayInterval);
			currentDelay = 0;
			scrollInterval = window.setInterval("scrollPic(\"out\")",intSize);
		}
	}

	if(lastScrollAction=="out")
	{
		if(currentDelay<scroll_IN_DelayTime)
		{
			currentDelay+=intSizeDelay;
		}
		else
		{
			clearInterval(delayInterval);
			currentDelay = 0;
			scrollInterval = window.setInterval("scrollPic(\"in\")",intSize);
		}
	}
}

function scrollPic(direction)
{
	picDiv = document.getElementById("news_pic");

	try
	{	currentPos = picDiv.style.getAttribute("left");	}
	catch(e)
	{	currentPos = picDiv.style.left;	}
	getNum = currentPos.split("px");
	posVal = getNum[0];
// SCROLLING IN
	if(direction=="in")
	{
		if(posVal<scrollMax)
		{
			if((Number(posVal)+scrollSpeed)>=scrollMax)
				newPos = scrollMax+"px";
			else
				newPos = (Number(posVal)+scrollSpeed)+"px";
			try
			{	picDiv.style.setAttribute("left",newPos,"false");	}
			catch(e)
			{	picDiv.setAttribute("style","left:"+newPos,"false");	}
		}
		else
		{
			clearInterval(scrollInterval);
			delayInterval = window.setInterval("scrollDelayTimer(\"in\")",intSizeDelay);
		}
	}
// SCROLLING OUT
	if(direction=="out")
	{
		if(posVal>scrollMin)
		{
			newPos = (Number(posVal)-scrollSpeed)+"px";
			try
			{	picDiv.style.setAttribute("left",newPos,"false");	}
			catch(e)
			{	picDiv.setAttribute("style","left:"+newPos,"false");	}
		}
		else
		{
			clearInterval(scrollInterval);
			//initScroll(); // uncomment, if scrolling should start again
		}
	}
}

// ENDE SCROLLING-functions ************************

