var appCache = window.applicationCache;
var updateProg;

function setCacheOptions(){
	cacheSpan = document.getElementById('cacheStatus');
	if (appCache.status == appCache.UNCACHED) { 
		cacheSpan.textContent="Not installed yet."; 
	}
	 
	appCache.oncached = function() { 
		cacheSpan.textContent="Install Complete"; 
	};

	appCache.onchecking = function() { 
		cacheSpan.textContent="Checking for update...."; 
	};

	appCache.onnoupdate = function() { 
		cacheSpan.textContent="Latest version installed."; 
	};

	appCache.onerror = function() { 
		cacheSpan.textContent="Error!! Contact html5<at>dublinbikes2go.com"; 
	};
	appCache.ondownloading = function() { 
		updateProg =0;
		cacheSpan.textContent="Downloading....";
	};

	appCache.onprogress = function() { 
		updateProg++;
		cacheSpan.textContent="Download progress: "+updateProg;
	};

	appCache.onupdateready = function() { 
		cacheSpan.textContent="Update Ready...."; 
		window.location.reload();
	};
}

