var imagenumber1 = 9 ;
var randomnumber1 = Math.random() ;
var rand1 = Math.round( (imagenumber1-1) * randomnumber1) + 1 ;
images1 = new Array
images1[1] = "../images/cars/car01.jpg"
images1[2] = "../images/cars/car02.jpg"
images1[3] = "../images/cars/car03.jpg"
images1[4] = "../images/cars/car04.jpg"
images1[5] = "../images/cars/car05.jpg"
images1[6] = "../images/cars/car06.jpg"
images1[7] = "../images/cars/car07.jpg"
images1[8] = "../images/cars/car08.jpg"
images1[9] = "../images/cars/car09.jpg"
var carimage = images1[rand1]

function cityimage () {
var imagenumber2 = 9 ;
var randomnumber2 = Math.random() ;
var rand2 = Math.round( (imagenumber2-1) * randomnumber2) + 1 ;
images2 = new Array;
images2[1] = "../images/teaser/teaser01";
images2[2] = "../images/teaser/teaser02";
images2[3] = "../images/teaser/teaser03";
images2[4] = "../images/teaser/teaser04";
images2[5] = "../images/teaser/teaser05";
images2[6] = "../images/teaser/teaser06";
images2[7] = "../images/teaser/teaser07";
images2[8] = "../images/teaser/teaser08";
images2[9] = "../images/teaser/teaser09";
return images2[rand2];
}
function showprice(price, district){
	var currUrl = document.URL;
	var lang = (currUrl.indexOf("ger") > -1)?"ger":"eng";
	var th = "th";
	if(lang=="ger"){
		alert("Der Transfer vom Flughafen zum " + district + ". Bezirk oder umgekehrt kostet " + price + " Euro");
	}
	else{
		switch (district) {
		  case "1":
		    th = "st";
		    break;
		  case "21":
		    th = "st";
		    break;
		  case "2":
		    th = "nd";
		    break;
		  case "22":
		    th = "nd";
		    break;
		  case "3":
		    th = "rd";
		    break;
		  case "23":
		    th = "rd";
		    break;
		  default:
		    break;
		}
		alert("The transfer fare from Airport to " + district + th + " district or return is " + price + " Euro");
	}
}
function setAddress() {
  document.formular.arr_company.value 	=  document.formular.dept_company.value;
  document.formular.arr_anrede.value 	=  document.formular.dept_anrede.value;
  document.formular.arr_name.value 		=  document.formular.dept_name.value;
  document.formular.arr_anzahl.value 	=  document.formular.dept_anzahl.value;
  document.formular.arr_street.value 	=  document.formular.dept_street.value;
  document.formular.arr_nr.value 		=  document.formular.dept_nr.value;
  document.formular.arr_stiege.value 	=  document.formular.dept_stiege.value;
  document.formular.arr_tuer.value 		=  document.formular.dept_tuer.value;
  document.formular.arr_plz.value 		=  document.formular.dept_plz.value;
  document.formular.arr_ort.value 		=  document.formular.dept_ort.value;
  document.formular.arr_country.value 	=  document.formular.dept_country.value;
  document.formular.arr_telefon.value 	=  document.formular.dept_telefon.value;
  document.formular.arr_fax.value 		=  document.formular.dept_fax.value;
  document.formular.arr_email.value 	=  document.formular.dept_email.value;
}
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',+resizable+'
	win = window.open(mypage,myname,settings)
	if(win.window.focus){win.window.focus();}
}
function checkIt(){
	var currUrl = document.URL;
	var lang = (currUrl.indexOf("ger") > -1)?"ger":"eng";
	var form = document.forms[0];
	for(;;){
		if(form.name.value==""){ 
			if(lang=="ger"){
				alert("Bitte geben Sie Ihren Namen ein."); form.name.focus();
			}
			else{
				alert("Bitte geben Sie Ihren Namen ein."); form.name.focus();
			}
			break; 
		}
		if(form.email.value==""){ 
			if(lang=="ger"){
				alert("Bitte geben Sie Ihre E-Mail-Adresse ein."); form.email.focus();
			}
			else{
				alert("Bitte geben Sie Ihre E-Mail-Adresse ein."); form.email.focus();
			}
			break; 
		}
		atPos = form.email.value.indexOf("@");
		dotPos = form.email.value.indexOf(".",atPos);
		if(atPos==-1 || dotPos==-1){ 
			if(lang=="ger"){
				alert("Bitte geben Sie eine gültige E-Mail-Adresse ein."); form.email.focus(); break;
			}
			else{
				alert("Bitte geben Sie eine gültige E-Mail-Adresse ein."); form.email.focus(); break;
			}
		}
		form.submit();
		break;
	}
}
//---switch between languages--------**
function switchlang(lang){
	var currUrl = document.URL;
	if(currUrl.indexOf("eng") > -1) {
		if(lang!="eng"){
				currUrl = currUrl.substring(0,currUrl.indexOf("eng")) 
				+ "ger" 
				+ currUrl.substring(currUrl.indexOf("eng") + 3);
		}
	}
	else{
		if(lang!="ger"){
			currUrl = currUrl.substring(0,currUrl.indexOf("ger")) 
				+ "eng" 
				+ currUrl.substring(currUrl.indexOf("ger") + 3);
		}
	}
	location.href = currUrl;
}


