$(document).ready(function(){
			// Prepend list to body -
			$('#all-tabs').append('<ul id="tabs-nav"></ul>')
			 
			$(function () {
				function addToTabs(el, i) {
						var title = (el.title) ? el.title : el.id;
						el.id = 'tab' + i;
						$('#tabs-nav').append('<li><a href="#' + el.id + '">' + title + '</a></li>');
				};
				function showTab(url) {
						var anc = '#' + url.split('#')[1];
						if (url.match('#')) {
								$('#tabs-nav a[href=' + anc + ']').addClass("active");
								return true;
						}
						return false;
				};
				$('#tabs-nav-container').
						//append('<h4>Details to know</h4>').
						append('<ul id="tabs-nav" class="middlelist"></ul>');
				// set up tabs
				$('.tabs').each(function (i) {
						var url = document.location.toString();
						addToTabs(this, i);
						if (!showTab(url) && (i === 0)) {
								$('.tabs:not(#' + this.id + ')').hide();
						}
				});
				// process tab click
				$('#tabs-nav a').click(function () {
						var id = '#' + this.href.split('#')[1];
						$('.tabs').hide().fadeOut();
						//$(id).show();
						$(id).fadeIn(400);
						$('a').removeClass("active");
						$(this).addClass("active");
						return false;
				});
				// add active class to first tab when page loads
				$('#tabs-nav a:first').addClass("active");
			});
			// Removes the title attribute from the div so it does not showup on hover -
			$('.tabs').removeAttr('title');
	
		});