
$(document).ready(function() {
   
   
    $('#header .content').cycle({
		fx: 'fade',  timeout: 6000   // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	
	
	
	
    
	 	$(".mmenu li a").filter(function() {

     	//Take the current URL and split it into chunks at each slash
      	var currentURL = window.location.toString().split("/");

      	//return true if the bit after the last slash is the current page name
      	return $(this).attr("href") == currentURL[currentURL.length-1];

	    //when the filter function is done, you're left with the links that match.
    	}).parent().addClass("active-trail");
	
	
		//if($('li.active-trail').has('ul')) {
	    $('li.active-trail').has('ul').addClass('open active-trail');
		//}
	
		$('li.active-trail').parents("ul").parents("li").addClass('open active-trail');
	 
	 
	 
	 	///FAQ
	 
	 
	 	///Hide all answers
	  	$("div.question .answer").filter(function() {
			return $(this)
			
    	}).hide()
	 
		///show or hide answer on click depending if visible or not
		$("div.question").click(function() {
			
			if($(this).children(".visible").length) {
				
				$(this).children(".answer").slideUp()
				$(this).children(".answer").removeClass("visible")
				
			} else if($(this).children(".answer")) {
			
				$(this).children(".answer").slideDown();
				$(this).children(".answer").addClass("visible")
			}
			
		})
		
		
		///////PREVENT EMAIL HARVEST
		
	
		   $('.emil').each(function() {
			  var $email = $(this);
			  var address = $email.text()
				 .replace(/\s*\[at\]\s*/, '@')
				 .replace(/\s*\[dot\]\s*/g, '.');
			  $email.html('<a href="mailto:' + address + '">'
				 + address +'</a>');
		   });
	

		
		
	 
	
});



