function addfav() {
    // user agent sniffing is bad in general, but this is one of the times 
    // when it's really necessary
    var ua=navigator.userAgent.toLowerCase();
    var isKonq=(ua.indexOf('konqueror')!=-1);
    var isSafari=(ua.indexOf('webkit')!=-1);
    var isMac=(ua.indexOf('mac')!=-1);
    var buttonStr=isMac?'Command/Cmd':'CTRL';

    if(window.external && (!document.createTextNode ||
      (typeof(window.external.AddFavorite)=='unknown'))) {
        // IE4/Win generates an error when you
        // execute "typeof(window.external.AddFavorite)"
        // In IE7 the page must be from a web server, not directly from a local 
        // file system, otherwise, you will get a permission denied error.
        window.external.AddFavorite(document.location.href, document.title); // IE/Win
    } else if(isKonq) {
      	alert('Please press CTRL + B to bookmark our site.', 'Bookmark This Page');
    } else if(window.opera) {
      	alert('In order to bookmark this site you need to do so manually through your browser.', 'Bookmark This Page');
    } else if(window.home || isSafari) { // Firefox, Netscape, Safari, iCab
      	alert('Please press '+buttonStr+' + D to bookmark our site.', 'Bookmark This Page');
    } else if(!window.print || isMac) { // IE5/Mac and Safari 1.0
      	alert('Please press Command/Cmd + D to bookmark our site.', 'Bookmark This Page');
    } else {
      	alert('In order to bookmark this site you need to do so manually through your browser.', 'Bookmark This Page');
    }
}


$().ready(function(){
	$('#btn-add-to-bookmark').click(function(){
		addfav();
	})
})

