var menudelay = 500;

var outc = '#F5F5F5';
var overc = '#DDE4ED';
var outfont = '#696969';
var overfont = '#02265C';

var delayflag;
var scrllflag;

function valid() {
	returnstr = '';
	if (document.con.fnm.value =='') {
		returnstr += 'Please enter your first name.\n';
	}
	if (document.con.lnm.value =='') {
		returnstr += 'Please enter your last name.\n';
	}
	if (document.con.kvs.value =='') {
		returnstr += 'Please enter your health insurance.\n';
	}
	if (document.con.fon.value =='') {
		returnstr += 'Please enter your Phone Number.\n';
	}
	if (document.con.eml.value =='') {
		returnstr += 'Please enter your email.\n';
	} else if ((!document.con.eml.value.match('@'))  || (!document.con.eml.value.match(/(\.)/))) {
		document.con.eml.value = '';
		document.con.eml.focus();
		returnstr += 'Please provide a valid email-address.';
	}
	if (document.con.nte.value == '') {
		returnstr += 'Please use the Note-field for your message.';
	}
	if (returnstr != '') {
		alert(returnstr);
		return false;
	} else {
		return true;
	}
}	
		
function gto(lnk) {
	document.location.href = lnk;
}

function delaytoggle(id, show) {
	id2 = id;
	show2 = show;
	if (document.all) {
		if (show2 == true) vis = "visible";
		else vis = "hidden";
		if (document.all[id2].style.visibility != vis) {
			if (vis == 'hidden') delayflag = window.setTimeout("eval('toggle(id2,show2)')", menudelay);
			else toggle(id2,show2);
		}
	} else if (document.getElementById) {
		if (show2 == true) vis = "visible";
		else vis = "hidden";
		if (document.getElementById(id2).style.visibility!= vis) {
			if (vis == 'hidden') delayflag = window.setTimeout("eval('toggle(id2,show2)')", menudelay);
			else toggle(id2,show2);
		}
	}
}

function toggle(id, show) {
	
	cid = "a"+id.slice(1,id.length);

	
	/*if (id.match('a')) { 
		cid = 'a0';
	} else if (id.match('b')) {
		cid = 'b0';
	} else if (id.match('c')) {
		cid = 'c0';
	} else if (id.match('d')) {
		cid = 'd0';
	}	*/
	if (document.all) {
		if (show) {
			clearTimeout(delayflag);
			document.all[id].style.visibility = "visible";
		} else {
			document.all[id].style.visibility = "hidden";
			maincolout(cid);
		}
	} else if (document.getElementById) {
		if (show == 1) {
			clearTimeout(delayflag);
			document.getElementById(id).style.visibility = "visible";
		} else {
			document.getElementById(id).style.visibility = "hidden";
			maincolout(cid);
		}
	}
}

function colout(id) {
	if (document.all) {
		temp = eval(id + ".style");
		temp.backgroundColor = outc;
		temp.color = outfont;
	} else if (document.getElementById) {
		document.getElementById(id).style.backgroundColor = outc;
		document.getElementById(id).style.color = outfont;
	}
}

function colover(id) {
	if (document.all) {
		temp = eval(id + ".style");
		temp.backgroundColor = 	overc;
		temp.color = overfont;
	} else if (document.getElementById) {
		document.getElementById(id).style.backgroundColor = overc;
		document.getElementById(id).style.color = overfont;
	}
}

function maincolout(id) {
	if (document.all) {
		temp = eval(id + ".style");
		temp.backgroundColor = outc;
		temp.color = outfont;
		temp.borderLeftColor = outc;
	} else if (document.getElementById) {
		document.getElementById(id).style.backgroundColor = outc;
		document.getElementById(id).style.color = outfont;
//		document.getElementById(id).style.borderLeftColor = outc;
	}
}

function maincolover(id) {
	if (document.all) {
		temp = eval(id + ".style");
		temp.borderColor = '#FFFFFF'; //overfont; 
		temp.backgroundColor = 	overc;
		temp.color = overfont;
	} else if (document.getElementById) {
//		document.getElementById(id).style.borderLeftColor = '#FFFFFF'; //overfont;
		document.getElementById(id).style.backgroundColor = overc;
		document.getElementById(id).style.color = overfont;
	}
}

function langsel(destlan) {
	if (destlan=='de') {
		alert('deutsche Version ist leider noch nicht verfügbar');
	} else {
		buffer=top.location.href.match('([a-z0-9_]+)(_)([a-z]+)(.html)');
		newloc = buffer[1]+buffer[2]+destlan+buffer[4];
		top.location = newloc;
	}
}
/*
function operasuche() {
	if ((navigator.userAgent.toLowerCase().match('opera')) && (parseFloat(navigator.appVersion) < 7.23 )){
		suche();
	}
}

function suche() {
	document.srch.qry.focus();
	alert('SORRY---search function not implemented yet.');
}
*/
function chkscroll() {
/*	if (document.getElementById) {
		for (i=1;i<=13;i++) {
			id='i'+i;
			if (document.getElementById(id)) {
				switch (document.getElementById(id).className) {
					case 'white':
						document.getElementById(id).backgroundColor = '#ffffff';
						break
					case 'blue':
						document.getElementById(id).backgroundColor = '#dde4ed';
						break
					case 'grey':
						document.getElementById(id).backgroundColor = '#f5f5f5';
				}
			}
		}
	}
	scrllflag = window.setTimeout("chkscroll()",500);*/
}

if ((navigator.userAgent.toLowerCase().match('opera')) && (parseFloat(navigator.appVersion) < 7.20 )){
	menudelay+=2000;
}