NavigationMenu.prototype = {};
function NavigationMenu(e) {
	var f = jQuery(e.selectors.list),
	d = jQuery(e.selectors.items),
	c = e.selectors.children;
	a();
	function a() {
		d.css("cursor", "pointer").hover(g, b);
	}
	function g() {
		var k = jQuery(this),
		j = k.find(c),
		h = j.length > 0,
		i = k.hasClass("open");
		k.addClass("hover");
		if (h || i) {
			j.show();
		}
	}
	function b() {
		var k = jQuery(this),
		j = k.find(c),
		h = j.length > 0,
		i = k.hasClass("open");
		k.removeClass("hover");
		if (h || i) {
			j.hide();
		}
	}
}

jQuery.noConflict();

jQuery(function () {
	
	jQuery('DIV.navigation .touch').bind('touchstart', function() {
		window.location.href = this;
	});
	
	navigationMenu = new NavigationMenu({
		selectors: {
			list: "DIV.navigation",
			items: "DIV.navigation UL > LI",
			children: "UL:not(.open)"
		}
	});
	
	jQuery('.slideshow').cycle();
	
	// jQuery(function() {
		jQuery('.gallery a').lightBox({fixedNavigation:true});
	// });
	/*
	jQuery(window).resize(onResize).resize();
	*/
});

// function onResize() {
// 	var a = jQuery("DIV#sidebar"),
// 	b = jQuery("DIV#content"),
// 	d = jQuery(window).height(),
// 	c = jQuery(document).height();
// 	e = jQuery("DIV#header").height();
// 	f = jQuery("UL#footer").outerHeight();
// 	
// 	//Maybe I need to do a clearfix on DIV#sidebarWrapper??
// 	
// 	g = jQuery("DIV#sidebarWrapper").height();
// 	// max = Math.max(c, d);
// 	// min = Math.min(c, d);
// 	// a.css("min-height", (((Math.min(c, d) - e) - f) - 15) + "px");
// 	// a.css("min-height", g + "px");
// 	// b.css("min-height", (Math.max(c, d)) - parseInt(b.css("padding-top"), 10) + "px");
// 	if (jQuery.browser.msie && parseInt(jQuery.browser.version) == 6) {
// 		jQuery("BODY").css("position", "relative");
// 		// a.css("height", (Math.min(c, d) - 30) + "px");
// 		a.css("height", g + "px");
// 	}
// 	// jQuery("p").html("window.height(): "+d+"<br />document.height(): "+c+"<br />DIV#header.height(): "+e+"<br />DIV#UL#footer.outerHeight(): "+f+"<br />max: "+max+"<br />min: "+min);
// 	jQuery("p").html("DIV#sidebarWrapper.height(): "+g);
// }
