function openWin(which,width,height) {
	var t = window.open(which,'PopUp','width='+width+',height='+height+',screenX=140, left=140, screenY=170, top=170, scrollbars=1, resizable=1');
	t.focus();
	return void(t);
}

function openFullWin(which,width,height) {
	var t = window.open(which,'PopUp','width='+width+',height='+height+',screenX=140, left=140, screenY=170, top=170, scrollbars=1, resizable=1, toolbar=1, menuebar=1, location=1, status=1');
	t.focus();
	return t;
}


	
function getValues(form,values){
	var f = form;
	var fields = values.split(",");
	var error = "";

	for (i=0; i<fields.length; i++) {
		if(document.forms[f].elements[fields[i]].value == ""){
			error += '   '+fields[i]+'\n';
		} else if (fields[i] == "Email") {
			error += (!proofMailSyntax(document.forms[f].elements[fields[i]].value)) ? "Sie haben keine oder eine fehlerhafte Emailadresse eingegeben\n" : "";
		}

	}
	if (error != "") {
		alert("Für eine erfolgreiche Weiterverarbeitung benötigen wir noch folgende Daten von Ihnen:\n"+error);
		return false;
	}
	else {
		document.forms[f].submit();	
	}
}


function proofMailSyntax(emailadress) {
	var a = false;
	var res = false;
	
	// test ob regEx unterstuetzt wird
	if(typeof(RegExp) == 'function') {
		var b = new RegExp('abc');
		if(b.test('abc') == true){a = true;}
	}
	
	if(a == true) {
	  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
	                   '(\\@)([a-zA-Z0-9äüößÄÜÖ\\-\\.]+)'+
	                   '(\\.)([a-zA-Z]{2,4})$');
	  res = (reg.test(emailadress));
	}
	else {
	  res = (s.search('@') >= 1 &&
	         s.lastIndexOf('.') > s.search('@') &&
	         s.lastIndexOf('.') >= s.length-5)
	}
	return(res);
}



var imgpath;
var protokoll = location.href.substring(location.href.indexOf('http'),location.href.lastIndexOf('//')+2);

function GetImagePath ( which ) {
	imgpath = document.images[which].src;
	imgpath = imgpath.substring(imgpath.lastIndexOf(protokoll), imgpath.lastIndexOf('/')+1);
}



function ShowMoGif ( which ) {
	GetImagePath( which );
	document.images[which].src = imgpath + 'nav_' +which+'_mo.gif';
}

function HideMoGif ( which ) {
	GetImagePath( which );
	document.images[which].src = imgpath + 'nav_' +which+'.gif';
}

function PreloadImages(imglist) {
	var list = imglist.split("&");
	var preload_img=new Array;

	for (i=0;i<list.length;i++) {
		preload_img[i]     = new Image;
		preload_img[i].src = list[i];
	}
}


function getPrueffeld() {
	alert('Hier bitte nichts eingeben. \n\nWie es scheint haben Sie CSS (Casscading Stylesheets) in Ihrem Browser deaktiviert.\n Dieses Feld ist normalerweise nicht sichtbar und dient ausschliesslich zur Abwehr gegen Spammails.\n\nWir danken für Ihr Verständnis.');
}