// Default statusbar text
window.defaultStatus = "Alpakaland Schweiz - get the genetics of...";

function addFav(){
    if (document.all)
        window.external.AddFavorite("http://www.alpakaland.ch/", "Alpakaland Schweiz - get the genetics of...");
    else if (window.sidebar)
        window.sidebar.addPanel("Alpakaland Schweiz - get the genetics of...", "http://www.alpakaland.ch/", "")
}

function CheckForm()
	{
	
	// alert("Bitte Telefonnummer eingeben! Bsp. 0318237689..");
	
	RegZahl = new RegExp('([a-zA-Z])');
	RegName = new RegExp('([0-9])');

	// name
	if(document.form.contactFormField_1.value == "" || RegName.test(document.form.contactFormField_1.value))
		 {
			document.form.contactFormField_1.value = "";
			// alert("Bitte Namen eingeben!");
		  	document.form.contactFormField_1.focus();
			document.form.contactFormField_1.style.border = "solid red 1px";
			return false;
		 }
	// vorname
	if(document.form.contactFormField_2.value == "" || RegName.test(document.form.contactFormField_2.value))
		 {
			document.form.contactFormField_2.value = "";
			// alert("Bitte Vorname eingeben!");
			document.form.contactFormField_2.focus();
			document.form.contactFormField_2.style.border = "solid red 1px";
			return false;
		 }
	//strasse
	if(document.form.contactFormField_3.value == "" || RegName.test(document.form.contactFormField_3.value))
		 {
			document.form.contactFormField_3.value = "";
			//alert("Bitte Strasse eingeben!");
			document.form.contactFormField_3.focus();
			document.form.contactFormField_3.style.border = "solid red 1px";
			return false;
		 }
	// plz
	if((document.form.contactFormField_4.value != "" && document.form.contactFormField_4.value > 1000 && document.form.contactFormField_4.value < 10000) == false )
		{
			document.form.contactFormField_4.value = "";
			//alert("Bitte eine gültige PLZ eingeben!");
			document.form.contactFormField_4.focus();
			document.form.contactFormField_4.style.border = "solid red 1px";
			return false;
		 }
	// ort
	if(document.form.contactFormField_5.value == "" || RegName.test(document.form.contactFormField_5.value))
		 {
			document.form.contactFormField_5.value = "";
			//alert("Bitte Ort eingeben!");
			document.form.contactFormField_5.focus();
			document.form.contactFormField_5.style.border = "solid red 1px";
			return false;
		 }
	// telefon
	if(document.form.contactFormField_7.value == "" || RegZahl.test(document.form.contactFormField_7.value))
		 {
			document.form.contactFormField_7.value = "";
			//alert("Bitte Telefonnummer eingeben! Bsp. 0318237689..");
			document.form.contactFormField_7.focus();
			document.form.contactFormField_7.style.border = "solid red 1px";
			return false;
		 }
	if(document.form.contactFormField_9.value != "")
		{
			if(false == EMail(document.form.contactFormField_9.value)){
				//alert("Bitte eine korrekte E-Mail angeben!");
				document.form.contactFormField_9.value = "";
				document.form.contactFormField_9.focus();
				document.form.contactFormField_9.style.border = "solid red 1px";
				return false;
				}
			}

	if((document.form.contactFormField_10.value != "" || document.form.contactFormField_12.checked || document.form.contactFormField_13.checked || document.form.contactFormField_14.checked || document.form.contactFormField_15.checked || document.form.contactFormField_16.checked || document.form.contactFormField_18.checked) == false ){
			 {
				//alert("Bitte wählen Sie eine Checkbox (Ich habe Interesse an ....) an oder schreiben sie etwas in das Feld Frage / Anregung!");
				document.form.contactFormField_10.style.border = "solid red 1px";
				document.form.contactFormField_12.style.border = "solid red 1px";
				document.form.contactFormField_13.style.border = "solid red 1px";
				document.form.contactFormField_14.style.border = "solid red 1px";
				document.form.contactFormField_15.style.border = "solid red 1px";
				document.form.contactFormField_16.style.border = "solid red 1px";
				document.form.contactFormField_18.style.border = "solid red 1px";
				return false;
			 }
		}
}


function EMail(s)
	{
		 var a = false;
		 var res = false;
		 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(s));
		 }
		 else
		 {
		  res = (s.search('@') >= 1 && s.lastIndexOf('.') > s.search('@') && s.lastIndexOf('.') >= s.length-5)
		 }
		 return(res);
	}







