jQuery(function($) {

	//Menu collapsing code
	$("#secondary h3").bind("click", function() {
		var menu = $(this).next();
		if(menu.is(":visible"))	{
			menu.slideUp(300);
			$('a', this).text($('a', this).text().replace(/\-/, "+")); //Mike: Comment this on tripster!
		} else {
			menu.slideDown(300);
			$('a', this).text($('a', this).text().replace(/\+/, "-")); //Mike: Comment this on tripster!
		}
	});
	
	//Tooltip Configuration
	var tooltipId = "tooltip";
	var delimiter = "|";
	var offsetLeft = $.browser.msie ? -91 : -183;
	var offsetTop = -150; //Some quirk for IE needed in the demo

	//Code	
	var ttHTML = $("#"+tooltipId).html();
	$("div.thumbs a[@rel^=tt]").hover(function(e) {
		
		var co = $("img", this).offset({ border: false });
		var relTag = $(this).attr("rel").substr(3, $(this).attr("rel").length-4).split(delimiter);
		
		var nHTML = ttHTML;
		for(var i=0; i<relTag.length; i++) {
			nHTML = nHTML.replace('{'+(i+1)+'}', relTag[i]);	
		}

		$("#"+tooltipId).css({
			top: co.top+offsetTop,
			left: co.left+offsetLeft 
		}).html(nHTML).show();
		
	}, function(e) {$("#"+tooltipId).hide();});
	
	
});