function changeForm(formType) {
	document.getElementById('quickquote').action = formType + '.php';
	if (formType == 'quickquote') {
		document.getElementById('quickquoteButton').style.backgroundImage = "url('images/left_on.gif')";
		document.getElementById('quickquoteButton').style.color = "#ffc220";
		document.getElementById('booknowButton').style.backgroundImage = "url('images/right_off.gif')";
		document.getElementById('booknowButton').style.color = "#ffffff";
	} else {
		document.getElementById('quickquoteButton').style.backgroundImage = "url('images/left_off.gif')";
		document.getElementById('quickquoteButton').style.color = "#ffffff";
		document.getElementById('booknowButton').style.backgroundImage = "url('images/right_on.gif')";
		document.getElementById('booknowButton').style.color = "#ffc220";
	}
}

function changeLocation(locationName) {
	document.getElementById('photo').src = '/images/' + locationName + '.gif';
	document.getElementById('auckland').style.color = '#ff0000';
	document.getElementById('airport').style.color = '#ff0000';
	document.getElementById('wellington').style.color = '#ff0000';
	document.getElementById('picton').style.color = '#ff0000';
	document.getElementById('nelson').style.color = '#ff0000';
	document.getElementById('christchurch').style.color = '#ff0000';
	document.getElementById('christchurch_airport').style.color = '#ff0000';
	document.getElementById('queenstown').style.color = '#ff0000';
	document.getElementById(locationName).style.color = '#ffff00';
	switch (locationName) {
		case 'auckland':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Auckland City</span></p><p>75 Beach Road<br />Auckland<br /><br /><b>Freephone from NZ</b><br />0800 52 52 10<br /><br /><b>Freephone from Australia</b><br />1800 144 367<br /><br />Tel + 64 9 377 5573<br />Fax + 64 9 377 5574<br /><br /><a class="goblue" href="locations.php" onclick="locationDetails(\'' + locationName + '\');return false;">Pickup Information</a><br /><a class="goblue" href="locations.php" onclick="viewMap(\'' + locationName + '\');return false;">View Map</a></p>';
			break;
		case 'airport':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Auckland Airport</span></p><p>42 Rennie Drive, Mangere<br />Auckland<br /><br /><b>Freephone from NZ</b><br />0800 22 11 22<br /><br /><b>Freephone from Australia</b><br />1800 144 367<br /><br />Tel + 64 9 275 3265<br />Fax + 64 9 275 3285<br /><br /><a class="goblue" href="locations.php" onclick="locationDetails(\'' + locationName + '\');return false;">Pickup Information</a><br /><a class="goblue" href="locations.php" onclick="viewMap(\'auckland ' + locationName + '\');return false;">View Map</a></p>';
			break;
		case 'wellington':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Wellington</span></p><p>96 Hutt Road<br />Wellington<br /><br /><b>Freephone from NZ</b><br />0800 66 77 22<br /><br /><b>Freephone from Australia</b><br />1800 144 367<br /><br />Tel + 64 4 472 8465<br />Fax + 64 4 472 8466<br /><br /><a class="goblue" href="locations.php" onclick="locationDetails(\'' + locationName + '\');return false;">Pickup Information</a><br /><a class="goblue" href="locations.php" onclick="viewMap(\'' + locationName + '\');return false;">View Map</a></p>';
			break;
		case 'picton':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Picton</span></p><p>1 Lagoon Road<br />Picton<br /><br /><b>Freephone from NZ</b><br />0800 18 19 18<br /><br /><b>Freephone from Australia</b><br />1800 144 367<br /><br />Tel + 64 3 573 5580<br />Fax + 64 3 573 5526<br /><br /><a class="goblue" href="locations.php" onclick="locationDetails(\'' + locationName + '\');return false;">Pickup Information</a><br /><a class="goblue" href="locations.php" onclick="viewMap(\'' + locationName + '\');return false;">View Map</a></p>';
			break;
		case 'nelson':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Nelson</span></p><p>Trent Drive<br />Nelson<br /><br /><b>Freephone from NZ</b><br />0800 27 74 47<br /><br /><b>Freephone from Australia</b><br />1800 144 367<br /><br />Tel + 64 3 546 7780<br />Fax + 64 3 547 4644<br /><br /><a class="goblue" href="locations.php" onclick="viewMap(\'' + locationName + '\');return false;">View Map</a></p>';
			break;
		case 'christchurch':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Christchurch</span></p><p>20 Lichfield Street<br />Christchurch<br /><br /><b>Freephone from NZ</b><br />0800 11 21 21<br /><br /><b>Freephone from Australia</b><br />1800 144 367<br /><br />Tel + 64 3 377 4558<br />Fax + 64 3 377 4559<br /><br /><a class="goblue" href="locations.php" onclick="locationDetails(\'' + locationName + '\');return false;">Pickup Information</a><br /><a class="goblue" href="locations.php" onclick="viewMap(\'' + locationName + '\');return false;">View Map</a></p>';
			break;
		case 'christchurch_airport':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Christchurch Airport</span></p><p>2 Export Avenue, Harewood<br />Christchurch<br /><br />Tel + 64 3 360 2885<br />Fax + 64 3 360 2886<br /><br /><a class="goblue" href="locations.php" onclick="locationDetails(\'' + locationName + '\');return false;">Pickup Information</a><br /><a class="goblue" href="locations.php" onclick="viewMap(\'christchurch airport\');return false;">View Map</a></p>';
			break;
		case 'queenstown':
			document.getElementById('details').innerHTML = '<p><span style="font-weight: bold; font-size: 110%"><font color="#25a8ed">//</font> Queenstown</span></p><p>20 Shotover Street<br />Queenstown<br /><br /><b>Freephone from NZ</b><br />0800 15 48 15<br /><br /><b>Freephone from Australia</b><br />1800 144 367<br /><br />Tel + 64 3 442 5224<br />Fax + 64 3 442 5253<br /><br /><a class="goblue" href="locations.php" onclick="locationDetails(\'' + locationName + '\');return false;">Pickup Information</a><br /><a class="goblue" href="locations.php" onclick="viewMap(\'' + locationName + '\');return false;">View Map</a></p>';
			break;
	}
}

function CreateVoucher()
{
	var strName = document.getElementById("discount_name").value;
	var strVoucher = document.getElementById("voucher_senior").checked;
    var h, w, options;
    w = 450;
    h = 290;
	if (strVoucher == true) h = 320;
    options = "height=" + h + ", width=" + w;
    if (strName != '') {
		x = window.open("create_voucher.php?name=" + strName + "&voucher=" + strVoucher, "voucher", options);	
	} else {
		alert('You must enter your name');
	}
}

function loadOmega() {
	return true;
}

function locationDetails(locationName) {
	var windowProperties = 'width=300,height=300,location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes';
	switch (locationName) {
		case 'auckland':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
		case 'airport':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
		case 'wellington':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
		case 'picton':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
		case 'nelson':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
		case 'christchurch':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
		case 'christchurch_airport':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
		case 'queenstown':
			window.open(locationName + '_details.php', 'details', windowProperties);
			break;
	}
}

function viewMap(locationName) {
	var windowProperties = 'width=500,height=450,location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=no';
	w = window.open('/uploads/map.php?location=' + urlencode(locationName), 'map', windowProperties);
	w.focus();
}