// JavaScript Document
var D=document,cltHeight,cltWidth,HeightA,ecranH1,ecranW,ecranH,ecranH,FactorW,FactorH,Factor,FactorNSh,FactorNSw,rawSize,newSizec,ns4=D.layers,ie4=D.all,ns6=D.getElementById&&!D.all,isNS = (navigator.appName == "Netscape") ? 1 : 0,dragswitch=0,nsx,nsy,nstemp,a="Auxiliary/FileCounter.php?filename=";b=document.URL;c="&Refer=";d=document.referrer;
 
//lang
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;

 if (language.indexOf('zh-cn') > -1) document.location.href = 'http://www.strada-mia.com/ch/index.html';
 else if (language.indexOf('zh') > -1) document.location.href = 'http://www.strada-mia.com/zh/index.html';
 else if (language.indexOf('da') > -1) document.location.href = 'http://www.strada-mia.com/da/index.html';
 else if (language.indexOf('nl') > -1) document.location.href = 'http://www.strada-mia.com/nl/index.html';
 else if (language.indexOf('es') > -1) document.location.href = 'http://www.strada-mia.com/es/index.html';
 else if (language.indexOf('de') > -1) document.location.href = 'http://www.strada-mia.com/de/index.html';
 else if (language.indexOf('el') > -1) document.location.href = 'http://www.strada-mia.com/el/index.html';
 else if (language.indexOf('it') > -1) document.location.href = 'http://www.strada-mia.com/it/index.html';
 else if (language.indexOf('ja') > -1) document.location.href = 'http://www.strada-mia.com/ja/index.html';
 else if (language.indexOf('ko') > -1) document.location.href = 'http://www.strada-mia.com/ko/index.html';
 else if (language.indexOf('pt') > -1) document.location.href = 'http://www.strada-mia.com/pt/index.html';
 else if (language.indexOf('sv') > -1) document.location.href = 'http://www.strada-mia.com/sv/index.html';
 else if (language.indexOf('no') > -1) document.location.href = 'http://www.strada-mia.com/no/index.html';
 else if (language.indexOf('he') > -1) document.location.href = 'http://www.strada-mia.com/he/index.html';

// Fonction resize onLoad et onResize de cadre 3
function NSResize(){ if (isNS) { history.go(0) } else { window.history.go(0); AreaResize3() }}

function AreaResize3()
{
if(isNS)
 {
 var cltHeight=window.innerHeight+1;
 var cltWidth=window.innerWidth;
 }
else
 {
 var cltHeight=document.body.clientHeight-3;
 var cltWidth=document.body.clientWidth-3;
 var ecranH1="100%";//Variable pour resize barre
 }
 var ecranW=screen.width;
 var ecranH=screen.height;
 var FactorW=cltWidth/(1024*.75);
 var FactorH=cltHeight/(768*.75);
 var Factor = Math.min(FactorW,FactorH,1.2);
 if(Factor>1)
   {Factor = ((Factor-1)*.7)+1}
 var rawSize = (18)*Factor;
 var newSizeb = Math.floor(rawSize*.85*1000)/1000;
 var newSizec = Math.floor(rawSize*1000)/1000;
  if(newSizec < 1 ) var newSizec=1;
  document.getElementById("ResizeArea0").style.fontSize=newSizec+"px";
  document.getElementById("ResizeArea1").style.fontSize=newSizeb+"px";
  document.getElementById("ResizeArea").style.fontSize=newSizec+"px";
}

//Calculs qui attribuent les valeurs par d&eacute;faut &agrave; ecranH1, HeightA et FactorNSxx
if(isNS)
 {
 var cltHeight=window.innerHeight+1;
 var cltWidth=window.innerWidth;
 var FactorW=cltWidth/(1024);
 var FactorH=cltHeight/(768);
 var Factor = Math.min(FactorW,FactorH,1.2);
 if(Factor>1)
   {Factor = ((Factor-1)*.7)+1}
 var Corrector=16;
 var ecranH1=(window.innerHeight-Corrector)*.25;
 var ecranH2=(window.innerHeight-Corrector)*.60;
 var ecranH3=(window.innerHeight-Corrector)*.15;
 }
 else
 {
 var ecranH="100%";
 var ecranH1="30%";
 var ecranH2="50%";
 var ecranH3="20%";
 }

//IPop
 function drag_drop(name)
 {
  if (!ns4)
  return
 temp=eval(name)
 temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
 temp.onmousedown=down
 temp.onmousemove=move
 temp.onmouseup=up
 }

 function down(e)
 {
 temp.captureEvents(Event.MOUSEMOVE)
 nsx=e.x
 nsy=e.y
 }
 function move(e)
 {
  if(dragswitch==1)
  {
  temp.moveBy(e.x-nsx,e.y-nsy)
  return false
  }
 }

 function up()
 {
 temp.releaseEvents(Event.MOUSEMOVE)
 }


 function drag_drop(e)
 {
  if (ie4&&dragapproved)
  {
  crossobj.style.left=tempx+event.clientX-offsetx
  crossobj.style.top=tempy+event.clientY-offsety
  return false
  }
  else if (ns6&&dragapproved)
  {
  crossobj.style.left=tempx+e.clientX-offsetx+"px"
  crossobj.style.top=tempy+e.clientY-offsety+"px"
  return false
  }
 }

 function initialize_drag(e)
 {
 crossobj=ns6? D.getElementById("pop") : D.all.pop
 var firedobj=ns6? e.target : event.srcElement
 var topelement=ns6? "html" : D.compatMode && D.compatMode!="BackCompat"? "documentElement" : "body"
  while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar")
  {
  firedobj=ns6? firedobj.parentNode : firedobj.parentElement
  }
  if (firedobj.id=="dragbar")
  {
  offsetx=ie4? event.clientX : e.clientX
  offsety=ie4? event.clientY : e.clientY
  tempx=parseInt(crossobj.style.left)
  tempy=parseInt(crossobj.style.top)
  dragapproved=true
  D.onmousemove=drag_drop
  }
 }
D.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

 function hide_box(){if (ie4||ns6){crossobj.style.visibility="hidden";D.getElementById("pop").style.display="none";}else if (ns4){D.pop.visibility="hide";D.pop_content.visibility="hide";}}
 function hide_boxb(){D.getElementById("pop2").style.display="none"}

 function centrePopNoScroll(url,largeur,hauteur)
 { 
 var gauche = (screen.width - largeur)/2
 var haut = (screen.height - hauteur)/2 
 window.open(url,"","width="+largeur+",height="+hauteur+",left="+gauche+",top="+haut+",scrollbars=no") 
 }
//end Ipop
 
//end IPopTournament
function openPromoWin(url)
{
if (ie4||ns6)
{
SpaceTop=document.body.scrollTop;
SpaceLeft=document.body.scrollWidth/2;
PopH=350
PopV=607
PopContV=593
document.getElementById('pop_content2').style.overflow='auto';
document.getElementById('pop2').style.top=SpaceTop+(PopH/2);
document.getElementById('pop2').style.left=SpaceLeft-(PopV/2);
document.getElementById('pop2').style.width=PopV;
document.getElementById('pop2').style.height=PopH;
document.getElementById('pop_content2').style.height=PopH;
document.getElementById('pop2').style.display="block";
document.getElementById('pop_content2').innerHTML = window.cadrex.document.body.innerHTML;
}
else
window.open(url, 'promo1','top=10,left=10,width=450,height=500,scrollbars=1')
}

//small stuff
 function CountClick(){cadreSys.location.href=a+b+c+d;}
 function CtLk(){L=D.links.length;document.write(L);}

