$(document).ready(function() {

	var tabs = $('dl.tabs')
		tabsContent = $('ul.tabs-content');
	
	tabs.each(function(i) {
		//Get all tabs
		var tab = $(this).children('dd').children('a');
		tab.click(function(e) {
			
			//Get Location of tab's content
			var contentLocation = $(this).attr("href");			
			//Let go if not a hashed one
			if(contentLocation.charAt(0)=="#") {
			
				e.preventDefault();
			
				//Make Tab Active
				tab.removeClass('active');
				$(this).addClass('active');
				
				//Show Tab Content
				$(contentLocation).parent('.tabs-content').children('li').css({"display":"none"});
				$(contentLocation).css({"display":"block"});
				
			} 
		});
	});

		// preparing the bar, this time customizing some parameters
		$('#bar2').colorBar({displayNumbers:false, bottomValue:0, topValue:100, startValue:25, bottomColor:'#2b2b00', topColor:'#555500' })

		// buttons events
		$('a.progress').one('click', function(e) {
	$('#bar2').colorBar('+=25');
	
	
	e.preventDefault();

		});

	

	$("a[href^='http:']:not([href*='" + window.location.host + "'])").each(function() {               
        $(this).attr("target", "_blank");
    });
  $('.email').each(function(i){

    var protectedEmail = $(this).html();
    protectedEmail = protectedEmail.replace(" [at] ","@");
    protectedEmail = protectedEmail.replace(" [dot] ",".");

    $(this)
      .html(protectedEmail)
      .replaceWith("<a href=\"mailto:"+$(this).text()+"\">"+$(this).text()+"</a>");

  });
	
});



  

