//******************************************************************//
//*****  CONSTRUCT THE REFERENCE STRING FOR AN OBJECT  *************//
//******************************************************************//
function objConstruct(objName)
	{
	if (IE4)
		{this.obj = document.all[objName].style;}
	else if (NS4)
		{this.obj = document.layers[objName];}
	else if (NS6)
		{this.obj = document.getElementById(objName).style;}
	}


//******************************************************************//
//*****  SET DISPLAY PROPERTY FOR AN OBJECT  ***********************//
//******************************************************************//		
function displayElem(objName,status)
	{
	objConstruct(objName);
	if (status == "")
		{
		var theStatus;
		if (IE4 || NS6)
			{theStatus = this.obj.visibility;}
		else if (NS4)
			{if (this.obj.visibility == "show")
				{theStatus = "visible";}
			else
				{theStatus = "hidden";}
			}
		return theStatus;
		}
	else
		{
		if (IE4 || NS6)
			{this.obj.visibility = status;}
		else if (NS4)
			{if (status == "visible")
				{NSstatus = "show";}
			else
				{NSstatus = "hide";}
		this.obj.visibility = NSstatus;}
		}
	}

	
//******************************************************************//
//*****  SET Z-INDEX PROPERTY FOR AN OBJECT  ***********************//
//******************************************************************//		
function zIndexElem(objName,zindex)
	{
	objConstruct(objName);
	if (zindex == "" && zindex != 0)
		{
		var theIndex = this.obj.zIndex;
		return theIndex;
		}
	else
		{this.obj.zIndex = zindex;}
	}


//******************************************************************//
//*****  MOVE AN OBJECT TO SPECIFIED X AND Y COORDINATES  **********//
//******************************************************************//	
function moveElem(objName,left,top)
	{
	objConstruct(objName);
	if (IE4)
		{if (left != "")
			{this.obj.pixelLeft = left;}
		if (top != "")
			{this.obj.pixelTop = top;}
		}
	else if (NS4)
		{if (left != "")
			{this.obj.left = left;}
		if (top != "")
			{this.obj.top = top;}
		}
	else if (NS6)
		{if (left != "")
			{this.obj.left = left+"px";}
		if (top != "")
			{this.obj.top = top+"px";}
		}
	}


//******************************************************************//
//*****  FIND THE X AND Y COORDINATES FOR AN OBJECT  ***************//
//******************************************************************//
function findCoordElem(imgName,objName1)
	{
	if(IE4||NS6)
		{imgPosX = document.images[imgName].offsetLeft;
		tempEl = document.images[imgName].offsetParent;
		while (tempEl != null)
			{imgPosX += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;}
		imgPosY = document.images[imgName].offsetTop;
		tempEl = document.images[imgName].offsetParent;
		while (tempEl != null)
			{imgPosY += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;}
		}
	else
		{if (objName1 != null)
			{objConstruct(objName1);
			imgPosX = this.obj.document.images[imgName].x;
			imgPosY = this.obj.document.images[imgName].y;}
		else
			{imgPosX = document.images[imgName].x;
			imgPosY = document.images[imgName].y;}
		}
	}


//******************************************************************//
//*****  CLIP THE VIEWABLE AREA OF AN OBJECT  **********************//
//******************************************************************//
function clipElem(objName,top,right,bottom,left)
	{
	objConstruct(objName);
	if (IE4 || NS6)
		{this.obj.clip = "rect("+top+","+right+","+bottom+","+left+")";}
	else
		{this.obj.clip.top = top;
		this.obj.clip.bottom = bottom;
		this.obj.clip.left = left;}
	}


//******************************************************************//
//*****  SWAP THE IMAGE SOURCE OF AN OBJECT  ***********************//
//******************************************************************//
function swapImgElem(objName,imgName,imgSrc)
	{
	if (pathLevel != ""){imgSrc = pathLevel+imgSrc;}
	if (IE4||NS6)
		{document.images[imgName].src = imgSrc;}
	else if (NS4)
		{if (objName != null && objName != "")
			{objConstruct(objName);
			this.obj.document.images[imgName].src = imgSrc;}
		else
			{document.images[imgName].src = imgSrc;}
		}
	}
