function openWindow(url, title) {
	window.open(url, title, "toolbar=no,status=yes,scrollbars=no,resizable=no,width=490,height=320");
}

function resizeWindow() {
	IE7 = ((document.all) && (navigator.appVersion.indexOf("MSIE 7.") != -1)) ? true : false;
	if (IE7) {
		this.window.resizeTo(document.images['img'].width + 40, document.images['img'].height + 135);
	}
	else {
		this.window.resizeTo(document.images['img'].width + 40, document.images['img'].height + 140);
	}
}

function showObject(obj) {
	var x = document.getElementById(obj);
	x.style.display = "table";
}

function hideObject(obj) {
	var x = document.getElementById(obj);
	x.style.display = "none";
}

function urlencode(str) {
	str = escape(str);
	str = str.replace('+', '%2B');
	str = str.replace('%20', '+');
	str = str.replace('*', '%2A');
	str = str.replace('/', '%2F');
	str = str.replace('@', '%40');
	return str;
}

function urldecode(str) {
	str = str.replace('+', ' ');
	str = unescape(str);
	return str;
}

function changeCountry(form) {
	//window.location.href = form.url.value + '?d=' + form.day.options[form.day.selectedIndex].value + '&m=' + form.month.options[form.month.selectedIndex].value + '&y=' + form.year.options[form.year.selectedIndex].value + '&n=' + form.country.options[form.country.selectedIndex].value;
	window.location.href = form.url.value + '?d=' + form.date.value + '&n=' + form.country.options[form.country.selectedIndex].value;
}

function changeClub(form) {
	//window.location.href = form.url.value + '?d=' + form.day.options[form.day.selectedIndex].value + '&m=' + form.month.options[form.month.selectedIndex].value + '&y=' + form.year.options[form.year.selectedIndex].value + '&n=' + form.country.options[form.country.selectedIndex].value + '&l=' + form.club.options[form.club.selectedIndex].value;
	window.location.href = form.url.value + '?d=' + form.date.value + '&n=' + form.country.options[form.country.selectedIndex].value + '&l=' + form.club.options[form.club.selectedIndex].value;
}

function changeCourse(form) {
	//window.location.href = form.url.value + '?d=' + form.day.options[form.day.selectedIndex].value + '&m=' + form.month.options[form.month.selectedIndex].value + '&y=' + form.year.options[form.year.selectedIndex].value + '&n=' + form.country.options[form.country.selectedIndex].value + '&l=' + form.club.options[form.club.selectedIndex].value + '&c=' + form.course.options[form.course.selectedIndex].value;
	window.location.href = form.url.value + '?d=' + form.date.value + '&n=' + form.country.options[form.country.selectedIndex].value + '&l=' + form.club.options[form.club.selectedIndex].value + '&c=' + form.course.options[form.course.selectedIndex].value;
}

function changeCourseStatHole(form) {
	window.location.href = form.url.value + '?course=' + form.course.options[form.course.selectedIndex].value;
}
/*
function changeDrive(form) {
	window.location.href = form.url.value + '?c=' + form.course.options[form.course.selectedIndex].value + '&h=' + form.hcp.value + '&d=' + form.drive.options[form.drive.selectedIndex].value;
}
*/
function changeCountrySC(form) {
	window.location.href = form.url.value + '?n=' + form.country.options[form.country.selectedIndex].value + '&c=' + form.count.value;
}

function changeClubSC(form) {
	window.location.href = form.url.value + '?n=' + form.country.options[form.country.selectedIndex].value + '&l=' + form.club.options[form.club.selectedIndex].value + '&c=' + form.count.value;
}

function changeCourseSC(form) {
	window.location.href = form.url.value + '?n=' + form.country.options[form.country.selectedIndex].value + '&l=' + form.club.options[form.club.selectedIndex].value + '&s=' + form.course.options[form.course.selectedIndex].value + '&c=' + form.count.value;
}

function changeTypeSC(form) {
	if (form.type.options[form.type.selectedIndex].value == "ONE_PLAYER") {
		form.count.disabled = true;
	}
	if (form.type.options[form.type.selectedIndex].value == "FLIGHT_ONE"
		|| form.type.options[form.type.selectedIndex].value == "FLIGHT_ALL") {
		form.count.disabled = false;
	}
}

function showSendForm() {
	var sendForm = document.getElementById('sendForm');
	//var commentForm = document.getElementById('commentForm');
	//var comments = document.getElementById('comments');
	if (sendForm != null) {
		sendForm.className = "visible";
	}
	/*
	if (commentForm != null) {
		commentForm.className = "hide";
	}
	if (comments != null) {
		comments.className = "hide";
	}
	*/
}

function hideSendForm() {
	var sendForm = document.getElementById('sendForm');
	if (sendForm != null) {
		sendForm.className = "hide";
	}
}
