function writeCurrencyCookie(currency) 
{
 var today = new Date();
 var the_date = new Date("December 31, 2023");
 var the_cookie_date = the_date.toGMTString();
 var the_cookie = "currency="+ currency;
 var the_cookie = the_cookie + ";expires=" + the_cookie_date;
 document.cookie = the_cookie;
 location.reload(true);
}
 
function setCurrency( form ) 
{ 
  var newIndex = form.fieldname.selectedIndex; 
  if ( newIndex == 0 ) { 
	 alert( "Please select a location!" ); 
	} 
  else { 
	 var currency = form.fieldname.options[ newIndex ].value; 
	 writeCurrencyCookie(currency);
      } 
} 


