﻿

$(document).ready(function()
{
	MatchContentLength();
	
	//Add colorbox functionality to links that want it (iframe)
	$("a.clsPopMeFrame").colorbox({iframe:true, width:"690px", height:"600px"});
	$("ul.clsPhotoGallery a").colorbox();
	$("a.clsPopMe").colorbox();
	
});


//Set the content height to be the same as the info panel if the content height is less than the info panel height
function MatchContentLength()
{
	var ContentPanel = $("[id$='htmContent']");
	var ActionPanel = $("[id$='htmExtraInfo']");
	
	if (ContentPanel && ActionPanel)
	{
		var ContentHeight = ContentPanel.height();
		var ActionHeight = ActionPanel.height();
		var ContentPadding = parseInt(ContentPanel.css("padding-top")) + parseInt(ContentPanel.css("padding-bottom"));
		var ActionPadding = parseInt(ActionPanel.css("padding-top")) + parseInt(ActionPanel.css("padding-bottom"));
		
		if ((ContentHeight + ContentPadding) < (ActionHeight + ActionPadding))
		{
			ContentPanel.height(ActionHeight - ContentPadding);
		}
	}
}