if (document.getElementById) DOM = true; else DOM = false;
dom = DOM;

function turnOn (imgId) {
	imgSrc = document.getElementById(imgId).getAttribute("src");
	replaceInImageSrc(imgId, "_off.", "_on.");
} // function turnOn

function turnOff (imgId) {
	imgSrc = document.getElementById(imgId).getAttribute("src");
	replaceInImageSrc(imgId, "_on.", "_off.");
} // function turnOff

function setDisabled (imgId) {
	imgSrc = document.getElementById(imgId).getAttribute("src");
	replaceInImageSrc(imgId, "_off.", "_disabled.");
	replaceInImageSrc(imgId, "_on.", "_disabled.");
} // function turnOn

function setEnabled (imgId) {
	imgSrc = document.getElementById(imgId).getAttribute("src");
	replaceInImageSrc(imgId, "_disabled.", "_off.");
} // function turnOff

function replaceInImageSrc (imgId, replace, replaceBy)
{
	if (dom) {
		imgSrc = document.getElementById(imgId).getAttribute("src");
		if (imgSrc.indexOf(replace) > 0) imgSrc = imgSrc.substring(0, imgSrc.indexOf(replace)) + replaceBy + imgSrc.substring(imgSrc.indexOf(replace) + replace.length, imgSrc.length);
		document.getElementById(imgId).setAttribute("src", imgSrc);
	}
} // function replaceInImageSrc

function addBookmark (title, url)
{
	if (navigator.appName != "Microsoft Internet Explorer")
		window.external.addPanel(title, url, '');
	else
		window.external.addFavorite(url, title);
} // function addBookmark
