var liens = new Array("accueil.html","presentation/index.html","organisation/index.html","etudes/index.html","4","scd/index.html","formationcontinue/index.html","organisation/espaces_collaboratifs.html","8","liens/index.html","10","presentation/index.html","presentation/historique.html","presentation/plans/index.html","presentation/acces.php","presentation/ann.php","16","17","18","organisation/appariteurs.html","20","accueil.html","organisation/doyens.html","organisation/index.html","organisation/index.html","organisation/serv_adm.html","organisation/scol1.html","organisation/scol2.html","organisation/scol3p.html","organisation/scol3r.html","30","accueil.html","etudes/1ercycle.php","etudes/2ecycle.php","etudes/ecn.php","etudes/3iemecycle.php","etudes/masters.php","etudes/autre.php","etudes/exams.html","etudes/these.html","40","etudes/sujetsecn.html","etudes/inscriptions.php","etudes/resultats.html","etudes/dcem1.php","etudes/dcem2.php","etudes/dcem3.php","etudes/dcem4.php","etudes/echanges.php","49","organisation/scol3du.html","organisation/finr.html","organisation/finp.html","organisation/info.html","etudes/exams_juin.html","etudes/gardes.html","etudes/exams_sept.html","etudes/conc_ortho_psychomot.html","etudes/caledt.php","etudes/paces.php","scd/index.html","formationcontinue/index.html","etudes/corriges.html","etudes/anglais.php","etudes/accueil_stages.html","etudes/kine.php","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","etudes/stageP2.html","presentation/informations.html","presentation/portesouvertes.html","presentation/elections.html","etudes/comment_vivez_vous.html");

var rubriques = new Array(0,1,2,3,0,5,6,7,0,9,1,1,1,1,1,1,1,1,1,25,2,2,2,2,2,25,25,25,25,25,3,3,3,33,3,3,3,3,3,3,0,3,3,3,33,33,33,33,3,0,2,25,25,25,3,33,2,2,3,3,5,6,3,33,33,3,3,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0)

var hauteur = new Array("600","675","510","1200","390","390","390","390","390","530","-10-","675","2400","390","650","390","390","390","390","390","-20-","390","500","510","510","920","1000","700","470","600","-30-","390","1200","490","750","1500","700","1000","900","390","-40-","470","900","470","700","850","950","800","600","470","470","470","500","470","700","370","370","370","1700","370","370","370","470","570","370","500","370","370","370","370","-70-","370","370","370","370","370","370","370","370","370","-80-","370","370","370","370","370","370","370","370","370","-90-","370","370","370","370","370","470","370","370","700","-100-");


function BGC(x,y){
 var obj = document.getElementById(x); 
 if (y == '0')
	{ obj.style.backgroundColor='';}
 if (y == '1')
	{ obj.style.backgroundColor='#ffb200';}
 if (y == '2')
	{ obj.style.backgroundColor='#ffda86';}
}

function SCLK(x,r,n){
 var obja = parent.document.getElementById("rubs");
 var objb = parent.document.getElementById("centre");
 var objc = parent.document.getElementById("news");
 var obje = parent.document.getElementById("tab_haut");
 var objf = parent.document.getElementById("tab_rubs");
 var objg = parent.document.getElementById("tab_centre");
 var objh = parent.document.getElementById("tab_news");
 var k;
 
 if (x > 99) k = 0;
 else k = rubriques[x];
 obja.src="./rubs/" + k + "_rub.html";
 var ln = parseFloat(liens[x]);
 if (isNaN(ln))
	{ objb.src = "./" + liens[x] + "?nw=" + n + "#" + r;
	}
 else objb.src="./accueil.html";
 
 y = hauteur[x];
 obja.height = y;
 objb.height = y;
 objc.height = 600;
 objf.height = y;
 objg.height = y;
 objh.height = 440;

 resize();
}

function resize(){
 var obja = parent.document.getElementById("rubs");
 var objb = parent.document.getElementById("centre");
 var objc = parent.document.getElementById("news");
 var objd = parent.document.getElementById("bandeau-UPS");
 var obje = parent.document.getElementById("tab_haut");
 var objf = parent.document.getElementById("tab_rubs");
 var objg = parent.document.getElementById("tab_centre");
 var objh = parent.document.getElementById("tab_news");

 objd.src = "./images/bandeau_logo_UPS.jpg";
 objd.height = 150;
 if (parent.document.body.clientWidth < 912)
	{
	 obja.width = 152;
	 objb.width = 402;
	 objc.width = 152;
	 objd.width = 152;
	 obje.width = 708;
	 objf.width = 152;
	 objg.width = 406;
	 objh.width = 152;
	}
 else
	{
	 obja.width = 202;
	 objb.width = 500;
	 objc.width = 200;
	 objd.width = 201;
	 obje.width = 906;
	 objf.width = 202;
	 objg.width = 506;
	 objh.width = 200;
	}
 
}

function CLK(x){ SCLK(x,'',0);}

function OUVRE_GRAND(x,y){
 window.open(x , y , "toolbar=no, menubar=no, scrollbars=no, resizable=yes, directories=no, status=no, fullscreen=yes");
}

function PLAN_P(){
 OUVRE_GRAND("./purpan/plan.html",'plan_Purpan');
}

function PLAN_R(){
 OUVRE_GRAND("./rangueil/plan.html",'plan_Rangueil');
}


function getVar(name)
{
 get_string = document.location.search;
 return_value = '';
 
 do { //This loop is made to catch all instances of any get variable.
      name_index = get_string.indexOf(name + '=');

      if(name_index != -1)
	{
	 get_string = get_string.substr(name_index + name.length + 1, get_string.length - name_index);
	 end_of_value = get_string.indexOf('&');
	 if(end_of_value != -1) value = get_string.substr(0, end_of_value);
	 else value = get_string;
	 if(return_value == '' || value == '') return_value += value;
	 else return_value += ', ' + value;
	}
    } while(name_index != -1)
 return(return_value);
}

function PAGE()
{
 var x = getVar('pg');
 var y = getVar('sr');
 var z = getVar('nw');
 if (x == '') CLK(0);
 else	{
	  if (z == '') z=0;
	  SCLK(x,y,z);
	}
}

