var BoniBor,BoniBod,isLoaded=0;
window.onresize = NSResize;
 function AreaResize()
 {
 BoniBod = 0;//body
 BoniBor = 0;//border
  if(ecranH<700)
  {
 	IncrSize();
  BoniBod = 56;//head
  BoniBor = 28;//border
 	}

  if(isNS)
  {
  ScrWdt = window.innerWidth;
  ScrHgt = window.innerHeight-3;
 	}
 	else
  {
  ScrWdt = D.body.clientWidth;
  ScrHgt = D.body.clientHeight-3;
 	}
  if(ecranH < 600 && ScrHgt < 500 )
  mp_msg(5,'');
  else if(ScrHgt < 370 || ScrWdt < 550)
  mp_msg(4,'');

 factorH = (ScrHgt-56+BoniBor)/(712+BoniBor);
	factorW = (ScrWdt-62)/(1218);
 factorImWH = Math.min(Math.min(factorW,factorH),1);//images up to x 1.20((+-)
 factorWH = factorImWH*1.18;//cross webs correction
	 if(factorWH > 1)
		factorWH = Math.min(factorWH,1.1);
	ArrSpot = 32;//32ie, 32ns / scr arrow height - margin 2
	 if(isNS)
		ArrSpot = 32;

 ScrBarHgt = VerBarHgt = ScrHgt-((56-BoniBod)*factorH)-56+BoniBor;//head / bord
 ScrBarHgt -= (55*factorH);//head / bord
 CatBarHgt = ScrHgt-((300-BoniBod)*factorH)-56+BoniBor-ArrSpot;//top,men,tit,foot, / bord
// smB       = Math.max(CatBarHgt-(40*factorH),1);//butt
 smB       = ScrBarHgt-(200*factorH);//cs,margin

 MovieScr=175*factorWH;//wmv
 divh=hgt=wdt=195;
 	if(isNS){wdt=hgt=175}
  pad=14*factorWH;

// LaliH('SmTBarA',smB);//keep at top
 n = D.all.length;
	namList="";
  for (i=0;i<n;i++)
  {
		si=0;
		nam=D.all(i).id;
   if(nam)
   {
				if(nam.indexOf("Fws")>-1)
    {
    val=nam.replace(/[^0-9]/g,'');
    LaliW(nam,val*factorW);
    }
 		 else if(nam.indexOf("Fhs")>-1)
    {
    val=nam.replace(/[^0-9]/g,'');
    LaliH(nam,val*factorH);
    }
				if(nam.indexOf("Ffs")>-1)
    {
    val=nam.replace(/[^0-9]/g,'');
				 if(val>0)
     D.getElementById(nam).style.width = (val*factorW)+17;//ext. sidebar
    }
				else if(nam.replace(/[0-9]/g,'')=="BA")
    {
				val=205*factorH;
    LaliH(nam,val);
    LaliVA(nam,'bottom');
    }
// 		 else if(nam.indexOf("SmTBar")>-1)
//    LaliH(nam,smB);
    else if(nam.indexOf("Fhws")>-1)
    {
    valW=D.getElementById(nam).style.width;
    valH=D.getElementById(nam).style.height;
    valW=valW.replace(/[^0-9]/g,'');
    valH=valH.replace(/[^0-9]/g,'');
				 if(valW>0)
     LaliW(nam,valW*factorWH);
				 if(valH>0)
     LaliH(nam,valH*factorWH);
    }
    else 
    {
    ImgH=0; ImgW=0;	Hei=0; Wid=0; ImgR=1;
  		namIm = D.all(i).name;
 				if(namIm && nam==namIm+"A")
     {
 					if(D.getElementById(nam))
						{
   			elalli=D.getElementById(nam);
 					hei=elalli.height;
      wid=elalli.width;
						 if(isNS && hei == wid)//bug Mozilla
       wid=elalli.naturalWidth;
							if(wid > 0)
							{
       ImgR = hei/wid;
        if(nam.indexOf("ImgAmz")>-1)
 							{
 						 ImgW = Math.min(195*factorImWH,wid);
   					ImgH = Math.round(ImgW*ImgR);
 						 ImgH = Math.min(195*factorImWH,ImgH);
 						 ImgW = Math.round(ImgH/ImgR);
 							}
 							else
 							{
   					ImgH = Math.round(hei*factorImWH);
   					ImgW = Math.round(ImgH/ImgR);
 							}
							}
      LaliW(nam,ImgW);
      LaliH(nam,ImgH);
							if(nam.indexOf("ImgAmz")>-1)
       LaliAl(nam,'bottom');
						}
					}//if(namIm==
				}//else
			}//if(nam
  }//for
//CS
	
 LaliH('CatScrBarDivA',CatBarHgt);
 LaliH('CatScrBarDivB',CatBarHgt);
 LaliH('CatScrBarDivC',CatBarHgt);
 LaliH('CatScrBarDivD',CatBarHgt);
 LaliH('CatScrBarDivE',CatBarHgt);
 LaliH('MainScrBarDiv',ScrBarHgt);
	LaliH('MainVertBarTD',VerBarHgt);
	LaliH('MainVertBarTDR',VerBarHgt);


	CBhei=435*factorW;
 LaliH('cadreB',CBhei);
 wCs=280*factorW;wCsS=150*factorW;
  if(D.getElementById("pop"))
		{	
  D.getElementById("pop").style.width=wCs;
  D.getElementById("pop_content").style.width=wCs;
		}

	elalli=D.getElementById("RszFulldoc");
	 if(elalli)
		{
  val=elalli.style.fontSize;
  val=val.replace(/[^0-9]/g,'')
		elalli.style.fontSize=(val*factorWH)+"%";
  elalli.style.zIndex=3;	
  elalli.style.visibility='visible';
		}

 //Overflow control
	ScrollHgt = D.body.scrollHeight;
 SpaceNeedH = ScrollHgt-ScrHgt;
	ScrollWdt = D.body.scrollWidth;
 SpaceNeedW = ScrollWdt-ScrWdt;
  if(D.getElementById("MainScrBarDiv") ) 
  {
   if(SpaceNeedH > 0)
   LaliH("MainScrBarDiv",ScrBarHgt-SpaceNeedH);
  }
		if((Math.abs(D.body.scrollHeight-ScrHgt)+Math.abs(D.body.scrollWidth-ScrWdt))>3)
		Backflow(ScrollHgt,ScrBarHgt);

 VerBarHgt = D.body.scrollHeight-((56-BoniBod)*factorH)-56+BoniBor;//head / borders
	LaliH('MainVertBarTD',VerBarHgt);
	LaliH('MainVertBarTDR',VerBarHgt);
 FhNew = D.getElementById('FhsTopML56').scrollHeight;
	LaliH('FhsTopML56',FhNew);
	LaliH('FhsTopMR56',FhNew);

	AdjB = 0;
  if(D.getElementById("FootInfoBlock"))
  AdjB = D.getElementById("FootInfoBlock").scrollHeight;
// smBB = VerBarHgt-Math.max((AdjB),0)-((55)*factorH)-20;
 LaliH('SmBarB',smB);
// D.getElementById("NextSet5").style.display = 'none';
// smBBW = 1200*factorW;
//	LaliW('SmBarB',smBBW);

	AvailH = D.getElementById('MainVertBarTDR').scrollHeight-CatBarHgt-D.getElementById('FhsFootBlock55').scrollHeight-D.getElementById('TopMenu').scrollHeight-34*factorH;
 TopMenHgt=D.getElementById('TopMenu').scrollHeight+(0.5*AvailH);
// 	if(AvailH > 5)
//  LaliH('TopMenu',TopMenHgt);
//  LaliMT('CatScrBarDiv',0.5*AvailH);

 DHTo = D.location.hash; 
 val = DHTo.replace(/[^0-9]/g,'');
  if(val.length==0)
		val=0;
 ShowNxt('0',val);
 isLoaded=1;
 }//End AreaResize

 function IncrSize()
	{
 D.getElementById("Header").style.display = 'none';
 D.getElementById("HideTop4").style.display = 'none';
 D.getElementById("HideTop5").style.display = 'none';
 D.getElementById("HideTop6").style.display = 'none';
 D.getElementById("FhsTopML56").style.display = 'none';
 D.getElementById("FhsTopMR56").style.display = 'none';
 D.getElementById("HideTop1").style.display = 'none';
 D.getElementById("HideTop2").style.display = 'none';
 D.getElementById("HideTop3").style.display = 'none';
 }

 function Backflow(ScrollHgt,ScrBarHgt)
	{
	 if(D.getElementById("MainTable"))
 	D.getElementById("MainTable").style.fontSize='85%';
	 if(D.getElementById("TopMenu"))
 	D.getElementById("TopMenu").style.fontSize='90%';
	 if(D.getElementById("CatScrBarDivA"))
	 D.getElementById("CatScrBarDivA").style.fontSize='85%';
	 if(D.getElementById("CatScrBarDivB"))
 	D.getElementById("CatScrBarDivB").style.fontSize='85%';
	 if(D.getElementById("CatScrBarDivC"))
 	D.getElementById("CatScrBarDivC").style.fontSize='85%';
	 if(D.getElementById("CatScrBarDivD"))
 	D.getElementById("CatScrBarDivD").style.fontSize='85%';
	 if(D.getElementById("CatScrBarDivE"))
 	D.getElementById("CatScrBarDivE").style.fontSize='85%';
	 if(D.getElementById("Header"))
  D.getElementById("Header").style.fontSize='80%';
	 if(D.getElementById("FootInfo"))
 	D.getElementById("FootInfo").style.fontSize='80%';
//	D.getElementById("TitleH1").style.fontSize='90%';
 //Loupe
		if( (Math.abs(D.body.scrollHeight-ScrHgt)+Math.abs(D.body.scrollWidth-ScrWdt)) > 2)
	 {
  D.body.style.overflow='scroll';//150% font-size+
  LaliH("MainScrBarDiv",ScrBarHgt);
		}
 }//End f AssessSize
	
	function AreaFormat() {	D.body.style.overflow='hidden';	D.body.scroll='no'; }

//Common
function DBP(a,d) {D.getElementById(a).style.borderWidth='thin';D.getElementById(a).style.margin='2px';D.getElementById(a).style.backgroundColor=d;}
function UBP(a,d) {D.getElementById(a).style.borderWidth='medium';D.getElementById(a).style.margin='0px';D.getElementById(a).style.backgroundColor=d;}
function OuC(a,c) {D.getElementById(a).style.color=c;}
function OvC(a) {D.getElementById(a).style.color='#FFCC00';}
function Raz(a) {window.location.href=a;}

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

 function initB_drag(e,f,g)
 {
 crossobj = ns6 ? D.getElementById(g) : D.all[g]
 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!=f)
  {
  firedobj=ns6? firedobj.parentNode : firedobj.parentElement
  }
  if (firedobj.id==f)
 	{
  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_dropB
  }
 }
