<!-- Begin
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Ultimater :: http://ultimiacian.tripod.com/
Add this snippet to the very beginning of your script. */

if(!document.getElementById){
  if(document.all)
  document.getElementById=function(){
    if(typeof document.all[arguments[0]]!="undefined")
    return document.all[arguments[0]]
    else
    return null
  }
  else if(document.layers)
  document.getElementById=function(){
    if(typeof document[arguments[0]]!="undefined")
    return document[arguments[0]]
    else
    return null
  }
}



function getRefToDivMod( divID, oDoc ) {
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDivNest(divID,oDoc.layers[x].document); }
			return y; } }
	if( document.getElementById ) { return oDoc.getElementById(divID); }
	if( document.all ) { return oDoc.all[divID]; }
	return oDoc[divID];
}

function resizeWinTo( idOfDiv ) {
	var oH = getRefToDivMod( idOfDiv ); if( !oH ) { return false; }
	var x = window; x.resizeTo( screen.availWidth, screen.availWidth );
	var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
	var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
	x.resizeTo( oW + 200, oH + 200 );
	var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
	if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
	else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
	else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
	if( window.opera && !document.childNodes ) { myW += 16; }
	//second sample, as the table may have resized
	var oH2 = getRefToDivMod( idOfDiv );
	var oW2 = oH2.clip ? oH2.clip.width : oH2.offsetWidth;
	var oH2 = oH2.clip ? oH2.clip.height : oH2.offsetHeight;
	x.resizeTo( oW2 + ( ( oW + 200 ) - myW ), oH2 + ( (oH + 200 ) - myH ) );
}
  var NS = (navigator.appName=="Netscape")?true:false;

/*
function centerWindow(){
	var inwidth=0,winH=0;
var spacescroll=50;
var spaceheight=70;
if(parseInt(navigator.appVersion)>3){
if(navigator.appName=="Netscape"){
inwidth=window.innerWidth;
winH=window.innerHeight+35;
spacescroll=40;
spaceheight=82;
}
if(navigator.appName.indexOf("Microsoft")!=-1){
inwidth=document.body.offsetWidth;
winH=document.body.offsetHeight+20;

spaceheight=70;
}
}
//alert(spacescroll);
var _1=document.location.search.substring(1);
param=_1.split("&&");

newRien=param[0].split("=");
newWinL=param[1].split("=");
newWinH=param[2].split("=");
oH = document.getElementById("legende");
var oH = oH.clip ? oH.clip.height : oH.offsetHeight;
rw=parseInt(newWinL[1])+spacescroll;
rh=parseInt(newWinH[1])+oH+spaceheight;


var var_inwidth=inwidth;
var _4=winH;
widthmax=screen.width-80;
heightmax=screen.height-30;
var _5=0;
var _6=0;

		
			
if(rw>widthmax){
	rw=widthmax;
}		
if(rh>heightmax){
	rh=heightmax;
}

		window.resizeTo(rw,rh);
		
		

			window.moveTo((screen.width-rw)/2,(screen.height-rh)/2);

window.focus();
}


// End -->*/
function centerWindow(){
var _1=document.location.search.substring(1);
param=_1.split("&&");
newRien=param[0].split("=");
newWinL=param[1].split("=");
newWinH=param[2].split("=");

newWinL[1]=parseInt(newWinL[1])+50;
window.resizeTo(newWinL[1],newWinH[1]);
var _2=0,winH=0;
if(parseInt(navigator.appVersion)>3){
	if(navigator.appName=="Netscape"){
		_2=window.innerWidth+25;
		winH=window.innerHeight+35;
	}
	if(navigator.appName.indexOf("Microsoft")!=-1){
		_2=document.body.offsetWidth;
		winH=document.body.offsetHeight+20;
	}
}


 if( typeof( window.innerWidth ) == 'number' ) {
     //Non-IE
     myWidth = window.innerWidth;
     myHeight = window.innerHeight;
   } else if( document.documentElement && ( 
document.documentElement.clientWidth || 
document.documentElement.clientHeight ) ) {
     //IE 6+ in 'standards compliant mode'
     myWidth = document.documentElement.clientWidth;
     myHeight = document.documentElement.clientHeight;
   } else if( document.body && ( document.body.clientWidth || 
document.body.clientHeight ) ) {
     //IE 4 compatible
     myWidth = document.body.clientWidth;
     myHeight = document.body.clientHeight;
   }


winH=myHeight;
var _3=_2;
var _4=winH;
alert(_4);
widthmax=screen.width;
widthmax=widthmax-80;
heightmax=screen.height;
heightmax=heightmax-20;
var _5=0;
var _6=0;
if(_3>widthmax){
	alert("1");
_3=widthmax;
_5=1;
}
if(_4>heightmax){
	alert("2");
_4=heightmax;
_6=1;
}
if((_6==1)&&(_5==1)){
	alert("3");
self.moveTo(0,0);
self.resizeTo(screen.width,(screen.height-50));
}else{
if(_5==1){
	alert("4");
self.moveTo(0,(screen.height-_4)/2);
self.resizeTo(screen.width,_4+30);
}else{
if(_6==1){
	alert("5");
self.moveTo((screen.width-_3)/2,0);
self.resizeTo((_3+20),(screen.height-50));
}else{
	alert("6");
self.moveTo((screen.width-_3)/2,(screen.height-_4)/2);
alert((_4+20));
self.resizeTo((_3+20),(_4+20));
}
}
}
self.focus();
}


	
   var NS = (navigator.appName=="Netscape")?true:false;

     function FitPic() {
	 c = document.getElementById("contenu");
	  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  //alert(myWidth);
 // alert(myHeight);
  var oH = 	 (c.clip ? c.clip.height : c.offsetHeight) , oW =  (c.clip ? c.clip.width : c.offsetWidth) + 40;
	
  //alert(oW);
 // alert(oH);
 maxInnerWidth=screen.width-20;
 maxInnerHeight=screen.height-90;
 //alert(maxInnerHeight);
 //alert(oH );
window.resizeBy(Math.min(oW,maxInnerWidth) -myWidth-5,Math.min(oH ,maxInnerHeight)-myHeight + 10);
	
	
	  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  

			window.moveTo((screen.width-myWidth)/2,(screen.height-myHeight)/2);



	 /*

	   c = document.getElementById("contenu");
	    v=(NS)?-46:8;
		var oH = 	 (c.clip ? c.clip.height : c.offsetHeight)+v , oW =  (c.clip ? c.clip.width : c.offsetWidth) + 40;
	
		
		if( !oH || window.doneAlready ) { return; }	// if images are disabled, end the script
		window.doneAlready = true;		//fixes onload issues with Opera and Safari
		var x = window; x.resizeTo( oW + 500, oH + 500 );
		var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
		if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
		else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
		else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
		if( window.opera && !document.childNodes ) { myW += 16; }
		x.resizeTo( oW = oW + ( ( oW + 500 ) - myW ), oH = oH + ( (oH + 500 ) - myH ) );
		*/


      /* iWidth = (NS)?window.innerWidth:document.body.clientWidth;
       iHeight = (NS)?window.innerHeight:document.body.clientHeight;
	   v=(NS)?40:21;
	   a=<xsl:value-of select="$newWidth"/> ;
	   want = <xsl:value-of select="$newWidth"/> + v;
	   		alert("a="+a);
	   		alert("v="+v);
	   		alert("want="+want);
	   		alert("iWidth="+iWidth);
       iWidth =  want - iWidth ;
	   		alert("MODiWidth="+iWidth);
	   oH = document.getElementById("contenu");
		var oH = oH.clip ? oH.clip.height : oH.offsetHeight;

       iHeight = oH+5 - iHeight;
       window.resizeBy(iWidth, iHeight);
       self.focus();*/
     };
