function bookmark_it(url, title){
	if (window.sidebar)
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)
		window.external.AddFavorite(url, title);
}
function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt){
	jQuery('#sidebar .twitter li').removeClass('active').eq(i-1).addClass('active');
	jQuery('#sidebar .delicious li').removeClass('active').eq(i-1).addClass('active');
}
function mycarousel_initCallback(carousel){
	carousel.buttonNext.hover(function(){
		carousel.stopAuto();
	},function(){
		carousel.startAuto();
	});
	carousel.buttonPrev.hover(function(){
		carousel.stopAuto();
	},function(){
		carousel.startAuto();
	});
	carousel.clip.hover(function(){
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
}
jQuery.noConflict();
jQuery(document).ready(function(){
	jQuery('body.archive,body.search').find('.menu').find('li:first').addClass('current_page_item');
	jQuery('#content').find('a[href^="http"]').not('[href*="'+location.hostname+'"]').attr('target','_blank');
	/*jQuery('#author').attr('disabled','disabled');
	jQuery('#email').attr('disabled','disabled');
	jQuery('#url').attr('disabled','disabled');
	jQuery('#comment').attr('disabled','disabled');
	jQuery('#author').removeAttr('disabled');
	jQuery('#email').removeAttr('disabled');
	jQuery('#url').removeAttr('disabled');
	jQuery('#comment').removeAttr('disabled');*/
	jQuery('#logotype').find('a').mousedown(
		function(){
			jQuery('#logotype').toggleClass('clicked')
	}).mouseup(
		function(){
			jQuery('#logotype').toggleClass('clicked');
	});
	/*var post_items = jQuery('#posts .list .list-item').length;
	for(i=0; i < post_items; i++){
		jQuery('#posts .list .list-item').eq(i).addClass('item-'+i);
		jQuery('#posts .list .item-'+i+' .info').height(jQuery('#posts .list .item-'+i).height());
		jQuery('#posts .list .item-'+i+' .post').height(jQuery('#posts .list .item-'+i).height());
	}*/
	var scroll_top = jQuery(window).scrollTop(); 
	var info = jQuery('.single .info');
	if (info.length) {
		var info_top = info.offset().top;
		if (scroll_top < info_top) {
			info.css({
				'position': 'relative',
				'top': '0'
			});
		} else if (scroll_top > info_top) {
			info.css({
				'position': 'fixed',
				'top': '20px'
			});
		}
		jQuery(window).scroll(function(){
			var scroll_top = jQuery(window).scrollTop(); 
			if (scroll_top < info_top) {
				info.css({
					'position': 'relative',
					'top': '0'
				});
			} else if (scroll_top > info_top) {
				info.css({
					'position': 'fixed',
					'top': '20px'
				});
			}
		});
	}
	jQuery('a.lightbox').fancybox();
	jQuery('#sidebar .twitter').jcarousel({
		auto: 10,
		initCallback: mycarousel_initCallback,
		itemVisibleInCallback: {onAfterAnimation: mycarousel_itemVisibleInCallback},
		scroll: 1,
		vertical: true,
		visible: 1,
		wrap: 'both'
	});
	jQuery('#sidebar .delicious').jcarousel({
		auto: 10,
		initCallback: mycarousel_initCallback,
		itemVisibleInCallback: {onAfterAnimation: mycarousel_itemVisibleInCallback},
		scroll: 1,
		vertical: true,
		visible: 1,
		wrap: 'both'
	});
});
