function BrowserCheck() {
	var os= navigator.platform
	if (os.indexOf("Mac")!=-1) {
		this.os = "mac"
	} else {
		this.os = "pc"
	}
	var b = navigator.appName;
	if (b=="Netscape") this.b = "ns";
	else if (b=="Microsoft Internet Explorer") this.b = "ie";
	else this.b = b;
	this.v = parseInt(navigator.appVersion);
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
}
is = new BrowserCheck();

function showNav(which,lang){

	thePath = eval("'../../images/' + which + '_hi_' + lang + '.gif'");
	document[which].src = thePath;

	if ((is.os == "pc") && (is.ie4 || is.ie5)){
		theLayer = eval(which + '_Div.style');
		metaNavLayer = metaNavDiv.style;
	}else{
		theLayer = eval('document.getElementById("' + which + '_Div").style');
		metaNavLayer = document.getElementById("metaNavDiv");
	}

	theOne = GetElmParent(which);
	if (theOne == metaNavLayer){
		left = 585;
	}else{
		left = 0;
	}
	theLPos=document.images[which].offsetLeft + left;
	theLayer.left=theLPos + "px";
	theLayer.visibility = "visible";
}

function hideNav(which,lang){
	thePath = eval("'../../images/' + which + '_lo_' + lang + '.gif'");
	document[which].src = thePath;
	if (is.ie4 || is.ie5){
		theLayer = eval(which + '_Div.style');
	}else{
		theLayer = eval('document.getElementById("' + which + '_Div").style');
	}
	theLayer.visibility = "hidden";
}




function GetElmParent(which) {
	if (document.images[which] && document.images[which].parentNode.parentNode){
		return document.images[which].parentNode.parentNode;
	} else if (document.images[which] && document.images[which].parentElement.parentElement){
		return document.images[which].parentElement.parentElement.name;
	} else {
		return null;
	}
}

function hiLite(which){
	theLNK = GetParent(which);
	theLNK.className = "mainNavSingleAct";
}
function loLite(which){
	theLNK = GetParent(which);
	theLNK.className = "mainNavSingle";
}

function GetParent(which) {
	if (which && which.parentNode.parentNode){
		return which.parentNode;
	} else if (which && which.parentElement.parentElement){
		return which.parentElement.parentElement.name;
	} else {
		return null;
	}
}

function say(s) {
	errstr = 'Sie haben das Formular noch nicht vollständig ausgefüllt.\n' + s;
	alert(errstr);
}
function say_fr(s) {
	errstr = 'Vous n\'avez pas encore rempli complètement le formulaire.\n' + s;
	alert(errstr);
}

function verify_de() {
	with (document.forms.vertretungen) {

/*	var dest = document.forms.vertretungen;
	var go = 0;

	for (i=0; i<dest.elements.length; i++) {
		y = eval("dest.elements["+i+"].type");
		z = eval("dest.elements["+i+"].checked");
		if(dest.elements[i].type=="checkbox" && dest.elements[i].checked!=false){
			go++;
		}

	}	
	
	if (go == 0) {
		alert('Bitte wählen Sie wenigstens einen Artikel aus.');
	}else{
		return true;
	}
*/
		if (typeof(name) != "undefined") {
			if (name.value == '') {
				name.focus();
				say('Bitte geben Sie Ihren Namen an.');
				return false;
			}
		}
		if (typeof(vorname) != "undefined") {
			if (vorname.value == '') {
				vorname.focus();
				say('Bitte geben Sie Ihren Vornamen an.');
				return false;
			}
		}
		if (typeof(strasse) != "undefined") {
			if (strasse.value == '') {
				strasse.focus();
				say('Bitte geben Sie Ihre Adresse an.');
				return false;
			}
		}
		if (typeof(plz) != "undefined") {
			if (plz.value == '') {
				plz.focus();
				say('Bitte geben Sie Ihre Postleitzahl an.');
				return false;
			}
		}
		if (typeof(ort) != "undefined") {
			if (ort.value == '') {
				ort.focus();
				say('Bitte geben Sie Ihre Stadt an.');
				return false;
			}
		}
		if (typeof(land) != "undefined") {
			if (land.value == '') {
				land.focus();
				say('Bitte geben Sie Ihr Land an.');
				return false;
			}
		}
		if (typeof(email) != "undefined") {
			if (email.value == '') {
				email.focus();
				say('Bitte geben Sie Ihre E-Mail Adresse an.');
				return false;
			}
			if (email.value.indexOf('@')<0) {
				email.focus();
				say('Bitte geben Sie eine gültige E-Mail Adresse an.');
				return false;
			}
		}
  		return true;

	}
}
function verify_fr() {
	with (document.forms.vertretungen) {
		if (typeof(name) != "undefined") {
			if (name.value == '') {
				name.focus();
				say_fr('Veuillez indiquer votre nom.');
				return false;
			}
		}
		if (typeof(vorname) != "undefined") {
			if (vorname.value == '') {
				vorname.focus();
				say_fr('Veuillez indiquer votre prénom.');
				return false;
			}
		}
		if (typeof(strasse) != "undefined") {
			if (strasse.value == '') {
				strasse.focus();
				say_fr('Veuillez indiquer votre rue.');
				return false;
			}
		}
		if (typeof(plz) != "undefined") {
			if (plz.value == '') {
				plz.focus();
				say_fr('Veuillez indiquer votre NPA.');
				return false;
			}
		}
		if (typeof(ort) != "undefined") {
			if (ort.value == '') {
				ort.focus();
				say_fr('Veuillez indiquer votre localité.');
				return false;
			}
		}
		if (typeof(land) != "undefined") {
			if (land.value == '') {
				land.focus();
				say_fr('Veuillez indiquer votre pays.');
				return false;
			}
		}
		if (typeof(email) != "undefined") {
			if (email.value == '') {
				email.focus();
				say_fr('Veuillez indiquer votre adresse e-mail.');
				return false;
			}
			if (email.value.indexOf('@')<0) {
				email.focus();
				say_fr('Veuillez corriger votre adresse e-mail.');
				return false;
			}
		}
  		return true;

	}
}

function legal(url) {
	window.open(url,"Legal","width=500,height=450,scrollbars=yes,resizeable=no,menubar=yes,status=yes,top=50,left=100");
}
