function menuebar(obj,forecol,backcol) {
	obj.style.backgroundColor=backcol;
	obj.style.color=forecol;
}

function checkcontactform() {
	if(document.contactform.name.value=="") {
		alert("You did not enter a name!\n(missing field is colored)");
		document.contactform.name.style.border='2px solid #2B49AB';
		document.contactform.name.focus();
		return false;
	}
	if(document.contactform.email.value=="") {
		alert("You did not enter a email-address!\n(missing field is colored)");
		document.contactform.email.style.border='2px solid #2B49AB';
		document.contactform.email.focus();
		return false;
	}
	if(document.contactform.phone.value=="") {
		alert("You did not enter a phone number!\n(missing field is colored)");
		document.contactform.phone.style.border='2px solid #2B49AB';
		document.contactform.phone.focus();
		return false;
	}
	if(document.contactform.message.value=="") {
		alert("You did not enter a message!\n(missing field is colored)");
		document.contactform.message.style.border='2px solid #2B49AB';
		document.contactform.message.focus();
		return false;
	}
	if(document.contactform.subject.value=="") {
		alert("You did not select a subject!\n(missing field is colored)");
		document.contactform.subject.style.border='2px solid #2B49AB';
		document.contactform.subject.focus();
		return false;
	}
	return true;
}

function checkautoinsrequest()	{
	if ( document.autoinsform.name.value == "" )	{
		alert("You did not enter a name!\n(missing field is colored)");
		document.autoinsform.name.style.border='2px solid #2B49AB';
		document.autoinsform.name.focus();
		return false;
	}
	if ( document.autoinsform.birthmonth.value == "" || document.autoinsform.birthday.value == "" || document.autoinsform.birthyear.value == "" )	{
		alert("You did not enter a correct birthday!\n(missing field is colored)");
		document.autoinsform.birthmonth.style.border='2px solid #2B49AB';
		document.autoinsform.birthday.style.border='2px solid #2B49AB';
		document.autoinsform.birthyear.style.border='2px solid #2B49AB';
		return false;
	}
	if ( document.autoinsform.email.value == "" )	{
		alert("You did not enter a email-address!\n(missing field is colored)");
		document.autoinsform.email.style.border='2px solid #2B49AB';
		document.autoinsform.email.focus();
		return false;
	}
/*	if ( document.autoinsform.phone.value == "" )	{
		alert("You did not enter a phone-number!\n(missing field is colored)");
		document.autoinsform.phone.style.border='2px solid #2B49AB';
		document.autoinsform.phone.focus();
		return false;
	}	*/
	if ( document.autoinsform.firstreg.value == "" )	{
		alert("You did not enter a first registration year!\n(missing field is colored)");
		document.autoinsform.firstreg.style.border='2px solid #2B49AB';
		document.autoinsform.firstreg.focus();
		return false;
	}
	
	var datenow = new Date();
	var yearnow = datenow.getFullYear();
	var minyear = yearnow-100;
	
	if ( document.autoinsform.firstreg.value < minyear || document.autoinsform.firstreg.value > yearnow )	{
		alert("You did not enter a correct first registration year!\n(missing field is colored)");
		document.autoinsform.firstreg.style.border='2px solid #2B49AB';
		document.autoinsform.firstreg.focus();
		return false;
	}
	
	if ( document.autoinsform.make.value == "" )	{
		alert("You did not enter a car-make!\n(missing field is colored)");
		document.autoinsform.make.style.border='2px solid #2B49AB';
		document.autoinsform.make.focus();
		return false;
	}
	if ( document.autoinsform.model.value == "" )	{
		alert("You did not enter a car-model!\n(missing field is colored)");
		document.autoinsform.model.style.border='2px solid #2B49AB';
		document.autoinsform.model.focus();
		return false;
	}
	if ( document.autoinsform.usvalue.value == "" )	{
		alert("You did not enter a car value!\n(missing field is colored)");
		document.autoinsform.usvalue.style.border='2px solid #2B49AB';
		document.autoinsform.usvalue.focus();
		return false;
	}
	if ( document.autoinsform.liability.value == "no" && document.autoinsform.comprehensive.value == "no" && document.autoinsform.collision.value == "no" )	{
		alert("You did not select a insurance type!\n(Liability only, Comprehensive Loss and/or Collision Loss)");
		return false;
	}
	return true;
}

function checkmcinsrequest()	{
	if ( document.mcinsform.name.value == "" )	{
		alert("You did not enter a name!\n(missing field is colored)");
		document.mcinsform.name.style.border='2px solid #2B49AB';
		document.mcinsform.name.focus();
		return false;
	}
	if ( document.mcinsform.birthmonth.value == "" || document.mcinsform.birthday.value == "" || document.mcinsform.birthyear.value == "" )	{
		alert("You did not enter a correct birthday!\n(missing field is colored)");
		document.mcinsform.birthmonth.style.border='2px solid #2B49AB';
		document.mcinsform.birthday.style.border='2px solid #2B49AB';
		document.mcinsform.birthyear.style.border='2px solid #2B49AB';
		return false;
	}
	if ( document.mcinsform.email.value == "" )	{
		alert("You did not enter a email-address!\n(missing field is colored)");
		document.mcinsform.email.style.border='2px solid #2B49AB';
		document.mcinsform.email.focus();
		return false;
	}
/*	if ( document.mcinsform.phone.value == "" )	{
		alert("You did not enter a phone-number!\n(missing field is colored)");
		document.mcinsform.phone.style.border='2px solid #2B49AB';
		document.mcinsform.phone.focus();
		return false;
	}	*/
	if ( document.mcinsform.firstreg.value == "" )	{
		alert("You did not enter a first registration year!\n(missing field is colored)");
		document.mcinsform.firstreg.style.border='2px solid #2B49AB';
		document.mcinsform.firstreg.focus();
		return false;
	}
	
	var datenow = new Date();
	var yearnow = datenow.getFullYear();
	var minyear = yearnow-100;
	
	if ( document.mcinsform.firstreg.value < minyear || document.mcinsform.firstreg.value > yearnow )	{
		alert("You did not enter a correct first registration year!\n(missing field is colored)");
		document.mcinsform.firstreg.style.border='2px solid #2B49AB';
		document.mcinsform.firstreg.focus();
		return false;
	}
	
	if ( document.mcinsform.make.value == "" )	{
		alert("You did not enter a motorcycle make!\n(missing field is colored)");
		document.mcinsform.make.style.border='2px solid #2B49AB';
		document.mcinsform.make.focus();
		return false;
	}
	if ( document.mcinsform.model.value == "" )	{
		alert("You did not enter a motorcycle model!\n(missing field is colored)");
		document.mcinsform.model.style.border='2px solid #2B49AB';
		document.mcinsform.model.focus();
		return false;
	}
	if ( document.mcinsform.usvalue.value == "" )	{
		alert("You did not enter a motorcycle value!\n(missing field is colored)");
		document.mcinsform.usvalue.style.border='2px solid #2B49AB';
		document.mcinsform.usvalue.focus();
		return false;
	}
	if ( document.mcinsform.liability.value == "no" && document.mcinsform.comprehensive.value == "no" && document.mcinsform.collision.value == "no" )	{
		alert("You did not select a insurance type!\n(Liability only, Comprehensive Loss and/or Collision Loss)");
		return false;
	}
	return true;
}

function checkmainsrequest()	{
	if ( document.marineinsform.name.value == "" )	{
		alert("You did not enter a name!\n(missing field is colored)");
		document.marineinsform.name.style.border='2px solid #2B49AB';
		document.marineinsform.name.focus();
		return false;
	}
	if ( document.marineinsform.email.value == "" )	{
		alert("You did not enter a email-address!\n(missing field is colored)");
		document.marineinsform.email.style.border='2px solid #2B49AB';
		document.marineinsform.email.focus();
		return false;
	}
	if ( document.marineinsform.shipfrom.value == "" )	{
		alert("You did not enter a shipping from port!\n(missing field is colored)");
		document.marineinsform.shipfrom.style.border='2px solid #2B49AB';
		document.marineinsform.shipfrom.focus();
		return false;
	}
	if ( document.marineinsform.shipto.value == "" )	{
		alert("You did not enter a shipping to port!\n(missing field is colored)");
		document.marineinsform.shipto.style.border='2px solid #2B49AB';
		document.marineinsform.shipto.focus();
		return false;
	}
	if ( document.marineinsform.shipgood.value == "" )	{
		alert("You did not select a type of shipped goods!\n(missing field is colored)");
		document.marineinsform.shipgood.style.border='2px solid #2B49AB';
		document.marineinsform.shipgood.focus();
		return false;
	}
	if ( document.marineinsform.shipgood.value == "car" )	{
		if ( document.marineinsform.carvalue.value == "" )	{
			alert("You did not enter a car value!\n(missing field is colored)");
			document.marineinsform.carvalue.style.border='2px solid #2B49AB';
			document.marineinsform.carvalue.focus();
			return false;
		}
		if ( document.marineinsform.cartype.value == "" )	{
			alert("You did not select a car type!\n(missing field is colored)");
			document.marineinsform.cartype.style.border='2px solid #2B49AB';
			document.marineinsform.cartype.focus();
			return false;
		}
		if ( document.marineinsform.caryearmakemodel.value == "" )	{
			alert("You did not enter a car make, model and year!\n(missing field is colored)");
			document.marineinsform.caryearmakemodel.style.border='2px solid #2B49AB';
			document.marineinsform.caryearmakemodel.focus();
			return false;
		}
		if ( document.marineinsform.cardeductible.value == "" )	{
			alert("You did not select a deductable!\n(missing field is colored)");
			document.marineinsform.cardeductible.style.border='2px solid #2B49AB';
			document.marineinsform.cardeductible.focus();
			return false;
		}
	}
	if ( document.marineinsform.shipgood.value == "goods" )	{
		if ( document.marineinsform.goodvalue.value == "" )	{
			alert("You did not enter a goods value!\n(missing field is colored)");
			document.marineinsform.goodvalue.style.border='2px solid #2B49AB';
			document.marineinsform.goodvalue.focus();
			return false;
		}
		if ( document.marineinsform.gooddeductible.value == "" )	{
			alert("You did not select a deductable!\n(missing field is colored)");
			document.marineinsform.gooddeductible.style.border='2px solid #2B49AB';
			document.marineinsform.gooddeductible.focus();
			return false;
		}
		if ( document.marineinsform.gooddesc.value == "" )	{
			alert("You did not enter a description of what is being shipped!\n(missing field is colored)");
			document.marineinsform.gooddesc.style.border='2px solid #2B49AB';
			document.marineinsform.gooddesc.focus();
			return false;
		}
	}
	return true;
}

function checkclaimform()	{
	if ( document.claimform.name.value == "" )	{
		alert("You did not enter a name!\n(missing field is colored)");
		document.claimform.name.style.border='2px solid #2B49AB';
		document.claimform.name.focus();
		return false;
	}
	if ( document.claimform.email.value == "" )	{
		alert("You did not enter a email-address!\n(missing field is colored)");
		document.claimform.email.style.border='2px solid #2B49AB';
		document.claimform.email.focus();
		return false;
	}
	if ( document.claimform.policeno.value == "" )	{
		alert("You did not enter a policy-number!\n(missing field is colored)");
		document.claimform.policeno.style.border='2px solid #2B49AB';
		document.claimform.policeno.focus();
		return false;
	}
	if ( document.claimform.phone.value == "" )	{
		alert("You did not enter a phone-number!\n(missing field is colored)");
		document.claimform.phone.style.border='2px solid #2B49AB';
		document.claimform.phone.focus();
		return false;
	}
	if ( document.claimform.caryearmakemodel.value == "" )	{
		alert("You did not enter a car year, make and model!\n(missing field is colored)");
		document.claimform.caryearmakemodel.style.border='2px solid #2B49AB';
		document.claimform.caryearmakemodel.focus();
		return false;
	}
	if ( document.claimform.licenseno.value == "" )	{
		alert("You did not enter a license-number!\n(missing field is colored)");
		document.claimform.licenseno.style.border='2px solid #2B49AB';
		document.claimform.licenseno.focus();
		return false;
	}
	if ( document.claimform.damaged.value == "" )	{
		alert("You did not select if your car is damaged or not!\n(missing field is colored)");
		document.claimform.damaged.style.border='2px solid #2B49AB';
		document.claimform.damaged.focus();
		return false;
	}
	if ( document.claimform.damaged.value == "yes" )	{
		if ( document.claimform.damagedwhere.value == "" )	{
			alert("You did not enter where your car is damaged!\n(missing field is colored)");
			document.claimform.damagedwhere.style.border='2px solid #2B49AB';
			document.claimform.damagedwhere.focus();
			return false;
		}
	}
	if ( document.claimform.driveable.value == "" )	{
		alert("You did not select if your car is driveable or not!\n(missing field is colored)");
		document.claimform.driveable.style.border='2px solid #2B49AB';
		document.claimform.driveable.focus();
		return false;
	}
	if ( document.claimform.driveable.value == "yes" )	{
		if ( document.claimform.vehiclewhere.value == "" )	{
			alert("You did not enter where your car is!\n(missing field is colored)");
			document.claimform.vehiclewhere.style.border='2px solid #2B49AB';
			document.claimform.vehiclewhere.focus();
			return false;
		}
	}
	if ( document.claimform.accidentdatemonth.value == "" || document.claimform.accidentdateday.value == "" )	{
		alert("You did not select correct accident-date!\n(missing field is colored)");
		document.claimform.accidentdatemonth.style.border='2px solid #2B49AB';
		document.claimform.accidentdateday.style.border='2px solid #2B49AB';
		return false;
	}
	if ( document.claimform.accidenttimehour.value == "" || document.claimform.accidenttimeminute.value == "" )	{
		alert("You did not select correct accident-time!\n(missing field is colored)");
		document.claimform.accidenttimehour.style.border='2px solid #2B49AB';
		document.claimform.accidenttimeminute.style.border='2px solid #2B49AB';
		return false;
	}
	if ( document.claimform.drivername.value == "" )	{
		alert("You did not enter a driver-name!\n(missing field is colored)");
		document.claimform.drivername.style.border='2px solid #2B49AB';
		document.claimform.drivername.focus();
		return false;
	}
	if ( document.claimform.drvbirthmonth.value == "" || document.claimform.drvbirthday.value == "" || document.claimform.drvbirthyear.value == "" )	{
		alert("You did not enter a correct driver-birthday!\n(missing field is colored)");
		document.claimform.drvbirthmonth.style.border='2px solid #2B49AB';
		document.claimform.drvbirthday.style.border='2px solid #2B49AB';
		document.claimform.drvbirthyear.style.border='2px solid #2B49AB';
		return false;
	}
	if ( document.claimform.driverlicense.value == "" )	{
		alert("You did not enter a driver license-number!\n(missing field is colored)");
		document.claimform.driverlicense.style.border='2px solid #2B49AB';
		document.claimform.driverlicense.focus();
		return false;
	}
	if ( document.claimform.drvlicissuemonth.value == "" || document.claimform.drvlicissueday.value == "" || document.claimform.drvlicissueyear.value == "" )	{
		alert("You did not enter a correct license issue-date!\n(missing field is colored)");
		document.claimform.drvlicissuemonth.style.border='2px solid #2B49AB';
		document.claimform.drvlicissueday.style.border='2px solid #2B49AB';
		document.claimform.drvlicissueyear.style.border='2px solid #2B49AB';
		return false;
	}
	if ( document.claimform.anyinvolved.value == "" )	{
		alert("You did not select anybody else involved in the accident or not!\n(missing field is colored)");
		document.claimform.anyinvolved.style.border='2px solid #2B49AB';
		document.claimform.anyinvolved.focus();
		return false;
	}
	if ( document.claimform.anyinvolved.value == "yes" )	{
		if ( document.claimform.otherpersonname.value == "" )	{
			alert("You did not enter a name of in the accident involved person!\n(missing field is colored)");
			document.claimform.otherpersonname.style.border='2px solid #2B49AB';
			document.claimform.otherpersonname.focus();
			return false;
		}
		if ( document.claimform.othervehicle.value == "" )	{
			alert("You did not enter the vehicle-data of in the accident involved person!\n(missing field is colored)");
			document.claimform.othervehicle.style.border='2px solid #2B49AB';
			document.claimform.othervehicle.focus();
			return false;
		}
		if ( document.claimform.otherdamage.value == "" )	{
			alert("You did not enter where the vehicle of the involved person is damaged!\n(missing field is colored)");
			document.claimform.otherdamage.style.border='2px solid #2B49AB';
			document.claimform.otherdamage.focus();
			return false;
		}
	}
	if ( document.claimform.hitanything.value == "" )	{
		alert("You did not select whether you hit anything else!\n(missing field is colored)");
		document.claimform.hitanything.style.border='2px solid #2B49AB';
		document.claimform.hitanything.focus();
		return false;
	}
	if ( document.claimform.hitanything.value == "yes" )	{
		if ( document.claimform.hitanythingwhat.value == "" )	{
			alert("You did not enter what you did hit!\n(missing field is colored)");
			document.claimform.hitanythingwhat.style.border='2px solid #2B49AB';
			document.claimform.hitanythingwhat.focus();
			return false;
		}
		if ( document.claimform.hitanythingdoes.value == "" )	{
			alert("You did not enter who does it belong to!\n(missing field is colored)");
			document.claimform.hitanythingdoes.style.border='2px solid #2B49AB';
			document.claimform.hitanythingdoes.focus();
			return false;
		}
	}
	if ( document.claimform.anyinjured.value == "" )	{
		alert("You did not select whether someone was injured!\n(missing field is colored)");
		document.claimform.hitanything.style.border='2px solid #2B49AB';
		document.claimform.hitanything.focus();
		return false;
	}
	if ( document.claimform.anyinjured.value == "yes" )	{
		if ( document.claimform.whowhatinjuries.value == "" )	{
			alert("You did not enter who and what are the injuries!\n(missing field is colored)");
			document.claimform.whowhatinjuries.style.border='2px solid #2B49AB';
			document.claimform.whowhatinjuries.focus();
			return false;
		}
	}
	if ( document.claimform.yourfault.value == "" )	{
		alert("You did not select you think the accident was your fault or not!\n(missing field is colored)");
		document.claimform.yourfault.style.border='2px solid #2B49AB';
		document.claimform.yourfault.focus();
		return false;
	}
	if ( document.claimform.claimdamself.value == "" )	{
		alert("You did not select whether you like to claim damages yourself!\n(missing field is colored)");
		document.claimform.claimdamself.style.border='2px solid #2B49AB';
		document.claimform.claimdamself.focus();
		return false;
	}
	if ( document.claimform.whathappened.value == "" )	{
		alert("You did not enter a short description of what happened!\n(missing field is colored)");
		document.claimform.whathappened.style.border='2px solid #2B49AB';
		document.claimform.whathappened.focus();
		return false;
	}
	return true;
}

function advextlink(urllink) {
	antwort=confirm("BE ADVISED: You are about to leave this website. Despite thorough checks of content Mirascon does not take responsibility for external links. The operators of linked sites are responsible themselves for the content. Do you want to leave Mirascon website and proceed to \n\n"+urllink+" ?");
	if(antwort) {
		document.location.href=urllink;
	}
}

function changedivdisplay(divshow, divhide)	{
	document.getElementById(divshow).style.display="block";
	document.getElementById(divhide).style.display="none";
}

function collision_check() {
	if ( document.autoinsform.collision[0].checked == true )	{
		document.autoinsform.comprehensive[0].setAttribute("checked","checked",0);
		document.autoinsform.comprehensive[0].setAttribute("disabled","disabled",0);
		document.autoinsform.comprehensive[1].setAttribute("disabled","disabled",0);
	}
	else	{
		document.autoinsform.comprehensive[0].removeAttribute("checked",0);
		document.autoinsform.comprehensive[1].removeAttribute("checked",0);
		document.autoinsform.comprehensive[0].removeAttribute("disabled",0);
		document.autoinsform.comprehensive[1].removeAttribute("disabled",0);
	}
}

function show_image(image_name) {
	document.getElementById('main_body').style.filter = "alpha(opacity='30')";
	document.getElementById('main_body').style.MozOpacity = '0.30';
	document.getElementById('main_body').style.zIndex = '-1';
	
	document.getElementById('image_view').style.zIndex = '1000';
	document.getElementById('image_view').style.display = 'block';
	document.getElementById('image_view').style.filter = "alpha(opacity='100')";
	document.getElementById('image_view').style.MozOpacity = '1.0';
	document.getElementById('image_view').style.backgroundColor = 'rgb(255,255,255)';
	
	document.getElementById('image_show').src = image_name;
}

function close_image() {
	document.getElementById('image_view').style.display = 'none';
	document.getElementById('image_view').style.zIndex = '-1';
	
	document.getElementById('main_body').style.zIndex = '1';
	document.getElementById('main_body').style.filter = "alpha(opacity='100')";
	document.getElementById('main_body').style.MozOpacity = '1.0';
	
	document.getElementById('image_show').src = '';
	
	window.location.reload();
}

