function initimagesmenu(table, path, nsuffix, osuffix, ssuffix, initselect)
{
	this.menu=(document.getElementById)?document.getElementById(table):(document.all)?document.all[table]:(document.layers)?document.layers[table]:0;	
	if(!this.menu)
	{
    return alert('Table "'+table+'" does not exist or invalid referance')
  }
	this.selectedindex=(this.menu.selectedindex)?this.menu.selectedindex:0;
	this.items=new Array();

  this.replacesrc=function(index, src)
	{
    if (this.items[index].imageobj.src!=src)
    {
      if (this.usefilter)
      {
        this.items[index].imageobj.filters.blendTrans.apply();
        this.items[index].imageobj.src = src;
  		  this.items[index].imageobj.filters.blendTrans.play();
      }
      else	
      {
  	   	this.items[index].imageobj.src = src;
      }
    }
	}
	
	this.ncell=function(index)
	{
		this.replacesrc(index, this.items[index].nimageobj.src);
		this.items[index].style.cursor="hand";
	}

	this.ocell=function(index)
	{
		this.replacesrc(index, this.items[index].oimageobj.src);
		this.items[index].style.cursor="hand";
	}

	this.scell=function(index)
	{
	  this.replacesrc(index, this.items[index].simageobj.src);
	  this.items[index].style.cursor="default";
	}

	cells=(document.getElementById)?this.menu.getElementsByTagName("td"):this.menu.tags("td");
	itemindex=0;
	
  agt=navigator.userAgent.toLowerCase();
  this.usefilter=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));
  duration=(this.menu.duration)?this.menu.duration:".4";
	
	for (i=0; i<cells.length; i++)
	{
		if (cells[i].image)
		{	
			this.items.push(cells[i]);
			this.items[itemindex].owner=this;
			this.items[itemindex].index=itemindex;
			this.items[itemindex].imageobj=document.images[cells[i].image];
			if (this.usefilter)
			{
        this.items[itemindex].imageobj.style.filter="blendTrans(duration="+duration+")";
      }
			
      this.items[itemindex].nimageobj=new Image();
	    this.items[itemindex].nimageobj.src=(cells[i].nimage)?cells[i].nimage:(cells[i].bimage)?path + cells[i].bimage + nsuffix:'';
      this.items[itemindex].oimageobj=new Image();
	    this.items[itemindex].oimageobj.src=(cells[i].oimage)?cells[i].oimage:(cells[i].bimage)?path + cells[i].bimage + osuffix:'';
      this.items[itemindex].simageobj=new Image();
	    this.items[itemindex].simageobj.src=(cells[i].simage)?cells[i].simage:(cells[i].bimage)?path + cells[i].bimage + ssuffix:'';
			
			if (itemindex==this.selectedindex)
			{
				this.scell(itemindex)
 			  if (initselect&&this.items[itemindex].onselect)
   			{
          eval(this.items[itemindex].onselect);
        }	
			}
			else
			{
				this.ncell(itemindex)
			}	

			this.items[itemindex].onmouseover=function()
			{
				if (this.index!=this.owner.selectedindex)
				this.owner.ocell(this.index)
 			  if (this.onover)
   			{
          eval(this.onover);
        }	
			}
			
			this.items[itemindex].onclick=function()
			{
				if (this.index!=this.owner.selectedindex)
				{
					this.owner.scell(this.index)
					if (this.owner.selectedindex>=0)
						this.owner.ncell(this.owner.selectedindex);
					this.owner.selectedindex=this.index;
    			if (this.onselect)
   				{
      			eval(this.onselect);
   				}	
				}
				if (this.onitemclick)
				{
   				eval(this.onitemclick);
   			}	
			}

			this.items[itemindex].onmouseout=function()
			{
				if (this.index!=this.owner.selectedindex)
				this.owner.ncell(this.index)
 			  if (this.onout)
   			{
          eval(this.onout);
        }	
			}
			
			itemindex++
		}
	}
}

function initimageshover(table, path, nsuffix, osuffix)
{
	this.menu=(document.getElementById)?document.getElementById(table):(document.all)?document.all[table]:(document.layers)?document.layers[table]:0;	
	if(!this.menu)
	{
    return alert('Table "'+table+'" does not exist or invalid referance')
  }
	this.items=new Array();

  this.replacesrc=function(index, src)
	{
    if (this.items[index].imageobj.src!=src)
    {
      if (this.usefilter)
      {
        this.items[index].imageobj.filters.blendTrans.apply();
        this.items[index].imageobj.src = src;
  		  this.items[index].imageobj.filters.blendTrans.play();
      }
      else	
      {
  	   	this.items[index].imageobj.src = src;
      }
    }
	}
	
	this.ncell=function(index)
	{
		this.replacesrc(index, this.items[index].nimageobj.src);
		this.items[index].style.cursor="hand";
	}

	this.ocell=function(index)
	{
		this.replacesrc(index, this.items[index].oimageobj.src);
		this.items[index].style.cursor="hand";
	}

	cells=(document.getElementById)?this.menu.getElementsByTagName("td"):this.menu.tags("td");
	itemindex=0;
	
  agt=navigator.userAgent.toLowerCase();
  this.usefilter=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));
  duration=(this.menu.duration)?this.menu.duration:".4";
	
	for (i=0; i<cells.length; i++)
	{
		if (cells[i].image)
		{	
			this.items.push(cells[i]);
			this.items[itemindex].owner=this;
			this.items[itemindex].index=itemindex;
			this.items[itemindex].imageobj=document.images[cells[i].image];
			if (this.usefilter)
			{
        this.items[itemindex].imageobj.style.filter="blendTrans(duration="+duration+")";
      }
			
      this.items[itemindex].nimageobj=new Image();
	    this.items[itemindex].nimageobj.src=(cells[i].nimage)?cells[i].nimage:(cells[i].bimage)?path + cells[i].bimage + nsuffix:'';
      this.items[itemindex].oimageobj=new Image();
	    this.items[itemindex].oimageobj.src=(cells[i].oimage)?cells[i].oimage:(cells[i].bimage)?path + cells[i].bimage + osuffix:'';
			
			this.items[itemindex].onmouseover=function()
			{
				this.owner.ocell(this.index)
 			  if (this.onover)
   			{
          eval(this.onover);
        }	
			}
			
			this.items[itemindex].onmouseout=function()
			{
				this.owner.ncell(this.index)
 			  if (this.onout)
   			{
          eval(this.onout);
        }	
			}
			
			itemindex++
		}
	}
}

function initcssmenu(table, nstyle, ostyle, sstyle, initselect)
{
	this.menu=(document.getElementById)?document.getElementById(table):(document.all)?document.all[table]:(document.layers)?document.layers[table]:0;	
	if(!this.menu)
	{
    return alert('Table "'+table+'" does not exist or invalid referance')
  }
	this.selectedindex=(this.menu.selectedindex)?this.menu.selectedindex:0;
	this.items=new Array();

	this.ncell=function(index)
	{
		this.items[index].className = nstyle;
		this.items[index].style.cursor="hand";
	}

	this.ocell=function(index)
	{
		this.items[index].className = ostyle;
		this.items[index].style.cursor="hand";
	}

	this.scell=function(index)
	{
		this.items[index].className = sstyle;
		this.items[index].style.cursor="default";
	}

	cells=(document.getElementById)?this.menu.getElementsByTagName("td"):this.menu.tags("td");
	itemindex=0;
	for (i=0; i<cells.length; i++)
	{
		if (!cells[i].ignore)
		{	
			this.items.push(cells[i]);
			this.items[itemindex].index=itemindex;
			this.items[itemindex].owner=this;
			
			if (itemindex==this.selectedindex)
			{
				this.scell(itemindex)
 			  if (initselect&&this.items[itemindex].onselect)
   			{
          eval(this.items[itemindex].onselect);
        }	
			}
			else
			{
				this.ncell(itemindex)
			}	
			
			this.items[itemindex].onmouseover=function()
			{
				if (this.index!=this.owner.selectedindex)
				this.owner.ocell(this.index)
 			  if (this.onover)
   			{
          eval(this.onover);
        }	
			}
			
			this.items[itemindex].onclick=function()
			{
				if (this.index!=this.owner.selectedindex)
				{
					this.owner.scell(this.index)
					if (this.owner.selectedindex>=0)
						this.owner.ncell(this.owner.selectedindex);
					this.owner.selectedindex=this.index;
    			if (this.onselect)
   				{
      			eval(this.onselect);
   				}	
				}
				if (this.onitemclick)
				{
   				eval(this.onitemclick);
   			}	
			}

			this.items[itemindex].onmouseout=function()
			{
				if (this.index!=this.owner.selectedindex)
				this.owner.ncell(this.index)
 			  if (this.onout)
   			{
          eval(this.onout);
        }	
			}
			
			itemindex++
		}
	}
	
  return this
}

function initcsshover(table, nstyle, ostyle)
{
	this.menu=(document.getElementById)?document.getElementById(table):(document.all)?document.all[table]:(document.layers)?document.layers[table]:0;	
	if(!this.menu)
	{
    return alert('Table "'+table+'" does not exist or invalid referance')
  }
  this.nstyle=nstyle;
  this.ostyle=ostyle;
	this.items=new Array();

	this.ncell=function(index)
	{
		this.items[index].className = this.nstyle;
		this.items[index].style.cursor="hand";
	}

	this.ocell=function(index)
	{
		this.items[index].className = this.ostyle;
		this.items[index].style.cursor="hand";
	}

	cells=(document.getElementById)?this.menu.getElementsByTagName("td"):this.menu.tags("td");
	itemindex=0;
	for (i=0; i<cells.length; i++)
	{
		if (!cells[i].ignore)
		{	
			this.items.push(cells[i]);
			this.items[itemindex].index=itemindex;
			this.items[itemindex].owner=this;
			this.ncell(itemindex)
			
			this.items[itemindex].onmouseover=function()
			{
				this.owner.ocell(this.index)
 			  if (this.onover)
   			{
          eval(this.onover);
        }	
			}
			

			this.items[itemindex].onmouseout=function()
			{
				this.owner.ncell(this.index)
 			  if (this.onout)
   			{
          eval(this.onout);
        }	
			}
			
			itemindex++
		}
	}
	
  return this
}

