function SubmitCurrency( theForm )
 {
   amount       = theForm.Amount.value
   fromCurrency = theForm.From.options[theForm.From.selectedIndex].value
   toCurrency   = theForm.To.options[theForm.To.selectedIndex].value
   submitUrl    = 'http://www.xe.net/cgi-bin/ucc/convert?language=xe&To=' + 
                  toCurrency + '&Amount=' + amount + '&From=' + fromCurrency
   
   ResultsWindow = window.open ('', 'ResultsWindow', 'toolbar=0,location=0,'+
                                'directories=0,status=0,menubar=0,scrollbars=0'+
                                ',resizable=1,height=170,width=600')
   ResultsWindow.focus()
   ResultsWindow.location.href = submitUrl
      
   // just open the new window - don't submit form
   return false
  }
  //do ajax call to change session variable and message of popup
function updateSelectedPlace(obj)
{
  var functionName ="";
  var arrayPlaces = (obj.value).split('|');
  
  //calculate the absolute posion of popup 
  var divPosition = getPopUpPosition(150, 500, 70);
  var div = getObj("divSelected");
  var content = "";
   
  div.style.left = divPosition["Left"];
  div.style.top = divPosition["Top"];
   
  if(obj.checked)
  {
    functionName = "addSelectedPlace";
    content = " has been added to your list";
  }
  else
  {
    functionName = "removeSelectedPlace";
    content = " has been deleted from your list";
  }
  //ajax call to update session variable
  otherData = "placID=" + arrayPlaces[0];
  ajaxCall("", functionName, "ranches",updateSelectedPlaceCallback, '',otherData)
  
  //update the content of popup
  content= "<br>" + arrayPlaces[1] + content;
  setContent(content,'divSelected');
  
  //set a timer for 3 seconds
   resetTimer(3/60);
   return;  
}
    
function updateSelectedPlaceCallback(content,type)
{
  if(type == "string")
  {
    if(window.opener && !window.opener.closed)
   {
    try{
        if(window.opener.document.URL.indexOf("searchresults")>=0 )
        {
            window.opener.location.reload();
        }
      }
      catch(er)
      {
        //alert("Please refresh search results page manually by pressing F5");
      }
   }    
  }
  else
  {
    getObj("errorDiv").innerHTML = content;
  }
}

function recordWebClick(ID,hitType)
{
    otherData = "ID=" + ID + ",HitType=" + hitType;
    ajaxCall("", 'AddHitActivity', "logging",recordWebClickCallback, '',otherData);
}

//call back function,do nothing
function recordWebClickCallback(content,type)
{
	return;
}

    
function resetTimer(minutes)
{
  //set global variables
  if (minutes)
  {
    g_timerId = 0;
    g_timeOut = minutes*60000;//convert to milliseconds
  }
  
  //if timer already exists, clear it
  if (g_timerId)
    window.clearTimeout(g_timerId);
  
  //create timer to cause a page reload which will trigger the CF session management  
  g_timerId = window.setTimeout('displayElement("divSelected","hide");', g_timeOut);

  return;
}