function openwin(whichLink, whichName, width, height) {
	var breit = screen.availWidth;
	var hoch = screen.availHeight;
	var x = (breit-width)/2;
	var y = (hoch-height)/2;
	window.open(whichLink, whichName, 'top='+(hoch-height)/2+',left='+(breit-width)/2+',width='+width+',height='+height+',hotkeys=no,directories=no,menubar=no,location=no,personalbar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no');
	//self.blur();
}
function openwinscroll(whichLink, whichName, width, height) {
	var breit = screen.availWidth;
	var hoch = screen.availHeight;
	var x = (breit-width)/2;
	var y = (hoch-height)/2;
	window.open(whichLink, whichName, 'top='+(hoch-height)/2+',left='+(breit-width)/2+',width='+width+',height='+height+',hotkeys=no,directories=no,menubar=no,location=no,personalbar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no');
	//self.blur();
}
function mymail(prefix, suffix) {
	var tl = 'de';
	location='mailto:'+prefix+"@"+suffix+"."+tl;
}

function framecheck(currentpage, client) {
	if (parent.frames.length>0) {
		var currentclient = parent.frames[1].document.forms[0].client.value;
		if (currentclient != client) {
			if (client == "christl") {
				top.frames[1].location = "aktionen_christl.htm";
			} else if (client == "christl-schowalter") {
				top.frames[1].location = "aktionen_cs.htm";
			}
		}
	}
	if (parent.frames.length == 0) {
		if (client="christl") {
			var mytitle = "Autohaus Christl M&uuml;nchen, Ihr Audi- und Volkswagen-Partner";
			var bottomframe = "aktionen_christl.htm";
		}
		var topframe = currentpage;
		document.close();
		document.open();
		document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">');
		document.write('<html>');
		document.write('<head>');
		document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
		document.write('<title>'+mytitle+'</title>');
		document.write('</head>');
		document.write('<frameset rows="*,110" frameborder="NO" border="0" framespacing="0">');
		document.write('<frame src="" name="mainFrame">');
		document.write('<frame src="" name="bottomFrame" scrolling="NO" noresize>');
		document.write('</frameset>');
		document.write('<noframes><body>');
		document.write('</body></noframes>');
		document.write('</html>');
		document.close();
		top.frames[0].location = topframe;
		top.frames[1].location = bottomframe;
	} else {
		return;
	}
	return;
}

function adresswahl() {
	empfaengerliste = new Array("disposition@christl.de", "disposition@christl.de", "disposition@christl.de", "thomas.schula@christl.de", "vw.service@christl.de", "ralf.mautner@christl.de");
	bereichsliste = new Array("Audi", "Volkswagen", "Freizeitmobile/Nutzfahrzeuge", "Gebrauchte", "Service", "Zubehoer");
	
				var myform = document.forms[1];
				mandatory = new Array(myform.Name, myform.PLZ, myform.Ort, myform.Telefon,  myform.EMail);
				ids = new Array("txtname", "txtplz","txtort", "txttelefon", "txtemail");

// Check Formfields
				failure = new Array();
				checkfields = true;
					for (i=0; i<mandatory.length; i++) {
						if (mandatory[i].value == "" || mandatory[i].value == " ") {
						failure[failure.length]= i;
							var ok = document.getElementById(ids[i]);
								if (ok) {
									ok.style.color = "#FF0000";
									var check = false;
									}
							} else {
							if (document.getElementById) {
								var ok = document.getElementById(ids[i]);
								if (ok) {
									ok.style.color = "#000000";
									var check = true;
								}
							}
						}
					}
				// Display Error Message	
					if (!(check)){
					   document.getElementById("txtmessage").style.color = "#FF0000";
					}else{
							for (i=0; i<bereichsliste.length; i++) {					
								if (document.forms[0].Bereich[i].checked) {
									document.forms[1].Empfaenger.value = empfaengerliste[i];
									document.forms[1].Bereich.value = bereichsliste[i];
									break;
								}else{
									document.forms[1].Empfaenger.value = empfaengerliste[1];
									document.forms[1].Bereich.value = "Nicht selektiert";
								}
							}					   
						document.getElementById("txtmessage").style.color = "#000000";
						document.forms[1].action = "email.php?partner=christl";
						document.forms[1].submit();
					}
}

function FP_openNewWindow(w,h,nav,loc,sts,menu,scroll,resize,name,url) {//v1.0
 var windowProperties=''; if(nav==false) windowProperties+='toolbar=no,'; else
  windowProperties+='toolbar=yes,'; if(loc==false) windowProperties+='location=no,'; 
 else windowProperties+='location=yes,'; if(sts==false) windowProperties+='status=no,';
 else windowProperties+='status=yes,'; if(menu==false) windowProperties+='menubar=no,';
 else windowProperties+='menubar=yes,'; if(scroll==false) windowProperties+='scrollbars=no,';
 else windowProperties+='scrollbars=yes,'; if(resize==false) windowProperties+='resizable=no,';
 else windowProperties+='resizable=yes,'; if(w!="") windowProperties+='width='+w+',';
 if(h!="") windowProperties+='height='+h; if(windowProperties!="") { 
  if( windowProperties.charAt(windowProperties.length-1)==',') 
   windowProperties=windowProperties.substring(0,windowProperties.length-1); } 
 window.open(url,name,windowProperties);
}

