//**********************************************************
//**********************************************************
//****  Code to fix the yellow bar from Google Toolbar  ****
//**********************************************************
//**********************************************************
function clearValue(el, origValue)
{
   if (el.value == origValue)
   {
      el.value = '';
   }
   el.select();
}
function resetValue(el, origValue)
{
   if (el.value == '')
   {
      el.value = origValue;
   }
}
function setListeners()
{
   inputList = document.getElementsByTagName("INPUT");
   for (i=0; i < inputList.length; ++i)
   {
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
   }
   selectList = document.getElementsByTagName("SELECT");
   for (i=0; i < selectList.length; ++i)
   {
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
   }
}

function restoreStyles()
{
   if (event.srcElement.style.backgroundColor != "")
   {
      event.srcElement.style.backgroundColor = "";
   }
}

function topLevelOnLoad()
{
//    setListeners();
    initImage();
}

if (window.attachEvent)
{
   window.attachEvent("onload",topLevelOnLoad);
}

function launch3dtruck()
{
	window.open(
		"/media/3DTruck/3dTruck.html",
		"cascadia",
		mywhtl(840, 540) +
			"toolbar=no,location=no" +
			",status=no,menubar=no" +
			",scrollbars=yes,resizable=no");
}

function mywhtl(width, height)
{
   var left = (screen.availWidth - width) / 2;
   var top = (screen.availHeight - height) / 2;

   var result = "";

   result += "width=" + width + ",";
   result += "height=" + height + ",";
   result += "top=" + top + ",";
   result += "left=" + left + ",";

   return result;
}

