
// déclarations des fonctions utilisées pour la page index

// cross navigator functions

var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

function getTag(id) {
  if (isDOM) return document.getElementById(id);
  if (isIE4) return document.all[id];
  if (isNS4) return document.layers[id];
}

function getTagStyle(id) {
  return (isNS4 ? getTag(id) : getTag(id).style);
}

//*************************************************************	
// le menu déroulant pour les archives
//*************************************************************

function go(form) {
	choix= form.selection.options[form.selection.selectedIndex].value;

	switch (choix){
	   case "latente": 
	      window.open("http://www.latentesehnsucht.net","_blank");
	      break;
	   case "tristesse": 
	      window.open("/ladyfest/2005.html","_self");
	      break;
	   case "ladyfest": 
	      window.open("/ladyfest/","_self");
	      break;
	   case "silence_story": 
	      window.open("http://www.lichtensteiger.de/stories02.html","_blank");
	      break;
	   case "angoisse": 
	      window.open("/angoisse/index.html","_blank");
	      break;
	   case "latent": 
	      window.open("/latent/","_self");
	      break;
	   case "hope": 
	      window.open("http://nonfinito.de/hope","_blank");
	      break;
	   case "peripherie" : 
	      window.open("http://www.laperipherie.fr/manifestations/love_me.html","_blank");
	      break;
	   case "ampel": 
	      window.open("/ampelmaedchen/","_blank");
	      break;
	   case "christmas": 
	      window.open("/christmas/","_blank");
	      break;
	   case "valentin": 
	      window.open("/valentin/","_blank");
	      break;
	   case "baron":
	      affiche(1);
	      break;
	   case "yssaro":
	      affiche(2);
	      break;
	   case "nicolas02":
	      window.open("/correspondances/nicolas/correspondance_01.html","nicolas02","width=640,innerWidth=640,height=440,innerHeight=440,scrollbars=1");
	      break;
	   case "nicolas03":
	      window.open("/correspondances/nicolas/fin.html","nicolas03","width=1015,innerWidth=1015,height=710,innerHeight=710,scrollbars=1,left=0,top=0");
	      break;
	   case "nicolas01":
	      window.open("/arpla/nicolas.html","nicolas01","width=640,innerWidth=640,height=440,innerHeight=440,scrollbars=1,left=0,top=0");
	      break;
	   case "kimmon":
	      window.open("/blahblah/kimmon.html","tragic","width=595,innerWidth=595,height=710,innerHeight=710,scrollbars=1,left=0,top=0");
	      break;
	   case "tragic_end":
	      window.open("/blahblah/tragic_end.html","tragic","width=925,innerWidth=925,height=710,innerHeight=710,scrollbars=1,left=0,top=0");
	      break;
	   case "show_off":
	      window.open("/blahblah/show_off.html","tragic","width=925,innerWidth=925,height=710,innerHeight=710,scrollbars=1,left=0,top=0");
	      break;
	   case "harcelement":
	      window.open("/bologne/mouchette_01.html","mouchette_01","width=450,innerWidth=450,height=330,innerHeight=330");
	      break;
	   case "mouchette": 
	      window.open("/mouchette/","_blank");
	      break;
	   case "mouche": 
	      window.open("/mouchette/film/film.html","_blank");
	      break;
	   case "anniversaire":
	      window.open("/anniversaire/index.html","anniversaire","width=150,innerWidth=150,height=150,innerHeight=150,left=20,top=280");
	      break;
	   case "tokyo":
	      window.open("/anniversaire/2002.html","tokyo","width=450,innerWidth=450,height=350,innerHeight=350,left=20,top=280,scrollbars=1");
	      break;
	   case "birthday": 
	      window.open("/birthday_25/index.html","_blank");
	      break;
	   case "berlin":
	      window.open("/berlin/index.html","berlin","width=1000,innerWidth=1000,height=385,innerHeight=385,left=0,top=20");
	      break;
	   case "rome":
	      window.open("/italie/italie.html","italie","width=640,innerWidth=640,height=510,innerHeight=510,scrollbars=1");
	      break;	   
	   case "horoscope05":
	      window.open("/horoscope/index.html","horoscope","width=620,innerWidth=620,height=520,innerHeight=520,status=1");
	      break;
	   case "horoscope04":
	      window.open("/horoscope/2004.html","horoscope","width=620,innerWidth=620,height=520,innerHeight=520,status=1");
	      break;
	   case "horoscope03":
	      window.open("/horoscope/2003.html","horoscope","width=620,innerWidth=620,height=520,innerHeight=520,status=1");
	      break;
	   case "horoscope02":
	      window.open("/horoscope/2002.html","horoscope","width=620,innerWidth=620,height=520,innerHeight=520,status=1");
	      break;
	   case "horoscope01":
	      window.open("/horoscope/2001.html","horoscope","width=620,innerWidth=620,height=520,innerHeight=520,status=1");
	      break;
	   case "mouton":
	      window.open("/damien/mail_mouton.html","mouton","width=340,innerWidth=340,height=360,innerHeight=360");
	      break;
	   case "vache":
	      window.open("/damien/mail_vache.html","vache","width=410,innerWidth=410,height=410,innerHeight=410");
	      break;
	   case "paroles":
	      window.open("/paroles/index.html","paroles","width=600,innerWidth=600,height=415,innerHeight=415,scrollbars=0");
	      break;
	   case "pueppchen":
	      window.open("/pueppchen/","pueppchen","width=600,innerWidth=600,height=415,innerHeight=415,scrollbars=1");
	      break;
	   case "anonym":
	      window.open("/inconnu/deutsch.html","anonym","width=630,innerWidth=630,height=403,innerHeight=403");
	      break;
	   case "anonyme":
	      window.open("/inconnu/index.html","anonyme","width=630,innerWidth=630,height=400,innerHeight=400");
	      break;
	   case "so":
		  window.open("/smile/index.html","so","fullscreen=yes");
	      break;
	}
}	
//*************************************************************



//*************************************************************	
// pour afficher les menus correspondances entre un baron et une marquise
// et hyperliens
//*************************************************************

var a_l_ecran_actuellement = 0;

function efface() {

    if (a_l_ecran_actuellement == 1) {
		getTagStyle("baron").display = "none";
	}
	
    if (a_l_ecran_actuellement == 2) {
		getTagStyle("hyperlien").display = "none";
	}
	
    if (a_l_ecran_actuellement == 3) {
		getTagStyle("photos").display = "none";
	}
	
	a_l_ecran_actuellement == 0;

}

function affiche(sous_projet) {

    if (sous_projet == 1 && getTagStyle("baron").display != "block") {
	    efface();
    	getTagStyle("baron").display = "block";
    	a_l_ecran_actuellement = 1;
		return;
	}
  
  	if (sous_projet == 2 && getTagStyle("hyperlien").display != "block") {
	    efface();
    	getTagStyle("hyperlien").display = "block";
    	a_l_ecran_actuellement = 2;
		return;
  	}
  
  	if (sous_projet == 3 && getTagStyle("photos").display != "block") {
	    efface();
    	getTagStyle("photos").display = "block";
    	a_l_ecran_actuellement = 3;
		return;
  	}
	
	 //if (sous_projet == 3 && getTagStyle("toto").display != "block") {
    //getTagStyle("toto").display = "block";
    //a_l_ecran_actuellement = 3;
  	//}


  return;
}

//*************************************************************


//*****************************************************************
// pour afficher l'ascenseur et le faire fonctionner si nécessaire
//*****************************************************************

// parameters

var scrollwindowid = "ascenseur";
var scrollcontentid = "projets";
var upid = "upbutton";
var downid = "downbutton";

var moveupvar = null;
var movedownvar = null;

var inc=10;
var speed=200;
var end_margin=10;

// setup

var sc = null;
var cl = null;
var max_top = 0;
var current_top = 0;
var window_height = 0;

function setup() {

	sc = getTagStyle(scrollcontentid);
 	sc.top = current_top + "px";

	window_height = getTag(scrollwindowid).offsetHeight;

	
	var up = getTagStyle(upid);
	var down = getTagStyle(downid);
	
	if (getTag(scrollcontentid).offsetHeight > window_height) {
	    /* we do scrolling */
   
		sc.padding = "0px 30px 0px 0px";
		if (cl) {
			cl.top = "0px";
			cl.right =  "0px";
		}
		up.visibility = "visible";
		down.visibility = "visible";
		max_top = window_height - getTag(scrollcontentid).offsetHeight - end_margin;
		current_top = parseInt(sc.top);
	}
	else {
		up.visibility = "hidden";
		down.visibility = "hidden";
	}
}

// scrolling functions

function movestop() {
	if (moveupvar) clearTimeout(moveupvar);
	if (movedownvar) clearTimeout(movedownvar);
}

function moveup(){
	if (movedownvar) clearTimeout(movedownvar);
	/*if (*/
	if (current_top < 0) {
		current_top = current_top + inc;
		sc.top = current_top + "px";
// IE5 on mac has a bug, curious, it's working with this line
		sc.padding = "0px 30px 0px 0px";
 	}	
	moveupvar=setTimeout("moveup()",speed)
}

function movedown(){
 
	if (moveupvar) clearTimeout(moveupvar);
	
if (current_top >= max_top) {
		current_top = current_top - inc;
		sc.top = current_top + "px"; 
// IE5 on mac has a bug, curious, it's working with this line
		sc.padding = "0px 30px 0px 0px";
	}
	movedownvar=setTimeout("movedown()",speed);
}

//*************************************************************

/*function identite() {
	document.write('<img src="images/' + parseInt(Math.random()*2) + '.jpg" width="185" height="240" alt="Stephanie Boisset -- eine identitaet in bewegung -- une identite en mouvement --" border="0">');
}*/


//*************************************************************	
// concerne la photo d'identité
//*************************************************************

laDateActuelle=new Date();
jour=laDateActuelle.getDate(); {
	if(jour<25)version = "a";
		else version ="b";
}
	  
decouvreMoi=0; //pas trop quand même
	  
function sourisOut () {
	document.images [2].src="images/" + decouvreMoi + version + ".jpg";
}

function sourisIn () {
	document.images [2].src="images/1" + version + ".jpg";
}

//*************************************************************
