
function getOb(ob) { return (document.all)?eval('document.all.'+ob):(document.getElementById)?eval('document.getElementById("'+ob+'")'):null }
function getHt(ob) {return ob.offsetHeight }
function getLg(ob) { return ob.offsetWidth }
function show(ob) {ob.style.visibility = "visible" }
function hide(ob) { ob.style.visibility = "hidden" }
function display_show(ob) {getOb(ob).style.display = "block" }
function display_hide(ob) {getOb(ob).style.display = "none" }
function enx(ob,px) { if (document.all) ob.style.pixelLeft = px; else ob.style.left = px }
function eny(ob,px) {if (document.all) {ob.style.pixelTop = px} else {ob.style.top = px; } }
function getx(ob) { return (document.all)?ob.style.pixelLeft:parseInt(ob.style.left) }
function gety(ob) { return (document.all)?ob.style.pixelTop:parseInt(ob.style.top) }
function laht(ob,px) { ob.style.height = px }
function lalg(ob,px) { ob.style.width = px }
function clp(ob,htm,lgd,htp,lgg) {ob.style.clip = eval("'rect("+htm+"px, "+lgd+"px, "+htp+"px, "+lgg+"px)'") }
function prop(mn,mx,bi,ind,bs) { return (((mx-mn)*ind)/(bs-bi)) }
function inner(idob,contenu){getOb(idob).innerHTML=contenu;}

function coord_univ()
{
	//document.write('<B>Université de La Réunion</B><br>15 avenue René Cassin<br>BP 7151<br>97715 Saint-Denis Messag Cedex 9');
	document.write('<img src="/lenya_univ/universite/live/img/adresse.gif" border="0" />');
}

function ecrit_alinea()
{
	document.write('<img src="/lenya_univ/universite/live/img/e.gif"/ width="15">');
}

function charg_hauteur()
{
	var min_col = document.getElementById("body").offsetHeight-252;
	document.getElementById("col").height = min_col;
	//document.getElementById("bground").height = ht_body;
	//document.getElementById("img_bg").height=ht_body;
	//document.getElementById("bground").style.visibility='visible';
}

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

//if (document.getElementById){ //DynamicDrive.com change
//document.write('<style type="text/css">\n')
//document.write('.submenu{display: none;}\n')
//document.write('.submenu_ouvert{display: block;}\n')
//document.write('</style>\n')
//}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				/*if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";*/
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate


/*
Chargement aléatoire des images en haut de page

SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
http://www.editeurjavascript.com
*/

var width;
var height;
var url;
//function banniere(nb)
//{
//nbimage = nb * 10;
//numimage= Math.round(Math.random()*(nbimage-1)+1);
//if (numimage <= 10)
//{
//url = "/lenya_univ/universite/live/img/s_ouvrir_au_monde_1.jpg";
//alte = "S'ouvrir aux mondes";
//}
//if (numimage > 10 && numimage <= 20)
//{
//url = "/lenya_univ/universite/live/img/s_ouvrir_au_monde_2.jpg";
//alte = "S'ouvrir aux mondes";
//}
//if (numimage > 20 && numimage <=30)
//{
//url = "/lenya_univ/universite/live/img/s_ouvrir_au_monde_3.jpg";
//alte = "S'ouvrir aux mondes";
//}
//if (numimage > 30)
//{
//url = "/lenya_univ/universite/live/img/s_ouvrir_au_monde_4.jpg";
//alte = "Partager ensemble";
//}
//
//document.getElementById("banniere").src = url;
//document.getElementById("banniere").alt = alte;
//
//}

function banniere(lang, nb)
{   
    numimage = Math.floor(Math.random() * nb) + 1;

    url = "/lenya_univ/universite/live/img/" + lang + "/bandeau_" + numimage + ".jpg";
    
    document.getElementById("banniere").src = url;
}



function img(url, hauteur, largeur)
{
	if (largeur>410)
    {
	document.write('<div style="block:table-cell"><img src="' + url + '" width="410px" border="0" height="' + Math.floor(hauteur*410/largeur) + '"/></div>');
    }
        else if (largeur>=0)
    {
         document.write('<img src="' + url + '" width="' + largeur +'" height="' + hauteur + '"/>');
    }
   else
    {
        document.write('<img src="' + url + '"/>');
    }
}



