// JavaScript Document

function chgcouleurbarre()
/* Changement des couleurs de la scrolbar */
{
 with(document.body.style)
 {
 scrollbarDarkShadowColor="#000000";
 scrollbar3dLightColor="#000000";
 scrollbarArrowColor="#ffcc00";
 scrollbarBaseColor="#cccccc";
 scrollbarFaceColor="#6699ff";
 scrollbarHighlightColor="#cccccc";
 scrollbarShadowColor="#cccccc";
 scrollbarTrackColor="#cccccc";
 }
}

/*Controle du clique droit */
function yaunclick()
	{
	alert('Copyright Espace Soleil');
	}

function noclick(scx)
	{
	if (navigator.appName == "Netscape" && scx.which == 3)
		{
		yaunclick();
		return false; 
		}
	if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2)
		{
		yaunclick();
		return false; 
		}
	}
document.onmousedown = noclick

/*Affichage vignette*/
function afficheVignette(cheminVignette,cheminMaxi)
	{
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="../%27+cheminVignette+%27" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour voir en grand"></A>');
	}

function afficheMaxi(chemin)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="../%27+chemin+%27" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	};

/* Imprimer image*/
function ImprimeImage(chemin)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="../%27+chemin+%27" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
	popupImage.print();
	popupImage.close()
	};
	
/* Affichage dans la barre de status */	
window.defaultStatus='bienvenu:www.espacesoleil.com !'; 


/* Renvoi le jour d'une date au format texte */
function StJourSemaine(jour)
	{
	selectdate = "" + jour;
	p1 = 200;
	p2 = 200;
	for(var k = 0; k < selectdate.length; k++)
		{
		test = selectdate.substring(k, k+1);	
		if((test == "/") && (p1 <=199) && (p2 == 200)) { p2 = k	}
		if((test == "/") && (p1 == 200) && (p2 == 200)) { p1 = k }
		}
	datejour = selectdate.substring(0, p1);
	datemois = selectdate.substring(p1+1,p2);
	datean = selectdate.substring(p2+1,selectdate.length);
	date = new Date(datean,datemois-1,datejour);
	joursemaine = date.getDay();
	if (joursemaine == 1){return "lundi";}
	if (joursemaine == 2){return "mardi";}
	if (joursemaine == 3){return "mercredi";}
	if (joursemaine == 4){return "jeudi";}
	if (joursemaine == 5){return "vendredi";}
	if (joursemaine == 6){return "samedi";}
	}
	
/*-------------------------------------------*/
/* Renvoi la valeur d'une séance de bronzage */
function getRes(form,liste,val,res,res2)
	{
		eval ( chrForm = window.document [form]);
		eval ( Select = window.document [form] [liste]);
		eval ( Resultat = window.document [form] [res]);
		eval ( ValForfait = window.document [form] [res2]);
		
		temp = Select.value*1;
		
		Total = Math.round(((temp/3)*val)*100)/100;
		ValForTotal = Total * (50/70);
		
		/* mise au format */
		Total = Total +"";
		ValForTotal = ValForTotal +"";
		
		if(Total.lastIndexOf(".")==(-1))
			{
				Total = Total +"€00"
			}
		else
			{	
			parms = Total.substring(0).split(".");
			Total = parms[0] +"€"+parms[1];
			if (parms[1].length = 1){Total = Total + "0"}
			}
		
		if(ValForTotal.lastIndexOf(".")==(-1))
			{
				ValForTotal = ValForTotal +"€00"
			}
		else
			{	
			parms = ValForTotal.substring(0).split(".");
			ValForTotal = parms[0] +"€"+parms[1];
			if (parms[1].length = 1){ValForTotal = ValForTotal + "0";};
			if (parms[0] < 10)
			{ValForTotal = ValForTotal.substring(0,4);}
			else
			{ValForTotal = ValForTotal.substring(0,5);};
			
			}
			
		Resultat.value = "=> " + Total;
		ValForfait.value = ValForTotal;
	}
	
/*-----------------------------------------------*/
/* Détermine le type de peau                     */  
function CalculIndice(form)
{

eval ( chrForm = window.document [form]);
if (chrForm.yeux[0].checked){c1 = 1};
if (chrForm.yeux[1].checked){c1 = 2};
if (chrForm.yeux[2].checked){c1 = 3};
if (chrForm.yeux[3].checked){c1 = 4};	
if (chrForm.cheveux[0].checked){c2 = 1};
if (chrForm.cheveux[1].checked){c2 = 2};
if (chrForm.cheveux[2].checked){c2 = 3};
if (chrForm.cheveux[3].checked){c2 = 4};
if (chrForm.teint[0].checked){c3 = 1};
if (chrForm.teint[1].checked){c3 = 2};
if (chrForm.teint[2].checked){c3 = 3};
if (chrForm.teint[3].checked){c3 = 4};
if (chrForm.tache[0].checked){c4 = 1};
if (chrForm.tache[1].checked){c4 = 2};
if (chrForm.tache[2].checked){c4 = 3};
if (chrForm.tache[3].checked){c4 = 4};
if (chrForm.coup[0].checked){c5 = 1};
if (chrForm.coup[1].checked){c5 = 2};
if (chrForm.coup[2].checked){c5 = 3};
if (chrForm.coup[3].checked){c5 = 4};

rCoefTotal = (c1+c2+c3+c4+c5)/5;	

if (rCoefTotal < 1.6){geIndice = "I"}
else if (rCoefTotal < 2.6){geIndice = "II"}
else if (rCoefTotal < 3.6){geIndice = "III"}
else geIndice = "IV";
chrForm.res.value = geIndice;
};


/* Défilement de texte verticale*/

/* appel de la fonction 
<body onLoad="c1();">
    <div align="center" style="position:absolute; top:450; left:20" id="a">TEXTE A MODIFIER</div>

Commentaire :

Le code tient maintenant compte de la largeur de l'écran. Il ne reste plus qu'à déterminer la longueur de texte incorporé dans la balise DIV en remplaçant 175 de l'exemple par la longueur en pixel de votre texte. Si la résolution de l'écran change le code saura s'y adapter sans modification.*/


rd=10;
la=screen.availWidth;

function defile_texte_vert()
      {
      rd+=10;
      if (rd>la-175) // selon longueur texte
      rd=20;
      el=document.getElementById("a");
      el.style.left=rd;
      setTimeout("c1()", 100); // vitesse de défilement
      };
	  
	  

