function addBookmark(loc,tit) {
	//Gecko
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (tit, loc, "");
	//IE4+
	else if (typeof window.external == "object") window.external.AddFavorite(loc, tit);
//	//Opera7+
//	else if (window.opera && document.createElement) {
//		var a = document.createElement('A');
//		if (!a) return false; //IF Opera 6
//		a.setAttribute('rel','sidebar');
//		a.setAttribute('href',loc);
//		a.setAttribute('title',tit);
//		a.click();
//	}
	else return false;
	return true;
};
$(document).ready(function () {
	if($('a.portfolio-img-prev').length > 0 || $('a.portfolio-link-prev').length > 0) {
		$('body').append('<div class="overlay" id="gallery"><a class="prev">назад</a><a class="next">вперед</a><div class="info"></div><img class="progress" src="template/img/loading.gif" /></div>');
		$('a.portfolio-img-prev').overlay({
			target: '#gallery',
			expose: '#111',
			closeOnClick: false,
			onClose: function () {
				$('#img').remove();
				$('#gallery').removeAttr('style')
			}
		}).gallery({
			disabledClass: 'inactive',
			template: '<span>Работа ${index} из ${total}</span>'
		});
		$('a.portfolio-link-prev').overlay({
			target: '#gallery',
			expose: '#111',
			closeOnClick: false,
			onClose: function () {
				$('#img').remove();
				$('#gallery').removeAttr('style')
			}
		}).gallery({
			disabledClass: 'inactive',
			template: '<span>Работа ${index} из ${total}</span>'
		});
	}
})
