// Global jQuery Functions


$(document).ready(function() {

       
	// New window functions
	$("a[rel=\"nofollow\"]").click(function() {
        this.target = "_blank";
     });													 											
	$("a[rel=\"external\"]").click(function() {
        this.target = "_blank";
     });	

	// Hide email address function     												 												
	$(function() {  
	   $('.email').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>');  
	   });  
	});
	
   // menu show on hover
  $("div.menu ul > li ul").hide();
  $("div.menu ul > li").hover (
    function() {
      $(this).children('ul').show ();
    },
    function() {
      $(this).children('ul').hide();
    }
  );
  
	var $gallery = $("a[rel=gallery]").colorbox();
		$("a#openGallery, a#openGallery1").click(function(e){
		    e.preventDefault();
		    $gallery.eq(0).click();
		});

  // Hide all the tabs
  	$("section.information .content").addClass('hidetab');

    // Set the default active tab
    $("section.information #description").removeClass('hidetab');
    $("section.information #description").addClass('displaytab');

    $("header.meta nav ul li a.toggle").click(function (e) {
      e.preventDefault();

      // Hide all the tabs when the tab is clicked
      $("section.information .content").removeClass('displaytab');
      $("section.information .content").addClass('hidetab');

      // Display the clicked tab
      var hre=$(this).attr('href');
      $(hre).addClass('displaytab');

      // Remove all currently active tabs
      $('header.meta nav ul li a.toggle').each(function(index) {
          $(this).removeClass('current');
      });

      // Activate the clicked tab
      $(this).addClass('current');

    });

	
});





