String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function low(LinkObject)	{
	LinkObject.style.background='#FF9400';
	LinkObject.style.borderColor='#51567C';
}

function low2(LinkObject)	{
	LinkObject.style.background='#ffbb00';
	LinkObject.style.borderColor='#51567C';
}


function norm(LinkObject)	{
	LinkObject.style.background='#E5E5F1';
	LinkObject.style.borderColor='#E5E5F1';
}

function openFrame(URL)	 {
		parent.location.href=URL;
		return true;
}

var aktiv;

function setNextStep(theElementID) {
	aktiv = window.setInterval("laufband(\""+theElementID+"\")", 50);
}
	
function laufband(theElementID) {	
	var elem = document.getElementById(theElementID);
	if (null != elem) {
		var topPos = elem.style.top;
		var offPos = elem.offsetHeight;
		//alert(offPos + " + " + topPos); 
		if (null != topPos) {
			topPos = topPos.replace(/px/, "");
			if (1-topPos > offPos) {
				topPos = 5;
			}
			elem.style.top = (topPos-1)+"px";
		}
	}
}

function stopLaufband() {
	window.clearInterval(aktiv);
}


function checkAndSendAnfrage() {
	var formElement = $("form_anfrage");
	var email = $("input_email");
	var inname = $("input_name");
	var Kommentar = $("Kommentar");
	if (null != formElement) {
		if (null == inname || inname.value =="") {
			alert("Bitte geben Sie einen Namen ein.");
			return ;
		} 
		if (null != Kommentar && (Kommentar.value.indexOf("href") >= 0 || Kommentar.value.indexOf("http") >= 0 || Kommentar.value.indexOf("warcraft") >= 0)) {
			alert("Links sind nicht erlaubt!");
			return false;
		}

		if (email.value =="" || (email.value.indexOf(".") <= 1) || (email.value.indexOf("@") == 0)) {
			alert("Bitte geben Sie ein g&uuml;ltige EMail-Adresse ein!");
			return false;
		} else {
			formElement.action="sendprodrequest.php";
			formElement.submit();
		}
	}
}
