function showPicture(url,titel)
{
  titel = titel.replace(' ','%20');
  titel = titel.replace(' ','%20');
  titel = titel.replace(' ','%20');
  titel = titel.replace(' ','%20');
  titel = titel.replace(' ','%20');
  newWin = open ('/travel/australia02/loadimage.asp?name='+titel+'&image='+url,'newWin','screenX=40,screenY=5,width=250,height=250,scrollbars=yes,resizable=yes');

  newWin.focus();
}

function setMovie(MovieName){
  var movie = 'http://www.gecco.ch/~markus/australia02/movies/' + MovieName;
  if((navigator.userAgent.indexOf("IE") > -1) && (navigator.platform == "Win32")){
    MediaPlayer.autoStart = true; 
    MediaPlayer.Filename = movie;
  }else{
    document.MediaPlayer.SetAutoStart(true);
    document.MediaPlayer.SetFileName(movie);
  }
}

function checkEmail(formdata) {
  var success = true;

  if (formdata['name'].value == "") {
    success = false;
    alert('Bitte gib deinen Namen an!');
  }  
  if ( success ) {
    success = checkEmailAddress(formdata['email'].value);
    if ( !success ) alert('Bitte gib eine korrekte Email Adresse ein!');
  }
  //was everything all right?
  if( success ) {
    formdata.submit();
  }
  else {
    //don't submit of course!
  }
}

function checkEmailAddress( email ) {
  var success;
  var at_index= email.indexOf( "@", 0 );
  var dot_index= email.indexOf( ".", at_index );
  var re = /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/i;

  if (!re.test( email) ) { // check regular expressions - matches a limited version of the rfc 2822 addr-spec form.
    success = false;
  }
  else if( at_index<1 ) { //is there an @ in the string with minimum one character in front?
    success = false;
  }
  else if( (at_index+2)>=dot_index ) {  //is the 2nd level domain name min. two characters long?
    success = false;
  }
  else if( (dot_index+2)>=email.length ) { //is the 1st leve domein name min. two charachter long?
    success = false;
  }
  else {  //could be ok!
    success = true;
  }
  return success;
}
