$(function() {	initHeight = $("#content").height();	// Background fader	$(".fadedBackground").click(function() {		if ($("#box").css("display") == "block" && !$(this).hasClass("noclose")) {			CloseBooking();		}	});	// Holdbooking	InitPublicTeamBooking();	InitTeamBooking();	// Popover Box	StaticBox();	$(window).resize(function() {		StaticBox();	});	//$(window).scroll(function() {		// StaticBox();	//});	/*	$("#NextScreen").click(function() {		currentID = parseInt($("#currentID").val());		nextID = currentID + 1;		if (currentID < 3) {			var tempMainHeight = $("#main").height();			var tempContentHeight = $("#content").height();			$("#main").css({				height: tempMainHeight			});			$("#book" + currentID).animate({				opacity: 0			}, 200, function() {				$(this).css({					"display": "none"				});				$("#book" + nextID).css({					"display": "block",					"opacity": "0"				});				$("#book" + nextID).animate({					opacity: 1				});				var newContentHeight = $("#content").height();				var newMainHeight = (tempMainHeight - tempContentHeight) + newContentHeight;				$("#main").animate({					height: newMainHeight				});				$("#currentID").val(nextID);			});		}	});	*/});function InitPublicTeamBooking() {	$("img.info").click(function() {		$.ajax({			type: "GET",			url: "ajax_acceptbooking.asp?getinfo=" + $(this).attr("value"),			success: function(html) {				$("#waitdiv #box").html(html);				$("#waitdiv").show();				StaticBox();			}		});		return false;	});	// Team filters	$("div.selector").click(function() {		$(this).parent().find("ul").slideToggle(150);	});	// REWRITE THIS !!!	$("ul.selector label").click(function() {		thisClass = $(this).parent().parent().attr("class");		if ($(this).parent().find("input").attr("value") != "") {			$("ul.selector").find("input").each(function(i) {				if ($(this).attr("value") == "" && $(this).parent().parent().attr("class") == thisClass) {					$(this).attr("checked", false);				}			});		} else {			$("ul.selector").find("input").each(function(i) {				if ($(this).attr("value") != "" && $(this).parent().parent().attr("class") == thisClass) {					$(this).attr("checked", false);				}			});		}	});}function StaticBox() {	//OriginalHeight();	var topMargin = 250;	var boxHeight = $("#waitdiv #box").height() + topMargin;	var boxWidth = $("#waitdiv #box").width();	var parentHeight = $("#content").height();	$("#waitdiv #box").css({		"position" : "absolute",		"top" : $(window).scrollTop() + 100 + "px",		"margin-left" : "-" + (boxWidth + 30) / 2 + "px"	});	if (($("#loader").length == 0 || $("#loader").css("display") == "none") && boxHeight + parseInt($("#waitdiv #box").css("top"), 10) > parentHeight) {		$("#content").height((boxHeight + parseInt($("#waitdiv #box").css("top"), 10)));	}	if (boxHeight - topMargin + 100 > parentHeight) {		$("#content").height(boxHeight + 100 + top); // - topMargin + 1000);	}}function CloseBooking() {	var noClear = false;	$("#waitdiv").find("#no_clear").each(function(i) {		noClear = true;	});	if (noClear) {		$("#waitdiv").hide();	} else {		document.getElementById("waitdiv").style.display = "none";		if (!$.find("#hold")) {			document.getElementById("box").style.display = "none";			document.getElementById("loader").style.display = "block";		}		document.getElementById("box").innerHTML = "";	}	OriginalHeight();}function OriginalHeight() {	if ($("#loader").length === 0 && $("#package-wrapper").length === 0) {		$("#content").height(initHeight);	}}function InitTeamBooking() {	return true;}
