// JavaScript Document

function validate_form_DE()
	{
	/*if (document.bookingform.firstname.value == "")
		{alert ("Geben Sie bitte Ihre Vorname an");
		document.bookingform.firstname.focus();
		return false;
		}*/	
	if (document.bookingform.surname.value == "")
		{alert ("Geben Sie bitte Ihre Nachname an");
		document.bookingform.surname.focus();
		return false;
		}	
	if (document.bookingform.address1.value == "")
		{alert ("Geben Sie bitte Ihre Addresse an");
		document.bookingform.address1.focus();
		return false;
		}
	if (document.bookingform.postcode.value == "")
		{alert ("Geben Sie bitte Ihre Postleitzahl an");
		document.bookingform.postcode.focus();
		return false;
		}	
	if (document.bookingform.town.value == "")
		{alert ("Geben Sie bitte Ihre Ort an");
		document.bookingform.town.focus();
		return false;
		}
	if (document.bookingform.country.value == "")
		{alert ("Geben Sie bitte Ihren Land an");
		document.bookingform.country.focus();
		return false;
		}	
	if ((document.bookingform.tele.value == "")&&(document.bookingform.mobile.value == ""))
		{alert ("Geben Sie bitte eine Telefonnummer an");
		document.bookingform.tele.focus();
		return false;
		}
	if (document.bookingform.email.value == "")
		{alert ("Geben Sie bitte eine email an");
		document.bookingform.email.focus();
		return false;
		}
	if (document.bookingform.email.value != "")
		{
		i=document.bookingform.email.value.indexOf("@")
	 	j=document.bookingform.email.value.indexOf(".",i)
	 	k=document.bookingform.email.value.indexOf(",")
	 	kk=document.bookingform.email.value.indexOf(" ")
	 	jj=document.bookingform.email.value.lastIndexOf(".")+1
	 	len=document.bookingform.email.value.length
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else 
			{alert ("Geben Sie bitte eine g&uuml;ltige Email an");
			document.bookingform.email.focus();
			return false;
			}
 		}
	if (document.bookingform.party.value == 0)
		{alert ("Geben Sie bitte die Anzahl Erwachsenen an");
		document.bookingform.party.focus();
		return false;
		}
	if (document.bookingform.day.value == "dd")
		{alert ("Auf welchen Tag m&ouml;chten Sie die Stadtf&uuml;hrung machen?");
		document.bookingform.day.focus();
		return false;
		}
	if (document.bookingform.month.value == "mm")
		{alert ("Geben Sie bitte einen Monat an");
		document.bookingform.day.focus();
		return false;
		}
	var iChars = "#{}|<>";
	for (var i = 0; i < document.bookingform.comments.value.length; i++)
	{
  	if (iChars.indexOf(document.bookingform.comments.value.charAt(i)) != -1) 
		{
  	alert ("Ihre Nachricht hat unerlaubte Buchstaben. \n&Auml;ndern Sie bitte Ihre Nachricht.");
  	document.bookingform.comments.focus();
	return false;
  		}
  	}
		
	
	}
	
function validate_contactform_DE()
	{
errmsg = new Array();
	if (document.contactform.email.value == "")
		{
		errmsg.push("- Geben Sie bitte Ihre Email an");
		}
	if (document.contactform.email.value != "")
		{
		i=document.contactform.email.value.indexOf("@")
	 	j=document.contactform.email.value.indexOf(".",i)
	 	k=document.contactform.email.value.indexOf(",")
	 	kk=document.contactform.email.value.indexOf(" ")
	 	jj=document.contactform.email.value.lastIndexOf(".")+1
	 	len=document.contactform.email.value.length
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else {
 			errmsg.push("- Geben Sie bitte eine g&uuml;ltige Email an");
 				}
		}
	
	if (document.contactform.name.value == "")
		{
		errmsg.push("- Geben Sie bitte Ihre Name an");
		}
	if (document.contactform.message.value == "")
		{
		errmsg.push("- Vergessen Sie bitte Ihre Nachricht nicht");
		}
	var iChars = "#{}<>";
	for (var i = 0; i < document.contactform.message.value.length; i++) 
		{
  		if (iChars.indexOf(document.contactform.message.value.charAt(i)) != -1) 
			{
  			errmsg.push("- Ihre Nachricht hat unerlaubte Buchstaben. \n&Auml;ndern Sie bitte Ihre Nachricht.");
			}
		}
	if (errmsg.length > 0) 
		{
		alert(("Das Formular wurde nicht geschickt:\n") + errmsg.join(",\n") + ("."));
	//	{
	//	alert(errmsg);
		return false
		}
	else
		{
		return true;
		}
	}

function checkdate_DE() {
	
	if ((document.bookingform.month.value < 8)&&(document.bookingform.year.value ==2007))
		{alert ("Dieses Datum ist im Vergangen.\n Geben Sie bitte ein g&uuml;ltiges Datum an.")
		document.bookingform.month.focus();
		}
	if ((document.bookingform.month.value == 2)&&(document.bookingform.day.value > 29))
		{alert ("In Februar gibt es nur 28 oder 29 Tagen, &auml;ndern Sie bitte Ihre Auswahl.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 4)&&(document.bookingform.day.value == 31))
		{alert ("In April gibt es nur 30 Tagen, &auml;ndern Sie bitte Ihre Auswahl.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 6)&&(document.bookingform.day.value == 31))
		{alert ("In Juni gibt es nur 30 Tagen, &auml;ndern Sie bitte Ihre Auswahl.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 9)&&(document.bookingform.day.value == 31))
		{alert ("In September gibt es nur 30 Tagen, &auml;ndern Sie bitte Ihre Auswahl.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 11)&&(document.bookingform.day.value == 31))
		{alert ("In November gibt es nur 30 Tagen, &auml;ndern Sie bitte Ihre Auswahl.");
		document.bookingform.day.focus();
		}
	else
		{
		return true;
		}
}
function openmailfriend(mypage) 
	{
win = window.open(mypage,"blank","toolbar=yes, width=500, height=500");
win.window.focus();
}

function validate_mail_friend_DE()
	{
errmsg = new Array();
	if (document.mail_friend.email.value == "")
		{
		errmsg.push("- Geben Sie bitte Ihre Emailadresse an");
		}
	if (document.mail_friend.email.value != "")
		{
		i=document.mail_friend.email.value.indexOf("@");
	 	j=document.mail_friend.email.value.indexOf(".",i);
	 	k=document.mail_friend.email.value.indexOf(",");
	 	kk=document.mail_friend.email.value.indexOf(" ");
	 	jj=document.mail_friend.email.value.lastIndexOf(".")+1;
	 	len=document.mail_friend.email.value.length;
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else {
 			errmsg.push("- Geben Sie bitte eine gültige Emailadresse an.");
 				}
		}
	if (document.mail_friend.name.value == "")
		{
		errmsg.push("- Geben Sie bitte den Namen Ihres Freunds an");
		}
	if (document.mail_friend.email_friend.value == "")
		{
		errmsg.push("- Geben Sie bitte die Emailadresse Ihres Freunds an");
		}
	if (document.mail_friend.email_friend.value != "")
		{
		i=document.mail_friend.email_friend.value.indexOf("@");
	 	j=document.mail_friend.email_friend.value.indexOf(".",i);
	 	k=document.mail_friend.email_friend.value.indexOf(",");
	 	kk=document.mail_friend.email_friend.value.indexOf(" ");
	 	jj=document.mail_friend.email_friend.value.lastIndexOf(".")+1;
	 	len=document.mail_friend.email_friend.value.length;
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else {
 			errmsg.push("- Geben Sie bitte eine gültige Emailadresse für Ihren Freund an.");
 				}
		}
	if (document.mail_friend.name_friend.value == "")
		{
		errmsg.push("- Geben Sie bitte den Namen Ihres Freunds an");
		}
	if (errmsg.length > 0) 
		{
		alert(("Fehlermeldung:\n") + errmsg.join(",\n") + ("."));
		return false
		}
	else
		{
		return true;
		}
	}

function CreateBookmarkLink_DE() 
{
	var title="Guided Tours Prague, Persönliche Stadtführungen"
    var url="http://www.guidedtoursprague.com/Stadtfuhrungen_DE/index_DE.htm"

    if (window.sidebar) window.sidebar.addPanel(title, url,"");

    else if( window.opera && window.print )
    {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();
    }

    else if( document.all ) window.external.AddFavorite( url, title);

}