isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;


function GetElementByID(TargetID) 
{
	if (isNS4)
	{
		objElement = document.layers[TargetID];
	}
	else if (isIE4) 
	{
		objElement = document.all[TargetID];
	}
	else if (isIE5 || isNS6) 
	{
		objElement = document.getElementById(TargetID);
	}
	return(objElement);
}

function SwitchImage(imgName, imgSrc)
{
   document[imgName].src = imgSrc;
}


function QuickStartMenuItem(name, menu_count)
{
	this.name = name;
	this.state = "hid";
	this.tick = 0;
	this.timer = 0;
	this.timeout = 20;
	this.animate_step = (isIE5 ? 8 : 4);
	this.max_tick = Math.ceil((menu_count * (isIE5 ? 11 : 9) + 
		(isIE5 ? 19 : 17)) / this.animate_step);

	this.show = function()
	{
		if(!this.timer && this.tick < this.max_tick)
		{
			this.timer = setTimeout("obj_" + this.name + ".animate()", 
				this.timeout);
		}
		this.state = "inc";
	}

	this.hide = function()
	{
		this.state = "dec";
		if(this.tick == this.max_tick)
		{
			this.timer = setTimeout("obj_" + this.name + ".animate()", 
				this.timeout);
		}
	}

	this.animate = function()
	{
		var obj = GetElementByID(this.name);
		if(this.state == 'inc')
		{
			if(this.tick < this.max_tick)
			{
				this.tick++;
			}
		}
		else
		{
			if(this.tick > 0)
			{
				this.tick--;
			}
		}

		if(this.tick == 1)
		{
			obj.style.height = "0px";
			obj.style.display = "block";
		}
		else if(this.tick == 0)
		{
			obj.style.display = "none";
			this.timer = 0;
			this.state = 'hid';
		}
	
		if(this.tick < this.max_tick && this.tick > 0)
		{
			
			obj.style.height = String(this.tick * this.animate_step) + 'px';
			this.timer = setTimeout("obj_" + this.name + ".animate()", 
				this.timeout);
		}
	}
}
