//Browser identification
//if (navigator.appName == "Microsoft Internet Explorer") { document.write("<link rel='stylesheet' type='text/css' href='media/Styles/styles_ie.css'>") };

//PopUp
function popup (datei) {
	win = window.open(datei ,"shaPE","width=700, height=600,location=no,status=no,scrollbars=yes,resizable=yes");
	win.focus();
}
//Form validation
function validateForm(){
	v_form = document.ContactForm;
	if (v_form.f_fname.value == "" || v_form.f_lname.value == "" || v_form.f_email.value == ""){
		alert('Information incomplete. Please fill out all fields which are marked with a *.');
	//} else if (v_form.f_reports.checked == false || v_form.f_public.checked == false || v_form.f_meeting.checked == false || v_form.f_news.checked == false){
		//alert('Please select at least one News.');
	} else if (checkEmail(v_form.f_email.value)) {
		alert('E-mail is incorrect. Please enter a valid e-mail address.');
	} else {
		v_form.submit();
	}
}
function checkEmail(address) {
	var reg_email = /^[\w](([_\.-]?[\w]+)*)@([\w]+)(([\.-]?[\w]+)*)\.([A-Za-z]{2,})$/;
	if (! reg_email.exec(address))
		return true;
	else
		return false;
}
function writeMail(domain,name) {
	 document.write('<a href=\"mailto:'+name+String.fromCharCode(64)+domain+'\">'+name+String.fromCharCode(64)+domain+'</a>');
}

function expandAll(quantity) {
	for (var i = 1; i <= quantity; i++){
		document.getElementById(i).style.display = "block";
	}
}
function collapseAll(quantity) {
	for (var i = 1; i <= quantity; i++){
		document.getElementById(i).style.display = "none";
	}
}
