/*
 * Copyright : (c) 2009 Webfish IT Services
 * Website   : http://www.webfish.nl
 * Email     : info@webfish.nl
 * -------------------------------------------------------------------------
 *   $Id: functions.js 41 2011-05-03 11:22:27Z caspar $
 * -------------------------------------------------------------------------
 */

switch (lang)
{
default:
case 'en':
	var arr_lang = {
		previous: 'previous',
		next:     'next',
		close:    'close',
		current:  '{current} of {total}'
	};
break;
case 'nl':
	var arr_lang = {
		previous: 'vorige',
		next:     'volgende',
		close:    'sluiten',
		current:  '{current} van {total}'
	};
break;
}

function appendOnLoadAlert(str_msg)
{
	var appendOnLoadAlert_oldOnload = (window.onload) ? window.onload : function () { };
	window.onload = function () { appendOnLoadAlert_oldOnload(); alert(str_msg); }
}

$(document).ready(function(){

	Cufon.replace('h1, ul#menu a, div#item div.img a',{
		hover: true
	});

	$('a[rel=external]').attr('target','_blank');

	$('div#item div.img a.item_cbox').colorbox({
		width:'800px',
		height:'600px',
		previous:arr_lang.previous,
		next:arr_lang.next,
		close:arr_lang.close,
		current:arr_lang.current,
		rel:'item_cbox'
	});

	$('div#overview ul li a').each(function(){
		$img = $(this).find('img');
		$img.removeClass('nojs');
		$img = $img.clone().addClass('hover');
		$(this).append($img);

		var $img = $('> img.hover', this).css('opacity', 0);
		$(this).hover(function () {
			// on hover
			$img.stop().fadeTo(750, 1);
		}, function () {
			// off hover
			$img.stop().fadeTo(1000, 0);
		});
	});

});
