	function checkMailForm(){
		if (document.emailform.email.value=="E-Mail Adresse"){
			document.emailform.email.style.borderWidth="2px";
			document.emailform.email.style.borderColor="#CA0018";
			return false;
		} else if (document.emailform.email.value==""){
			document.emailform.email.style.borderWidth="2px";
			document.emailform.email.style.borderColor="#CA0018";
			return false;
		} else if (document.emailform.email.value.indexOf("@")<0){
			document.emailform.email.style.borderWidth="2px";
			document.emailform.email.style.borderColor="#CA0018";
			return false;
		}
		return true;
	}
	
	function addForm(name,value){
var newname=new Number(name.substr(4));
newname++;
newname="file"+newname;
		var input = document.createElement("input");
		input.type="file";
	    input.name=name;
		input.className="inputbox";
		input.onchange=function(){addForm(this.name,this.value);};
		input.style.width="334px";
		var formarea = document.getElementById("zuploadform");
		formarea.appendChild(input)
	
	}
	
	function checkKontaktFormBanner(field1,field2){
		var color="#CA0018";
		var colorok="#FFFFFF";
		var ret=true;
		var opt=false;
		ret=checkKontaktForm(field1);
		field2 = field2.split(",");
		for (var i=0;i<field2.length;i++){
			var field = document.getElementById(field2[i]);
			if (field && field.type=="checkbox"){
				if (field.checked==true){
					opt=true;
				}
					field.style.borderWidth="1px";
					field.style.backgroundColor=colorok;
			}
			
		}
		if (opt==false){
			for (var i=0;i<field2.length;i++){
				var field = document.getElementById(field2[i]);
				if (field && field.type=="checkbox"){
					field.style.borderWidth="2px";
					field.style.backgroundColor=color;
				}
			}
			ret=false;
		
		}
		return ret;
	}
	
	function checkKontaktForm(field){
		var fields = field.split(",");
		var returnvalue = true;
		var color="#CA0018";
		var colorok="#A3A3A3";
		for (var i=0;i<fields.length;i++){
			var field = document.getElementsByName(fields[i])[0];
			if (field.type=="text" || field.type=="textarea"){
				if (field.value==""){
					field.style.borderWidth="2px";
					field.style.borderColor=color;
					returnvalue = false;
				} else if ((fields[i]=="email" || fields[i]=="weiter_sendto" || fields[i]=="weiter_sendfrom") && field.value.indexOf("@")<0){
					field.style.borderWidth="2px";
					field.style.borderColor=color;
					returnvalue = false;
				} else {
					field.style.borderWidth="1px";
					field.style.borderColor=colorok;
				}
			} else if (field.type=="radio"){
					var schleife = false;
					field=document.getElementsByName(fields[i]);
					for (var j=0; j<field.length; j++) {
						if (field[j].checked) {
							schleife=true;
						}
					}
					if (schleife==false){
						for (var j=0; j<field.length; j++) {
							field[j].style.borderWidth="2px";
							field[j].style.borderColor=color;
						}
						returnvalue = false;
					} else {
						for (var j=0; j<field.length; j++) {
							field[j].style.borderWidth="0px";
							field[j].style.borderColor=colorok;
						}
					}
				} else if (field.type=="checkbox"){
					if (field.checked!=true){
							field.style.borderWidth="2px";
							field.style.backgroundColor=color;
							returnvalue = false;
					} else {
						field.style.borderWidth="1px";
						field.style.backgroundColor="";
					}
				}
		}
	return returnvalue;
	}
	
	function openWeiter(){
		document.getElementById('weiterempfehlen').style.display='inline';
		document.getElementById('weiter_sendto').focus();
	}
	
		
	function setContentColor(obj){
		obj.style.backgroundColor="#F4F4F4";
	}
	
	function setContentColorOut(obj){
		obj.style.backgroundColor="";
	}
	
function setBackgroundColor(obj){
		if (obj.style.backgroundColor.toUpperCase()=="#E4E4E4" || obj.style.backgroundColor == "rgb(228, 228, 228)"){
			obj.style.backgroundColor="";
			if (obj.id=="first"){
					obj.style.borderBottom="0px #D0D0D0 solid";
				if (obj.childNodes.length>1){
					obj.childNodes[1].style.borderBottom="1px #D0D0D0 solid";
				} else {
					obj.childNodes[0].style.borderBottom="1px #D0D0D0 solid";
				}
			} else {
				obj.style.borderTop="0px #D0D0D0 solid";
				if (obj.previousSibling.childNodes.length<1){
					obj.previousSibling.previousSibling.childNodes[0].style.borderBottom="1px #D0D0D0 solid";
				} else {
					obj.previousSibling.childNodes[0].style.borderBottom="1px #D0D0D0 solid";
				}
			}
		} else {
			obj.style.backgroundColor="#E4E4E4";
			if (obj.id=="first"){
				obj.style.borderBottom="1px #D0D0D0 solid";
				if (obj.childNodes.length>1){
					obj.childNodes[1].style.borderBottom="0px #D0D0D0 solid";
				} else {
					obj.childNodes[0].style.borderBottom="0px #D0D0D0 solid";
				}
			} else {
				obj.style.borderTop="1px #D0D0D0 solid";
				if (obj.previousSibling.childNodes.length<1){
					obj.previousSibling.previousSibling.childNodes[0].style.borderBottom="0px #D0D0D0 solid";
				} else {
					obj.previousSibling.childNodes[0].style.borderBottom="0px #D0D0D0 solid";
				}
			}
		}
}

function setBackgroundColortrust(obj){
		if (obj.style.backgroundColor.toUpperCase()=="#E4E4E4" || obj.style.backgroundColor == "rgb(228, 228, 228)"){
			obj.style.backgroundColor="";
			if (obj.id=="first"){
					obj.style.borderBottom="0px #D0D0D0 solid";
				if (obj.childNodes.length>1){
					obj.childNodes[1].style.borderBottom="1px #D0D0D0 solid";
				} else {
					obj.childNodes[0].style.borderBottom="1px #D0D0D0 solid";
				}
			} else {
				obj.style.borderTop="0px #D0D0D0 solid";
				if (obj.previousSibling.childNodes.length<1){
					obj.previousSibling.previousSibling.childNodes[1].style.borderBottom="1px #D0D0D0 solid";
				} else {
					obj.previousSibling.childNodes[0].style.borderBottom="1px #D0D0D0 solid";
				}
			}
		} else {
			obj.style.backgroundColor="#E4E4E4";
			if (obj.id=="first"){
				obj.style.borderBottom="1px #D0D0D0 solid";
				if (obj.childNodes.length>1){
					obj.childNodes[1].style.borderBottom="0px #D0D0D0 solid";
				} else {
					obj.childNodes[0].style.borderBottom="0px #D0D0D0 solid";
				}
			} else {
				obj.style.borderTop="1px #D0D0D0 solid";
				if (obj.previousSibling.childNodes.length<1){
					obj.previousSibling.previousSibling.childNodes[1].style.borderBottom="0px #D0D0D0 solid";
				} else {
					obj.previousSibling.childNodes[0].style.borderBottom="0px #D0D0D0 solid";
				}
			}
		}
}

function viewUpload(id){
		document.getElementById(id).style.display="block";
	}
	function closeUpload(id){
		document.getElementById(id).style.display="none";
		document.getElementById(id+"gif").src="upload_grau.gif";
		document.getElementById(id+"gif").onmouseover="";
		document.getElementById(id+"gif").onmouseout="";
		document.getElementById(id+"check").checked ="true";
	}
	
	function openBanner(width,height,id,w,h,lang){
		window.open('http://www.trustsympany.ch/showbanner?id='+id+'&w='+w+'&h='+h+'&lang='+lang,'_blank','left=150,top=150,width='+width+',height='+height+',toolbar=no,status=no,scrollbars=no,menubar=no,location=no');
	}
