var curDesc;
var loc;
var rand;

$(document).ready(function() 
{
	var bg = 'themes/inndeknip/images/bg.jpg';
	_addBackground(bg);

	//arrows
	$('#deco a').hoverIntent(function()
	{
		curDesc = $(this).html();
		loc = $(this).offset();
		rand = Math.floor(Math.random() * 8) + 1;
		
		curID = $(this).parent().attr('id')
		addToTop = (curID == 'map-5') ? 70 : (curID == 'map-3') ? -65 : -40;
		
		$('#arrow p').removeClass().addClass('opt-'+rand);
		$('#arrow span').html(curDesc);
		$('#arrow').css({ 'top' : loc.top + addToTop + 'px', 'left' : loc.left + 10 + 'px' }).show();	
	},
	function(){
		$('#arrow').hide();
	});
	
	if($('#slides-wrapper').length > 0)
	{
		$('#slides').cycle({
			fx: 'fade',
		    speed: 'slow',
		    timeout: 4500,
			pause: 1,
			cleartype: true,
			cleartypeNoBg: true		
		});
	}
	
	//lightbox
	$('.lightbox').lightBox({
		//..
	});	
	
});

function _addBackground(bg)
{
	if($.backstretch)
		$.backstretch(bg, { speed: 150 });
}
