browser=find_browser();
os=find_os();
ajm_state=new MenuObj();

function MenuObj()
{
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.scrolling=false;
this.scroll_active=false;
this.scroll_ele="";
this.mtopoffset=0;
this.menuoffset=10;
this.sticky_exists = false;
if(os=="Mac")
  {this.leftoffset=8;}
  else
  {this.leftoffset=0;}
this.ver="1.63";
this.id="40190";
};

function mainMenu(layout,spacing,nbgcolor,hbgcolor,nftcolor,hftcolor,bgimage,menu_dirn,divider)
{
this.itemArray=new Array(30);
this.iac=0;
ajm_state.mainmenuArray[ajm_state.mmac++]=this;
this.count=1;
this.name="aj"+ajm_state.mmac;
this.css="iwmainmenu";
this.item='';
this.htmlBefore='  ';
this.htmlAfter='  ';
this.sp_item='';
if(arguments.length>=1&&arguments[0]=='vertical')
  {
  this.layout='vertical';
  ajm_state.mainmenu_layout[ajm_state.mmac]='vertical';
  }
  else
  {
  this.layout='horizontal';
  ajm_state.mainmenu_layout[ajm_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.bgimage=bgimage;
  this.nbgcolor='transparent';
  }
  else
  {this.bgimage=null;}
if(arguments.length>=8&&arguments[7]=='left')
  {ajm_state.mainmenu_dirn[ajm_state.mmac]='left';}
  else
  {ajm_state.mainmenu_dirn[ajm_state.mmac]='right';}
if(arguments.length>=9&&arguments[8]!='')
  {this.divider=divider;}
  else
  {this.divider=' ';}
this.over_img=new Array(30);
this.out_img=new Array(30);
this.pad_1=0;
this.pad_2=0;
this.cellpadding=1;
this.layerpadding=0;
this.target='_self';
this.valign='middle';
this.menuborder='';
this.itemborder='';
this.sticky = false;
this.sticky_x = 0;
this.sticky_y = 0;
this.sticky_scroll_x = false;
this.sticky_scroll_y = false;
this.writeMenu=writeMenu;
this.addItem=addItem;
this.addItems=addItems;
this.addImages=addImages;
this.addWithoutLink=addWithoutLink;
this.addItemSansLink=addItemSansLink;
this.addItemsWithTarget=addItemsWithTarget;
this.addImagesWithTarget=addImagesWithTarget;
};


function writeMenu() // writeMenu
{
if(browser=="NS4")
  {
//  if (this.sticky) {document.writeln('<layer id="'+this.name+'" z-index="29">');}
  document.writeln('<table ');
  if(this.nbgcolor!='transparent')
    {document.writeln('bgcolor="'+this.nbgcolor+'" ');}
  if(this.bgimage!=null)
    {document.writeln('background="'+this.bgimage+'" ');}
    else
    {document.writeln('background="" ');}
  document.writeln('border="0" cellpadding="'+this.cellpadding+'" cellspacing="0">');
//  if (this.sticky) {document.writeln('</layer>');}
  }
if(browser=="IE"||browser=="NS6"||browser=="Opera")
  {
  if (this.sticky && browser=="IE")
    {
    document.writeln('<div align="left" id="'+this.name+'" style="position:absolute;z-index:29;left:'+this.sticky_x+';top:'+this.sticky_y+'">');ajm_state.sticky_exists = true;
    }
  
  document.writeln('<table ');
  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="0" onmouseout="ajm_state.menuActive=false;" onmouseover="ajm_state.menuActive=true;" style="border:'+this.menuborder+'">');
  }
if(this.layout=='vertical'&&this.pad_1!=0)
  {document.writeln('<tr><td height="'+this.pad_1+'"> </td></tr>');}
if(this.layout=='horizontal')
  {
  document.writeln('<tr>');
  if(this.pad_1!=0)
    {document.writeln('<td width="'+this.pad_1+'"> </td>');}
  }
document.writeln(this.item);
if(this.layout=='horizontal')
  {
  if(this.pad_2!=0)
    {document.writeln('<td width="'+this.pad_2+'"> </td>');}
  document.writeln('</tr>');
  }
if(this.layout=='vertical'&&this.pad_2!=0)
  {document.writeln('<tr><td height="'+this.pad_2+'"> </td></tr>');}
document.writeln('</table>');
if(browser=="IE")
  {
	if(this.sticky)
		{document.writeln('</div>');}
  document.writeln('<div id="'+this.name+'dmy" style="position:absolute;top:0;left:-100;padding:'+this.layerpadding+'px"><a href="" class="'+this.css+'"> </a></div>');
  }
};


function addItem(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+'\',\''+ajm_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+'\',\''+ajm_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"> </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 addItemSansLink(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"> </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)
  {
  for(var i=0;i<ajm_state.smac;i++)
    {
    var menu=ajm_state.submenuArray[i];
    var name=menu.name;
    var count=name.substring(name.indexOf("aj")+2,name.indexOf("sm"));
    if(name.indexOf("i")==-1)
			{
			var t_name=name.replace("sm","mi");
			var main_menu=ajm_state.mainmenuArray[parseInt(count)-1];
			if(main_menu.layout=='vertical')
				{
				if(ajm_state.mainmenu_dirn[parseInt(count)]=='right')
					{set_ele_x_pos(name,get_ele_x_pos_2(t_name+'clip')+get_ele_width(t_name));}
					else
					{set_ele_x_pos(name,get_ele_x_pos_2(t_name+'clip')-get_ele_width(t_name));}
				set_ele_y_pos(name,get_ele_y_pos_1(t_name+'clip'));
				}
			if(main_menu.layout=='horizontal')
				{
				set_ele_x_pos(name,get_ele_x_pos_2(t_name+'clip'));
				set_ele_y_pos(name,get_ele_y_pos_1(t_name+'clip')+get_ele_height(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(ajm_state.mainmenu_dirn[parseInt(count)]=='right')
			  {set_ele_x_pos(name,get_ele_x_pos_2(t_name)+get_ele_width(t_name)-ajm_state.menuoffset);}
			  else
			  {set_ele_x_pos(name,get_ele_x_pos_2(t_name)-get_ele_width(name)+ajm_state.menuoffset);}
			set_ele_y_pos(name,get_ele_y_pos_1(t_name)+get_ele_y_pos_1(u_name));
			}
		}
	}
if (browser=="IE" && ajm_state.sticky_exists)
	{
	setTimeout("reposition()", 200);
	}
if(browser=="NS4")
  {
  for(var i=0;i<ajm_state.mmac;i++)
  	{
  	var menu=ajm_state.mainmenuArray[i];
  	var width=0;
  	var height=0;
  	if(menu.layout=='vertical')
			{
			for(var j=0;j<menu.iac;j++)
				{
				if(get_ele_width(menu.itemArray[j]+'clip')>width)
					{width=get_ele_width(menu.itemArray[j]+'clip');}
				}
			}
  	for(var j=0;j<menu.iac;j++)
  	  {
  	  if(menu.layout=='horizontal')
  	    {width=get_ele_width(menu.itemArray[j]+'clip');}
  	  set_ele_width(menu.itemArray[j],width);
  	  set_ele_x_pos(menu.itemArray[j],get_ele_x_pos_2(menu.itemArray[j]+'clip'));
  	  set_ele_y_pos(menu.itemArray[j],get_ele_y_pos_1(menu.itemArray[j]+'clip'));
  	  show_ele(menu.itemArray[j],true);
  	  }
  	}
  for(var i=0;i<ajm_state.smac;i++)
    {
    var menu=ajm_state.submenuArray[i];
    var width=0;
    for(var j=0;j<menu.iac;j++)
      {
      if(get_ele_width(menu.itemArray[j]+'clip',menu.name)>width)
        {width=get_ele_width(menu.itemArray[j]+'clip',menu.name);}
      }
    set_ele_width(menu.name,width+2);
    for(var j=0;j<menu.iac;j++)
    	{
    	set_ele_width(menu.itemArray[j],width,menu.name);
			set_ele_x_pos(menu.itemArray[j],1,menu.name);
			set_ele_y_pos(menu.itemArray[j],get_ele_y_pos_1(menu.itemArray[j]+'clip',menu.name)-get_ele_y_pos_1(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")
	{
	set_bg_col(nm2,bgcolor);
	set_fg_col(name+'a'+count,ftcolor);
	}
hide_all();
if(browser=="NS4")
	{
	if(find_layer(nm1))
		{
		ajm_state.activemenuArray[ajm_state.amac++]=nm1;
		if(ajm_state.mainmenu_layout[mmac]=="horizontal")
			{
			left=get_ele_x_pos_2(nm2);
			top=get_ele_y_pos_1(nm2)+get_ele_height(nm2);
			set_ele_x_pos(nm1,left);
			set_ele_y_pos(nm1,top);
			}
		if(ajm_state.mainmenu_layout[mmac]=="vertical")
			{
			if(ajm_state.mainmenu_dirn[mmac]=='right')
				{
				left=get_ele_x_pos_2(nm2)+get_ele_width(nm2);
				set_ele_x_pos(nm1,left);
				}
				else
				{
				left=get_ele_x_pos_2(nm2)-get_ele_width(nm1);
				set_ele_x_pos(nm1,left);
				}
			top=get_ele_y_pos_1(nm2);
			set_ele_y_pos(nm1,top);
			}
		}
	}
if(browser=="IE"||browser=="NS6"||browser=="Opera")
	{
	if(find_layer(nm1))
		{
		ajm_state.activemenuArray[ajm_state.amac++]=nm1;
		if(ajm_state.mainmenu_layout[mmac]=="horizontal")
			{
			if(os=="Mac"&&browser=="IE")
				{
				top=get_ele_y_pos_1(nm2+'clip')+get_ele_height(nm2)+get_ele_height(name.substring(0,3)+'dmy')+ajm_state.mtopoffset;
				}
				else
				{
				top=get_ele_y_pos_1(nm2+'clip')+get_ele_height(nm2);
				}
			left=get_ele_x_pos_2(nm2+'clip');
			}
		if(ajm_state.mainmenu_layout[mmac]=='vertical')
			{
			if(ajm_state.mainmenu_dirn[mmac]=='right')
				{
				left=get_ele_x_pos_2(nm2+'clip')+get_ele_width(nm2);
				}
				else
				{
				left=get_ele_x_pos_2(nm2+'clip')-get_ele_width(nm1);
				}
			if(os=="Mac"&&browser=="IE")
				{top=get_ele_y_pos_1(nm2+'clip')+get_ele_height(name.substring(0,3)+'dmy');}
				else
				{top=get_ele_y_pos_1(nm2+'clip');}
			}
		if (browser=="IE" && ajm_state.mainmenuArray[mmac-1].sticky)
			{
			if (!ajm_state.mainmenuArray[mmac-1].sticky_scroll_y)
				{
				top += get_top_scroll();
				}
			if (!ajm_state.mainmenuArray[mmac-1].sticky_scroll_x)
				{
				left += get_left_scroll();
				}
			}
		set_ele_y_pos(nm1,top);
		set_ele_x_pos(nm1,left);
		if (find_layer(nm1+'scroll'))
			{set_ele_y_pos(nm1+'scroll',0);}
		}
	}
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;}
ajm_state.menuActive=true;
if(find_layer(nm1))
	{
	if(left<get_left_scroll())
		{set_ele_x_pos(nm1,get_left_scroll());}
	if(left+get_ele_width(nm1)>total_innerWidth())
		{set_ele_x_pos(nm1,total_innerWidth()-get_ele_width(nm1));}
	if(top<get_top_scroll())
		{set_ele_y_pos(nm1,get_top_scroll());}
	if(top+get_ele_height(nm1)>total_innerHeight())
		{
		// set_ele_y_pos(nm1,total_innerHeight()-get_ele_height(nm1));
		// added for scrolling
		activate_scroll();
		}
	}
show_ele(nm1,true);
};


function mainMenuMouseOut(name,count,bgcolor,ftcolor,img)
{
if(browser!="Opera")
	{
	set_bg_col(name+'mi'+count,bgcolor);
	set_fg_col(name+'a'+count,ftcolor);
	}
ajm_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("hide_all();",300);
};


function subMenu(menuName,nbgcolor,hbgcolor,nftcolor,hftcolor,bgimage)
{
ajm_state.submenuArray[ajm_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.bgimage=bgimage;
  this.nbgcolor='transparent';
  }
  else
  {
  this.bgimage=null;
  }
this.css="iwsubmenu";
this.name="aj"+ajm_state.mmac+"sm"+menuName;
this.count=1;
this.item='';
this.htmlBefore='  ';
this.htmlAfter='  ';
this.cellpadding=1;
this.layerpadding=0;
this.menuborder='';
this.itemborder='';
this.target='_self';
this.writeMenu=writeSubMenu;
this.addItem=sub_addItem;
this.addItems=addItems;
this.addWithoutLink=addWithoutLink;
this.addItemSansLink=sub_addItemSansLink;
this.addItemsWithTarget=addItemsWithTarget;
};


function writeSubMenu()
{
if(browser=="NS4")
  {
  document.writeln('<layer id="'+this.name+'" ');
  if(this.nbgcolor!='transparent')
    {document.writeln('bgColor="'+this.nbgcolor+'" ');}
  if(this.bgimage!=null)
    {document.writeln('background="'+this.bgimage+'" ');}
  document.writeln('visibility="hide" z-index="30" onmouseout="ajm_state.menuActive=false;" onmouseover="ajm_state.menuActive=true;"><layer visibility="hide"></layer><table border="0" cellspacing="0" 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")
  {
  document.writeln('<div align="left" id="'+this.name+'" style="position:absolute;background-color:'+this.nbgcolor+';visibility:hidden;z-index:30;border:'+this.menuborder+';overflow:hidden;" onmouseout="ajm_state.menuActive=false;" onmouseover="ajm_state.menuActive=true;"><div id="'+this.name+'scroll" style="position:relative;">');
  document.writeln('<table border="0" style="left:0;top:0" cellspacing="0" cellpadding="'+this.cellpadding+'" ');
  if(this.bgimage!=null)
    {document.writeln('background="'+this.bgimage+'" ');}
  document.writeln('id="'+this.name+'table">'+this.item+'</table></div></div>');
  }
if(browser=="NS6"||browser=="Opera")
  {
  document.writeln('<div align="left" id="'+this.name+'" style="position:absolute;background-color:'+this.nbgcolor+';z-index:30;border:'+this.menuborder+';visibility:hidden" onmouseout="ajm_state.menuActive=false;" onmouseover="ajm_state.menuActive=true;">');
  document.writeln('<table border="0" style="left:0;top:0" cellspacing="0" cellpadding="'+this.cellpadding+'" ');
  if(this.bgimage!=null)
    {document.writeln('background="'+this.bgimage+'" ');}
  document.writeln('id="'+this.name+'table">'+this.item+'</table></div>');
  }
// if(!ajm_state.menuReady){x6666261();}
// if(browser=="NS6"||(browser=="IE"&&version==4))
if(browser=="NS6"||browser=="IE")
  {
  set_ele_width(this.name,get_ele_width(this.name+'table'));
  }
set_ele_x_pos(this.name,8);
set_ele_y_pos(this.name,8);
};


function sub_addItem(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+'\',\''+ajm_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+'" valign="middle" nowrap onclick="'+tStr+'" onmouseover="subMenuMouseOver(\''+this.name+'\', \''+this.count+'\',\''+this.hbgcolor+'\',\''+this.hftcolor+'\',\''+ajm_state.mmac+'\',this)" 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 sub_addItemSansLink(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 total_innerWidth(){if(browser=="NS4"||browser=="NS6"||browser=="Opera"){return(window.innerWidth+window.pageXOffset);}if(browser=="IE"){return(document.body.clientWidth+document.body.scrollLeft);}};


function get_left_scroll(){if(browser=="NS4"||browser=="NS6"||browser=="Opera"){return(window.pageXOffset);}if(browser=="IE"){return(document.body.scrollLeft);}};


function get_top_scroll(){if(browser=="NS4"||browser=="NS6"||browser=="Opera"){return(window.pageYOffset);}if(browser=="IE"){return(document.body.scrollTop);}};


function total_innerHeight(){if(browser=="NS4"||browser=="NS6"||browser=="Opera"){return(window.innerHeight+window.pageYOffset);}if(browser=="IE"){return(document.body.clientHeight+document.body.scrollTop);}};


function subMenuMouseOver(name,count,bgcolor,fgcolor,mmac,evt)
{
var tmp_amac=ajm_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(ajm_state.activemenuArray[i]!=name)
    {
    if(nm1.indexOf(ajm_state.activemenuArray[i])==-1)
      {
      show_ele(ajm_state.activemenuArray[i],false);
      ajm_state.amac--;
      }
    }
  }
if(browser!="Opera")
  {
  set_bg_col(nm2,bgcolor,name);
  set_fg_col(name+'a'+count,fgcolor,name);
  }
if(browser=="NS4")
  {
  if(find_layer(nm1))
    {
    ajm_state.activemenuArray[ajm_state.amac++]=nm1;
    if(ajm_state.mainmenu_dirn[mmac]=='right')
      {
      left=get_ele_x_pos_2(name)+get_ele_width(name)-ajm_state.menuoffset;
      set_ele_x_pos(nm1,left);
      }
      else
      {
      if(get_ele_x_pos_2(name)-get_ele_width(nm1)+ajm_state.menuoffset>0)
        {
        left=get_ele_x_pos_2(name)-get_ele_width(nm1)+ajm_state.menuoffset;
        set_ele_x_pos(nm1,left);
        }
        else
        {
        left=0;
        set_ele_x_pos(nm1,0);
        }
      }
    top=get_ele_y_pos_1(nm2,name);
    set_ele_y_pos(nm1,top);
    }
  }
if(browser=="IE"||browser=="NS6"||browser=="Opera")
  {
  if(find_layer(nm1))
    {
    ajm_state.activemenuArray[ajm_state.amac++]=nm1;
    if(ajm_state.mainmenu_dirn[mmac]=='right')
      {
      left=get_ele_x_pos_1(name)+get_ele_width(name)-ajm_state.menuoffset+ajm_state.leftoffset;
      if(left+get_ele_width(nm1)>total_innerWidth())
				{
				left = total_innerWidth()-get_ele_width(nm1);
				if (left - 15 < get_ele_x_pos_1(name))
					{
					left=get_ele_x_pos_1(name)-get_ele_width(nm1)+ajm_state.menuoffset;
					}
				}
      set_ele_x_pos(nm1,left);
      }
      else
      {
      left=get_ele_x_pos_1(name)-get_ele_width(nm1)+ajm_state.menuoffset;
      set_ele_x_pos(nm1,left);
      }
    if(browser=="IE")
      {
//      top=get_ele_y_pos_1(name)+get_ele_y_pos_1(nm2+'clip');
//      top=get_ele_y_pos_1(nm2+'clip')+get_ele_y_pos_1(name+'scroll')-2;
//			top=get_ele_y_pos_1(nm2+'clip')+get_ele_y_pos_1(name+'scroll')-2+get_ele_y_pos_1(name);
			top=evt_y_pos(evt)+get_ele_y_pos_1(name+'scroll')-6+get_ele_y_pos_1(name)-get_top_scroll();
      set_ele_y_pos(nm1,top);
      }
    if(browser=="NS6")
      {
      if(version==6.1)
        {top=get_ele_y_pos_1(name)+get_ele_y_pos_1(nm2+'clip');
        set_ele_y_pos(nm1,top);
        }
        else
        {
        top=get_ele_y_pos_1(nm2+'clip');
        set_ele_y_pos(nm1,top);
        }
      }
    if(browser=="Opera")
      {
      top=get_ele_y_pos_1(name)+get_ele_y_pos_1(nm2+'clip');
      set_ele_y_pos(nm1,top);
      }
    }
  }
if(find_layer(nm1))
  {
  if(left<get_left_scroll())
    {
    set_ele_x_pos(nm1,get_left_scroll());
    }
  if(left+get_ele_width(nm1)>total_innerWidth())
    {
    set_ele_x_pos(nm1,total_innerWidth()-get_ele_width(nm1));
    }
  if(top<get_top_scroll())
    {
    set_ele_y_pos(nm1,get_top_scroll());
    }
  if(top+get_ele_height(nm1)>total_innerHeight())
    {set_ele_y_pos(nm1,total_innerHeight()-get_ele_height(nm1));
    }
  show_ele(nm1,true);
  }
ajm_state.menuActive=true;
};


function subMenuMouseOut(name,count,bgcolor,fgcolor)
{
if(browser!="Opera")		
	{
	set_bg_col(name+'itm'+count,bgcolor,name);
	set_fg_col(name+'a'+count,fgcolor,name);
	}
setTimeout("hide_all()",300);
};


function addItems(){for(var i=0;i<arguments.length;i+=2){this.addItem(arguments[i],arguments[i+1]);}};

function addWithoutLink(){for(var i=0;i<arguments.length;i++){this.addItemSansLink(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 hide_all()
{
if(!ajm_state.menuActive)
	{
	for(var i=0;i<ajm_state.amac;i++)
		{show_ele(ajm_state.activemenuArray[i],false);}
	ajm_state.amac=0;
	show_ele("upscroll",false);
	show_ele("downscroll",false);
	}
};

function displayMenu()
{
for(var i=ajm_state.mmcp;i<ajm_state.mmac;i++)
	{ajm_state.mainmenuArray[i].writeMenu();}
ajm_state.mmcp=ajm_state.mmac;
};

function createMenu()
{
for(var i=ajm_state.smcp;i<ajm_state.smac;i++)
  {ajm_state.submenuArray[i].writeMenu();}
ajm_state.smcp=ajm_state.smac;
// add scroller obj
document.writeln('<div align="center" id="upscroll" style="position:absolute;left:0;top:0;visibility:hidden;z-index:30;" onmouseout="scroller_stop()" onmouseover="scroller_start(-1)"><img src="imgs/defilbas.gif" /></div>');
document.writeln('<div align="center" id="downscroll" style="position:absolute;left:0;top:0;visibility:hidden;z-index:30;" onmouseout="scroller_stop()" onmouseover="scroller_start(1)"><img src="imgs/defilhaut.gif"/></div>');
};

function scroller_start(dir)
{
var tmp_amac=ajm_state.amac;
for(var i=0;i<tmp_amac;i++)
  {
  if(ajm_state.activemenuArray[i]!=ajm_state.scroll_ele)
    {
    show_ele(ajm_state.activemenuArray[i],false);
    ajm_state.amac--;
    }
  }

var speed = 5;
ajm_state.scrolling=true;
ajm_state.menuActive=true;
 setTimeout("do_scroll("+dir*speed+")", 20);
};

function scroller_stop()
{
ajm_state.scrolling=false;
ajm_state.menuActive=false;
};

function activate_scroll()
{
var sm = ajm_state.activemenuArray[ajm_state.amac-1]; // obj: dernier submenu ouvert
var menu;
var found = false;
for(var i=0;i<ajm_state.smac;i++)
  {
  menu=ajm_state.submenuArray[i];
  if (menu.name==sm)
  	{
  	found = true;
  	break;
  	}
  }

if (found)
	{
	// set colors
	set_bg_col("upscroll", menu.nbgcolor);
	set_fg_col("upscroll", menu.nftcolor);
	set_bg_col("downscroll", menu.nbgcolor);
	set_fg_col("downscroll", menu.nftcolor);
	}
// set positions
if (find_layer(sm))
//if (false)
	{
	var x1 = get_ele_x_pos_1(sm);
	var y1 = get_ele_y_pos_1(sm);
	var dx = get_ele_width(sm);
//	var y2 = total_innerHeight()-get_top_scroll();
	var y2 = total_innerHeight();
	set_ele_x_pos("upscroll", x1);
	set_ele_x_pos("downscroll", x1);
	set_ele_width("upscroll", dx);
	set_ele_width("downscroll", dx);
	set_ele_y_pos("downscroll", y1);
	set_ele_y_pos("upscroll", y2 - get_ele_height("upscroll"));

	show_ele("upscroll",true);
	ajm_state.scroll_active = true;
	ajm_state.scroll_ele = sm;
	}
	else
	{
	alert(sm+" pas trouvé");
	}
};

function de_activate_scroll()
{
show_ele("upscroll",false);
show_ele("downscroll",false);
ajm_state.scroll_scrolling = false;
ajm_state.scroll_active = false;
ajm_state.scroll_ele = "";
};

function do_scroll(delta)
{
if (ajm_state.scrolling)
	{
	if (find_layer(ajm_state.scroll_ele) && find_layer(ajm_state.scroll_ele+'scroll'))
		{
		var top = get_ele_y_pos_1(ajm_state.scroll_ele+'scroll') + delta;
		if (top >= 0)
			{
			top = 0;
			show_ele("upscroll",true);
			show_ele("downscroll",false);
			ajm_state.scrolling = false;
			}
			else
			{
			var max_delta = total_innerHeight()-get_ele_y_pos_1(ajm_state.scroll_ele)-get_ele_height(ajm_state.scroll_ele+'scroll');
			if (top <= max_delta)
				{
				top = max_delta;
				show_ele("upscroll",false);
				show_ele("downscroll",true);
				ajm_state.scrolling = false;
				}
				else
				{
				show_ele("upscroll",true);
				show_ele("downscroll",true);
				setTimeout("do_scroll("+delta+")", 20);
			  }
			}
		set_ele_y_pos(ajm_state.scroll_ele+'scroll', top);
		}
	}
};

function reposition()
{
if(browser=="IE"||browser=="NS6"||browser=="Opera")
	{
	for (i=0;i<ajm_state.mmac;i++)
		{
		if (ajm_state.mainmenuArray[i].sticky)
			{
			nm = ajm_state.mainmenuArray[i].name;
			if (find_layer(nm))
				{
				if (!ajm_state.mainmenuArray[i].sticky_scroll_x)
					{
					set_ele_x_pos(nm, get_left_scroll()+ajm_state.mainmenuArray[i].sticky_x);
					}
				if (!ajm_state.mainmenuArray[i].sticky_scroll_y)
					{
					set_ele_y_pos(nm, get_top_scroll()+ajm_state.mainmenuArray[i].sticky_y);
					}
				}
			}
		}
	}
setTimeout("reposition()", 100);
};

window.onresize=x6168031115541;
origWidth=window.innerWidth;
origHeight=window.innerHeight;

function x6168031115541(){if(browser=='NS4'&&origWidth==window.innerWidth&&origHeight==window.innerHeight){return;}};
