

var m = 0;
var face;
var face_aktiv;

var inBewegung = 0;
var nichts;

function all_faces(){
		
		document.getElementById("antonio").style.color = "#666666";
		document.getElementById("luis").style.color = "#666666";
		document.getElementById("juan").style.color = "#666666";	
		document.getElementById("all_faces").style.color = "#B7006A";		

		document.getElementById("antonio").style.fontWeight  = "normal";
		document.getElementById("luis").style.fontWeight  = "normal";
		document.getElementById("juan").style.fontWeight  = "normal";	
		document.getElementById("all_faces").style.fontWeight  = "bold";
		
		document.getElementById("biography-antonio").style.display = "none";
		document.getElementById("biography-luis").style.display = "none";
		document.getElementById("biography-juan").style.display = "none";	
		document.getElementById("biography-all").style.display = "inline";
}

function check_aktiv(face) {
	if (face == 0){
		
		document.getElementById("antonio").style.color = "#B7006A";
		document.getElementById("luis").style.color = "#666666";
		document.getElementById("juan").style.color = "#666666";		
		document.getElementById("all_faces").style.color = "#666666";

		document.getElementById("antonio").style.fontWeight  = "bold";
		document.getElementById("luis").style.fontWeight  = "normal";
		document.getElementById("juan").style.fontWeight  = "normal";	
		document.getElementById("all_faces").style.fontWeight  = "normal";
		
		document.getElementById("biography-antonio").style.display = "inline";
		document.getElementById("biography-luis").style.display = "none";
		document.getElementById("biography-juan").style.display = "none";	
		document.getElementById("biography-all").style.display = "none";

		
		}
	else if (face == 20){
		
		document.getElementById("antonio").style.color = "#666666";
		document.getElementById("luis").style.color = "#B7006A";
		document.getElementById("juan").style.color = "#666666";
		document.getElementById("all_faces").style.color = "#666666";

		document.getElementById("antonio").style.fontWeight  = "normal";
		document.getElementById("luis").style.fontWeight  = "bold";
		document.getElementById("juan").style.fontWeight  = "normal";	
		document.getElementById("all_faces").style.fontWeight  = "normal";
		
		document.getElementById("biography-antonio").style.display = "none";
		document.getElementById("biography-luis").style.display = "inline";
		document.getElementById("biography-juan").style.display = "none";	
		document.getElementById("biography-all").style.display = "none";	
		}
	else if (face == 40){
		
		document.getElementById("antonio").style.color = "#666666";
		document.getElementById("luis").style.color = "#666666";
		document.getElementById("juan").style.color = "#B7006A";
		document.getElementById("all_faces").style.color = "#666666";

		document.getElementById("antonio").style.fontWeight  = "normal";
		document.getElementById("luis").style.fontWeight  = "normal";
		document.getElementById("juan").style.fontWeight  = "bold";
		document.getElementById("all_faces").style.fontWeight  = "normal";
		
		document.getElementById("biography-antonio").style.display = "none";
		document.getElementById("biography-luis").style.display = "none";
		document.getElementById("biography-juan").style.display = "inline";		
		document.getElementById("biography-all").style.display = "none";
		}
	face_aktiv = face;
	if (face == m){
		nichts = 0;		
		}
	else{
		if (inBewegung == 0){
			inBewegung = 1;
			aktiv = window.setInterval("morph('"+face+"')", 30);
			}
		}
	}

function morph(face) {
	m = m + 1;
	if (m==60){m=0;}
	if (face_aktiv == m){
		window.clearInterval(aktiv);
		inBewegung = 0;
		}
	else{
		var pfad = "url(http://www.glamourtokill.de/biography/flip/"+m+".jpg)";
		document.getElementById("face").style.backgroundImage = pfad; 
		}
	//document.getElementById("anzeige1").innerHTML = face_aktiv+" "+m;
	}



untere_schranken 	= new Array(0,		0,		0,		0,		0,		0,		0,		0,		0,		0);
obere_schranken 	= new Array(240,	240,	240,	240,	240,	240,	240,	240,	240,	240);
zustaende			= new Array("unten","unten","unten","unten","unten","unten","unten","unten","unten","unten"	);
pos				 	= new Array(240,	240,	240,	240,	240,	240,	240,	240,	240,	240);
checks			 	= new Array(0,		0,		0,		0,		0,		0,		0,		0,		0,		0);

var schrittweite			= 8;
var anzahl_der_sektionen 	= pos.length;
var moment 					= 20; 
var schleifenaufrufe = 0;
var zaehler = 0;

function aktivierung(Sektion,Befehl) {
	if (Befehl == "rauf"){
		zustaende[Sektion] = "rauf";
		zaehler = zaehler - 100;
		}
	if (Befehl == "runter"){
		zustaende[Sektion] = "runter";
		zaehler = zaehler - 100;
		}
	if (zaehler == -100){
		schleifenaufrufe = schleifenaufrufe + 1;
		//document.getElementById("deutsch").innerHTML = schleifenaufrufe+'';
		aktiv = window.setInterval("bewege('"+Sektion+"')", moment);
		}
	}

function bewege(Sektion) {
	if (zaehler < -150) zaehler = -150;
	if (zaehler >= -1) {
		window.clearInterval(aktiv);schleifenaufrufe = schleifenaufrufe - 1;
		//document.getElementById("deutsch").innerHTML = schleifenaufrufe+'';
	}
	zaehler = zaehler + 1;
	for (var i = 0; i <= anzahl_der_sektionen; i++){
		if (zustaende[i] == "rauf"){
			if (pos[i]<obere_schranken[i]){
				pos[i] = pos[i] + schrittweite;
				document.getElementById("tuer_"+i).style['right'] = '-'+pos[i]+'px';
				checks[i] = 1;
				}else{checks[i] = 0;}
			}
		if (zustaende[i] == "runter"){
			if (pos[i]>untere_schranken[i]){
				pos[i] = pos[i] - schrittweite;
				document.getElementById("tuer_"+i).style['right'] = '-'+pos[i]+'px';
				checks[i] = 1;
				}else{checks[i] = 0;}
			}
		}
	}
function textIsWeg(weg, wirklich){
	var standard = 'e-mail';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}

function KontaktNameDeIsWeg(weg, wirklich){
	var standard = 'Dein Name';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}
function KontaktMailDeIsWeg(weg, wirklich){
	var standard = 'Deine Email';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}
function KontaktSubjectDeIsWeg(weg, wirklich){
	var standard = 'Betreff';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}

function functionkontakt_name(weg, wirklich){
	var standard = 'Your Name';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}
function functionkontakt_mail(weg, wirklich){
	var standard = 'Your Mail';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}
function functionkontakt_subject(weg, wirklich){
	var standard = 'Subject';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}
function functioninfoletter(weg, wirklich){
	var standard = 'Your Mail';
	if(wirklich)
		if(weg.value == standard)
			weg.value = '';
	if(!wirklich)				
		if(weg.value == '')
			weg.value = standard;			
	}
