        function getElementById(id){
            var o, d=document;
            if (d.layers) {o=d.layers[id];if(o) o.style=o};
            if (!o && d.getElementById) o=d.getElementById(id);
            if (!o && d.all) o = d.all[id];
            return o;
        }
		
var redimall=0;

/*var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

alert(navigator.appVersion+' - '+navigator.appVersion.substr((parseInt(navigator.appVersion.indexOf("MSIE"))+5),1)+' - '+is_minor+' - '+is_major);
*/
var isIE7  = (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.substr((parseInt(navigator.appVersion.indexOf("MSIE"))+5),1) >= 7) ? true : false;

//alert(isIE7);

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;


var lo=0;

var fontmax = 20;
var fontmini = 5;
/*var lfenmax = 1540;
var hfenmax = 1040;*/
var lfenmax = 1595;
var hfenmax = 1015;
var lpourc = 80;
var hpourc = 95;
var hpourcontent = 65;
var lmaxref = Math.round((lfenmax*lpourc)/100);
var hmaxref = Math.round((hfenmax*hpourc)/100);
var hmaxrefcontent = Math.round((hfenmax*hpourcontent)/100);


var bodhaut;
var bodlarg;

function tailbodset() {

//Surtout IE7
if (document.documentElement.clientHeight) {

	//bodhaut = bod.clientHeight + bod.scrollTop + 40;
	bodhaut =  document.documentElement.clientHeight + document.documentElement.scrollTop;
	bodlarg = document.documentElement.clientWidth + document.documentElement.scrollLeft;
	//alert('ie = document.all : '+bodlarg+' = '+document.body.clientWidth+' - '+document.body.scrollLeft+' / '+bodhaut+' = '+document.body.clientHeight+' - '+document.body.scrollTop);

//if (document.all) { // IE 4+
} else if (document.all) {
	bodhaut = document.body.clientHeight + document.body.scrollTop;
	bodlarg = document.body.clientWidth + document.body.scrollLeft;
	
} else {
//alert('autres nav');
	// Les autres navig
	bodhaut = window.innerHeight; 
	bodlarg = window.innerWidth;
	//alert('NON ie : '+bodlarg+' = '+window.innerWidth+' / '+bodhaut+' =  '+window.innerHeight);
}
//bodhaut = getTotalHeight();

  //alert(window.innerWidth+' --> '+bodlarg);
//if (ie) { /* Si saloperie d'IE */
/*haut = document.body.clientHeight + document.body.scrollTop;
larg = document.body.clientWidth + document.body.scrollLeft;
}else{
haut = window.innerHeight;
larg = window.innerWidth;
}*/

}

// function setdimension
function setdimension(lmaxref,hmaxref,lpourcmax,hpourcmax) {

tailbodset();

var result=new Array();

var rapo=lfenmax/hfenmax;
var rapa=bodlarg/bodhaut;
var compa = rapo/rapa;

var lpourc = Math.floor((lmaxref*100)/lfenmax);
var hpourc = Math.floor((hmaxref*100)/hfenmax);

// reduction dans masque pourcentages maxi --> pour img tres larges ou hautes
if(lpourc > lpourcmax){
lpourc=lpourcmax;
hpourc=Math.floor((hmaxref*lpourc)/lmaxref);
}
if(hpourc > hpourcmax){
hpourc=hpourcmax;
lpourc=Math.floor((lmaxref*hpourc)/hmaxref);
}


//relativement plus haut que large
if(compa >= 1){
//alert('compa : '+compa+' >= 1');
nlarg = Math.floor((bodlarg*lpourc)/100);
if(lmaxref > nlarg){

nhaut = Math.floor((nlarg*hmaxref)/lmaxref);
}else{
nhaut = hmaxref;
nlarg = lmaxref;
}
//relativement plus large que haut
}else if(compa < 1){
//alert('compa : '+compa+' < 1');
nhaut = Math.floor((bodhaut*hpourc)/100);
if(hmaxref > nhaut){
nlarg = Math.floor((nhaut*lmaxref)/hmaxref);
}else{
nhaut = hmaxref;
nlarg = lmaxref;
}

}

result[0]=nlarg;
result[1]=nhaut;

//alert(result[0]+' x '+result[1]);

return result;

}
// fin function setdimension 

var nlarg;
var nhaut;
var nhautcontent;
var fontaille;

function redimrel() {

tailbodset();

var rapo=lfenmax/hfenmax;
var rapa=bodlarg/bodhaut;
var compa = rapo/rapa;


//relativement plus haut que large
if(compa >= 1){
//alert('compa : '+compa+' >= 1');
if(lfenmax > bodlarg){
nlarg = Math.floor((bodlarg*lpourc)/100);
nhaut = Math.floor((nlarg*hmaxref)/lmaxref);
nhautcontent = Math.floor((nlarg*hmaxrefcontent)/lmaxref);
fontaille=Math.ceil((fontmax*nlarg)/lfenmax);
}else{
nhaut = hmaxref;
nhautcontent = hmaxrefcontent;
nlarg = lmaxref;
fontaille=fontmax;
}
//relativement plus large que haut
}else if(compa < 1){
//alert('compa : '+compa+' < 1');
if(hfenmax > bodhaut){
nhaut = Math.floor((bodhaut*hpourc)/100);
nlarg = Math.floor((nhaut*lmaxref)/hmaxref);
nhautcontent = Math.floor((bodhaut*hpourcontent)/100);
fontaille=Math.ceil((fontmax*nhaut)/hfenmax);
}else{
nhaut = hmaxref;
nhautcontent = hmaxrefcontent;
nlarg = lmaxref;
fontaille=fontmax;
}

}

}

function redimtext() {


//tailbodset();

redimrel();

bobo.style.width = nlarg+"px";
bobo.style.height = nhaut+"px";

//redim img
/*if(pagimg){
var himgpourc=45;
// si hauteur cadre :
//var himgpourc=69;

var himg=pagimg.getAttribute("height");
var limg=pagimg.getAttribute("width");
var nhimg=Math.round((nhaut*himgpourc)/100);
var nlimg=Math.round((nhimg*limg)/himg);
pagimg.style.height=nhimg+"px";
pagimg.style.width=nlimg+"px";
}*/
//if(eval(nimg)){

var imglist=new Array(
new Array('pagimg',430,430,31,31));
/*new Array('rg_img',440,440,33,31),
new Array('rgv1_img',314,314,22,22),
new Array('rgv2_img',224,224,18,23),
new Array('logo',200,100,9,10));*/

for(i=0;i<imglist.length;i++){

var nimg=imglist[i][0];
var ndim=setdimension(imglist[i][1],imglist[i][2],imglist[i][3],imglist[i][4]);

if(eval(nimg)){
eval(nimg).style.width=ndim[0]+"px";
eval(nimg).style.height=ndim[1]+"px";
}

}
//alert(himg+' / '+limg+' - '+nhimg+' / '+nlimg);

//redimension polices
/*if(bobo.style.width <= lmaxref) {
fontaille=Math.ceil((fontmax*bodlarg)/lfenmax);
//alert('fontmax : '+fontmax+' * bobolarg : '+bobolarg+' / lfenmax : '+lfenmax+' = fontaille : '+fontaille);
if(fontaille<fontmini) {
fontaille=fontmini;
}
} else {
fontaille=fontmax;
}*/

if(fontaille<fontmini) {
fontaille=fontmini;
}
bobo.style.fontSize = fontaille+"px";


//document.getElementById('bod').style.fontSize = "8px";
}//fin redimt

/* function flashdim */
function flashdim(name,type,largmax,hautmax) {

//tailbodset();

redimrel();

// détermination hauteur de référence

var nl;
var nh;
var flamaxref;
var flamaxref;


if(name=='logo'){
var largpourc=9;
var hautpourc=10;
var largmax=200;
var hautmax=100;
}else if(name=='flamh'){
var largpourc=33;
var hautpourc=100;
var largmax=390;
var hautmax=650;
}else if(name=='flaml'){
var largpourc=64;
var hautpourc=48;
var largmax=780;
var hautmax=325;
}else{
var largpourc=32;
var hautpourc=48;
var largmax=390;
var hautmax=325;
}
var lflamaxref= Math.floor(nlarg*largpourc/100);
var hflamaxref= Math.floor(nhautcontent*hautpourc/100);
/*if(name=='flamh'){
alert(lmaxref+' '+hmaxref+' '+largmax+' '+hautmax);
}*/

var rapo=lmaxref/hmaxref;
var rapa=nlarg/nhaut;
var compa = rapo/rapa;

//relativement plus haut que large
if(compa >= 1){
//alert('compa : '+compa+' >= 1');
if(largmax > lflamaxref){
flashlarg = lflamaxref;
flashhaut = Math.floor((flashlarg*hautmax)/largmax);
}else{
flashhaut = hautmax;
flashlarg = largmax;
}

}else if(compa < 1){
//alert('compa : '+compa+' < 1');
if(hautmax > hflamaxref){
flashhaut = hflamaxref;
flashlarg = Math.floor((flashhaut*largmax)/hautmax);
}else{
flashhaut = hautmax;
flashlarg = largmax;
}

}// fin if compa

}
/* FIN function flashdim */



//comment ne recharger qu'une fois ???

//function winload(v){
function winload(){
redimtext();
/*if(redimall==0){
menupose();
}*/
redimall=1;
//fondpos(v);
}

function dimouload(v,flalist){
//function dimouload(){
if (isOpera){
//alert('reload !!!');
window.location.reload();
}else{

redimtext();

if(flalist.length>0){
for(i=0;i<flalist.length;i++){
	flashdim(flalist[i],'','','');
if (document.all){
	document.all[flalist[i]].width = flashlarg;
	document.all[flalist[i]].height = flashhaut;
}else{
	window.document.embeds[flalist[i]].width = flashlarg;
	window.document.embeds[flalist[i]].height = flashhaut;
}

	}//fin for
}//fin if
//redim2(imglist,bullist);
//fondpos(v);

}

}//fin dimouload

function resize(v,flalist){
//function resize(){
//alert("redimall : "+redimall);
if(redimall==0){
dimouload(v,flalist);
//dimouload();
if(isIE){
redimall=1;
}
}else{
redimall=0;
}
}



function flashload(name,type,file,largm,hautm,v){

/*if(largm!=1&&hautm!=1){
flashdim(name,type,largm,hautm);
}else{*/
flashlarg=largm;
flashhaut=hautm;
//}
//alert(name+' : '+nlarg+' '+nhaut);
var oeTags = '<object readonly="true" type="text" id="'+name+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
    + 'width="'+flashlarg+'" height="'+flashhaut+'" '
    + 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" />'
    + '<param name="movie" value="'+file+'" /><param name="quality" value="high" />'
	+ '<param name="scale" value="noborder" />'
	+ '<param name="wmode" value="transparent" />'
	//+ '<param name="salign" value="t" />'
	+ '<param name="flashvars" value="v='+v+'" />'
    + '<embed src="'+file+'?v='+v+'" scale="noborder" wmode="transparent" '
    + 'width="'+flashlarg+'" height="'+flashhaut+'" name="'+name+'" id="'+name+'" align="center" '
    + 'quality="high" '
    + 'allowScriptAccess="sameDomain" '
    + 'type="application/x-shockwave-flash" '
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer" />'
    + '<\/embed>'
    + '<\/object>';
	//if(name=='carre'){
	//alert(oeTags);
	//}
document.write(oeTags);

}


function essaitailles(){

//var z = pagimg.getAttribute("z-index");
//alert(fontaille+' - '+bod.style.fontSize);
//alert(nlarg+' - '+nhaut);
alert('bodlarg : '+bodlarg+' / bodhaut : '+bodhaut+' / nlarg : '+nlarg+' = nhaut : '+nhaut);
/*
var lfenmax = 1540;
var hfenmax = 1040;
var lpourc = 80;
var hpourc = 95;
var lmaxref = Math.round((lfenmax*lpourc)/100);
var hmaxref = Math.round((hfenmax*hpourc)/100);
var bodhaut;
var bodlarg;
*/



//var bod = document.getElementById("bod");
//var v = bod.getAttribute("width");
//pagimg.style.width=300+"px";
//bod.style.width=300+"px";
//alert(bodlarg+' - '+v+' - '+bod.style.width);
  //var x = element.getElementsByTagName("img").item(0);
  /*var bod = document.getElementById("bod");
  var v = bod.getAttribute("width");
  alert(bod.getAttribute("width")+' --> '+v+' - '+bod.style.width+' - bodlarg : '+bodlarg);*/
  /*if(v == "feed-blue.png")
    v = "feed-orange.png");
  else
    v = "feed-blue.png");
  x.setAttribute("src", v);	*/
}
