/*
| -----------------------------------------------------
| Author	: Feng Wu, http://come.to/feng, feng@ou.edu
| -----------------------------------------------------
| Created	: 7/3/00
| Last Mod.	: 5/28/04 6:00PM - minor cleans
| -----------------------------------------------------
| Copyright © Feng Wu, 2000 - 2004
| -----------------------------------------------------
*/


var isIE = (document.all) ? 1 : 0,
	isNS = (document.layers) ? 1 : 0,
	hasImages = (document.images) ? 1 : 0;


function WF_Status(desc)
{
	window.status = desc;

	return true;
}

function WF_StatusIndex(nIndex)
{
	window.status = sDesc[nIndex];

	return true;
}

function WF_ChangeImg(nArrowID, nStatus)
{
	nNewID = (nStatus) ? parseInt(nArrowID / 100) : nStatus;

	if (nArrowID < 800)
		if (hasImages)
			document.images['arrow_' + nArrowID].src = ImgArrows[nNewID].src;
}

function WF_ShowDesc(nDocID, sColor, sContent)
{
	// determine what to show
	if (sContent == "")
		sToShow = "";
	else
	{
		sFont  = '<font face=Verdana size=2 style="font: 10pt verdana"';
		sFont += (sColor == "") ? "" : ' color=' + sColor;
		sFont += '>'

		sToShow = sFont + sContent + '</font>'
	}

	// show it
	if (isIE)
	{
		if		(nDocID >=   0 && nDocID < 100)	Desc_0.innerHTML = sToShow;
		else if (nDocID >= 100 && nDocID < 200)	Desc_1.innerHTML = sToShow;
		else if (nDocID >= 200 && nDocID < 300)	Desc_2.innerHTML = sToShow;
		else if (nDocID >= 300 && nDocID < 400)	Desc_3.innerHTML = sToShow;
		else if (nDocID >= 400 && nDocID < 500)	Desc_4.innerHTML = sToShow;
		else if (nDocID >= 500 && nDocID < 600)	Desc_5.innerHTML = sToShow;
		else if (nDocID >= 600 && nDocID < 700)	Desc_6.innerHTML = sToShow;
		else if (nDocID >= 700 && nDocID < 800)	Desc_7.innerHTML = sToShow;
		else if (nDocID >= 800 && nDocID < 900)	Desc_8.innerHTML = sToShow;
		else if (nDocID >= 900 && nDocID <1000)	Desc_9.innerHTML = sToShow;
	}
	else if (isNS)
	{
		// nnn = 10 * (parseInt((nDocID-11)/50) + 1) + 1;
		if      (nDocID >=   0 && nDocID < 100)
		{	document.Desc_01.document.Desc_02.document.write(sToShow)
			document.Desc_01.document.Desc_02.document.close()
		}
		else if (nDocID >= 100 && nDocID < 200)
		{	document.Desc_11.document.Desc_12.document.write(sToShow)
			document.Desc_11.document.Desc_12.document.close()
		}
		else if (nDocID >= 200 && nDocID < 300)
		{	document.Desc_21.document.Desc_22.document.write(sToShow)
			document.Desc_21.document.Desc_22.document.close()
		}
		else if (nDocID >= 300 && nDocID < 400)
		{	document.Desc_31.document.Desc_32.document.write(sToShow)
			document.Desc_31.document.Desc_32.document.close()
		}
		else if (nDocID >= 400 && nDocID < 500)
		{	document.Desc_41.document.Desc_42.document.write(sToShow)
			document.Desc_41.document.Desc_42.document.close()
		}
		else if (nDocID >= 500 && nDocID < 600)
		{	document.Desc_51.document.Desc_52.document.write(sToShow)
			document.Desc_51.document.Desc_52.document.close()
		}
		else if (nDocID >= 600 && nDocID < 700)
		{	document.Desc_61.document.Desc_62.document.write(sToShow)
			document.Desc_61.document.Desc_62.document.close()
		}
		else if (nDocID >= 700 && nDocID < 800)
		{	document.Desc_71.document.Desc_72.document.write(sToShow)
			document.Desc_71.document.Desc_72.document.close()
		}
		else if (nDocID >= 800 && nDocID < 900)
		{	document.Desc_81.document.Desc_82.document.write(sToShow)
			document.Desc_81.document.Desc_82.document.close()
		}
		else if (nDocID >= 900 && nDocID < 1000)
		{	document.Desc_91.document.Desc_92.document.write(sToShow)
			document.Desc_91.document.Desc_92.document.close()
		}
	}
}

function WF_Change(nArrowID, nContent, nStatus)
{
	// 1) status
	WF_StatusIndex(nContent);

	// 2) image
	WF_ChangeImg(nArrowID, nStatus);

	// 3) content with font color
	sContent = sDesc[nContent];

	nColor = parseInt(nArrowID / 100);
	sColor = vColorHotlink[nColor];
	WF_ShowDesc(nArrowID, sColor, sContent);
}

function WF_MOver(nArrowID)
{
	WF_Change(nArrowID, nArrowID, 1);

	return true;
}

function WF_MOut(nArrowID)
{
	WF_Change(nArrowID, 0, 0);

	return true;
}


// used in "../Home.html"
function WF_ChangeImg_2(nArrowID)
{
	if (hasImages)	document.images['arrow_1'].src = ImgArrows[nArrowID].src;
}

function WF_Change_2(nArrowID)
{
	// 1) status
	WF_StatusIndex(nArrowID + 10);

	// 2) image
	WF_ChangeImg_2(nArrowID);

	// 3) content
	sContent = sDesc[nArrowID];
	WF_ShowDesc(0, "", sContent);
}

function WF_MOver_2(nArrowID)
{
	WF_Change_2(nArrowID);

	return true;
}


// used in "DescHome.js"
function WF_Change_3(nContent)
{
	// 1) status
	WF_StatusIndex(nContent);

	// 2) content with font color
	sContent = sDesc[nContent];
	nColor = parseInt(nContent / 100);
	sColor = vColor[nColor];
	WF_ShowDesc(nContent, sColor, sContent);
}

function WF_MOver_3(nContent)
{
	WF_Change_3(nContent);

	return true;
}
