$(document).ready(function() {


	$(".single-details-title").css("margin-bottom", 0);
	if($(".single-details-time").width() < 100) $(".single-details-title").css({"left" : "153px"});
	if($(".single-details-title").height() > 30) $(".single-details-title").css({"top" : "8px"});

	if($(".tab-container .active").length != 1) {
		$(".tab-content:eq(0)").addClass("active");
		$(".tab-container .active").fadeIn(200);
	}

	$(".tab-reiter li a").live("click", function(e) {
		e.preventDefault();

		pos = $(this).attr("title");
		$(".tab-reiter li").removeClass("active");
		$(this).parent().addClass("active");
		$(".tab-container .active").removeClass("active").addClass("inactive").fadeOut("fast", function(){
			$("#" + pos).fadeIn("fast", function() {
				if($("#" + pos).hasClass("inactive")) {
					$("#" + pos).removeClass("inactive").addClass("active");
					if($("#map-view").hasClass("active")) {
						curLocation = $(".location").html().replace("  ", "").replace('"', '').replace(",", "").split('&nbsp;')[0];
						curAddress = $(".gmapsAddress").html();
						var myMaps = $("#map");
						myMaps.gMap({
							markers: [{ 
								address: curAddress,	
								html: "<div id='toolTip'><b>" + curLocation + "</b><br /><br />" + curAddress.replace(",", ",<br />") + "</div>",
								icon: { 
									image: 'typo3conf/ext/br_gallerycal/res/images/marker.png',
									shadow: 'typo3conf/ext/br_gallerycal/res/images/marker_shadow.png',
									iconsize: [33, 38],
									iconanchor: [0, 38],
									infowindowanchor: [0,0] }
							}],
							zoom: 14
						});
					};
				}
			});
		});
		Cufon.replace("ul.tab-reiter li a");
	});
});



