$(function(){
	// menu
	var menu = $('.menuCol img');
	menu.hover(
		function(){ $('.menuCol .bg:eq('+menu.index(this)+')').css({'backgroundPosition': '0px -100px'}); },
		function(){ $('.menuCol .bg:eq('+menu.index(this)+')').css({'backgroundPosition': '0px 0px'}); });
		
	// zoomer
	$('.mdlZoomer .body').each(function()
	{
		this.firstChild.id = 'swfZoomer' + Math.floor(Math.random()*100000);
		var list = encodeURIComponent($(this).attr('name'));
		swfobject.embedSWF('/public/flash/zoomer.swf', this.firstChild.id, '100%', '100%', '8.0.0', '/public/flash/expressInstall.swf', {'listPath': list}, {wmode: 'transparent', allowscriptaccess: 'always'});
	});
	
	// slider
	$('.slider').click(function(){ $($(this).attr('href')).slideToggle(); return false; });
});

var debug = function(s)
{
	$('.layFooter p').html($('.layFooter p').html()+'<br/>'+s);
};

var zoomerShow = function()
{
	$('.mdlZoomer .body').css({'zIndex': '3'});
};

var zoomerHide = function()
{
	$('.mdlZoomer .body').css({'zIndex': '1'});
};

var setImg = function(elem)
{
	$(elem).closest('.mdlItemFull').find('.img').attr('src', elem.href);
	$(elem).closest('.photos').find('img').removeClass('act');
	$(elem.firstChild).addClass('act');
	return false;
};

