/*================================================*
*
*	Drop Down Navigation for La Redoute.co.uk
*	Version 9 created 28/10/09
*	Last Modified 30/01/10 by J.Fallon
*
*================================================*/

$(function(){
	
	var defSignIn = $("#LAR_genericLoggedOutHeader").html();
	
	if( $('.subnav-bar').length == 0 )
	{
		// No subnav-bar so must be using generic nav
		$("#navigation-bar > a").hoverIntent( 
		function(){//mouse over
			navReset();
			var tab = eval($(this).attr("subnav"));
			if($(this).attr("id")!= "navbar-sale")
				$(this).addClass("navHover");
			else
				$(this).addClass("navHoverSale");
			$(".pageIndicator").css("visibility", "hidden");
			$("#LAR_genericLoggedOutHeader").html(tab);
			$("#LAR_genericLoggedOutHeader").hover (  function(){}, function(){ navReset(); } );
		}, 
		function(){}//mouse out
		 );
		
	} else {
		// subnav-bar exists so must be in a category
		$("#navbar-ourshops").hoverIntent(function(){showOurShops();},function(){});//.addClass("navHover");
		$("#navbar-homeware").hover(function(){navReset()},function(){});
		$("#navbar-sale").hover(function(){navReset()},function(){});
		$(".subnav-bar > ul > li").hoverIntent(
			function(){ $(this).children(".thirdTier").show(); $("select").css("visibility", "hidden");},
			function(){ $(this).children(".thirdTier").hide(); $("select").css("visibility", "visible");}
		);
	}
	function navReset(){
		$("#navigation-bar > a").removeClass("navHover");
		$("#navigation-bar > a").removeClass("navHoverSale");
		$("#LAR_genericLoggedOutHeader").html(defSignIn);	
		$(".pageIndicator").css("visibility", "visible");
		$("#ourShopsDD").hide();
		$("select").css("visibility", "visible");
	}
	
	function showOurShops(){
		$("#ourShopsDD").show();
		$("#ourShopsDD").hover ( function(){}, function(){ navReset(); } );
		$(".pageIndicator").css("visibility", "hidden");
		$("select").css("visibility", "hidden");
	}
});

// Below is the HTML for each of the different drop down menus.
var newInLnk='<div class="subnav-bar"><ul class="secondTier"><li class="nav-top"><div><a title="women" href="/clothing/New-In.aspx?CategoryId=50873961&Path=50873961/51011752&ChmCatId=51011752">Women</a></div></li><li class="nav-top"><div><a title="men" href="/clothing/New-In.aspx?CategoryId=50873961&Path=50873961/51011824&ChmCatId=51011824">Men</a></div></li><li class="nav-top"><div><a title="children" href="/clothing/New-In.aspx?CategoryId=50873961&Path=50873961/51011993&ChmCatId=51011993">Children</a></div></li></ul></div>';
var womenLnk='<div class="subnav-bar"><ul class="secondTier cramped"><li class="nav-top"><div><a title="New In" href="/clothing/New-In.aspx?CategoryId=61045377&Path=61026618/61045377&ChmCatId=61045377">New In</a></div></li><li class="nav-top"><div><a href="/clothing/Tops.aspx?CategoryId=61045378&Path=61026618/61045377/61045378&ChmCatId=61045378" title="Tops" >Tops</a></div></li><li class="nav-top"><div><a href="/clothing/Shirts-Blouses.aspx?CategoryId=61028888&Path=61026618/61028888&ChmCatId=61028888" title="Shirts &amp; Blouses" >Shirts</a></div></li><li class="nav-top"><div><a href="/clothing/Knitwear.aspx?CategoryId=61030394&Path=61026618/61030394&ChmCatId=61030394" title="Knitwear" >Knitwear</a></div></li><li class="nav-top"><div><a href="/clothing/Trousers-Cropped-Trousers.aspx?CategoryId=61031479&Path=61026618/61031479&ChmCatId=61031479" title="Trousers &amp; Cropped Trousers" >Trousers</a></div></li><li class="nav-top" id=""><div><a href="/clothing/Jeans.aspx?CategoryId=61032587&Path=61026618/61032587&ChmCatId=61032587" title="Jeans" >Jeans</a></div></li><li class="nav-top"><div><a href="/clothing/Skirts.aspx?CategoryId=61033219&Path=61026618/61033219&ChmCatId=61033219" title="Skirts" >Skirts</a></div></li><li class="nav-top"><div><a href="/clothing/Dresses.aspx?CategoryId=61033616&Path=61026618/61033616&ChmCatId=61033616" title="Dresses" >Dresses</a></div></li><li class="nav-top"><div><a href="/clothing/Jackets-Coats.aspx?CategoryId=61034338&Path=61026618/61034338&ChmCatId=61034338" title="Jackets &amp; Coats" >Jackets &amp; Coats</a></div></li><li class="nav-top"><div><a href="/clothing/Swimwear.aspx?CategoryId=61034991&Path=61026618/61034991&ChmCatId=61034991" title="Swimwear" >Swimwear</a></div></li><li class="nav-top"><div><a href="/clothing/Shoes.aspx?CategoryId=61035209&Path=61026618/61035209&ChmCatId=61035209" title="Shoes" >Shoes</a></div></li><li class="nav-top"><div><a href="/clothing/Accessories.aspx?CategoryId=61035731&Path=61026618/61035731&ChmCatId=61035731" title="Accessories" >Accessories</a></div></li><li class="nav-top"><div><a href="/clothing/Sportswear.aspx?CategoryId=61026618&&Path=61026618/61036254&&ChmCatId=61036254" title="Sportswear" >Sports</a></div></li><li class="nav-top"><div><a href="/clothing/Maternity.aspx?CategoryId=61036885&Path=61026618/61036885&ChmCatId=61036885" title="Maternity" >Maternity</a></div></li><li class="nav-top"><div><a href="/clothing/Plus-Size.aspx?CategoryId=61036995&Path=61026618/61036995&ChmCatId=61036995" title="Plus Size" >Plus Size</a></div></li></ul></div>';
var lingerieLnk='<div class="subnav-bar"><ul class="secondTier"><li class="nav-top"><div><a title="Bras" href="/clothing/Bras.aspx?CategoryId=17513341">Bras</a></div></li><li class="nav-top"><div><a title="Knickers & Briefs" href="/clothing/Knickers-Briefs.aspx?CategoryId=17513390">Knickers &amp; Briefs</a></div></li><li class="nav-top"><div><a title="Tops" href="/clothing/Tops.aspx?CategoryId=17513415">Tops</a></div></li><li class="nav-top"><div><a title="Stockings and Socks" href="/clothing/Stockings-Socks.aspx?CategoryId=17513443">Stockings &amp; Socks</a></div></li><li class="nav-top"><div><a title="Nightwear" href="/clothing/Nightwear.aspx?CategoryId=17513465">Nightwear</a></div></li><li class="nav-top"><div><a title="Sexy" href="/clothing/Sexy.aspx?CategoryId=17513491">Sexy</a></div></li><li class="nav-top"><div><a title="Mum-to-be" href="/clothing/Mum-to-be.aspx?CategoryId=17513516">Mum-to-be</a></div></li></ul></div>';
var plusSizeLnk='<div class="subnav-bar"><ul class="secondTier"><!--<li class="nav-top"><div><a title="New In" href="/clothing/New-In.aspx?CategoryId=61028325&Path=61028324/61028325&ChmCatId=61028325">New In</a></div></li>--><li class="nav-top"><div><a title="Tops" href="/clothing/Tops.aspx?CategoryId=61028327&Path=61028324/61028327&ChmCatId=61028327">Tops</a></div></li><li class="nav-top"><div><a title="Shirts &amp; Blouses" href="/clothing/Shirts-Blouses.aspx?CategoryId=61028811&Path=61028324/61028811&ChmCatId=61028811">Shirts</a></div></li><li class="nav-top"><div><a title="Knitwear" href="/clothing/Knitwear.aspx?CategoryId=61029050&Path=61028324/61029050&ChmCatId=61029050">Knitwear</a></div></li><li class="nav-top"><div><a title="Trousers, Jeans &amp; Shorts" href="/clothing/Trousers-Jeans-Shorts.aspx?CategoryId=61029903&Path=61028324/61029903&ChmCatId=61029903">Trousers &amp; Jeans</a></div></li><li class="nav-top"><div><a title="Jackets &amp; Coats" href="/clothing/Jackets-Coats.aspx?CategoryId=61030551&Path=61028324/61030551&ChmCatId=61030551">Jackets &amp; Coats</a></div></li><li class="nav-top"><div><a title="Tailoring" href="/clothing/Tailoring.aspx?CategoryId=61030848&Path=61028324/61030848&ChmCatId=61030848">Tailoring</a></div></li><li class="nav-top"><div><a title="Lingerie &amp; Nightwear" href="/clothing/Lingerie-Nightwear.aspx?CategoryId=61030935&Path=61028324/61030935&ChmCatId=61030935">Lingerie</a></div></li><li class="nav-top"><div><a title="Swimwear" href="/clothing/Swimwear.aspx?CategoryId=61032247&Path=61028324/61032247&ChmCatId=61032247">Swimwear</a></div></li><li class="nav-top"><div><a title="Shoes" href="/clothing/Shoes.aspx?CategoryId=61032318&Path=61028324/61032318&ChmCatId=61032318">Shoes</a></div></li><li class="nav-top"><div><a title="Accessories" href="/clothing/Accessories.aspx?CategoryId=61032574&Path=61028324/61032574&ChmCatId=61032574">Accessories</a></div></li><li  class="nav-top"><div><a title="Men" href="/clothing/Men.aspx?CategoryId=61032800&Path=61028324/61032800&ChmCatId=61032800">Men</a></div></li></ul></div>';
var childrensLnk='<div class="subnav-bar"><ul class="secondTier"><li class="nav-top"><div><a href="/clothing/New-In.aspx?CategoryId=61048316&Path=61040674/61048316&ChmCatId=61048316" title="New In">New In</a></div></li><li class="nav-top"><div><a href="/clothing/Nursery.aspx?CategoryId=61040674&&Path=61040674/61041157&&ChmCatId=61041157" title="Nursery">Nursery</a></div></li><li class="nav-top"><div><a href="/clothing/Baby-Girl-0-to-4.aspx?CategoryId=61041165&Path=61040674/61041165&ChmCatId=61041165" title="Baby Girl 0-4">Baby Girl 0-4</a></div></li><li class="nav-top"><div><a href="/clothing/Baby-Boy-0-to-4.aspx?CategoryId=61041537&Path=61040674/61041537&ChmCatId=61041537" title="Baby Boy 0-4">Baby Boy 0-4</a></div></li><li class="nav-top"><div><a href="/clothing/Girls-2-to-12.aspx?CategoryId=61041845&Path=61040674/61041845&ChmCatId=61041845" title="Girls 2-12">Girls 2-12</a></div></li><li class="nav-top" ><div><a href="/clothing/Boys-2-to-12.aspx?CategoryId=61042413&Path=61040674/61042413&ChmCatId=61042413" title="Boys 2-12">Boys 2-12</a></div></li><li class="nav-top"><div><a href="/clothing/Girls-10-to-18.aspx?CategoryId=61042880&Path=61040674/61042880&ChmCatId=61042880" title="Girls 10-18">Girls 10-18</a></div></li><li class="nav-top"><div><a href="/clothing/Boys-10-to-18.aspx?CategoryId=61043446&Path=61040674/61043446&ChmCatId=61043446" title="Boys 10-18">Boys 10-18</a></div></li></ul></div>';
var menLnk='<div class="subnav-bar"><ul class="secondTier"><li class="nav-top"><div><a title="New In" href="/clothing/New-In.aspx?CategoryId=51032559">New In</a></div></li><li class="nav-top"><div><a title="Shoes" href="/clothing/Shoes.aspx?CategoryId=17514260">Shoes</a></div></li><li class="nav-top"><div><a title="Accessories" href="/clothing/Accessories.aspx?CategoryId=17514216">Accessories</a></div></li><li class="nav-top"><div><a title="T-shirts" href="/clothing/T-shirts.aspx?CategoryId=17514311">T-shirts</a></div></li><li class="nav-top"><div><a title="Sweaters" href="/clothing/Sweaters.aspx?CategoryId=17514390">Sweaters</a></div></li><li class="nav-top"><div><a title="Shirts" href="/clothing/Shirts.aspx?CategoryId=17514359">Shirts</a></div></li><li class="nav-top"><div><a title="Trousers" href="/clothing/Trousers.aspx?CategoryId=17514418">Trousers</a></div></li><li class="nav-top"><div><a title="Suits & Jackets" href="/clothing/Suits-Jackets.aspx?CategoryId=17514456">Suits &amp; Jackets</a></div></li><li class="nav-top"><div><a title="Coats" href="/clothing/Coats.aspx?CategoryId=17514489">Coats</a></div></li><li class="nav-top"><div><a title="Swimwear" href="/clothing/Swimwear.aspx?CategoryId=17514285">Swimwear</a></div></li><li class="nav-top"><div><a title="Underwear" href="/clothing/Underwear.aspx?CategoryId=17514522">Underwear</a></div></li><li class="nav-top"><div><a title="Sportswear" href="/clothing/Sportswear.aspx?CategoryId=17512781&Path=17512781/54723015&ChmCatId=54723015">Sportswear</a></div></li></ul></div>';
var homewareLnk='<div class="subnav-bar"><ul class="secondTier"><li class="nav-top"><div><a title="Bedroom" href="/clothing/Bedroom.aspx?CategoryId=67702668&Path=67702668/67702679&ChmCatId=67702679">Bedroom</a></div></li><li class="nav-top"><div><a title="Bathroom" href="/clothing/Bathroom.aspx?CategoryId=67702668&Path=67702668/67706838&ChmCatId=67706838">Bathroom</a></div></li><li class="nav-top"><div><a title="Kitchen &amp; Dining" href="/clothing/Kitchen-Dining.aspx?CategoryId=67702668&Path=67702668/67707716&ChmCatId=67707716">Kitchen &amp; Dining</a></div></li><li class="nav-top"><div><a title="Lounge" href="/clothing/Lounge.aspx?CategoryId=67702668&Path=67702668/67709131&ChmCatId=67709131">Lounge</a></div></li><li class="nav-top"><div><a title="Children" href="/clothing/Children.aspx?CategoryId=67702668&Path=67702668/67711285&ChmCatId=67711285">Children</a></div></li></ul></div>';
var vertbaudetLnk='<div class="subnav-bar"><ul class="secondTier"><li class="nav-top" id=""><div><a title="Maternity" href="/clothing/Maternity.aspx?CategoryId=2&&Path=2/10986&&ChmCatId=10986">Maternity</a></div></li><li class="nav-top"><div><a title="Nursery" href="/clothing/Nursery.aspx?CategoryId=2&Path=2/11053&ChmCatId=11053">Nursery</a></div></li><li class="nav-top"><div><a title="Newborn" href="/clothing/Newborn.aspx?CategoryId=2&&Path=2/13281&&ChmCatId=13281">Newborn</a></div></li><li class="nav-top"><div><a title="Baby Girl" href="/clothing/Baby-Girl.aspx?CategoryId=2&&Path=2/13266&&ChmCatId=13266">Baby Girl</a></div></li><li class="nav-top"><div><a title="Baby Boy" href="/clothing/Baby-Boy.aspx?CategoryId=2&&Path=2/13252&&ChmCatId=13252">Baby Boy</a></div></li><li class="nav-top"><div><a title="Girls" href="/clothing/Girls.aspx?CategoryId=2&&Path=2/11011&&ChmCatId=11011">Girls</a></div></li><li class="nav-top"><div><a title="Boys" href="/clothing/Boys.aspx?CategoryId=2&&Path=2/11025&&ChmCatId=11025">Boys</a></div></li><li class="nav-top"><div><a title="Homes Collection" href="/clothing/Homes-collection.aspx?CategoryId=2&&Path=2/11037&&ChmCatId=11037">Homes Collection</a></div></li></ul></div>';
var saleLnk='<div class="subnav-bar saleNav"><ul class="secondTier"><li class="nav-top"><div><a title="Women" href="/clothing/Women.aspx?CategoryId=54136964&Path=54136964/54137001&ChmCatId=54137001">Women</a></div></li><li class="nav-top"><div><a title="Men" href="/clothing/Men.aspx?CategoryId=54136964&Path=54136964/54137015&ChmCatId=54137015">Men</a></div></li><li class="nav-top"><div><a title="Children" href="/clothing/Children.aspx?CategoryId=54136964&Path=54136964/54137027&ChmCatId=54137027">Children</a></div></li><li class="nav-top"><div><a title="Homeware" href="/clothing/Homeware.aspx?CategoryId=54136964&Path=54136964/54137030&ChmCatId=54137030">Homeware</a></div></li></ul></div>';
var ourShopsLnk='<div class="subnav-bar" id="ourShopsDD"><ul><li><a title="Vertbaudet" href="/clothes/Vertbaudet.aspx?CategoryId=2&Path=2&ChmCatId=2&MEC=RS10:Vertbaudet:DropDownNav:01:01" id="vertbaudetDD"></a></li><li><a title="Taillissime" href="/shop/Taillissime-SS10.aspx?CategoryId=68368947&Path=68368947&ChmCatId=68368947&MEC=RS10:Taillissime:DropDownNav:01:01" id="taillissimeDD"></a></li><li><a title="Somewhere" href="/shop/SOMEWHERE.aspx?CategoryId=63619763&Path=63619763&ChmCatId=63619763&MEC=RS10:Somewhere:DropDownNav:01:01" id="somewhereDD"></a></li><li><a title="Ellos" href="/shop/Ellos.aspx?CategoryId=64404023&Path=64404023&ChmCatId=64404023&MEC=RS10:Ellos:DropDownNav:01:01" id="ellosDD"></a></li><li><a title="Anne Weyburn" href="/shop/Anne-Weyburn.aspx?CategoryId=68301463&Path=68301463&ChmCatId=68301463&MEC=RS10:Anne_Weyburn:DropDownNav:01:01" id="AnneWeyburn"></a></li></ul></div>';