/////////////////////////////////////////////////////////////////////
function addOnLoadFunction(OnLoadFunction){
		
	var oldOnLoad = window.onload;
	
	window.onload = function(){
		
		if(oldOnLoad){
			oldOnLoad();
		}//end if
		
		OnLoadFunction();
	
	}//end function
	
}//end function
/////////////////////////////////////////////////////////////////////
function showMeldung(id){
	var meldungsbox = document.getElementById(id);
	if(meldungsbox.style.display = "none"){
		meldungsbox.style.display="block";
		return true; 
	}
}
/////////////////////////////////////////////////////////////////////
function hideMeldung(id){
	var meldungsbox = document.getElementById(id);
	
	if(meldungsbox.style.display = "block"){
		
		meldungsbox.style.display="none";
		return true; 
	}
}
/////////////////////////////////////////////////////////////////////
function flipPicture(Src, Id){
	document.getElementById("bigpicture").src = Src;
	
	document.getElementById("scrolldown").onclick = function(){
		scrollPicture(Id , document.getElementById("scroll"), "down");
	}; 
	
	document.getElementById("scrollup").onclick = function(){
		scrollPicture(Id , document.getElementById("scroll"), "up");
	};
	
}//end function	
/////////////////////////////////////////////////////////////////////
function scrollPicture(Id, Element, Direction){
	
	var thumbs 		= document.getElementsByName("thumbs");
	var lastIndex	= thumbs.length-1;	
	
	for(var i=0;i<=lastIndex;i++){
		/* Thumb gefunden */
		if(thumbs[i].id == Id){
			
			if(Direction == "down"){
				var thumb = (i-1) < 0 ? lastIndex : i-1;
			}//end if
			
			if(Direction == "up"){
				var thumb = (i+1) > lastIndex ? 0 : i+1;
			}// end if
			
			with(thumbs[thumb]){
				onmouseover();	
				Element.onclick = function(){
					scrollPicture(id ,Element, Direction);
				};
			}//end with
			
			
		}//end if
	}//end for

}//end function
/////////////////////////////////////////////////////////////////////
function showWait(hide_id, show_id) {
    document.getElementById(hide_id).style.display = "none";
    document.getElementById(show_id).style.display = "block";
}
