function urlifyToken(token) {	token = token.toLowerCase();	token = token.replace("+", "-");	token = token.replace(" ", "_");	token = token.replace(" ", "_");	token = token.replace(" ", "_");	token = token.replace(" ", "_");	token = token.replace(" ", "_");	return token;}function popCountries() {	$("[name=selCountry]").html("<option value=''>Country</option>");	window.thisRegion = urlifyToken($("[name=selRegion]").val());	if(thisRegion=="region")		window.thisRegion = "";			 if(thisRegion!="") {		var artcmsCountries = tcmsCountries[thisRegion].split(",");		for(i=0; i<artcmsCountries.length; i++) {			var urlifiedCountry = urlifyToken(artcmsCountries[i]);			switch(urlifiedCountry) {				case "":					break;				case thisCountry:					$('<option value="' + artcmsCountries[i] + '" selected="selected">' + artcmsCountries[i] + '</option>').appendTo("[name=selCountry]")					break;				default:					$('<option value="' + artcmsCountries[i] + '">' + artcmsCountries[i] + '</option>').appendTo("[name=selCountry]")			}		}		$("[name=selCountry]").attr("disabled", "");	 } else {		  // Reset the countries		  $("[name=selCountry]").html("<option value=''>Country</option>");		  $("[name=selCountry]").attr("disabled", "disabled");	 }}function selMenu() {	var arPath = window.location.pathname.split("/");	if(arPath.length>=3) {		var strURL = arPath[2];		$("#menu li a[href*=" + strURL + "]").addClass("current");	} else if (arPath.length==2) {		var strURL = arPath[1];		if(arPath[1]=="")			$("#menu li a[href=/]").addClass("current");			else			$("#menu li a[href*=" + strURL + "]").addClass("current");	}}$(function(){    // Get the current region and country from the browser URL  if(typeof window.thisRegion=='undefined') {	window.thisRegion = "";	window.thisCountry = "";}  var arPath = window.location.pathname.split("/");  if(arPath.length >= 3) {	  if(arPath[1]=="destinations") {		  window.thisRegion = arPath[2];		  if(arPath.length >= 4) {			window.thisCountry = arPath[3];		  }	  }  }    var artcmsRegions = tcmsRegions.split(",");  // Reset the regions  $("[name=selRegion]").html('<option value="">Region</option>');  // Reset the countries  $("[name=selCountry]").html('<option value="">Country</option>');  if(thisRegion=="")	$("[name=selCountry]").attr("disabled", "disabled");	    for(i=0; i<artcmsRegions.length; i++) {	var urlifiedRegion = urlifyToken(artcmsRegions[i]);	switch(urlifiedRegion) {		case "":			break;		case thisRegion:			$('<option value="' + artcmsRegions[i] + '" selected="selected">' + artcmsRegions[i] + '</option>').appendTo("[name=selRegion]")			break;		default:			$('<option value="' + artcmsRegions[i] + '">' + artcmsRegions[i] + '</option>').appendTo("[name=selRegion]")	}  }    if(thisRegion!="")	popCountries();	  $("[name=selRegion]").bind("change",popCountries);  selMenu();  });