document.resize=function(){
if(document.body.clientWidth>document.getElementById('tabbase').width){offsetW=((document.body.clientWidth-document.getElementById('tabmenu').width)/2)+11;}
else{offsetW=((document.getElementById('tabbase').width-document.getElementById('tabmenu').width)/2)+11;}
left=offsetW;
}

function smOut(){
lesdivs = document.getElementsByTagName("div");
for(i=3;i<lesdivs.length;i++){
if(document.getElementsByTagName("div")[i].id!="flash" && document.getElementsByTagName("div")[i].id!="leplan"){
document.getElementsByTagName("div")[i].style.visibility="hidden";
}}

for(i=0;i<lesdivs.length;i++){
if(document.getElementsByTagName("div")[i].id!="flash" && document.getElementsByTagName("div")[i].id!="leplan"){
document.getElementsByTagName("div")[i].style.top=-200;
}}}

function menuOut(){
for(i=1;i<5;i++){
if(i!=rub){
document.getElementById("TD"+i).bgColor="#83b817";}
}}

function menuOver(x){
document.getElementById(x.id).bgColor="#fd9f36";
}


function afficheSM(x){
smOut();
menuOut();

if(x){temp=(x.id).substr(2,x.id.length);}
else{temp=rub; xtemp="sm"+rub;}
document.getElementById("TD"+temp).bgColor="#fd9f36";
if(document.name=="index" && document.getElementById("flash").style.visibility=="hidden" || !document.getElementById("flash") ||!document.getElementById("leplan")){

//alert("TD"+temp);
if(temp<3){

xtemp="sm"+(x.id).substr(2,x.id.length);
xtab="tab"+(x.id).substr(2,x.id.length);
if(document.getElementById(xtemp).width<document.getElementById(x.id).offsetWidth){document.getElementById(xtemp).width=document.getElementById(x.id).offsetWidth;}
if(document.getElementById(xtab).width<document.getElementById(x.id).offsetWidth){document.getElementById(xtab).width=document.getElementById(x.id).offsetWidth;}

offsetW=0;
posX=0;
wcache=(document.getElementById(xtab).offsetWidth)+30;
hcache=(document.getElementById(xtab).offsetHeight)+30;
//alert((document.body.clientWidth-1000)/2)

if(document.name=="index"){
offsetWhome=13;
offsetHhome=(-6);
}
else{
offsetWhome=0;
offsetHhome=0;
}

if(document.body.clientWidth>document.getElementById('tabbase').width){(offsetW=(document.body.clientWidth-document.getElementById('tabmenu').width)/2)-1;}
else{offsetW=((document.getElementById('tabbase').width-document.getElementById('tabmenu').width)/2)-1;}

for(i=1;i<temp;i++){posX+=document.getElementById("TD"+i).offsetWidth;}

if(temp>1){document.getElementById(xtemp).style.left=(posX+offsetW+(i*1)-2)+offsetWhome;}
else{document.getElementById(xtemp).style.left=posX+offsetW+offsetWhome-2;}

document.getElementById(xtemp).style.top=152+offsetHhome;
document.getElementById(xtemp).style.visibility="visible";

document.getElementById("tabcache").width=wcache;
document.getElementById("tabcache").height=hcache;

with (document.getElementById("cache").style){
top=153;
left=posX+offsetW-15;
width=document.getElementById("tabcache").width;
height=document.getElementById("tabcache").height
}

document.getElementById("tabcacheH").width=wcache;

with (document.getElementById("cacheH").style){
top=114;
left=posX+offsetW-15;
width=document.getElementById("tabcacheH").width;
}

with (document.getElementById("cacheL").style){
top=130;
left=offsetW-16;
}

//document.getElementById('test').value="xtemp="+xtemp+" // xtab="+xtab;
}
}}

function openExpo(x){
var top=(screen.height-480)/2;
var left=(screen.width-680)/2;
var opt="resizable=0,tollbar=0,location=0,directorie=0,status=0,menubar=0,scrollbar=0,width=640,height=485,left="+left+",top="+top;
window.open ("expo.php?"+x,"expo",opt).focus();
}

function flipflop(x){
temp0=x.src.lastIndexOf(".")
deb=x.src.substr(0,x.src.lastIndexOf("."))
fin=x.src.substr(x.src.lastIndexOf("."),x.src.length)
if (deb.substr(deb.length-2,deb.length)=="_o"){temp1=deb.substr(0,deb.length-2)+fin;}
else{temp1=deb+"_o"+fin;}
document.getElementById(x.id).src=temp1;
}

function lecurseur(x){
document.getElementById(x.id).style.cursor="pointer"
}


function verifierMail(){
reg=new RegExp("^[a-zA-Z0-9\-_]+[a-zA-Z0-9\.\-_]*@[a-zA-Z0-9\-_]+\.[a-zA-Z\.\-_]{1,}[a-zA-Z\-_]+");
if (!reg.test(document.forms[0][0].value)){
if (lang=="fr"){alert("email invalide");}
if (lang=="en"){alert("email not good");}
}
else{
if (lang=="fr"){alert("email ok");}
if (lang=="en"){alert("ok all");}
}}

tempflash=""
function presentation(){
	tempflash=document.getElementById('leflash').innerHTML;
	document.getElementById('leflash').innerHTML="";
temp="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='781' height='285' id='flashDejade'>";
if (lang=="fr"){temp+="<param name='movie' value='flash/dejade.swf'>"}
if (lang=="en"){temp+="<param name='movie' value='flash/dejade_en.swf'>"}
temp+="<param name='quality' value='high'>";
if (lang=="fr"){temp+="<embed src='flash/dejade.swf'" }
if (lang=="en"){temp+="<embed src='flash/dejade_en.swf'" }
temp+=" width='781' height='285' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' swliveconnect='true' name='flashDejade' id='flashDejade'></embed>";
temp+="</object>";
tempLeft=((document.body.clientWidth-document.getElementById('tabmenu').width)/2)+12;

if(document.body.clientWidth>document.getElementById('tabbase').width){offsetW=((document.body.clientWidth-document.getElementById('tabmenu').width)/2)+11;}
else{offsetW=((document.getElementById('tabbase').width-document.getElementById('tabmenu').width)/2)+11;}

with (document.getElementById("flash").style){
top=158;
left=offsetW;
visibility="visible";
}
document.getElementById("flash").innerHTML=temp;
}

function hidePresentation(){
with (document.getElementById("flash").style){
top=-1000;
visibility="hidden";
}
document.getElementById("flash").innerHTML="";
document.getElementById('leflash').innerHTML=tempflash;
}


function popupPresentation(x){
var top=(screen.height-420)/2;
var left=(screen.width-850)/2;
var opt="resizable=0,tollbar=0,location=0,directorie=0,status=0,menubar=0,scrollbar=0,width=850,height=420,left="+left+",top="+top;
window.open("presentation.php?lang="+x,"presentation",opt).focus();
}

function openPlan(x){
var top=(screen.height-460)/2;
var left=(screen.width-590)/2;
var opt="resizable=0,tollbar=0,location=0,directorie=0,status=0,menubar=0,scrollbar=0,width=590,height=460,left="+left+",top="+top;
window.open("leplan.php?lang="+x,"plan",opt).focus();
}


function poserQuestion(x){

if(x=="fr"){lang=0;}
else{lang=1;}
//alert(lang)
temp=[["Le champ question est vide","Field question is empty"],["email invalide","email invalid"]]
ok=1;
reg=new RegExp("^[a-zA-Z0-9\-_]+[a-zA-Z0-9\.\-_]*@[a-zA-Z0-9\-_]+\.[a-zA-Z\.\-_]{1,}[a-zA-Z\-_]+");
adresse=document.getElementById("email").value;

//if (!reg(adresse)){alert(temp[1][lang]);ok=0;}
//alert(adresse)
texte=document.getElementById("laquestion").value
if(texte=="Question" ||texte==""){alert(temp[0][lang]);ok=0;}
if(ok==1){document.getElementById("lemail").src="poserquestion.php?&letexte="+texte+"&adresse="+adresse;}
}

