function moveUp(){
	window.scrollBy(0,+2);
	yPos = parent.cont.document.body.scrollTop + parent.cont.document.body.clientHeight - 400;
	parent.cont.document.getElementById('moveup').style.top = yPos;
}


function moveDown(){
	window.scrollBy(0,-2);
	yPos = parent.cont.document.body.scrollTop + parent.cont.document.body.clientHeight -50;
	parent.cont.document.getElementById('movedown').style.top = yPos;
}



function moveStop(){
	clearInterval(moveIt);
	
}

function changeBG(objekt){
	if(objekt.className == "moveOver"){
		objekt.className = "moveOut";
	}
	else{
		objekt.className = "moveOver";
	}
}


function NewWindow_image(n) {

NewWin =  window.open("image.html","image",'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=370');    

         
}
// Change Image Function

function changeImage(objekt,e){	
	
		source = objekt.src;
		position = source.length-5; // 5 = l.gif

			if(e.type == 'mouseover'){
				(objekt.src.indexOf("_c.png") == -1)? objekt.src = (source.slice(0,position)).concat('h.png') : nope = "";
			}

			if(e.type == 'mouseout'){
				(objekt.src.indexOf("_c.png") == -1)? objekt.src = (source.slice(0,position)).concat('l.png') : nope = "";
			}
			
			if(e.type == 'click'){
				for(i = 0; i < (document.images.length); i++){
					(document.images[i].src.indexOf(".png") != -1)?	document.images[i].src = (document.images[i].src.slice(0,position)).concat('l.png'): nope = "";
				}
				objekt.src = (source.slice(0,position)).concat('c.png');
			}
			
}
// END Change Image Function


function changeLinkBG(objekt,e){
	// Aufruf
	// onmouseover="javascript:changeLinkBG(this,event);"
	(e.type == "mouseout")?objekt.parentNode.parentNode.style.backgroundColor = '#000000' : objekt.parentNode.parentNode.style.backgroundColor = '#ffffff';
}



function checkInsert(objekt, specialchars, onlyspecialchars){ 
	//mit dem zweiten Parameter kann man zusätzliche Zeichen erlauben
	//wenn der dritte Parameter auf "on" steht, wird nur gegen die specialchars geprüft
	errors = "";
	text = objekt.value;
	if(onlyspecialchars == "on"){
		permit = specialchars;
	}
	else{
		permit = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" + specialchars;
	}
		
	for (i = 0; i < text.length; i++){
		((permit.indexOf(text.slice(i,i+1))) == -1)? errors = "Fehlerhafte Eingabe!" : errors = errors;
	}
		
	if(errors == "Fehlerhafte Eingabe!"){
		alert("Es wurde kein gültiger Eintrag gemacht!\nFolgende Zeichen sind erlaubt:\n\n" + permit);
		objekt.value = "";
		objekt.focus();
		objekt.style.backgroundColor = "#ff0000";
		return false;
	}
	else{
		objekt.style.backgroundColor = "#00ff00";
		//nope  Eingabe ist in Ordnung und Formular kann verschickt werden
	}
}
