<!--hide this script from non-javascript-enabled browsers

var LocationInfoIndexString="DeliveryIndex";
var shipping2="shipping2";
var shipping="shipping";

// return the current selection which just needs to be a number between 0 and number of locations
// also sets the viewed list on the paypal form to that which is stored in the cookie
function getLocationInfoIndex(maxLocations) 
{
	// start with the last one which should be the most expensive
	var locationInfoIndex =maxLocations-1;
		// look if a cookie has been stored
	var allcookies=document.cookie;
	position=allcookies.indexOf(LocationInfoIndexString);
	var start=position+LocationInfoIndexString.length;
	var end=allcookies.indexOf(";", start);
	if(end<0)
	{
		end=allcookies.length;
	}
	if(end>0 && start>=0)
	{
		locationInfoIndex=allcookies.substring(start, end);
	}
	else
	{
		// locationInfoIndex is undefined so define it now to be the maximum
		locationInfoIndex=maxLocations-1;
		setLocationInfoIndex(locationInfoIndex);
	}
		
	if(locationInfoIndex<0 || locationInfoIndex> maxLocations-1)
	{
		locationInfoIndex =maxLocations-1;
		setLocationInfoIndex(locationInfoIndex);
	}	
	if(document.forms['paypalform'] && document.forms['paypalform'].elements[shipping])
	{
		// update the current selection to the one saved in the cookie
		document.forms['paypalform'].elements[shipping].selectedIndex=locationInfoIndex;
		// set the shipping2 value as well
		document.forms['paypalform'].elements[shipping2].value=document.forms['paypalform'].elements[shipping].options[locationInfoIndex].value;
	}
	return locationInfoIndex;
}
function setLocationInfoIndex(LocationInfoIndex) 
{
	var nextYear=new Date();
	nextYear.setFullYear(nextYear.getFullYear()+1);
	document.cookie=LocationInfoIndexString+LocationInfoIndex+"; expires="+nextYear.toGMTString()+"; path=/";
	return;
}
// change shipping2 to be the same as shipping and also save it in the cookie
function changeShipping2(list)
{
	var save;
	save= list.selectedIndex; 
	setLocationInfoIndex(save);
	document.forms['paypalform'].elements[shipping2].value=list.options[save].value;
}
// -->


