﻿// This function checks for browser support of the <audio> tag.  If supported, it then
// locates the id="autoplay" audio element, if any, and plays it.  This is an attempt
// to circumvent an apparent problem with Internet Explorer 9, which sometimes ignores
// <audio autoplay> items.
function playAudio() {
	// Check for audio element support.
	if (window.HTMLAudioElement) {
		try {
			var a = document.getElementById('autoplay');

			if (a) {
//				a.load();
//				a.addEventListener("load", function() { this.play(); }, false);
				a.play();
			}
		}
		catch (e) {
			// Fail silently but show in F12 developer tools console
			if (window.console && console.error("Error:" + e));
		}
	}
}
