function CRollOver(MenuLength, ImageID, ImageSrcDefault, ImageSrcOver, ImageSrcType)
{
	this.m_iAppVer = parseInt(navigator.appVersion);
	this.m_bIsNC = (document.layers && (this.m_iAppVer >= 4));
	this.m_bIsIE = (document.all	&& (this.m_iAppVer >= 4));

	this.m_imgPreLoad = null;

	this.m_strImageID = ImageID;
	this.m_strImageSrcDefault = ImageSrcDefault;
	this.m_strImageSrcOver = ImageSrcOver;
	this.m_strImageSrcType = ImageSrcType;

	this.m_nMaxMenu = MenuLength;

	this.PreLoadImage = PreLoadImage;
	this.SwapImage = SwapImage;
	this.DoRollOver = DoRollOver;
	this.Init = Init;

	function PreLoadImage()
	{
		if( !(this.m_bIsNC || this.m_bIsIE) )
			return false;
		var tempimgSrc = null;
		this.m_imgPreLoad = new Array; 
		for( i = 0 ; i < this.m_nMaxMenu ; i++ )
		{
			var tempimgName = (this.m_strImageID + (""+(i+1)));
			this.m_imgPreLoad[tempimgName] = new Array; 
			for( j = 0 ; j < 2 ; j++ )
			{
				switch(j)
				{
				case 0:
					if(!this.m_strImageSrcDefault)
						break;
					tempimgSrc = this.m_strImageSrcDefault + (""+(i+1)) + "." + this.m_strImageSrcType;
					break;
				case 1:
					if(!this.m_strImageSrcOver)
						break;
					tempimgSrc = this.m_strImageSrcOver + (""+(i+1)) + "." + this.m_strImageSrcType;
					break;
				default:
					return false;
				}
				this.m_imgPreLoad[tempimgName][tempimgSrc] = new Image();
				this.m_imgPreLoad[tempimgName][tempimgSrc].src = tempimgSrc;
			}
		}
	}

	function SwapImage(imgName, imgSrc)
	{
		if( !(this.m_bIsNC || this.m_bIsIE) )
			return false;
		document.images[imgName].src = imgSrc;
	}

	function DoRollOver( iIndexNum, bFlg)
	{
		if( !(this.m_bIsNC || this.m_bIsIE) )
			return false;
		if(  iIndexNum > this.m_nMaxMenu)
			return false;
		if( !(this.m_strImageSrcOver && this.m_strImageSrcDefault) )
			return false;
		var target = this.m_strImageID + (""+(iIndexNum));
		var src = (bFlg) ? this.m_strImageSrcOver : this.m_strImageSrcDefault ;
		src += (""+(iIndexNum)) + "." + this.m_strImageSrcType;
		this.SwapImage( target, src );
	}

	function Init()
	{
		if( !(this.m_bIsNC || this.m_bIsIE) )
			return false;
		this.PreLoadImage();
	}

	this.Init();
}

function CreateRollOver(MenuLength, ImageID, ImageSrcDefault, ImageSrcOver, ImageSrcType)
{
	cRollOver = new CRollOver(MenuLength, ImageID, ImageSrcDefault, ImageSrcOver, ImageSrcType);
}

var cRollOver = null;

