$(document).ready(function(){
	
	/*attach dropdown menus to "nl-xxx-dropdown-anchor"s using simpletip()*/
	$("#nl-back-bay-dropdown-anchor").simpletip({
		content:$("#ddNav-BackBay"),
		fixed:true,
		position: [0,178],
		onBeforeShow: function(){$("#nl-back-bay > a").addClass("nl-back-bayHover");},
		onHide: function(){$("#nl-back-bay > a").removeClass("nl-back-bayHover");},
		showEffect:"slide",
		showTime:300,
		hideEffect:"slide",
		hideTime:300
	});
	$("#nl-long-wharf-dropdown-anchor").simpletip({
		content:$("#ddNav-LongWharf"),
		fixed:true,
		position: [130,178],
		onBeforeShow: function(){$("#nl-long-wharf > a").addClass("nl-long-wharfHover");},
		onHide: function(){$("#nl-long-wharf > a").removeClass("nl-long-wharfHover");},
		showEffect:"slide",
		showTime:300,
		hideEffect:"slide",
		hideTime:300
	});
	$("#nl-natick-dropdown-anchor").simpletip({
		content:$("#ddNav-Natick"),
		fixed:true,
		position: [288,178],
		onBeforeShow: function(){$("#nl-natick > a").addClass("nl-natickHover");},
		onHide: function(){$("#nl-natick > a").removeClass("nl-natickHover");},
		showEffect:"slide",
		showTime:300,
		hideEffect:"slide",
		hideTime:300
	});
	
	/*attach the action of expanding and contracting the li for each of the location links using hoverIntent()*/
	$("#nl-back-bay").hoverIntent(showBackBay,hideBackBay);
	$("#nl-long-wharf").hoverIntent(showLongWharf,hideLongWharf);
	$("#nl-natick").hoverIntent(showNatick,hideNatick);
		
});

/* 
show and hide functions for each location dropdown created by accessing simpletip() api
these are then used by hoverIntent() to show/hide the dropdown menus
*/
function showBackBay(){
var api = $("#nl-back-bay-dropdown-anchor").eq(0).simpletip();
	api.show();
}
function hideBackBay(){
var api = $("#nl-back-bay-dropdown-anchor").eq(0).simpletip();
	api.hide();
}
function showLongWharf(){
var api = $("#nl-long-wharf-dropdown-anchor").eq(0).simpletip();
	api.show();
}
function hideLongWharf(){
var api = $("#nl-long-wharf-dropdown-anchor").eq(0).simpletip();
	api.hide();
}
function showNatick(){
var api = $("#nl-natick-dropdown-anchor").eq(0).simpletip();
	api.show();
}
function hideNatick(){
var api = $("#nl-natick-dropdown-anchor").eq(0).simpletip();
	api.hide();
}