// JavaScript Document
function popp(data,w,h){
	if (!w || !h){
		w=540;
		h=388;
	}
	t=(screen.height-h)/2;
	l=(screen.width-w)/2;
	var Win = window.open(data,'','width='+w+',height='+h+',top='+t+',left='+l+',location=no, statusbar=no, directories=no, resizable=yes, menubar=no, toolbar=no, scrollbars=yes, outerHeight =0, outerWidth = 0');
	Win.focus();
	return;
}

function popen2(urlstr,nom,larg,haut,top,gch,scrl,rsz)
{
	if (haut>(screen.height-30))
      haut = screen.height-30;

   new_win=window.open(urlstr,nom,'toolbar=no,location=no,directories=no,status=no,scrollbars='+scrl+',resizable='+rsz+',menubar=no,width='+larg+',height='+haut+',top='+top+',left='+gch+'');
	new_win.focus();
	return;
}

function swap_m(img_name,to_what) { // Images
		var swap, towhat;
		swap	= eval('document.images.'+img_name);
		towhat='_img/'+to_what+'.gif';
		swap.src	= towhat;
}

function swap_me(img_name,img_src,nochange) // Image des menus de gauche
{
	swap = eval('document.images.'+img_name);
	noext = ((img_src.length)-5);
	state = img_src.substr(noext,1)
	if ((state!=1))
	{
		noext2 = ((img_src.length)-4);
		src_trim = img_src.substring(0,noext2)
		swap.src=src_trim+"1.gif";
	}
	if ((state==1)&&(nochange==''))
	{
		noext2 = ((img_src.length)-5);
		src_trim = img_src.substring(0,noext2)
		swap.src=src_trim+".gif";
	}
}

function hideIt(menu){
	document.getElementById(menu).style.display='none';
}

function divmenu(divID,divHeight)
{
	if (theDoc.getElementById(divID).style.display!="")
	{
		for (i=1;i<(menunbr+1);i++)
		{
			/*menu = 'menu_div_'+i;
			if (menu!=divID){
				setTimeout('hideIt(menu)',2000);//*/
				eval ("document.getElementById('menu_div_"+i+"').style.display='none';");
				//alert(menu);
			//}
		}
		theDoc.getElementById(divID).style.display="";

		if (navigator.platform.indexOf("Mac") != 0)
		{
			theDoc.getElementById(divID).style.height="0";
			speed = ((divHeight/12.5)+8);
			open_it(divHeight,divID,speed)
		}
	}else{
		theDoc.getElementById(divID).style.display="none";
	}
}

function open_it(max,name,hm)
{
	if (hm<0) return;
	maxi = max;
	divname = name;
	act = theDoc.getElementById(divname).style.height;
	act2 = parseInt(act);

	if (act2>=maxi) { clearTimeout(tempoO); theDoc.getElementById(divname).style.height=maxi+"px"; return; };

	y = ((act2-1)+hm);
	hr = hm-1;
	theDoc.getElementById(divname).style.height=y+"px";
	tempoO = setTimeout('open_it(maxi,divname,hr)', 30);
}
