//	Animation des Untermenüs

var Timeout = new Array();

function show_navi(id) {
	document.getElementById('navi_'+id).style.display = 'block';
	
	if(typeof(Timeout[id])!='undefined') clearTimeout(Timeout[id]);
}

function hide_navi(id) {
	Timeout[id] = window.setTimeout("do_hide_navi('"+id+"')", 300);
}

function do_hide_navi(id) {
	document.getElementById('navi_'+id).style.display = 'none';
}


//	Animation der Orte

var Orte = new Array(
	'Bad Homburg',
	'Berlin',
	'Bern',
	'Bordeaux',
	'Boston',
	'Chicago',
	'Cologne',
	'Dusseldorf',
	'Frankfurt',
	'Hamburg',
	'Heidelberg',
	'Hongkong',
	'Jersey City',
	'Kiev',
	'Los Angeles',
	'Luxembourg',
	'Mainz',
	'Miami',
	'Milan',
	'Milwaukee',
	'Minneapolis',
	'Monaco',
	'Montclair',
	'New York',
	'Newark',
	'Paris',
	'Philadelphia',
	'Ponte Vedra Beach',
	'Saint Heller',
	'Salt Lake',
	'San Diego',
	'San Francisco',
	'Santa Fe',
	'Sindelfingen',
	'Singapore',
	'St. Louis',
	'St. Paul',
	'Stanford',
	'Stuttgart',
	'Zurich'
);


var Transparenz = new Array();
Transparenz[1] = 34;
Transparenz[2] = 67;
Transparenz[3] = 100;

var Ist = new Array();
Ist[1] = 0;
Ist[2] = 1;
Ist[3] = 2;

var Animation;
var Anzahl = Orte.length;

function orte_starten() {
	var isIe/*@cc_on = true@*/;
	
	var Delivering = document.getElementById('Delivering');
			
	Delivering.innerHTML = '<h2>Currently delivering to</h2>';
	
	var Ortsnamen = document.createElement('div');
	Ortsnamen.setAttribute('id', 'Ortsnamen');

	Delivering.appendChild(Ortsnamen);
		
	var Ort = new Array();
		
	for(i=0; i<Orte.length; i++) {
		var Groesse;
	
		if(Orte[i].length<5) Groesse = "Ort_sehrgross";
		else if(Orte[i].length<7) Groesse = "Ort_sehrgross";
		else if(Orte[i].length<9) Groesse = "Ort_mittel";
		else if(Orte[i].length<12) Groesse = "Ort_klein";
		else Groesse = "Ort_sehrklein";
		
		Ort[i] = document.createElement('p');
		if(isIe) Ort[i].setAttribute('className', Groesse);
		else Ort[i].setAttribute('class', Groesse);
		Ort[i].setAttribute('id', 'Ort_'+i);
			
		Ortsnamen.appendChild(Ort[i]);
			
		document.getElementById('Ort_'+i).innerHTML = Orte[i];
	}
	
	Animation = window.setInterval('orte_animation()', '40');
}

function orte_animation() {
	for(i=1;i<4;i++) {
		if(Transparenz[i]==1) {
			document.getElementById('Ort_'+Ist[i]).style.display = 'none';
		
			Ist[i]+=3;

			if(Ist[i]==Anzahl) Ist[i]=Ist[i]-Anzahl;
			if(Ist[i]>Anzahl) Ist[i]=Ist[i]-Anzahl;

			Transparenz[i]=100;
			
			document.getElementById('Ort_'+Ist[i]).style.display = 'block';

			if(i==3) {
				document.getElementById('Ort_'+Ist[i]).style.top = '70px';
				document.getElementById('Ort_'+Ist[i]).style.left = '10px';
			} else if(i==2) {
				document.getElementById('Ort_'+Ist[i]).style.top = '85px';
				document.getElementById('Ort_'+Ist[i]).style.left = '40px';
			} else {
				document.getElementById('Ort_'+Ist[i]).style.top = '100px';
				document.getElementById('Ort_'+Ist[i]).style.left = '25px';
			}
		}
		
		css_transparenz(Ist[i], Transparenz[i]);
		
		Transparenz[i]-=1;
	}
}

function css_transparenz(ID, Wert) {
	document.getElementById('Ort_'+ID).style.filter = 'alpha(opacity='+Wert+')';
	document.getElementById('Ort_'+ID).style.MozOpacity = (Wert/100);
	document.getElementById('Ort_'+ID).style.opacity = (Wert/100);
}

function sprache_auswaehlen() {
	Ziel = document.forms['Sprachwahl'].Sprache.options[document.forms['Sprachwahl'].Sprache.options.selectedIndex].value;
	
	if(Ziel != '') document.location.href = '../'+Ziel+'/';
}