/*- Увеличение картинок colorbox -*/
$(document).ready(function()
{ 
$("a[rel='jack']").colorbox({transition:"fade"}); 
$("a[rel='under']").colorbox({transition:"fade"});
$(".iframe").colorbox({width:"80%", height:"80%", iframe:true});
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here."); 
return false; });
$("#inline").colorbox({width:"50%", inline:true, href:"#inline_example1", title:"Inline"}); 
})	
/* ---------------------------- */

// потемнение персон
$(function() { 
    $("#test0961").click(function() { 
    $(this).expose({api: true}).load(); 
	}); 



	// Lazy load
	$('.article-content img').lazyload({
		effect :     'fadeIn',
		//placeholder: 'http://i.nsawt.ru/css/jpg/images/loading.gif'
	});

	
/* Картиночки от 0,3 к 0,3 */	
$('.hover_image img').css('opacity', 0.3).hover(function(){
	$(this).stop().animate({opacity: 1}, 500);
	}, function(){
	$(this).stop().animate({opacity: 0.3}, 500);	
	});
	

// Каруселька правая вертикальная		
$('#mycarousel').jcarousel({
    vertical: true,
    scroll: 2
    });	
	

	
	
	
});


// Таблесортировалка к jquery.tablesorter.js
$(function() {		
	$("#tablesorter-demo").tablesorter({sortList:[[0,0],[2,1]], widgets: ['zebra'],headers: { 1:{sorter: false}}});
	$("#options").tablesorter({sortList: [[0,0]], headers: { 3:{sorter: false}, 4:{sorter: false}}});
	});	
	
$(document).ready(function() { 
    $("table").tablesorter({widgets:['zebra']}); 
    $("table").bind("sortStart",function() { 
    $("#overlay").show(); 
    }).bind("sortEnd",function() { 
    $("#overlay").hide(); 
    }); 		
}); 



// Функция "Добавить в Избранное"
function add2Fav(url,title, link_name) {
    if (!url) url = location.href;
    if (!title) title = document.title;

    if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')) {
        window.sidebar.addPanel (title, url, '');
    } else if (typeof window.external == 'object') {
        window.external.AddFavorite(url, title);
    } else if (window.opera && document.createElement) {
        document.getElementById(link_name).setAttribute('rel','sidebar');
        document.getElementById(link_name).setAttribute('href',url);
        document.getElementById(link_name).setAttribute('title',title);
      } else {
        return false;
    }
return true;
}
