function cleartext(inputname)
{
	if (inputname.value == "SHOE SIZE")
	{
		inputname.value = "";
	}
};
function blurShoe()
{
	if (document.getElementById("shoe").value == "")
	{
		document.getElementById("shoe").value = "SHOE SIZE";
	}
};
function writeText(strName, strValue, intWidth)
{
	if (document.layers)
	{
		document.write("<input id=\"" + strName + "\" name=\"" + strName + "\" value=\"" + strValue + "\" type=\"text\" onkeyup=\"convertIt()\" onblur=\"blurShoe()\" onkeydown=\"convertIt()\" onFocus=\"cleartext(" + strName + ")\" size=\"" + Math.round(parseInt(intWidth / 11)) + "\">");
	}
	else
	{
		document.write("<input id=\"" + strName + "\" name=\"" + strName + "\" value=\"" + strValue + "\" type=\"text\" onkeyup=\"convertIt()\" onblur=\"blurShoe()\" onkeydown=\"convertIt()\" onFocus=\"cleartext(" + strName + ")\" class=\"textarea\" style=\"width:" + intWidth + "px;\">");
	}
};
function convertIt()
{
	var intSize, strFrom, strTo, intIndex;
	intSize = document.convert.shoe.value;

	strFrom = document.convert.elements[1].options[document.convert.elements[1].selectedIndex].value;
	strTo = document.convert.elements[2].options[document.convert.elements[2].selectedIndex].value;
	intIndex = "";
	var UKSize = new Array();
	UKSize[0] = 2;
	UKSize[1] = 2.5;
	UKSize[2] = 3;
	UKSize[3] = 3.5;
	UKSize[4] = 4;
	UKSize[5] = 4.5;
	UKSize[6] = 5;
	UKSize[7] = 5.5;
	UKSize[8] = 6;
	UKSize[9] = 6.5;
	UKSize[10] = 7;
	UKSize[11] = 7.5;
	UKSize[12] = 8;
	UKSize[13] = 8.5;
	UKSize[14] = 9;
	UKSize[15] = 9.5;
	UKSize[16] = 10;
	UKSize[17] = 10.5;
	UKSize[18] = 11;
	UKSize[19] = 11.5;
	UKSize[20] = 12;
	UKSize[21] = 12.5;
	UKSize[22] = 13;
	var ContSize = new Array();
	ContSize[0] = 34.5;
	ContSize[1] = 35;
	ContSize[2] = 36;
	ContSize[3] = 36;
	ContSize[4] = 36.5;
	ContSize[5] = 37;
	ContSize[6] = 38;
	ContSize[7] = 39;
	ContSize[8] = 39.5;
	ContSize[9] = 40;
	ContSize[10] = 40.5;
	ContSize[11] = 41;
	ContSize[12] = 42;
	ContSize[13] = 42.5;
	ContSize[14] = 43;
	ContSize[15] = 44;
	ContSize[16] = 44.5;
	ContSize[17] = 45;
	ContSize[18] = 46;
	ContSize[19] = 46.5;
	ContSize[20] = 46.5;
	ContSize[21] = 47.5;
	ContSize[22] = 48.5;
	if (intSize != "" && intSize != "SHOE SIZE" && isNaN(intSize) == false && document.getElementById("from").selectedIndex != 0 && document.getElementById("to").selectedIndex != 0)
	{
		if (strFrom == "UK")
		{
			for (var i = 0; i < 23; i++)
			{
				if (UKSize[i] == intSize)
				{
					intIndex = i;
				}
			}
		}
		else if (strFrom == "Continental")
		{
			for (var i = 0; i < 23; i++)
			{
				if (ContSize[i] == intSize)
				{
					intIndex = i;
				}
			}
		}
		else
		{
			for (var i = 0; i < 23; i++)
			{
				if (UKSize[i] == intSize - 1.5)
				{
					intIndex = i;
				}
			}
		}
		if (intIndex != "")
		{
			if (strTo == "UK")
			{
				intTotal = UKSize[intIndex];
			}
			else if (strTo == "Continental")
			{
				intTotal = ContSize[intIndex];
			}
			else	
			{
				intTotal = UKSize[intIndex] + 1.5;
			}
			intTotal = intSize + " " + strFrom + " = " + intTotal + " " + strTo;
		}
		else
		{
			intTotal = "Try another size";
		}
		
		//write to div
		if (document.all)
		{
			document.all.answer.innerHTML = intTotal;
		}
		else if (document.layers)
		{
			document.answer.document.write(intTotal);
			document.answer.document.close();
		}
		else if (document.getElementById)
		{
			document.getElementById("answer").innerHTML = intTotal;
		}
	}
	else
	{
		document.getElementById("answer").innerHTML = "";
	}
};
function aolFrig()
{
	if (blnAOL)
	{
		if (document.all)
		{
			document.all.answer.style.top = 534;
		}
		else if(document.getElementById)
		{
			document.getElementById("answer").style.top = 534;
		}
	}
};