// JavaScript Document

jQuery(document).ready(function()
{
	// FONTSIZER
	
  fontResizer('70%','75%','105%');
	
	// CYCLE KAMPAGNE
	
	randoms = new Array('4000', '5000', '6000', '7000', '8000');
	
	jQuery('.entry-image').cycle(
	{ 
  	fx: 'fade',    
  	delay: 2000,
		speed: 1000,
		timeoutFn: calculateTimeout 
	});
	
	function calculateTimeout(currElement, nextElement, opts, isForward)
	{
  	randomize = randoms[Math.round(Math.random() * 4)]; 
		return randomize;
	}

	// BOXED HEADLINES
	
	jQuery('h1').each(function()
	{
		$el = jQuery(this);
		$text = $el.val();
		$el.wrapInner('<span>' + $text + '</span>');
	});
	
	jQuery('div.right-header').find('img:eq(1)').css('opacity', 0);
	
	jQuery('div.right-header').hover(function()
	{
		jQuery(this).find('img:eq(1)').stop().animate(
		{
			'opacity' : 1
		}, 1500, 'easeOutExpo');
	}, function()
	{
		jQuery(this).find('img:eq(1)').stop().animate(
		{
			'opacity' : 0
		}, 1500, 'easeOutExpo');
	});
	
	jQuery('ul#navigation li').hover(function()
	{
		jQuery(this).stop().animate(
		{
			'paddingLeft' : 20 + 'px'
		}, 500, 'easeOutExpo');
	}, function()
	{
		jQuery(this).stop().animate(
		{
			'paddingLeft' : 10 + 'px'
		}, 500, 'easeOutExpo');
	});
	
	jQuery('ul#blog li').hover(function()
	{
		jQuery(this).stop().animate(
		{
			'paddingLeft' : 20 + 'px'
		}, 500, 'easeOutExpo');
	}, function()
	{
		jQuery(this).stop().animate(
		{
			'paddingLeft' : 10 + 'px'
		}, 500, 'easeOutExpo');
	});
	
	$("a.fancygroup").fancybox({'hideOnContentClick':false,'overlayColor':'#000000','overlayOpacity':0.65});

	
});