function doFocus() {
	document.form1.hotels.focus();
}

function dispImage(imageName) {
	var img = new Image();
	img.src = imageName;
	var str = "height=" + (img.height + 20) + ", " + "width=" + (img.width + 20);
	window.open(img.src, "Image", str);
}

function dispModule(page) {
	window.open(page, "Module", "status=0, toolbar=0, menubar=0, directories=0, width=10000, height=1000");
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function displayCities(countryId) {
	var cities = document.getElementById("cities[" + countryId + "]");
	if (removeCity[countryId] == true) {
		for (var i=0; i<citiesCountryId.length; i++) {
			if (countryId == citiesCountryId[i]) {
				//alert(citiesName[i]);
				var lineBreak = document.getElementById("lineBreak[" + i + "]");
				cities.removeChild(lineBreak);						
				var city = document.getElementById(citiesName[i]);		
				cities.removeChild(city);		
				
			}
		}
		removeCity[countryId] = false;
	} else {
		removeCity[countryId] = true;
	}
	if (removeCity[countryId] == true) {
		for (var i=0; i<citiesCountryId.length; i++) {
			if (countryId == citiesCountryId[i]) {
				var link = document.createElement("a");
				//link.innerText = citiesName[i];
				//link.textContent = citiesName[i];
				var linkText = document.createTextNode(citiesName[i]);
				link.appendChild(linkText);
				link.setAttribute("href", "plannerindex.php?countryid=" + citiesCountryId[i] + "&cityid=" + citiesId[i]);
				link.setAttribute("id", citiesName[i]);
				cities.appendChild(link);			
				var lineBreak = document.createElement("br");
				lineBreak.setAttribute("id", "lineBreak[" + i + "]");
				cities.appendChild(lineBreak);
			}
		}
	}
}
	
/*
	savedNumOfDaysChosen = readCookie('numOfDaysChosen');
	for (var i=0; i < savedNumOfDaysChosen; i++) {
		var moduleName = 'modName' + i;
		eraseCookie(moduleName);
	}
	eraseCookie('numOfDaysChosen');
	eraseCookie('hotelCategory');
	eraseCookie('hotel');	
	eraseCookie('TotalCostSingle');
	eraseCookie('totalCostTwin');
	eraseCookie('totalCostTriple');
	eraseCookie('totalCostWithBed');
	eraseCookie('totalCostWithoutBed');
*/
