if (parent.document.layers || document.layers)
nv="sn";
else
nv="s";

if(top.document.getElementById('haute1')){
wi=top.document.getElementById('haute1').offsetWidth;
he1=top.document.getElementById('haute1').offsetHeight;
he2=top.document.getElementById('gauche').offsetHeight;
hf=he1+he2;
}
else
{
wi=this.document.offsetWidth;
he1=this.document.offsetHeight;
he2=this.document.offsetHeight;
hf=he1+he2;
}

ra=wi/hf;
tac=Math.round(wi*18/1280);
tap=Math.max(Math.min(Math.floor((tac-1.5)/4), 4), 1);
document.writeln('<style type=text/css><!--');
document.writeln('body {font-size:'+tac+'px;}');
document.writeln('--></style>');
document.writeln('<link rel="stylesheet" href="'+nv+'.css" type="text/css">');

function rez() {

if(top.document.getElementById('haute1')){
wi=top.document.getElementById('haute1').offsetWidth+top.document.getElementById('gauche').offsetWidth;
he1=top.document.getElementById('haute1').offsetHeight;
he2=top.document.getElementById('gauche').offsetHeight;
hf=he1+he2;
}
else
{
wi=this.document.offsetWidth;
he1=this.document.offsetHeight;
he2=this.document.offsetHeight;
hf=he1+he2;
}

ra=wi/(hf);

if (ra>1.8)
{
tac=Math.round((hf)*18*1.3/1024);
tap2=Math.max(Math.min(Math.floor((tac-1.5)/4), 4), 1);
}
else
{
tac=Math.round(wi*18/1280);
tap2=Math.max(Math.min(Math.floor((tac-1.5)/4), 4), 1);
}

if(top.document.getElementById('haute1')){
document.getElementsByTagName('body')[0].style.fontSize=tac+'px';
var Rules = document.styleSheets[2].rules||document.styleSheets[2].cssRules;
for(j=0; j<Rules.length; j++)
{
if(Rules[j].style.backgroundImage&&(tap!=tap2))
{
bgim=Rules[j].style['backgroundImage'].split(".");
bgim1=bgim[0];
lbgim=bgim1.length;
tapim=bgim1.substr(0,lbgim-1);
tapim1=tapim+=tap2+'.'+bgim[1];

Rules[j].style.backgroundImage=tapim1;

}
}
}
tap=tap2;
}

cha=new RegExp("&","g");
re=document.referrer.replace(cha,"§");
ref=re.split("/");
ref1=location.href.split("/");
lo=location.href.substring(35,1000);
a=top.location.search;

function nav(){
xhr = null; 
if(window.XMLHttpRequest){
xhr = new XMLHttpRequest();
asp();
}
else if(window.ActiveXObject){
xhr = new ActiveXObject("Microsoft.XMLHTTP");
asp();
}
else{
return false;
}
}

function asp(){
xhr.open("POST","ajax.aspx",true);
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
we=screen.width;
he=screen.height;
xhr.send("env="+we+"&env1="+he+"&env2="+re+"&env3="+lo);
}

if ((ref[2]!=ref1[2]||ref1[3]=='top.htm')&&a.length==0){
nav();
}
