function AddFavorite() {
	var name = navigator.appName;
	var useragent = navigator.userAgent;
	var version = parseInt(navigator.appVersion);
	if ( useragent.indexOf("MSIE") != -1) {
		var index = navigator.userAgent.indexOf("MSIE ");
		if ( index != -1 ) {
			version = parseInt(navigator.userAgent.substring(index+5,index+6));
		}
		if ( version > 4) {
			window.external.AddFavorite('http://www.v2b.ru','Журнал «Время Бухгалтера»');
		}
	}
}

function docTitle(title) {
	dtitle = '';
	if (title.length > 0) {dtitle=title + ' - ';}
	dtitle += 'Журнал «Время Бухгалтера»';
	window.document.title = dtitle;
}

function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}
 
function bookmark(a){
 var url = 'http://www.v2b.ru';//window.document.location;
 var title = 'Журнал «Время Бухгалтера»';//window.document.title;
 var b = getBrowserInfo();
 if (b.type == 'IE' && 7 >= b.version && b.version >= 4) window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = url+','+title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
 return false;
}
