// DECLARATION DES VARIABLES


// Variables communes aux thèmes

	adresseImagesCommunes='http://www.stat.ucl.ac.be/commun/images/';
	numinfo=0;
	datemodif=0;	
	var ok=1;

	background='';

	nonstat=0;
	textefinperso='';
	haut=1;
	ciblelien='';
	adresseImagesIRIS='http://www.stat.ucl.ac.be/IRIS/images/';
		adresseCSS='http://www.stat.ucl.ac.be/commun/stylesConsultation.css';
	
// Fonctions communes

	function initArray() { 
	        this.length = initArray.arguments.length 
	        for (var i = 0; i < this.length; i++) 
	        this[i+1] = initArray.arguments[i] 
        } 
        

function ChargeTheme(theme)
{

	if (theme=='ISUcl')
	{
	// Theme page IS
		bgcolor='';
	haut=0;
		background='';
		fgcolor='#000066';
		bgcolor2='#f2f1ff';
		bgcolor1='#FFFFFF';
		imageHautPage='barrehaut.gif';
		imageTitrePage='consultation.gif'
		imageRubrique='ss-pucetitreconsultation.gif';
		adresseCSS='http://www.stat.ucl.ac.be/commun/stylesConsultation.css';
		CouleursInfo = new Array (3); 
		CouleursInfo[0]=bgcolor;
		CouleursInfo[1]=bgcolor1;
		CouleursInfo[2]=bgcolor2;
		map='<area shape="rect" coords="0,0,100,51" href="http://www.ucl.ac.be" ><area shape="rect" coords="5,54,65,72" href="http://www.uclouvain.be/isba" >';
		datemodif=1;
	}
	

	
	
	if (theme=='pageis')
	{
	// Theme page IS
		bgcolor='#f2f1ff';
		background='';
		fgcolor='#000066';
		bgcolor2='#f2f1ff';
		bgcolor1='#FFFFFF';
		imageHautPage='barreISvide.gif';
		imageTitrePage='consultation.gif'
		imageRubrique='ss-pucetitreconsultation.gif';
		adresseCSS='http://www.stat.ucl.ac.be/commun/stylesConsultation.css';
		CouleursInfo = new Array (3); 
		CouleursInfo[0]=bgcolor;
		CouleursInfo[1]=bgcolor1;
		CouleursInfo[2]=bgcolor2;
		map='<area shape="rect" coords="0,0,100,51" href="http://www.ucl.ac.be" ><area shape="rect" coords="5,54,65,72" href="http://www.uclouvain.be/isba" >';
		datemodif=1;
	}
	
	
	if (theme=='intranet')
		{
		// Theme page intranet IS
			bgcolor='#ffffcc';
			background='';
			fgcolor='#000066';
			bgcolor2='#f2f1ff';
			bgcolor1='#FFFFFF';
			imageHautPage='barreISvide.gif';
			imageTitrePage='consultation.gif'
			imageRubrique='puce.gif';
			adresseCSS='http://www.stat.ucl.ac.be/commun/stylesIntranet.css';
			adresseSite="http://www.stat.ucl.ac.be/restricted/";
			map='<area shape="rect" coords="0,0,100,51" href="http://www.ucl.ac.be" ><area shape="rect" coords="5,54,65,72" href="http://www.stat.ucl.ac.be" >';
			datemodif=1;
			responsableNom='Sophie Malali';
			responsableMail='sophie.malali@uclouvain.be';

		}
		
		
	if (theme=='dhc')
			{
			// Theme page Doctor Honoris Causa
				bgcolor='#9999FF';
				background='';
				fgcolor='#000066';
				bgcolor2='#f2f1ff';
				bgcolor1='#FFFFFF';
				imageHautPage='barreISvide.gif';
				imageTitrePage='consultation.gif'
				imageRubrique='puce.gif';
				adresseCSS='http://www.stat.ucl.ac.be/commun/stylesdhc.css';
				adresseSite="http://www.stat.ucl.ac.be/photodhc/";
				map='<area shape="rect" coords="0,0,100,51" href="http://www.ucl.ac.be" ><area shape="rect" coords="5,54,65,72" href="http://www.stat.ucl.ac.be" >';
				datemodif=0;
				responsableNom='Sophie Malali';
				responsableMail='sophie.malali@uclouvain.be';
		
		}
	
	
	if (theme=='consultation')
	{
	// Theme consultation
		
		adresseSite='http://www.stat.ucl.ac.be/ISconsultation/';
		bgcolor='';
		background=adresseSite+'bgnombre.gif';
		fgcolor='#000066';
		bgcolor2='#E0E0E0';
		bgcolor1='#FFFFFF';
		

		imageHautPage='barreISconsultation.gif';
		imageTitrePage='consultation.gif'

		imageRubrique='ss-pucetitreconsultation.gif';
		adresseCSS='http://www.stat.ucl.ac.be/commun/stylesConsultation.css';

		responsableNom='Alain Guillet';
		responsableMail='alain.guillet@uclouvain.be';
		responsableBureau='C.316';
		responsableTelephone='+32 10 47.30.50';

		CouleursInfo = new Array (3); 
		CouleursInfo[0]=bgcolor;
		CouleursInfo[1]=bgcolor1;
		CouleursInfo[2]=bgcolor2;
		
		map='<area shape="rect" coords="0,0,100,51" href="http://www.uclouvain.be" ><area shape="rect" coords="5,54,50,72" href="http://www.uclouvain.be/stat.html" ><area shape="rect" coords="60,54,100,72" href="'+adresseSite+'" ><area shape="rect" coords="205,58,250,72" href="'+adresseSite+'"><area shape="rect" coords="260,58,400,72" href="'+adresseSite+'CI/"><area shape="rect" coords="410,58,520,72" href="'+adresseSite+'CE/"><area shape="rect" coords="530,58,640,72" href="'+adresseSite+'FC/">';
		
		datemodif=1;
		
	}
	

if (theme=='smcs')
	{
	// Theme smcs
		
		adresseSite='http://www.stat.ucl.ac.be/SMCS/';
		bgcolor='';
		background=adresseSite+'bgnombre.gif';
		fgcolor='#000066';
		bgcolor2='#E0E0E0';
		bgcolor1='#FFFFFF';
		

		imageHautPage='barreISsmcs.gif';
		imageTitrePage='spacer.gif';

		imageRubrique='ss-pucetitreconsultation.gif';
		adresseCSS='http://www.stat.ucl.ac.be/commun/stylesConsultation.css';

		responsableNom='Alain Guillet';
		responsableMail='alain.guillet@uclouvain.be';
		responsableBureau='C.316';
		responsableTelephone='+32 10 47.30.50';

		CouleursInfo = new Array (3); 
		CouleursInfo[0]=bgcolor;
		CouleursInfo[1]=bgcolor1;
		CouleursInfo[2]=bgcolor2;
		
		map='<area shape="rect" coords="0,0,100,51" href="http://www.uclouvain.be" ><area shape="rect" coords="5,54,50,72" href="http://www.uclouvain.be/isba.html" ><area shape="rect" coords="60,54,100,72" href="http://www.uclouvain.be/SMCS.html" >';
		
		datemodif=1;
		
	}

		
	if (theme=='salledida')
	{
	// Theme salle didactique 
	// Aller voir dans les fonctions /dida/fonctionsdida.js

		// THEME DIDA
		
				bgcolor='#B0CCD4';
			//	bgcolor='#004E98';
//				background="http://www.stat.ucl.ac.be/ISdidactique/flocon.gif";
				background="";
				fgcolor='#295E6D';
				bgcolor2='#DAEAEE';
				bgcolor1='#FFFFFF';
				adresseSite='http://www.stat.ucl.ac.be/ISdidactique/';
		
				imageHautPage='barreISdida.gif';
				imageTitrePage='computer.gif'
		
				imageRubrique='ss-pucetitredida.gif';
				adresseCSS='http://www.stat.ucl.ac.be/commun/stylesDida.css';
		
				responsableNom='Alain Guillet';
				responsableMail='alain.guillet@uclouvain.be';
				responsableBureau='C.316';
				responsableTelephone='+32 10 47.30.50';
		
				CouleursInfo = new Array (3); 
				CouleursInfo[0]=bgcolor;
				CouleursInfo[1]=bgcolor1;
				CouleursInfo[2]=bgcolor2;
				
				map='<area shape="rect" coords="0,0,100,51" href="http://www.ucl.ac.be" ><area shape="rect" coords="5,54,65,72" href="http://www.stat.ucl.ac.be" ><area shape="rect" coords="470,58,650,72" href="'+adresseSite+'">';
				
		datemodif=1;

		document.write('<SCRIPT LANGUAGE="Javascript1.2" SRC="http://www.stat.ucl.ac.be/commun/dida/fonctionsdida.js"></SCRIPT>');
	}

	if (theme=='cours'){

	// Theme cours
		bgcolor='#d0e8d0';
		bgcolor2='#d0e8d0';
		responsableNom='';
		responsableMail='';
		fgcolor='#006600';
		adresseSite='http://www.stat.ucl.ac.be/cours/';

		adresseCSS='http://www.stat.ucl.ac.be/cours/stylesEns.css';

		imageHautPage='barreISens.gif';
		imageTitrePage='ss-ens.gif';
		imageRubrique='ss-pucetitre.gif';
		
		
		map='<map name="Map"><AREA shape="rect" coords="0,0,100,51" href="http://www.uclouvain.be" title=""><AREA shape="rect" coords="5,54,65,72" href="http://www.uclouvain.be/isba" title=""><AREA shape="rect" coords="187,58,248,76" ="http://www.stat.ucl.ac.be/diploma/" title=""><area shape="rect" coords="590,1,648,57" href="http://www.uclouvain.be/isba"><AREA shape="default" nohref><area shape="default" nohref></map>';



	}	

	// Theme page personnelle
	if (theme=='pageperso')
	{

		bgcolor='#E7E7FA';
		bgcolor1='#000063';
		bgcolor2=bgcolor;
		
		fgcolor='#FFFFF';
		
	

		adresseCSS='http://www.stat.ucl.ac.be/commun/stylesPerso.css';
		imageHautPage='barreISperso.gif';		
		imageTitrePage='';
		imageRubrique='ss-pucetitre.gif';
		
		
		
		adresseSite='http://www.stat.ucl.ac.be/commun/';
		responsableNom='';
		responsableMail='';
		numinfo=0;
		CouleursInfo = new Array (3); 
		CouleursInfo[0]=bgcolor;
		CouleursInfo[1]=bgcolor1;
		CouleursInfo[2]=bgcolor2;
		map='<area shape="rect" coords="0,0,100,51" href="http://www.uclouvain.be" ><area shape="rect" coords="5,54,65,72" href="http://www.uclouvain.be/isba" >';

		
	}
}




// FONCTIONS COMMUNES

function CheckVersion()
{
	var user_agent=navigator.userAgent.toLowerCase();
	var nav_version = navigator.appVersion.toLowerCase();
	var nav_minor = parseFloat(nav_version);
	var nav_major = parseInt(nav_minor);
	var iePos = nav_version.indexOf('msie');
	if (iePos !=-1) {
	  nav_major = parseInt(nav_minor);
	}
	var nav6Pos = user_agent.indexOf('netscape6');
	if (nav6Pos !=-1) {
	  nav_minor = parseFloat(user_agent.substring(nav6Pos+10))
	  nav_major = parseInt(nav_minor)
	}
	var nav_nav = ((user_agent.indexOf('mozilla')!=-1) && (user_agent.indexOf('spoofer')==-1)
	  && (user_agent.indexOf('compatible') == -1) && (user_agent.indexOf('opera')==-1)
	  && (user_agent.indexOf('webtv')==-1));
	var nav_nav3 = (nav_nav && (nav_major == 3));
	var nav_nav4up = (nav_nav && (nav_major >= 4));
	var nav_nav6up = (nav_nav && nav_minor >= 6);
	var nav_ie = (iePos!=-1);
	var nav_ie3 = (nav_ie && (nav_major < 4));
	var nav_ie4up = (nav_ie && nav_minor >= 4);
	var nav_ie5up = (nav_ie && nav_minor >= 5);
	var nav_opera = (user_agent.indexOf("opera") != -1);
	var nav_win = ( (user_agent.indexOf("win")!=-1) || (user_agent.indexOf("16bit")!=-1) );
	var nav_mac = (user_agent.indexOf("mac")!=-1);
	var nav_linux = (user_agent.indexOf("inux")!=-1);

	if (nav_win){

	  if (nav_nav6up) ok = 1; else ok=0;
	  if (nav_ie) ok=1;
	} else if (nav_mac) {
	  if (nav_nav6up) ok = 1;
	    else ok=0;
	} 
	else if (nav_linux) {
	  if (nav_nav6up) ok = 1;
	    else if (nav_nav4up) ok = 0;
	    else if (nav_nav3) ok = 0;
	}
	return ok;
}

function EcritDebut(version,titre)
{

	if (version==1)
	{
	
	
	if (background.length >0)
	{
	document.write('<HTML><HEAD><BASE HREF="'+document.URL+'"><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><TITLE>UCL/STAT - '+titre+'</TITLE><style><!--a:hover{background-color:'+bgcolor2+'}!--></style></HEAD><BODY background="'+background+'"  text="#000000"><DIV align="center">  <TABLE width="650" border="0" cellspacing="0" cellpadding="0">');
	}
	else
	{
	document.write('<HTML><HEAD><BASE HREF="'+document.URL+'"><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><TITLE>UCL/STAT - '+titre+'</TITLE><style><!--a:hover{background-color:'+bgcolor2+'}!--></style></HEAD><BODY bgcolor="'+bgcolor+'"  text="#000000"><DIV align="center">  <TABLE width="650" border="0" cellspacing="0" cellpadding="0">');
	}
	
	
	if (haut==1)
	{
		document.write('<TR> <TD colspan="3"><IMG src="'+adresseImagesCommunes+imageHautPage+'" width="650" height="77" usemap="#Map" border="0"></TD>    </TR>');
	}
	else
	{
		document.write('<TR> <TD colspan="3"><IMG src="'+adresseImagesCommunes+'barrehaut.gif" width="650" usemap="#Map" border="0"></TD>    </TR>')
	}
	document.write('<TR><TD bgcolor="#FFFFFF" width="10" background="'+adresseImagesCommunes+'ss-fond-gauche.gif">&nbsp;</TD><TD bgcolor="#FFFFFF" width="630" class="justifier"><LINK href="'+adresseCSS+'" type=text/css rel=stylesheet>');

	}
	else
	 {
	document.write('<HTML><HEAD><BASE HREF="'+document.URL+'"><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><TITLE>UCL/STAT - '+titre+'</TITLE><style><!--a:hover{background-color:'+bgcolor2+'}!--></style></HEAD><BODY bgcolor="FFFFFF" background="'+background+'" text="#000000">' );
	document.write('<TABLE width="650" border="0" cellspacing="0" cellpadding="0">      <TD width=650 bgcolor=#FFFFFF class="justifier">')
	if (haut==1){
		document.write('<IMG src="'+adresseImagesCommunes+imageHautPage+'" width="650" height="77" usemap="#Map" border="0">');
	}
	else
	{
		document.write('<TR> <TD colspan="3"><IMG src="'+adresseImagesCommunes+'barrehaut.gif" width="650" usemap="#Map" border="0"></TD>    </TR>')
	}

	document.write('<LINK href="'+adresseCSS+'" type=text/css rel=stylesheet>');
	
	 }
}

function DebutPageNew(theme,titre) { 
	ChargeTheme(theme);
	
	if (nonstat==1) 
	{
		imageHautPage='barreISvide.gif';
		map='<area shape="rect" coords="0,0,100,51" href="http://www.ucl.ac.be" ><area shape="rect" coords="5,54,65,72" href="http://www.stat.ucl.ac.be" >';
	}

	ok=CheckVersion();
	EcritDebut(ok,titre);
}

function DebutPage(sigle,intitule) { 
	
//	ChargeTheme('cours');
	DebutPageNew('cours',sigle+': '+intitule);
	TitrePage('<A CLASS="nsvert" HREF="http://www.stat.ucl.ac.be/cours/'+sigle.toLowerCase()+'/">'+sigle+': '+intitule+'</A>');
	
}

function DebutPageNonStat(sigle, intitule)
{
	nonstat=1;
	DebutPage(sigle,intitule);
}


function TitrePage(titre)
{

	document.write('<BR><BR><TABLE width="600" border="0" cellspacing="0" cellpadding="0"><TR valign="middle"> <TD width="50"><IMG src="'+adresseSite+'images/'+imageTitrePage+'" ></TD><TD width="550"><P CLASS="nsgris"><FONT COLOR="'+fgcolor+'">'+titre+'</FONT></P></TD> </TR></TABLE>');
}

	
function Rubrique(titre)
{
	document.write('<BR><TABLE BORDER=0><TD VALIGN=middle ALIGN=left><IMG SRC="'+adresseSite+'images/'+imageRubrique+'"></TD><TD VALIGN=middle><P CLASS="rubrique">&nbsp;'+titre+'</P></TD></TABLE>');
}


function LienFichier(nomfic,description)
	{
	x=nomfic.length +1;
	extension=nomfic.substring(x-4,x);
	document.write('<CENTER><BR><TABLE cellSpacing=0 cellPadding=0 width=450 border=0><TD width=10 bgColor='+bgcolor2+'>&nbsp;</TD><TD width=450 bgColor='+bgcolor2+'><A HREF='+nomfic+' CLASS="nonsouligne">'+description+'</A></TD><TD width=50 bgColor='+bgcolor2+' align=center VALIGN=bottom><A HREF='+nomfic+'><IMG src="'+adresseImagesCommunes+'dwld-'+extension+'.gif" BORDER=0></A>&nbsp;</TD></TABLE></CENTER>');
	}


function Cadre(description)
	{
	document.write("<CENTER><BR><TABLE cellSpacing=0 cellPadding=0 width=450 border=0><TD width=10 bgColor="+bgcolor2+">&nbsp;</TD><TD width=450 bgColor="+bgcolor2+">"+description+"</TD></TABLE></CENTER>");
	}


function Lien(cible,description)
{
	 if (ciblelien=='')
	 {
	 document.write('<CENTER><BR><TABLE cellSpacing=0 cellPadding=0 width=450 border=0><TD width=10 bgColor='+bgcolor2+'>&nbsp;</TD><TD width=450 bgColor='+bgcolor2+'><A HREF='+cible+' CLASS="nonsouligne">'+description+'</A></TD><TD width=50 bgColor='+bgcolor2+' align=center><A HREF='+cible+'><IMG src="'+adresseImagesCommunes+'link3.gif" BORDER=0></A></TD></TABLE></CENTER>');
	 }
	 else
	 {
	 document.write('<CENTER><BR><TABLE cellSpacing=0 cellPadding=0 width=450 border=0><TD width=10 bgColor='+bgcolor2+'>&nbsp;</TD><TD width=450 bgColor='+bgcolor2+'><A HREF='+cible+' CLASS="nonsouligne" target="'+ciblelien+'">'+description+'</A></TD><TD width=50 bgColor='+bgcolor2+' align=center><A HREF='+cible+'><IMG src="'+adresseImagesCommunes+'link3.gif" BORDER=0></A></TD></TABLE></CENTER>');
	 ciblelien='';
	 }

}


function DateModification()
	{
		var MOYArray = new initArray("janvier","février","mars","avril","mai","juin","juillet","août","sept.","oct.","nov.","déc."); 
		var LastModDate = new Date(document.lastModified); 
		document.write('<TABLE WIDTH=100% BORDER=0><td>')

		if (responsableNom.length >0) document.write('Contact: <A HREF=mailto:'+responsableMail+' CLASS="nonsouligne">'+responsableNom+'</A></td>');

		document.write('<TD ALIGN=RIGHT><I>Dernière modification: '); 
		document.write(LastModDate.getDate()," ");
		document.write(MOYArray[(LastModDate.getMonth()+1)]," "); 
	

		datem=LastModDate.getFullYear();

		document.write(datem+"</i></td></table>")
			
		
}


function AdresseIS(bureau,tel,mail)
	{


	document.write('<hr size=1 color="#000000"><table width="100%" border=0 cellpadding="0" cellspacing=0><td valign="bottom"><img src="http://www.stat.ucl.ac.be/commun/images/blocstat100b.gif" border=0></td><td width=10>&nbsp;</td><td>');

	if (textefinperso=='')
	{
		DateModification();
	}
	else
	{
		document.write(textefinperso);
	}

	document.write('<hr size=1>	<table width=100% border=0><TD valign="bottom" width="250">Institut de statistique, UCL<BR>Voie du Roman Pays, 20<BR>B-1348 Louvain-la-Neuve<br> Belgium</TD><td width="100">&nbsp;</td><td valign="bottom" width="100">Bureau<br>Tel<br>Fax<br>E-Mail</td><td valign=bottom width=250  align=right >'+bureau+'<br>'+tel+'<br>+32 10 47.30.32<br><A HREF="mailto:'+mail+'" CLASS="nonsouligne">'+mail+' </A></td></table></td></tr></table>');
}


function FinPage() { 
	if (datemodif==1)  {
		document.write('<hr size=1>');
		DateModification();
	}
	if (ok==1)
	{
	document.write('</TD><TD bgcolor="#FFFFFF" width="10" background="'+adresseImagesCommunes+'ss-fond-droit.gif">&nbsp;</TD></TR><TR><TD bgcolor="#FFFFFF" colspan="3"><IMG src="'+adresseImagesCommunes+'ss-bas.gif" width="650" height="5"></TD></TR> </TABLE></DIV><map name="Map">'+map+'</map></BODY></HTML>');
	}
	else
	{
	document.write('</td></table><map name="Map">'+map+'</map></BODY></HTML>');

	}


}





// FONCTIONS theme COURS


function ZoneInfo(information, image)
		{
	document.write('<TABLE cellSpacing=0 cellPadding=0 width=600 border=0><TBODY><TR vAlign=center><TD width=10>&nbsp;</TD><TD width=10 bgColor=#d0e8d0>&nbsp;</TD><TD width=450 bgColor=#d0e8d0>'+information+'</TD><TD width=100 bgColor=#d0e8d0 valign=top><IMG src="'+image+'"></TD></TR></TBODY></TABLE>');
}

function HoraireCours(siglecours)	
		{
	document.write('<CENTER><IFRAME SRC=http://www.stat.ucl.ac.be/cgi-bin/getdata?FMPRO?-db=Cours.fp5&-format=/horaireinclude.htm&-Lay=Saisie&-SortOrder=ascend&-max=all&CH_CODE='+siglecours+'&-find" FRAMEBORDER=0 WIDTH=100% HEIGHT=200 marginwidth=0 ALIGN=CENTER SCROLLING=NO><P ALIGN=right><A HREF=http://www.stat.ucl.ac.be/cgi-bin/getdata?FMPRO?-db=Cours.fp5&-format=/horaires3.htm&-Lay=Horaires&-SortField=CH_CODE&-SortOrder=ascend&-max=all&-Token='+siglecours +'&-find#'+siglecours+' CLASS="nonsouligne">Horaires du cours</A><B>&lt;</B></P></IFRAME></CENTER>');
}




	
	
//FONCTIONS theme pageperso


	
function Item(item){	document.write('<LI>'+item+'<BR>');	}

function EnTetePagePersoIndex(nom,status,image)
{
	document.write('<center><table width=100%><td width=100 valign=top><img src="'+image+'" width=95></td><td width=10>&nbsp;</td><td valign=top><table width=100% cellspacing=0 cellpadding=0><tr><td><font face=arial size=+3>'+nom+'</font></td></tr><tr bgcolor=000063><td><font color=FFFFFF><B>&nbsp;'+status+'</B></font></td>	</tr><tr><td width=100%>');
}

function FermePagePersoIndex()
{
	document.write('</td></tr></table></td></table></center>');
}
	

// FONCTIONS IRIS

function ImageIRIS(image,commentaire)
{
	document.write('<center><img src="'+adresseImagesIRIS+image+'">');
	if (commentaire!="")
	{
	document.write('<br><i>'+commentaire+'</i>');
	}
	document.write('<br></center>');

}


