function AutoConvertToProperCase(str, target)
{
strTemp = str
strTemp = strTemp.toLowerCase()
var test=""
var isFirstCharOfWord = 1
for (var intCount = 0; intCount < strTemp.length; intCount++)
{
var temp = strTemp.charAt(intCount)
if (isFirstCharOfWord == 1)
{
temp = temp.toUpperCase()
}
test = test + temp
if (temp == " ")
{
isFirstCharOfWord = 1
}
else isFirstCharOfWord = 0
}
document.getElementById(target).value = test
}