
	
	

var defaultRating

Estate.Waalwijk = (function() {
	/* START PUBLIC */
	return {
		SetMenu1: function() {
			var menuHideTimeout = 0;
			jQuery("#Menu1 > li").each(function() {
				jQuery(this).mouseover(function() {
					clearTimeout(menuHideTimeout)
					jQuery("#Menu1 > li").removeClass("active")
					jQuery(this).addClass("active")
					if (isIE6) {
						jQuery("#Tools").css("position", "static")
						jQuery("#headerlinks").css("position", "static")
					}
				})
				jQuery(this).mouseout(function() {
					menuHideTimeout = setTimeout("Estate.Waalwijk.HideMenu()", 500)
				})
			})
		},

		HideMenu: function() {
			jQuery("#Menu1 > li").removeClass("active")
			if (isIE6) {
				jQuery("#Tools").css("position", "relative")
				jQuery("#headerlinks").css("position", "relative")
			}
		},

		SetSloppyClicking: function(rootSelector, boxSelector) {
			jQuery(rootSelector + " > " + boxSelector).each(function() {
				if (jQuery(this).find("a").size() > 0 && jQuery(this).find("ul").size() == 0) {
					jQuery(this).click(function() {
						document.location.href = jQuery(this).find("a").attr("href")
					})
					jQuery(this).css("cursor", "pointer")
					jQuery(this).mouseover(function() {
						jQuery(this).find("a").css("text-decoration", "underline")
					})
					jQuery(this).mouseout(function() {
						jQuery(this).find("a").css("text-decoration", "none")
					})
				}
			})
		},

		SetWeb2BlockEvents: function() {
			var link
			jQuery("#Iconslist a").each(function() {
				jQuery(this).css("opacity", 0.5);
				jQuery(this).prepend("<span>" + jQuery(this).attr("title") + "</span>")
				jQuery(this).mouseover(function() {
					jQuery(this).find("span").slideDown(100)
					jQuery(this).css("opacity", 1);
				})
				jQuery(this).mouseout(function() {
					jQuery(this).find("span").slideUp(0)
					jQuery(this).css("opacity", 0.5);
				})
				link = ""
			})

			jQuery("#Rating").data("rating", jQuery("#Rating img[src$='rating-notrated.png']").size())
			var ratingTimeout
			jQuery("#Rating a").mouseover(function() {
				clearTimeout(ratingTimeout)
				var index = -1
				index = jQuery("#Rating a").index(this)
				jQuery("#Rating a:lt(" + index + ")").find("img").attr("src", "/images/rating-rated.png")
				jQuery("#Rating a:eq(" + index + ")").find("img").attr("src", "/images/rating-rated.png")
				jQuery("#Rating a:gt(" + index + ")").find("img").attr("src", "/images/rating-notrated.png")
			})
			jQuery("#Rating a").mouseout(function() {
				ratingTimeout = setTimeout("Estate.Waalwijk.ResetRating()", 500)
			})
		},

		ResetRating: function() {
			jQuery("#Rating a").find("img").attr("src", "images/rating-notrated.png")
			jQuery("#Rating a:eq(" + jQuery("#Rating").data("rating") + ")").find("img").attr("src", "/images/rating-rated.png")
			jQuery("#Rating a:lt(" + jQuery("#Rating").data("rating") + ")").find("img").attr("src", "/images/rating-rated.png")
		},

		SetPagerEvents: function() {
			if (jQuery("ol.pager:not(.tag_ignore)").size() > 0) {
				var image1 = new Image();
				image1.src = "/images/pager-first-active.png";
				var image2 = new Image();
				image2.src = "/images/pager-back-active.png";
				var image3 = new Image();
				image3.src = "/images/pager-next-active.png";
				var image4 = new Image();
				image4.src = "/images/pager-last-active.png";
			}
			jQuery("ol.pager:not(.tag_ignore)").each(function() {
				jQuery(this).addClass("tag_ignore")
				jQuery(this).find("li.tag_pagerFirst a").hover(
					function() { jQuery(this).find("img").attr("src", "/images/pager-first-active.png") },
					function() { jQuery(this).find("img").attr("src", "/images/pager-first.png") }
				)
				jQuery(this).find("li.tag_pagerBack a").hover(
					function() { jQuery(this).find("img").attr("src", "/images/pager-back-active.png") },
					function() { jQuery(this).find("img").attr("src", "/images/pager-back.png") }
				)
				jQuery(this).find("li.tag_pagerNext a").hover(
					function() { jQuery(this).find("img").attr("src", "/images/pager-next-active.png") },
					function() { jQuery(this).find("img").attr("src", "/images/pager-next.png") }
				)
				jQuery(this).find("li.tag_pagerLast a").hover(
					function() { jQuery(this).find("img").attr("src", "/images/pager-last-active.png") },
					function() { jQuery(this).find("img").attr("src", "/images/pager-last.png") }
				)
			})
		},

		SetSearchAdvancedEventsx: function() {
			jQuery("#DatumVan").datepicker({ showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: "dd-mm-yy", buttonText: "Kies startdatum" });
			jQuery("#DatumTot").datepicker({ showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: "dd-mm-yy", buttonText: "Kies einddatum" });
		},
		SetSearchAdvancedEvents: function() {
			jQuery("#fromdate").datepicker({ showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: "dd-mm-yy", buttonText: "Kies startdatum" });
		},

		SetActiviteitenSearchEvents: function() {
			jQuery("#ActiviteitenVan").datepicker({ showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: "dd-mm-yy", buttonText: "Kies startdatum" });
			jQuery("#ActiviteitenTot").datepicker({ showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: "dd-mm-yy", buttonText: "Kies einddatum" });
		},

		PlaceSpotlight: function() {
			var flashvars = {};
				flashvars.configURL = "/Pub/Configuration/XML/config.xml"
				flashvars.path = "" // dit pad wordt gebruikt als root voor de te laden foto's
			var params = {};
				params.wmode = "transparent";
			var attributes = {};

			if (swfobject.getFlashPlayerVersion().major >= 9) {
				swfobject.embedSWF("/flash/menu.swf?random=" + Math.random(), "Spotlight", "960", "294", "9.0.0", "flash/expressInstall.swf", flashvars, params, attributes);
			}
		},

		SetAccordionEvents: function(index) {
			var _index = 0
			if (typeof (index) == "number") {
				_index = index
			}
						jQuery("#Accordion dd").hide();
			jQuery("#Accordion dt:eq("+ _index +")").addClass("active");
			jQuery("#Accordion dd:eq("+ _index +")").slideDown("slow")

			jQuery("#Accordion dt").click(function() {
				jQuery("#Accordion dt").removeClass("active")
				jQuery(this).addClass("active")
				if (jQuery(this).next("dd").is(":hidden")) {
					jQuery("#Accordion dd").slideUp("slow")
					jQuery(this).next("dd").slideDown("slow");
				}
			})
		}
	}
	/* END PUBLIC */
})();

