function initMenus()	{		$('ul.menu ul').hide();		$.each($('ul.menu'), function () {			//alert(checkElement.className);			//$('ul.menu ul.expanded').show();			$('ul.menu ul.expanded').slideDown('normal');		});		$('ul.menu li a').click(			function() {				var checkElement = $(this).next();				var parent = this.parentNode.parentNode.id;								if((checkElement.is('ul')) && (checkElement.is(':visible'))) {					checkElement.slideUp('normal');					return false;				}				if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {					$('ul.menu ul.expanded').slideUp('normal');					$('ul.menu ul.notexpanded').slideUp('normal');					checkElement.slideDown('normal');					return false;				}			}		);		 	}	$(document).ready(function() {			var initiateTabs = function() {		//When page loads...		$(".tab_content").hide(); //Hide all content		$("ul.tabs li:first").addClass("active").show(); //Activate first tab		$(".tab_content:first").show(); //Show first tab content		//On Click Event		$("ul.tabs li").click(function() {			$("ul.tabs li").removeClass("active"); //Remove any "active" class			$(this).addClass("active"); //Add "active" class to selected tab			$(".tab_content").hide(); //Hide all tab content			var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content			$(activeTab).fadeIn(); //Fade in the active ID content			return false;		});	}();		var initiateMenu = function() {		$("ul#dmenu").children().each(function() {			$(this).find("a").each(function(){ 				$(this).find("span").hide();				$(this).css("background","url('/images/menu/"+$(this).attr("id")+".png') no-repeat" ); 			});		}); 		$("#cognitieve-gedragstherapie,#hartcoherentie-training").css("height", "22px"); 		$("#verschillende-angststoornissen, #oorzaken-van-angststoornissen").css("height", "35px");	}();	 	 	var replaceContactBox = function () {			$("#contact-box-left").html("");		$("#contact-box-left").append("<map name='phone'> <area shape='rect' coords='0,55, 145, 78' href='mailto:info@ggzgroep.nl' alt='mail to'/> </map> "); 		$("#contact-box-left").append("<img src='/images/phone_menu.gif' alt='phone ggz' usemap='#phone'/>"); 			}(); 		var location = window.location.pathname;	if(location != "/")	{   		loc = location.split("/");		total = loc.length;  		if(loc[total-1] != "")			location = loc[total-1] 		else			location = loc[total-2];					if(location =='amersfoort' || location =='amsterdam' || location =='breda' || location =='eindhoven' || location =='heerenveen' || location =='utrecht' || location =='rotterdam' || location =='arnhem' || location =='denbosch' || location =='denhaag'  )			location = loc[total-3];						$(".hover").css("background","url('/images/menu/"+$(".hover").attr("id")+".png') no-repeat" );  			$(".main-bottom-right").click(function() { alert("url('/images/menu/"+location+"-hover.png') no-repeat"); }); 			$("#"+location).css("background","url('/images/menu/"+location+"-hover.png') no-repeat").addClass("hover"); 			}	else	{		$(".hover").css("background","url('/images/menu/"+$(".hover").attr("id")+".png') no-repeat" );  		$("#ggzgroep_home").css("background","url('/images/menu/ggzgroep-hover.png') no-repeat").addClass("hover"); 	}		//smooth scrolling	 var scrollElement = 'html, body';    $('html, body').each(function () {        var initScrollTop = $(this).attr('scrollTop');        $(this).attr('scrollTop', initScrollTop + 1);        if ($(this).attr('scrollTop') == initScrollTop + 1) {            scrollElement = this.nodeName.toLowerCase();            $(this).attr('scrollTop', initScrollTop);            return false;        }        });	 $("a[href^='#']").click(function(event) {        event.preventDefault();         var $this = $(this),         target = this.hash,         $target = $(target);         $(scrollElement).animate({             'scrollTop': $target.offset().top         }, 500, 'swing', function() {             window.location.hash = target;        });     });});
