//[works in IE6, IE7, Firefox 2. displays nice "please add it manually" message in Opera. Doesn't seem to work in Safari]

if (typeof ecnext == "undefined") {
	ecnext = {};
}

if (!("bookmark" in ecnext)) {
	ecnext.bookmark = {};
}

ecnext.bookmark.add = function (urlAddress,pageName) {
	if (window.sidebar) { 
		window.sidebar.addPanel(pageName, urlAddress,""); 
	} else if( document.all ) {
		window.external.AddFavorite( urlAddress, pageName);
	} else if( window.opera && window.print ) {
		alert('Unfortunately, we were unable to bookmark this page for you. Please add the bookmark manually. Thank you.');
	}
}

ecnext.bookmark.addThisPage = function () {
	var urlAddress= document.URL;
	var pageName = document.title;
	ecnext.bookmark.add(urlAddress,pageName);
}

ecnext.bookmark.autoAddThisPage = function () {
	if(location.hash == '#bookmarkme') {
		var urlAddress= document.URL.replace(/#bookmarkme/,"");
		var pageName = document.title;
		ecnext.bookmark.add(urlAddress,pageName);
		location.replace(urlAddress);
	}

}

