var info = '#body .galleryblock .galleryblock_info, #body .galleryblock .galleryblock_info_bg';
var minW = 1050;

function onIntialRenderer(){}
function onResizeBodySpecific(){}
function onResizeGalleryItemSpecific(fimg){}
function onResizeSpecific(){}
function onMenuVisibilityChange(ul, visibile){}

function toggleGalleryStickySpecific(isGallery, overlay)
{
	imageOverflow = false;
	$('#sticky_gallery_nav').css('bottom', 8);
	if(isGallery)
	{
		imageOverflow = overlay;
		if(imageOverflow)
		{
			$('#sticky_gallery_nav').css('bottom', 4);
		}
	}
	//$('#content_layer_gallery').height(btm);
}

function onReadySpecific()
{
	galleryBlock = '#body .galleryblock .gallerywrap .galleryfocus .galleryblock_image';
	$(info).css('right', infoIntialPosition);
}

/////////////////////////
// LAYOUT FUNCTIONS
/////////////////////////

var menuHeight = 0;
var menuMaxHeight = 260;
var overflow = false;
var menuItemHeight = 20;

function onMenuClickedSpecific()
{
	onResizeCheckMenu();
}

function onResizeCheckMenu()
{
	//calculate total height, of the menus that are open
	menuHeight = $("#sitemap ul:visible li:visible").size()*menuItemHeight;
	
	//make overflow hidden, set max height
	$("#sitemap").css('overflow', 'hidden');
	$("#sitemap").height(menuMaxHeight);
	
	//make position relative
	$("#sitemap ul:first").css('position', 'relative');
	$("#sitemap ul:first").css("top", 0);
	
	//add arrows, and hide for now
	$('#left').append('<div class="sitemap_arrow" id="sitemap_right"><a href="#">&and;</a></div><div class="sitemap_arrow" id="sitemap_left"><a href="#">&or;</a></div>');
	$('.sitemap_arrow').hide();
	
	//check if arrows are needed
	if(menuHeight > menuMaxHeight)
	{
		overflow = true;
		$('#sitemap_right a').mousedown(function(){startTween(this, 1, $("#sitemap ul:first"), "top");});
		$('#sitemap_left a').mousedown(function(){startTween(this, -1, $("#sitemap ul:first"), "top");});
		$('.sitemap_arrow').show();
	}
	else if(!overflow)
	{
		overflow = false;
		$('.sitemap_arrow').hide();
	}
}

var infoIntialPosition = -617;

function toggleInfo(b)
{
	if(b)
	{
		$(info).css('right', 0);
		$('.scroll_wrap').css('visibility', 'visible');
		$(info).unbind('mouseover');
		$(info).mouseleave(closeInfo);
	}
	else if(!b)
	{
		$(info).css('right', infoIntialPosition);
		$('.galleryblock_info .scroll_wrap').css('visibility', 'hidden');
		$(info).unbind('mouseleave');
		$(info).mouseover(showInfo);
	}
}

function showInfo()
{
	toggleInfo(true);
	return false;
}

function closeInfo()
{
	toggleInfo(false);
	return false;
}

