$(document).ready(function() {
	// resizeList();
	
	// quick jumps
	$('.actions .next a, .actions .prev a').click(function(e) {
		e.preventDefault();
	
		var curPos = $('html').position();
		var element = $($(this).attr('href')).offset();		
		var calcTime = (parseInt(curPos.top.toString().replace('-', '')) - 
						element.top).toString().replace('-', '');
		
		$('html, body').animate({
			scrollTop: element.top - 40,
			easing: 'easeInOutExpo'
		}, calcTime);
	});

	
	 $('.page-id-126 .block').each(function() {		
		var $listwork = $(this).find('.reason');
		var sum = $listwork.height() / 2;
		$listwork.css({
			'top' : '50%',
			'margin-top' : '-' + sum + 'px'
		});
	});
	
	/* copy to clipboard */
	var trigger = $('a#copy-shortlink');
	
	trigger.zclip({
		path:'/wp-content/themes/iweb/swf/ZeroClipboard.swf',
		copy:$('span#copy').text(),
		afterCopy:function(){
			$('div.shortlink .feedback').show();
			$('div.shortlink .short-label').hide();
			$('div.shortlink .short-link').hide();
			$('div.shortlink').addClass('copied');
		}
	});
	trigger.click(function(e){ e.preventDefault; });
	
	$('div.shortlink').hover(function(){
		$('div.zclip').toggleClass('hover');
	});
        
        
        $('a#copy-shortlink').zclip({
            path:'/wp-content/themes/iweb/swf/ZeroClipboard.swf',
            copy:$('span#copy').text()
        });
	
	
	
	/*
	$('img.lazy').lazyload({ 
	    effect : 'fadeIn'
	});
	*/
	
});

/*
$(window).resize(function() {
	resizeList();
});

function resizeList() {
	$('.item').each(function() {		
		var $listwork = $(this).find('.info');
		var sum = $listwork.height() / 2;
		$listwork.css({
			'top' : '50%',
			'margin-top' : '-' + sum + 'px'
		});
	});
};
*/

//$('body.parent-pageid-34 h3').fitText(0.6, { minFontSize: '40px', maxFontSize: '75px' });
