$(document).ready(function(){
	
	$("#contentWrapper div:not(#aboutSAAFE, #footer, #col2)").hide();
	
//Back-to-top Links
	$(".backToTop").click(function(){
		$('html, body').animate({scrollTop:0}, '800');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
//MainNav Hover or Click Effects
	
	// If Javascript is enabled, initially hide the submenus
	
	$("#aboutNav").hide().addClass("navWithJSAbout");
	
	$("#infoNavArea").hide().addClass("navWithJSInfo");
	
	$("#aboutLink, #infoLink").click(function(){
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	// Make sure smartphone (or IE!) users can tap menu items to show & hide the submenus
	
	$("#aboutLinkSD").click(function(){
		$("#aboutNav").toggle();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$("#infoLinkSD").click(function(){
		$("#infoNavArea").toggle();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	// On larger devices, users only need to hover over the menu items
	
	$("#aboutLink, #aboutNav").mouseenter(function(){
		$("#aboutNav").show();
	});
	
	$("#aboutLink, #aboutNav").mouseleave(function(){
		$("#aboutNav").hide();
	});
	
	$("#infoLink, #infoNavArea").mouseenter(function(){
		$("#infoNavArea").show();
	});
	
	$("#infoLink, #infoNavArea").mouseleave(function(){
		$("#infoNavArea").hide();
	});
	
//InfoNav Link Effects
	$(".aboutSAAFE").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#aboutSAAFE").show();
		$("#aboutNav").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".historySAAFE").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#historySAAFE").show();
		$("#aboutNav").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".quickStart").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#quickStart").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".waysWorking").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#waysWorking").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".outcalls").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#outcalls").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".touring").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#touring").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".specialistServices").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#specialistServices").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".firstExperience").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#firstExperience").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".rentingFlat").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#rentingFlat").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gettingMortgage").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#gettingMortgage").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".hiringDriver").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#hiringDriver").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".whereAdvertise").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#whereAdvertise").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".ownWebsite").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#ownWebsite").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".findingAgency").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#findingAgency").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".theGUM").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#theGUM").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".oralWith").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#oralWith").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".keepingSafe").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#keepingSafe").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".timewasters").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#timewasters").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".moneyEtiquette").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#moneyEtiquette").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".keepingSane").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#keepingSane").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".contentThieves").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#contentThieves").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".scamAgencies").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#scamAgencies").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".liesHear").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#liesHear").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".lawUK").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#lawUK").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".payingTax").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#payingTax").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".disabledClients").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#disabledClients").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".notBlonde").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#notBlonde").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gettingOut").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#gettingOut").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".funnySide").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#funnySide").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".usefulLinks").click(function(){
		$("#contentWrapper div:not(#footer, #col2)").hide();
		$("#usefulLinks").show();
		$("#infoNavArea").hide();
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});

// Submenu Link Effects
//// Outcalls page

	$(".outcallsHomes").click(function(){
		var contentPosition = $("#outcallsHomes").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".outcallsHotels").click(function(){
		var contentPosition = $("#outcallsHotels").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
//// Keeping Sane page
	
	$(".lookingBack").click(function(){
		var contentPosition = $("#lookingBack").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".messageBoards").click(function(){
		var contentPosition = $("#messageBoards").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
//// Scam Agencies Page
	
	$(".registrationFee").click(function(){
		var contentPosition = $("#registrationFee").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".overpaymentScam").click(function(){
		var contentPosition = $("#overpaymentScam").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".auditionScam").click(function(){
		var contentPosition = $("#auditionScam").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".falsePayment").click(function(){
		var contentPosition = $("#falsePayment").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".goldenRule").click(function(){
		var contentPosition = $("#goldenRule").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".howToFind").click(function(){
		var contentPosition = $("#howToFind").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
//// Ways of Working page
	
	$(".homeNewspaper").click(function(){
		var contentPosition = $("#homeNewspaper").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".emailOnly").click(function(){
		var contentPosition = $("#emailOnly").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".noWebsite").click(function(){
		var contentPosition = $("#noWebsite").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".womensCollective").click(function(){
		var contentPosition = $("#womensCollective").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".phoneBookings").click(function(){
		var contentPosition = $("#phoneBookings").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".workingParlour").click(function(){
		var contentPosition = $("#workingParlour").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".workingHome").click(function(){
		var contentPosition = $("#workingHome").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".runningParlour").click(function(){
		var contentPosition = $("#runningParlour").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
//// OWO page

	$(".oralWithWith").click(function(){
		var contentPosition = $("#oralWithWith").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".oralWithWithout").click(function(){
		var contentPosition = $("#oralWithWithout").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
//// STIs page (starting with special BackToTop links to article submenu)

	$(".backToTopGUM").click(function(){
		var contentPosition = $("#submenuGUM").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '600');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gumHerpes").click(function(){
		var contentPosition = $("#gumHerpes").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gumHPV").click(function(){
		var contentPosition = $("#gumHPV").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gumSyphilis").click(function(){
		var contentPosition = $("#gumSyphilis").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gumGonorrhea").click(function(){
		var contentPosition = $("#gumGonorrhea").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }		
	});
	
	$(".gumPID").click(function(){
		var contentPosition = $("#gumPID").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gumHepatitis").click(function(){
		var contentPosition = $("#gumHepatitis").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".gumAIDS").click(function(){
		var contentPosition = $("#gumAIDS").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
//// STIs page (starting with special BackToTop links to article submenu)

	$(".backToTopTour").click(function(){
		var contentPosition = $("#submenuTouring").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '600');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".tourWhereGo").click(function(){
		var contentPosition = $("#tourWhereGo").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".tourAdvert").click(function(){
		var contentPosition = $("#tourAdvert").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".tourHow").click(function(){
		var contentPosition = $("#tourHow").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".tourWhere").click(function(){
		var contentPosition = $("#tourWhere").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".tourKeeping").click(function(){
		var contentPosition = $("#tourKeeping").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
	$(".tourTips").click(function(){
		var contentPosition = $("#tourTips").offset().top;
		$("html, body").animate({scrollTop:contentPosition}, '100');
		if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; }
	});
	
});
