//////////////////////////////////////////////////////
//
//	The purpose of this file is to
//	apply a hover class on mouseover
//	on the <li> elements in the nav.
//	This is because IE doesn't put
//	the pseudo class :hover on <li> elements
//
//	This is code that uses the
//	jquery javascript library (http://jquery.com/)
//
//////////////////////////////////////////////////////

$(document).ready(function() {
	/*
	 * Nav top dropdown code
	 */
	if (document.all&&document.getElementById) {
		// this is needed for the IE 6 pseudo hover class bug
		$(".navtop li").hover(function () {
			$(this).addClass("hover");
		},function () {
			$(this).removeClass("hover");
		});
	} else {
		// this is need for safari when nav covers flash
		$(".navtop li ul").hover(function () {
			$(this).addClass("redraw");
		},function () {
			$(this).removeClass("redraw");
		});
	}

	/*
	 * Increase font size on ff mac
	 */
	if ( /Mac/.test(navigator.platform) && $.browser.mozilla ) {
		$("body").css("font-size", 14);
	}

	/*
	 * more link back button
	 */
	$(".navportfolio li.more a").click(function () {
		window.history.back();
		return false;
	});

	/*
	 * hilight the left nav links when hovering in right nav
	 */
	$(".navportfolio .services .architecture a, #altcontainer .nav_level3 li.architecture a").hover(function () {
		$("#servicesnav .architecture a").css("background-position", "right top");
	},function() {
		$("#servicesnav .architecture a").css("background-position", "left top");
	});

	$(".navportfolio .services .interior a, #altcontainer .nav_level3 li.interior a").hover(function () {
		$("#servicesnav .interior a").css("background-position", "right top");
	},function() {
		$("#servicesnav .interior a").css("background-position", "left top");
	});

	$(".navportfolio .services .sustainability a, #altcontainer .nav_level3 li.sustainability a").hover(function () {
		$("#servicesnav .sustainability a").css("background-position", "right top");
	},function() {
		$("#servicesnav .sustainability a").css("background-position", "left top");
	});

	$(".navportfolio .services .landscape a, #altcontainer .nav_level3 li.landscape a").hover(function () {
		$("#servicesnav .landscape a").css("background-position", "right top");
	},function() {
		$("#servicesnav .landscape a").css("background-position", "left top");
	});

	$(".navportfolio .services .community a, #altcontainer .nav_level3 li.community a").hover(function () {
		$("#servicesnav .community a").css("background-position", "right top");
	},function() {
		$("#servicesnav .community a").css("background-position", "left top");
	});
});
