// Erinwood Ford JavaScript
$(document).ready(function() {
	// Show/hide info box on homepage  --  index.php
	$("a#btn_moreInfo").click(function () {
		if ($("#moreInfoBox").css("display") == "none") {
			$("#moreInfoBox").slideDown("normal");
			return false;
		}
		else if ($("#moreInfoBox").css("display") == "block") {
			$("#moreInfoBox").slideUp("normal");
			return false;
		}
	});
	
	// Remove a selected time from the Alternate Time in the Child Seat Installation appointment form  --  childseat.php
	$("#lstApptTime").change(function () {
		if ($("#lstApptTime :selected").val() == $("#lstAltTime :selected").val()) {
			alert("Sorry, this time conflicts with your alternate time selected. Please select another time.");
		}
	});
	
	$("#lstAltTime").change(function () {
		if ($("#lstApptTime :selected").val() == $("#lstAltTime :selected").val()) {
			alert("Sorry, this time conflicts with your originally selected requested time. Please select another time.");
		}
	});
});

// Swap image to selected thumbnail  --  view.php
function swapImg(imgName) {
	$("#bigImgLink").attr("href", imgName);
	$("#bigImg").attr("src", imgName);
}

// Auto print window function  --  print.php
function printWindow() {
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) {
		window.print();
	}
}