browser=BrowserType();		// Mémorisation du type de navigateur
os=SystemeExploitation();	// Mémorisation du système d'exploitation
Menu_state=new Menu();		// Racine de la liste des menus de l'écran


function mainMenu(layout,spacing,nbgcolor,hbgcolor,nftcolor,hftcolor,tablebgcolor,cellspacing,cellpadding,bgimage,menu_dirn)
//
// Construction d'un menu
//
// layout correspond à l'agencement du menu : 'horizontal' ou 'vertical' ('horizontal' par défaut)
// spacing correspond à l'espace entre les éléments du menu (0 par défaut)
// nbgcolor correspond à la couleur normale de fond du menu  (noir par défaut)
// hbgcolor correspond à la couleur de fond lorsque le menu est survolé (noir par défaut)
// nftcolor correspond à la couleur d'écriture normale du menu  (blanc par défaut)
// hftcolor correspond à la couleur d'écriture du menu lorsqu'il est survolé (blanc par défaut)
// tablebgcolor correspond à la couleur de séparation des éléments du menu
// cellspacing indique l'espace entre les cellules
// cellpadding indique
// bgimage correspond à l'image de fond utilisée pour le menu
// menu_dir correspond à l'ordre d'affichage des options du menu : 'left' ou 'right' si le menu est horizontal ('right' par défaut)
// before permet de spécifier une chaîne de caractères (au format HTML) qui sera insérée devant chaque élément du menu
// after permet de spécifier une chaîne de caractères (au format HTML) qui sera insérée après chaque élément du menu
// target permet de spécifier la fenêtre cible par défaut
{
	this.itemArray=new Array(30);
        this.iac=0;
	Menu_state.mainmenuArray[Menu_state.mmac++]=this;
	this.count=1;
	this.name="menu"+Menu_state.mmac;
	this.css="MainMenu";
	this.item='';
	this.sp_item='';
	if(arguments.length>=1 && arguments[0]=='vertical')
		{this.layout='vertical';
		Menu_state.mainmenu_layout[Menu_state.mmac]='vertical';}
	else
		{this.layout='horizontal';
		Menu_state.mainmenu_layout[Menu_state.mmac]='horizontal';}
	if(arguments.length>=2 && arguments[1]!='')
		{this.spacing=spacing;}
	else
		{this.spacing=0;}
	if(arguments.length>=3 && arguments[2]!='')
		{this.nbgcolor=nbgcolor;}
	else
		{this.nbgcolor="black";}
	if(arguments.length>=4 && arguments[3]!='')
		{this.hbgcolor=hbgcolor;}
	else
		{this.hbgcolor="black";}
	if(arguments.length>=5 && arguments[4]!='')
		{this.nftcolor=nftcolor;}
	else
		{this.nftcolor="white";}
	if(arguments.length>=6 && arguments[5]!='')
		{this.hftcolor=hftcolor;}
	else
		{this.hftcolor="white";}
	if(arguments.length>=7 && arguments[6]!='')
		{this.TableBgColor=tablebgcolor;}
	else
		{this.TableBgColor='transparent';}
	if(arguments.length>=8 && arguments[7]!='')
		{this.cellspacing=cellspacing;}
	else
		{this.cellspacing=0;}
	if(arguments.length>=9 && arguments[8]!='')
		{this.cellpadding=cellpadding;}
	else
		{this.cellpadding=1;}
	if(arguments.length>=10 && arguments[9]!='')
		{this.bgimage=bgimage;
		this.nbgcolor='transparent';}
	else
		{this.bgimage=null;}
	if(arguments.length>=11 && arguments[10]=='left')
		{Menu_state.mainmenu_dirn[Menu_state.mmac]='left';}
	else
		{Menu_state.mainmenu_dirn[Menu_state.mmac]='right';}
	if(arguments.length>=12 && arguments[11]!='')
		{this.htmlBefore=before;}
	else
		{this.htmlBefore='&nbsp;&nbsp;';}
	if(arguments.length>=13 && arguments[12]!='')
		{this.htmlAfter=after;}
	else
		{this.htmlAfter='&nbsp;&nbsp;';}
	if(arguments.length>=14 && arguments[13]!='')
		{this.target=target;}
	else
		{this.target='_self';}
	if (this.TableBgColor!='transparent' && this.cellspacing>0 && this.nbgcolor != 'transparent')
		{this.grid=true}
	else
		{this.grid=false}
	this.over_img=new Array(30);
	this.out_img=new Array(30);
	this.pad_1=0;
	this.pad_2=0;
	this.layerpadding=0;
	this.itemborder='';
	this.menuborder='';
	this.valign='middle';
	this.divider='&nbsp;';
	this.writeMenu=CreateMenu;
	this.addItem=CreateItemImageLink;
	this.addItems=addItems;
	this.addImages=addImages;
	this.addWithoutLink=PushArguments;
	this.PushArguments=CreateItemNoImageNoLink;
	this.addItemsWithTarget=addItemsWithTarget;
	this.addImagesWithTarget=addImagesWithTarget;
	this.displayMMenu=InitMenu;
};

function InitMenu()
{
	ResetMenu(this);
	Menu_state.menuReady=true;
};

function Menu()
{
	this.menuActive=false;
	this.submenuArray=new Array(50);
	this.mainmenuArray=new Array(5);
	this.mainmenu_dirn=new Array(5);
	this.mainmenu_layout=new Array(5);
	this.activemenuArray=new Array(10);
	this.mmcp=0;
	this.smcp=0;
	this.mmac=0;
	this.smac=0;
	this.amac=0;
	this.mtopoffset=0;
	this.menuoffset=10;
	if(os=="Mac")
		{this.leftoffset=8;}
	else
		{this.leftoffset=0;}
	this.menuReady=false;
	this.menuStatus=1;
	this.ver="1.1";
	this.id="508730";
};

function CreateMenu()
{
	this.displayMMenu();
	if(browser=="NS4")
		{document.writeln('<table ');
		if(this.grid)
			{if (this.TableBgColor != 'transparent')
				{document.writeln('bgcolor="'+this.TableBgColor+'" ');}
			}
		else
			{if (this.nbgcolor != 'transparent')
				{document.writeln('bgcolor="'+this.ncolor+'" ');}
			}
		if(this.bgimage!=null)
			{document.writeln('background="'+this.bgimage+'" ');}
		else
			{document.writeln('background="" ');}
		document.writeln('border="0" cellpadding="'+this.cellpadding+'" cellspacing="'+this.cellspacing+'">');
	}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{document.writeln('<table ');
		if(this.grid)
			{if (this.TableBgColor != 'transparent')
				{document.writeln('bgcolor="'+this.TableBgColor+'" ');}
			}
		else
			{if (this.nbgcolor != 'transparent')
				{document.writeln('bgcolor="'+this.nbgcolor+'" ');}
			}
		if(this.bgimage!=null)
			{document.writeln('background="'+this.bgimage+'" ');}
		document.writeln('border="0" cellpadding="'+this.cellpadding+'" cellspacing="'+this.cellspacing+'" onmouseout="Menu_state.menuActive=false;" onmouseover="Menu_state.menuActive=true;" style="border:'+this.menuborder+'">');
	}
	if(this.layout=='vertical' && this.pad_1!=0)
		{if (this.grid)
			{document.writeln('<tr><td bgcolor="' + this.nbgcolor +'" height="'+this.pad_1+'">&nbsp;</td></tr>');}
		else
			{document.writeln('<tr><td height="'+this.pad_1+'">&nbsp;</td></tr>');}
	}
	if(this.layout=='horizontal')
		{if (this.grid)
			{document.writeln('<tr bgcolor="' + this.nbgcolor +'">');}
		else
			{document.writeln('<tr>');}
		if(this.pad_1!=0)
			{document.writeln('<td width="'+this.pad_1+'">&nbsp;</td>');}
	}
	if(Menu_state.menuStatus==0)
		{document.writeln(this.item);}
	if(this.layout=='horizontal')
		{if(this.pad_2!=0)
			{document.writeln('<td width="'+this.pad_2+'">&nbsp;</td>');}
		document.writeln('</tr>');
	}
	if(this.layout=='vertical' && this.pad_2!=0)
		{if (this.grid)
			{document.writeln('<tr><td bgcolor="' + this.nbgcolor +'" height="'+this.pad_2+'">&nbsp;</td></tr>');}
		else
			{document.writeln('<tr><td height="'+this.pad_2+'">&nbsp;</td></tr>');}
		}
	document.writeln('</table>');
	if(browser=="IE")
		{document.writeln('<div id="'+this.name+'dmy" style="position:absolute;top:0;left:-100;padding:'+this.layerpadding+'px"><a href="" class="'+this.css+'">&nbsp;</a></div>');}
};

function ResetMenu()
{
	Menu_state.menuStatus=0;
};

function CreateItemImageLink(desc,URL,target,out_img,over_img)
{
	var mname=this.name+'mi'+this.count;
	if(arguments.length<3||arguments[2]==null)
		{target=this.target;}
	if(browser=="NS4")
		{desc=this.htmlBefore+'<font color="'+this.nftcolor+'">'+desc+'</font>'+this.htmlAfter;}
	else
		{desc=this.htmlBefore+desc+this.htmlAfter;}
	this.item+=this.sp_item;
	if(this.layout=='vertical')
		{this.item+='<tr>';}
	if(browser=="NS4")
		{this.item+='<td nowrap valign="'+this.valign+'"><ilayer id="'+mname+'clip" z-index="28" visibility="hide">';
	this.item+='<a href="'+URL+'" class="'+this.css+'">';
	if(arguments.length==5)
		{this.item+='<img id="'+this.name+'mi_img'+this.count+'clip" src="'+out_img+'" border="0"></font></a>';}
	else
		{this.item+=desc+'</a>';}
	this.item+='</ilayer>';
	this.item+='<layer id="'+mname+'" class="'+this.css+'" z-index="29" width="300" visibility="hide" ';
	if(this.nbgcolor!='transparent')
		{this.item+='bgColor="'+this.nbgcolor+'" ';}
	this.item+='onmouseover="mainMenuMouseOver(\''+this.name+'\',\''+this.count+'\',\''+Menu_state.mmac+'\',\''+this.hbgcolor+'\',\''+this.hftcolor+'\',\''+over_img+'\',\''+this.macoffset+'\')" onmouseout="mainMenuMouseOut(\''+this.name+'\',\''+this.count+'\',\''+this.nbgcolor+'\',\''+this.nftcolor+'\',\''+out_img+'\')">';this.item+='<a href="'+URL+'" id="'+this.name+'a'+this.count+'" class="'+this.css+'"';if(target!=''){this.item+=' target="'+target+'"';}
	if(URL=='')
		{this.item+=' onclick="return false;"';}
	if(arguments.length==5)
		{this.item+='><img id="'+this.name+'mi_img'+this.count+'" src="'+out_img+'" border="0"></a>';}
	else
		{this.item+='>'+desc+'</a>';}this.item+='</layer></td>';}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{var tStr;tStr=URL.toLowerCase();
		if(tStr.indexOf("javascript:")==0)
			{tStr=URL.substring(11,URL.length);}
		else
			{tStr='window.open(\''+URL+'\',\''+target+'\')';}
		this.item+='<td onclick="'+tStr+'" onmouseover="mainMenuMouseOver(\''+this.name+'\',\''+this.count+'\',\''+Menu_state.mmac+'\', \''+this.hbgcolor+'\',\''+this.hftcolor+'\',\''+over_img+'\',\''+this.macoffset+'\')" onmouseout="mainMenuMouseOut(\''+this.name+'\',\''+this.count+'\', \''+this.nbgcolor+'\',\''+this.nftcolor+'\',\''+out_img+'\')" nowrap valign="'+this.valign+'" style="border:'+this.itemborder+'"><div id="'+mname+'clip" style="position:absolute;width:1;height:1"></div>';
		this.item+='<div id="'+mname+'" style="padding:'+this.layerpadding+'px">';this.item+='<a href="'+URL+'" class="'+this.css+'" style="text-decoration:none"';
		if(browser!="Opera")
			{this.item+=' onclick="return false;"';}
		if(target!='')
			{this.item+=' target="'+target+'"';}
		if(arguments.length==5)
			{this.item+='><img id="'+this.name+'mi_img'+this.count+'" src="'+out_img+'" border="0"></a>';}
		else
			{this.item+='><font id="'+this.name+'a'+this.count+'" style="color:'+this.nftcolor+';">'+desc+'</font></a>';}
		this.item+='</div></td>';
	}
	this.itemArray[this.iac++]=mname;
	if(this.spacing!=0)
		{if(this.layout=='vertical')
			{this.sp_item='<tr><td height="'+this.spacing+'"><font size="1pt">&nbsp;</font></td></tr>';}
		if(this.layout=='horizontal')
			{this.sp_item='<td class="'+this.css+'" width="'+this.spacing+'" align="center"><font color="'+this.nftcolor+'">'+this.divider+'</font></td>';}
	}
	if(this.layout=='vertical')
		{this.item+='</tr>';}
	this.count++;
};

function CreateItemNoImageNoLink(desc)
{
	var mname=this.name+'mi'+this.count;
	if(browser=="NS4")
		{desc=this.htmlBefore+'<font color="'+this.nftcolor+'">'+desc+'</font>'+this.htmlAfter;}
	else
		{desc=this.htmlBefore+desc+this.htmlAfter;}
	this.item+=this.sp_item;
	if(this.layout=='vertical')
		{this.item+='<tr>';}
	if(browser=="NS4")
		{this.item+='<td nowrap valign="'+this.valign+'" class="'+this.css+'"><ilayer id="'+mname+'clip" z-index="28" visibility="hide">';
		this.item+=desc;
		this.item+='</ilayer>';
		this.item+='<layer id="'+mname+'" z-index="29" width="300" visibility="hide" ';
		if(this.nbgcolor!='transparent')
			{this.item+='bgColor="'+this.nbgcolor+'" ';}
		this.item+='>';
	}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{this.item+='<td nowrap valign="'+this.valign+'" style="border:'+this.itemborder+'" class="'+this.css+'"><div id="'+mname+'clip" style="position:absolute;width:1;height:1"></div>';
		this.item+='<div id="'+mname+'" style="padding:'+this.layerpadding+'px; color:'+this.nftcolor+'">';
	}
	this.item+=desc;
	if(browser=="NS4")
		{this.item+='</layer></td>';}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{this.item+='</div></td>';}
	this.itemArray[this.iac++]=mname;
	if(this.spacing!=0)
		{if(this.layout=='vertical')
			{this.sp_item='<tr><td height="'+this.spacing+'"><font size="1pt">&nbsp;</font></td></tr>';}
		if(this.layout=='horizontal')
			{this.sp_item='<td class="'+this.css+'" width="'+this.spacing+'" align="center"><font color="'+this.nftcolor+'">'+this.divider+'</font></td>';}
	}
	if(this.layout=='vertical')
		{this.item+='</tr>';}
	this.count++;
};

function loadMenu()
{
	if((browser=="NS6"&&version==6.1)||browser=="IE")
		{for(var i=0;i<Menu_state.smac;i++)
			{var menu=Menu_state.submenuArray[i];
			var name=menu.name;
			var count=name.substring(name.indexOf("menu")+2,name.indexOf("sm"));
			if(name.indexOf("i")==-1)
				{var t_name=name.replace("sm","mi");
				var main_menu=Menu_state.mainmenuArray[parseInt(count)-1];
				if(main_menu.layout=='vertical')
					{if(Menu_state.mainmenu_dirn[parseInt(count)]=='right')
						{SetEltLeftPosition(name,GetEltPageX(t_name+'clip')+GetEltWidth(t_name));}
					else
						{SetEltLeftPosition(name,GetEltPageX(t_name+'clip')-GetEltWidth(t_name));}
					SetEltTop(name,GetEltPageY(t_name+'clip'));
				}
				if(main_menu.layout=='horizontal')
					{SetEltLeftPosition(name,GetEltPageX(t_name+'clip'));
					SetEltTop(name,GetEltPageY(t_name+'clip')+GetEltHeight(t_name));}
				}
			else
				{var t_name=name.substring(0,name.lastindexOf("i"));
				var u_name=t_name+"itm"+name.substring(name.lastindexOf("i")+1)+"clip";
				if(Menu_state.mainmenu_dirn[parseInt(count)]=='right')
					{SetEltLeftPosition(name,GetEltPageX(t_name)+GetEltWidth(t_name)-Menu_state.menuoffset);}
				else
					{SetEltLeftPosition(name,GetEltPageX(t_name)-GetEltWidth(name)+Menu_state.menuoffset);}
				SetEltTop(name,GetEltPageY(t_name)+GetEltPageY(u_name));
			}
		}
	}
	if(browser=="NS4")
		{for(var i=0;i<Menu_state.mmac;i++)
			{var menu=Menu_state.mainmenuArray[i];
			var width=0;
			var height=0;
			if(menu.layout=='vertical')
				{for(var j=0;j<menu.iac;j++)
				{if(GetEltWidth(menu.itemArray[j]+'clip')>width)
					{width=GetEltWidth(menu.itemArray[j]+'clip');}
				}
			}
			for(var j=0;j<menu.iac;j++)
				{if(menu.layout=='horizontal')
					{width=GetEltWidth(menu.itemArray[j]+'clip');}
				SetEltWidth(menu.itemArray[j],width);
				SetEltLeftPosition(menu.itemArray[j],GetEltPageX(menu.itemArray[j]+'clip'));
				SetEltTop(menu.itemArray[j],GetEltPageY(menu.itemArray[j]+'clip'));
				FlipFlopEltVisibility(menu.itemArray[j],true);
			}
		}
		for(var i=0;i<Menu_state.smac;i++)
			{var menu=Menu_state.submenuArray[i];
			var width=0;
			for(var j=0;j<menu.iac;j++)
				{if(GetEltWidth(menu.itemArray[j]+'clip',menu.name)>width)
					{width=GetEltWidth(menu.itemArray[j]+'clip',menu.name);}
			}
			SetEltWidth(menu.name,width+2);
			for(var j=0;j<menu.iac;j++)
				{SetEltWidth(menu.itemArray[j],width,menu.name);
				SetEltLeftPosition(menu.itemArray[j],1,menu.name);
				SetEltTop(menu.itemArray[j],GetEltPageY(menu.itemArray[j]+'clip',menu.name)-GetEltPageY(menu.name),menu.name);
			}
		}
	}
};

function mainMenuMouseOver(name,count,mmac,bgcolor,ftcolor,img,macoffset)
{
	var left;
	var top;
	var nm1=name+'sm'+count;
	var nm2=name+'mi'+count;
	if(browser!="Opera")
		{SetEltBackgroundColor(nm2,bgcolor);
                SetEltForegroundColor(name+'a'+count,ftcolor);
	}
	RefreshMenu();
	if(browser=="NS4")
		{if(LayerExists(nm1))
			{Menu_state.activemenuArray[Menu_state.amac++]=nm1;
			if(Menu_state.mainmenu_layout[mmac]=="horizontal")
				{left=GetEltPageX(nm2);
				top=GetEltPageY(nm2)+GetEltHeight(nm2);
				SetEltLeftPosition(nm1,left);
				SetEltTop(nm1,top);
			}
			if(Menu_state.mainmenu_layout[mmac]=="vertical")
				{if(Menu_state.mainmenu_dirn[mmac]=='right')
					{left=GetEltPageX(nm2)+GetEltWidth(nm2);
					SetEltLeftPosition(nm1,left);}
				else
					{left=GetEltPageX(nm2)-GetEltWidth(nm1);
					SetEltLeftPosition(nm1,left);}
				top=GetEltPageY(nm2);
				SetEltTop(nm1,top);
			}
		}
	}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{if(LayerExists(nm1))
			{Menu_state.activemenuArray[Menu_state.amac++]=nm1;
			if(Menu_state.mainmenu_layout[mmac]=="horizontal")
				{if(os=="Mac"&&browser=="IE")
					{top=GetEltPageY(nm2+'clip')+GetEltHeight(nm2)+GetEltHeight(name.substring(0,3)+'dmy')+Menu_state.mtopoffset;}
				else
					{top=GetEltPageY(nm2+'clip')+GetEltHeight(nm2);}
				left=GetEltPageX(nm2+'clip');
				SetEltTop(nm1,top);
				SetEltLeftPosition(nm1,left);
			}
			if(Menu_state.mainmenu_layout[mmac]=='vertical')
				{if(Menu_state.mainmenu_dirn[mmac]=='right')
					{left=GetEltPageX(nm2+'clip')+GetEltWidth(nm2);
					SetEltLeftPosition(nm1,left);}
				else
					{left=GetEltPageX(nm2+'clip')-GetEltWidth(nm1);SetEltLeftPosition(nm1,left);}
				if(os=="Mac"&&browser=="IE")
					{top=GetEltPageY(nm2+'clip')+GetEltHeight(name.substring(0,3)+'dmy');}
				else
					{top=GetEltPageY(nm2+'clip');}
				SetEltTop(nm1,top);
			}
		}
	}
	if(browser=="NS4"&&img!="undefined"&&document.layers[nm2].document.images.length!=0)
		{document.layers[nm2].document.images[0].src=img;}
	if((browser=="IE"||browser=="NS6"||browser=="Opera")&&document.images[name+'mi_img'+count])
		{document.images[name+'mi_img'+count].src=img;}
	Menu_state.menuActive=true;
	if(LayerExists(nm1))
		{if(left<GetWindowLeft())
			{SetEltLeftPosition(nm1,GetWindowLeft());}
		if(left+GetEltWidth(nm1)>GetWindowWidth())
			{SetEltLeftPosition(nm1,GetWindowWidth()-GetEltWidth(nm1));}
		if(top<GetWindowTop())
			{SetEltTop(nm1,GetWindowTop());}
		if(top+GetEltHeight(nm1)>GetWindowHeight())
			{SetEltTop(nm1,GetWindowHeight()-GetEltHeight(nm1));}
	}
	FlipFlopEltVisibility(nm1,true);
};

function mainMenuMouseOut(name,count,bgcolor,ftcolor,img)
{
	if(browser!="Opera")
		{SetEltBackgroundColor(name+'mi'+count,bgcolor);
		SetEltForegroundColor(name+'a'+count,ftcolor);}
	Menu_state.menuActive=false;
	if(browser=="NS4"&&img!="undefined"&&document.layers[name+'mi'+count].document.images.length!=0)
		{document.layers[name+'mi'+count].document.images[0].src=img;}
	if((browser=="IE"||browser=="NS6"||browser=="Opera")&&document.images[name+'mi_img'+count])
		{document.images[name+'mi_img'+count].src=img;}
	setTimeout("RefreshMenu()",300);
};

function subMenu(menuName,nbgcolor,hbgcolor,nftcolor,hftcolor,tablebgcolor,cellspacing,cellpadding,bgimage,before,after,target)
//
// Construction d'un sous menu
//
// menuname correspond à l'option du menu principal à laquelle rattacher le sous menu
// nbgcolor correspond à la couleur normale de fond du sous menu  (noir par défaut)
// hbgcolor correspond à la couleur de fond lorsque le sous menu est survolé (noir par défaut)
// nftcolor correspond à la couleur d'écriture normale du sous menu  (blanc par défaut)
// hftcolor correspond à la couleur d'écriture du sous menu lorsqu'il est survolé (blanc par défaut)
// tablebgcolor correspond à la couleur de séparation des éléments du menu
// cellspacing indique l'espace entre les cellules
// cellpadding indique
// bgimage correspond à l'image de fond utilisée pour le sous menu
// before permet de spécifier une chaîne de caractères (au format HTML) qui sera insérée devant chaque élément du sous menu
// after permet de spécifier une chaîne de caractères (au format HTML) qui sera insérée après chaque élément du sous menu
// target permet de spécifier la fenêtre cible par défaut
{
	Menu_state.submenuArray[Menu_state.smac++]=this;
	this.itemArray=new Array(50);
	this.iac=0;
	if(arguments.length>=2 && arguments[1]!='')
		{this.nbgcolor=nbgcolor;}
	else
		{this.nbgcolor="black";}
	if(arguments.length>=3 && arguments[2]!='')
		{this.hbgcolor=hbgcolor;}
	else
		{this.hbgcolor="black";}
	if(arguments.length>=4 && arguments[3]!='')
		{this.nftcolor=nftcolor;}
	else
		{this.nftcolor="white";}
	if(arguments.length>=5 && arguments[4]!='')
		{this.hftcolor=hftcolor;}
	else
		{this.hftcolor="white";}
	if(arguments.length>=6 && arguments[5]!='')
		{this.TableBgColor=tablebgcolor;}
	else
		{this.TableBgColor='transparent';}
	if(arguments.length>=7 && arguments[6]!='')
		{this.cellspacing=cellspacing;}
	else
		{this.cellspacing=0;}
	if(arguments.length>=8 && arguments[7]!='')
		{this.cellpadding=cellpadding;}
	else
		{this.cellpadding=1;}
	if(arguments.length>=9 && arguments[8]!='')
		{this.bgimage=bgimage;
		this.nbgcolor='transparent';}
	else
		{this.bgimage=null;}
	if(arguments.length>=10 && arguments[9]!='')
		{this.htmlBefore=before;}
	else
		{this.htmlBefore='&nbsp;&nbsp;';}
	if(arguments.length>=11 && arguments[10]!='')
		{this.htmlAfter=after;}
	else
		{this.htmlAfter='&nbsp;&nbsp;';}
	if(arguments.length>=12 && arguments[11]!='')
		{this.target=target;}
	else
		{this.target='_self';}
	if (this.TableBgColor!='transparent' && this.cellspacing > 0 && this.nbgcolor != 'transparent')
		{this.grid=true}
	else
		{this.grid=false}
	this.css="SubMenu";
	this.name="menu"+Menu_state.mmac+"sm"+menuName;
	this.count=1;
	this.item='';
	this.layerpadding=0;
	this.itemborder='';
	this.menuborder='';
	this.writeMenu=CreateSubMenuLayer;
	this.addItem=CreateSubItemLink;
	this.addItems=addItems;
	this.addWithoutLink=PushArguments;
	this.PushArguments=CreateSubItemNoLink;
	this.addItemsWithTarget=addItemsWithTarget;
};

function CreateSubMenuLayer()
{
	if(browser=="NS4")
		{document.writeln('<layer id="'+this.name+'" ');
		if (this.grid)
		{if(this.TableBgColor!='transparent')
			{document.writeln('bgColor="'+this.TableBgColor+'" ');}
		}
		if(this.bgimage!=null)
			{document.writeln('background="'+this.bgimage+'" ');}
		if (this.grid)
			{document.writeln('visibility="hide" z-index="30" onmouseout="Menu_state.menuActive=false;" onmouseover="Menu_state.menuActive=true;"><layer visibility="hide"></layer><table border="0" cellspacing="'+this.cellspacing+'" cellpadding="'+this.cellpadding+'" background="" bgcolor="'+ this.TableBgColor +'" ');}
		else
			{document.writeln('visibility="hide" z-index="30" onmouseout="Menu_state.menuActive=false;" onmouseover="Menu_state.menuActive=true;"><layer visibility="hide"></layer><table border="0" cellspacing="'+this.cellspacing+'" cellpadding="'+this.cellpadding+'" background="" ');}
		if(this.nbgcolor!='transparent')
			{document.writeln('bgColor="'+this.nbgcolor+'" ');}
		document.writeln('>');
		document.writeln(this.item);
		document.writeln('</table></layer>');
	}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{if (this.grid)
			{document.writeln('<div align="left" id="'+this.name+'" style="position:absolute;z-index:30;border:'+this.menuborder+';visibility:hidden" onmouseout="Menu_state.menuActive=false;" onmouseover="Menu_state.menuActive=true;">');
			document.writeln('<table border="0" style="left:0;top:0" cellspacing="'+this.cellspacing+'" cellpadding="'+this.cellpadding+'" background="" bgcolor="'+ this.TableBgColor +'"');
		}
		else
			{document.writeln('<div align="left" id="'+this.name+'" style="position:absolute;background-color:'+this.nbgcolor+';z-index:30;border:'+this.menuborder+';visibility:hidden" onmouseout="Menu_state.menuActive=false;" onmouseover="Menu_state.menuActive=true;">');
			document.writeln('<table border="0" style="'+this.itemborder+'" cellspacing="'+this.cellspacing+'" cellpadding="'+this.cellpadding+'" ');
		}
		if(this.bgimage!=null)
			{document.writeln('background="'+this.bgimage+'" ');}
		document.writeln('id="'+this.name+'table">'+this.item+'</table></div>');
	}
	if(!Menu_state.menuReady)
		{TranslateURL();}
	if(browser=="NS6"||(browser=="IE"&&version==4))
		{SetEltWidth(this.name,GetEltWidth(this.name+'table'));}
	SetEltLeftPosition(this.name,8);
	SetEltTop(this.name,8);
};

function CreateSubItemLink(desc,URL,target)
{
	if(arguments.length<3)
		{target=this.target;}
	desc=this.htmlBefore+desc+this.htmlAfter;
	var mname=this.name+'itm'+this.count;
	if(browser=="NS4")
		{this.item+='<tr><td valign="middle" nowrap>';
		this.item+='<ilayer z-index="29" id="'+mname+'clip" class="'+this.css+'" visibility="hide">'+desc+'</ilayer>';
		this.item+='<layer z-index="30" id="'+mname+'" class="'+this.css+'" ';
		if(this.nbgcolor!='transparent')
			{this.item+='bgColor="'+this.nbgcolor+'" ';}this.item+='width="350" onmouseover="subMenuMouseOver(\''+this.name+'\',\''+this.count+'\',\''+this.hbgcolor+'\',\''+this.hftcolor+'\',\''+Menu_state.mmac+'\')" onmouseout="subMenuMouseOut(\''+this.name+'\',\''+this.count+'\',\''+this.nbgcolor+'\',\''+this.nftcolor+'\')"><a href="'+URL+'" class="'+this.css+'"';
		if(target!='')
			{this.item+=' target="'+target+'"';}
		if(URL=='')
			{this.item+=' onclick="return false;"';}
		this.item+='><font color="'+this.nftcolor+'">'+desc+'</font></a></layer>';
		this.item+='</td></tr>';this.itemArray[this.iac++]=mname;
	}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{var tStr;
		tStr=URL.toLowerCase();
		if(tStr.indexOf("javascript:")==0)
			{tStr=URL.substring(11,URL.length);}
		else
			{tStr='window.open(\''+URL+'\',\''+target+'\')';}
		this.item+='<tr><td class="'+this.css +'"'
		if (this.TableBgColor != 'transparent')
			{this.item+=' bgcolor="'+this.nbgcolor+'"'}
		this.item+=' valign="middle" nowrap onclick="'+tStr+'" onmouseover="subMenuMouseOver(\''+this.name+'\', \''+this.count+'\',\''+this.hbgcolor+'\',\''+this.hftcolor+'\',\''+Menu_state.mmac+'\')" onmouseout="subMenuMouseOut(\''+this.name+'\', \''+this.count+'\',\''+this.nbgcolor+'\',\''+this.nftcolor+'\')" style="border:'+this.itemborder+'"><div id="'+mname+'clip" style="position:absolute;width:1;height:1"></div>';
		this.item+='<div id="'+mname+'" style="padding:'+this.layerpadding+'px"><a href="'+URL+'" class="'+this.css+'" style="text-decoration:none"';
		if(browser!="Opera")
			{this.item+=' onclick="return false;"';}
		if(target!='')
			{this.item+=' target="'+target+'"';}
		this.item+='><font id="'+this.name+'a'+this.count+'" style="color:'+this.nftcolor+';">'+desc+'</font></a></div></td></tr>';
	}
	this.count++;
};

function CreateSubItemNoLink(desc)
{
	if(arguments.length<3)
		{target=this.target;}
	if(browser=="NS4")
		{desc=this.htmlBefore+'<font color="'+this.nftcolor+'">'+desc+'</font>'+this.htmlAfter;}
	else
		{desc=this.htmlBefore+desc+this.htmlAfter;}
	var mname=this.name+'itm'+this.count;
	if(browser=="NS4")
		{this.item+='<tr><td valign="middle" nowrap>';
		this.item+='<ilayer z-index="29" id="'+mname+'clip" class="'+this.css+'" visibility="hide">'+desc+'</ilayer>';
		this.item+='<layer z-index="30" class="'+this.css+'" id="'+mname+'" ';
		if(this.nbgcolor!='transparent')
			{this.item+='bgColor="'+this.nbgcolor+'" ';}
		this.item+='width="350">'+desc+'</layer>';this.item+='</td></tr>';
		this.itemArray[this.iac++]=mname;
	}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{this.item+='<tr><td valign="middle" class="'+this.css+'" nowrap style="border:'+this.itemborder+'"><div id="'+mname+'clip" style="position:absolute;width:1;height:1"></div>';
		this.item+='<div id="'+mname+'" style="padding:'+this.layerpadding+'px;color:'+this.nftcolor+'">'+desc+'</div></td></tr>';
	}
	this.count++;
};

function subMenuMouseOver(name,count,bgcolor,fgcolor,mmac)
{
	var tmp_amac=Menu_state.amac;
	var left;
	var top;
	var nm1=name+'i'+count;
	var nm2=name+'itm'+count;
	for(var i=0;i<tmp_amac;i++)
		{if(Menu_state.activemenuArray[i]!=name)
			{if(nm1.indexOf(Menu_state.activemenuArray[i])==-1)
				{FlipFlopEltVisibility(Menu_state.activemenuArray[i],false);
				Menu_state.amac--;}
		}
	}
	if(browser!="Opera")
		{SetEltBackgroundColor(nm2,bgcolor,name);
                SetEltForegroundColor(name+'a'+count,fgcolor,name);}
	if(browser=="NS4")
		{if(LayerExists(nm1))
			{Menu_state.activemenuArray[Menu_state.amac++]=nm1;
			if(Menu_state.mainmenu_dirn[mmac]=='right')
				{left=GetEltPageX(name)+GetEltWidth(name)-Menu_state.menuoffset;SetEltLeftPosition(nm1,left);}
			else
				{if(GetEltPageX(name)-GetEltWidth(nm1)+Menu_state.menuoffset>0)
					{left=GetEltPageX(name)-GetEltWidth(nm1)+Menu_state.menuoffset;SetEltLeftPosition(nm1,left);}
				else
					{left=0;SetEltLeftPosition(nm1,0);}
			}
			top=GetEltPageY(nm2,name);
			SetEltTop(nm1,top);
		}
	}
	if(browser=="IE"||browser=="NS6"||browser=="Opera")
		{if(LayerExists(nm1))
			{Menu_state.activemenuArray[Menu_state.amac++]=nm1;
			if(Menu_state.mainmenu_dirn[mmac]=='right')
				{left=GetEltLeftPosition(name)+GetEltWidth(name)-Menu_state.menuoffset+Menu_state.leftoffset;SetEltLeftPosition(nm1,left);}
			else
				{left=GetEltLeftPosition(name)-GetEltWidth(name)+Menu_state.menuoffset;SetEltLeftPosition(nm1,left);}
			if(browser=="IE")
				{top=GetEltPageY(name)+GetEltPageY(nm2+'clip');
				SetEltTop(nm1,top);
			}
			if(browser=="NS6")
				{if(version==6.1)
					{top=GetEltPageY(name)+GetEltPageY(nm2+'clip');
					SetEltTop(nm1,top);}
				else
					{top=GetEltPageY(nm2+'clip');SetEltTop(nm1,top);}
			}
			if(browser=="Opera")
				{top=GetEltPageY(name)+GetEltPageY(nm2+'clip');
				SetEltTop(nm1,top);}
		}
	}
	if(LayerExists(nm1))
		{if(left<GetWindowLeft())
			{SetEltLeftPosition(nm1,GetWindowLeft());}
		if(left+GetEltWidth(nm1)>GetWindowWidth())
			{SetEltLeftPosition(nm1,GetWindowWidth()-GetEltWidth(nm1));}
		if(top<GetWindowTop())
			{SetEltTop(nm1,GetWindowTop());}
		if(top+GetEltHeight(nm1)>GetWindowHeight())
			{SetEltTop(nm1,GetWindowHeight()-GetEltHeight(nm1));}
		FlipFlopEltVisibility(nm1,true);
	}
	Menu_state.menuActive=true;
};

function subMenuMouseOut(name,count,bgcolor,fgcolor)
{
	if(browser!="Opera")
		{SetEltBackgroundColor(name+'itm'+count,bgcolor,name);
		SetEltForegroundColor(name+'a'+count,fgcolor,name);}
	setTimeout("RefreshMenu()",300);
};

function addItems()
{
	for(var i=0;i<arguments.length;i+=2)
		{this.addItem(arguments[i],arguments[i+1]);
	}
};

function PushArguments()
{
	for(var i=0;i<arguments.length;i++)
		{this.PushArguments(arguments[i]);}
};

function addImages()
{
	for(var i=0;i<arguments.length;i+=3)
		{this.addItem(null,arguments[i],null,arguments[i+1],arguments[i+2]);}
};

function addImagesWithTarget()
{
	for(var i=0;i<arguments.length;i+=4)
		{this.addItem(null,arguments[i],arguments[i+1],arguments[i+2],arguments[i+3]);}
};

function addItemsWithTarget()
{
	for(var i=0;i<arguments.length;i+=3)
		{this.addItem(arguments[i],arguments[i+1],arguments[i+2]);}
};

function RefreshMenu()
{
	if(!Menu_state.menuActive)
		{for(var i=0;i<Menu_state.amac;i++)
			{FlipFlopEltVisibility(Menu_state.activemenuArray[i],false);}
		Menu_state.amac=0;
		}
};

function displayMenu()
{
	for(var i=Menu_state.mmcp;i<Menu_state.mmac;i++)
		{Menu_state.mainmenuArray[i].writeMenu();}
	Menu_state.mmcp=Menu_state.mmac;
};

function createMenu()
{
	for(var i=Menu_state.smcp;i<Menu_state.smac;i++)
		{Menu_state.submenuArray[i].writeMenu();}
	Menu_state.smcp=Menu_state.smac;
};

window.onresize=SetNSsize;
origWidth=window.innerWidth;
origHeight=window.innerHeight;

function SetNSsize()
{
	if(browser=='NS4'&&origWidth==window.innerWidth&&origHeight==window.innerHeight)
		{return;}
};

