//PREVENTS SHOP MENU ITEM BEING AN ACTIVE LINK

function setTarget()
{
	var theLinks = document.getElementsByTagName('a');
	for(var i = 0; i < theLinks.length; i++)
		{
		if(theLinks[i].getAttribute('href') == '/shop.html' || theLinks[i].getAttribute('href') == '/webapps/site/94997/276350/shopping/shopping-plus.html')
			{
			theLinks[i].onclick = function() { return false; }
			theLinks[i].onmouseover = function() { this.style.cursor = 'default'; }
			}
			}
		
}
window.onload = setTarget;


//CONTROLS ANSWER BEHAVIOUR IN FAQS PAGE

$(document).ready(
	function() {
		
		var currentHash = location.hash.split("#");
		
		if (currentHash.length > 1) {
			
			var currentHashString = currentHash[1].toString();
			
			$(".faq-nav li a").removeClass("selected");
										
			$(".faq-nav li a[href*="+currentHashString+"]").addClass("selected");
			
			var contentCollection = document.getElementsByTagName("#faq-slider li");
			
			for (i=0;i<contentCollection.length;i++) {
				if (contentCollection[i].id) {
					if (contentCollection[i].id === currentHashString || currentHashString === "") {
						$(contentCollection[i]).fadeIn(0);
					} else {
						$(contentCollection[i]).fadeOut(0).css("display", "none");
						if (location.hash !== "#") {
							location.hash = "#"+currentHash[1];
						} // if
					} // else
				} // if
			} // for

		} else {
			var contentCollection = document.getElementsByTagName("#faq-slider li");

			for (i=0;i<contentCollection.length;i++) {
				if (contentCollection[i].id) {
					if (contentCollection[i].id !== "mono-colour") {
						$(contentCollection[i]).fadeOut(0).css("display", "none");
					}
				} // if
			} // for
		} // else
		
		$(".faq-nav li a").click(function() {
																
										var myClicked = this.href.split("#");
										
										$(".faq-nav li a").removeClass("selected");
										
										this.className = "selected";
										
										
										var faqSlide = document.getElementById('faq-slider');
										var contentCollection = faqSlide.getElementsByTagName("li");
										
										
										for (i=0;i<contentCollection.length;i++) {
											if (contentCollection[i].id) {
												if (contentCollection[i].id === myClicked[1]) {
													$(contentCollection[i]).fadeIn(0);	
													  } else {
													$(contentCollection[i]).fadeOut(0).css("display", "none");
														//if (location.hash !== "#") {
														//	location.hash = "#"+myClicked[1];
														//}
														
												  } // else
							  
											} // if
										} // for
										
										return false;
									} // click func

								); // click event
		} // anon func 1

); // ready
