function toggleNewsletter()
{
	var newsletter = $('#newsletter_form');
	var lightbox = $('#lightbox_bg');
	var speed = 'fast';
	
	if (newsletter.css('display') === 'none') {
		lightbox.fadeIn(speed);
		newsletter.fadeIn(speed);
	}
	else {
		newsletter.fadeOut(speed);
		lightbox.fadeOut(speed);
	}
};
$(function() {
	
	$("#nav ul li.hasChild").mouseover(function() {
		$(this).children("a").css("background", "url(/images/dropdown-arrow.png) no-repeat center bottom");
		$(this).children("div").css("display", "block");
	});
	
	$("#nav ul li.hasChild").mouseout(function() {
		$(this).children("a").css("background", "none");
		$(this).children("div").css("display", "none");
	});
	
	$('#newsletter, #lightbox_bg').click(function(){
		toggleNewsletter();
		return false;
	});
	
	if(document.domain == "register.crossroadsworldwide.com") {
		if (location.pathname == "/" || location.pathname == "/default.aspx" || /logout/i.test(location.pathname)){
			location.href = "/Account/";
		}
	}
		
});
