function mainmenu(){

	attachLinks();	
}

function attachLinks() {

	navigateTab();
	
	lightBoxLinks();

}


function navigateTab() {

	
	 $('ol#toc a').click(function() { //start function when any link is clicked
		
		
			 				$(".content").slideUp("slow");
						 var content_show = $(this).attr("title"); //retrieve title of link so we can compare with php file
						 var content_href = $(this).attr("href");
						 var content_ajax = content_href.substring(0,content_href.lastIndexOf(".html"));
						 content_ajax = content_ajax + "ajax.html";
						 //alert(content_ajax);
							//method: "get",url: content_ajax,  // data: "page="+content_show,
							
							$.ajax({
							method: "get",url: content_ajax,  // data: "page="+content_show,
							beforeSend: function(){$("#loading").show("fast");}, //show loading just when link is clicked
							complete: function(){ $("#loading").hide("fast");}, //stop showing loading when the process is complete
							success: function(html){ //so, if data is retrieved, store it in html
							//alert(html);
							$(".content").show("fast"); //animation
							$(".content").html(html); //show the html inside .content div
							
							attachLinks();							
					 }
				 }); //close $.ajax(
         }); //close click(

			var tabContainers = $('div.tabs > div');
			tabContainers.hide().filter(':first').show();
			
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				//tabContainers.filter(this.hash).slideDown("slow");
				if ($.browser.msie && $.browser.version.substr(0,1) <="6") {
					tabContainers.filter(this.hash).slideDown("slow");
				}
				else {
					tabContainers.filter(this.hash).fadeIn("slow");
				}
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
}

function lightBoxLinks() {

	$('a[@rel*=lightbox]').lightBox(
		{
			//overlayBgColor: '#FFF',
			//fixedNavigation:true,
			overlayOpacity: 0.6,
			imageLoading: 'images/lightbox-ico-loading.gif',
			imageBtnClose: 'images/lightbox-btn-close.gif',
			imageBtnPrev: 'images/lightbox-btn-prev.gif',
			imageBtnNext: 'images/lightbox-btn-next.gif',
			containerResizeSpeed: 350,
			txtImage: 'Image',
			txtOf: 'of'

   		}
	
	); // Select all links that contains lightbox in the attribute rel
	
	$('#gallery a').lightBox({fixedNavigation:true});

}
 $(document).ready(function(){					
	
});

$(function () {

		mainmenu();

			
			});