function SetCounties(lstState,lstCounty,hidCounty,rememberSelection)
{
	var selected;
	if (rememberSelection && lstCounty.options.length>0 && lstCounty.selectedIndex >= 0)
	{
		selected = hidCounty.value;
	}
	lstCounty.options.length=0;
	
	var items;
	var list = counties[lstState.selectedIndex] ;
	items = list.split("|");
	
	for (i=0;i<items.length;i+=2)
	{
		lstCounty.options[i/2] = new Option(items[i+1],items[i]);
		if (rememberSelection && selected==items[i])
			lstCounty.options[i/2].selected=true;
	}
	
	if (hidCounty.value=="")
	{
		hidCounty.value = lstCounty.options[lstCounty.selectedIndex].value;
	}
	
}

function SwapImage(img,mainImage,imgCaption,mainCaption)
 {
 	// Swap the two images
 	var thumbImagePath = img.src;
 	var mainImagePath = mainImage.src;
 	var newMainImagePath;
 	var newThumbImagePath;
 	
 	newMainImagePath = thumbImagePath.replace("_thumb.","_main.");
 	newThumbImagePath = mainImagePath.replace("_main.","_thumb.");
 	
 	mainImage.src = newMainImagePath;
 	img.src = newThumbImagePath;
 	
 	// We know that mainCaption is always a hidden and imgCaption is always a span tag
 	var imgCap;
 	var mainCap;
 	
 	imgCap = imgCaption.innerText;
 	mainCap = mainCaption.value;
 	
 	mainCaption.value=imgCap;
 	imgCaption.innerText=mainCap;
}

function detail_MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=detail_MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
