function doBookmark(url) {					
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
	window.external.AddFavorite(url,document.title);
	}
	else {
	var msg = "Your browser requires you to add the bookmark yourself";
	if(navigator.appName == "Netscape") msg += "  (CTRL-D)";
	alert(msg)
	}
}

function doIndustryBookmark(url) {					
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
	window.external.AddFavorite(url,document.title);
	}
	else {
	var msg = "Your browser requires you to add the bookmark yourself";
	if(navigator.appName == "Netscape") msg += "  (CTRL-D)";
	alert(msg)
	}
}

function buildLink(href,title,innerHTML,rel,onclick){
	var afa = document.createElement('a');
	afa.title=title;
	if(rel){afa.rel=rel;}
	afa.innerHTML=innerHTML;
	afa.href=href;
	if(onclick){afa.onclick=onclick;}
	return afa;
}

function insertBookmark(elem,usetext){
	if(elem) {
		var text=usetext ? elem.innerHTML : 'Add to Favourites';
		elem.innerHTML='';
		elem.insertBefore(buildLink('#','Add to Favourites',text,'nofollow',function(){doBookmark(document.location.href); return false;}), elem.firstChild);
	}
}
insertBookmark(document.getElementById('fav'),false);
insertBookmark(document.getElementById('bookmarkme'),true);
