/* 
*  Copyright 2006-2010 Dynamic Site Solutions.
*  Free use of this script is permitted for non-commercial applications,
*  subject to the requirement that this comment block be kept and not be
*  altered.  The data and executable parts of the script may be changed
*  as needed.  Dynamic Site Solutions makes no warranty regarding fitness
*  of use or correct function of the script.  Terms for use of this script
*  in commercial applications may be negotiated; for this, or for other
*  questions, contact "license-info@dynamicsitesolutions.com".
*
*  Script by: Dynamic Site Solutions -- http://www.dynamicsitesolutions.com/
*  Last Updated: 2010-03-05
*/

//IE5+/Win, Firefox, Netscape 6+, Opera 7+, Safari, Google Chrome for Windows,
// Konqueror 3, IE5/Mac, iCab 3

var isMSIE=/*@cc_on!@*/false; // http://dean.edwards.name/weblog/2007/03/sniff/
var isIEmac=false; /*@cc_on @if(@_jscript&&!(@_win32||@_win16)&&(@_jscript_version<5.5)) isIEmac=true; @end @*/

function isEmpty(s) { return ((s == '') || /^\s*$/.test(s)); }

function AddBookmark(title, url) {
	if (window.external && isMSIE && !isIEmac) {
		window.external.AddFavorite(url, title);
	} else {
		var ua = navigator.userAgent.toLowerCase(), str = '';
		var isWebkit = (ua.indexOf('webkit') != -1), isMac = (ua.indexOf('mac') != -1);
		if (ua.indexOf('konqueror') != -1) {
			str = 'CTRL + B'; // Konqueror
		} else if (window.home || isWebkit || isIEmac || isMac) {
			// Firefox, Netscape, Safari, iCab, IE5/Mac
			str = (isMac ? 'Command/Cmd' : 'CTRL') + ' + D';
		}
		alert ((str) ? 'Press ' + str + ' to bookmark this page.' : str);
	}
}
