$(document).ready(function() {
   
   
  $('.tabs a').click(function() {
		
		var dataContainer = '';

	
		if($(this).hasClass('tab1'))
		{
			$(this).parent().children('.tab1').css('zIndex', 10);
			$(this).parent().children('.tab2').css('zIndex', 9);
			$(this).parent().children('.tab3').css('zIndex', 8);
			dataContainer = '.tabs_data1';	
		}else if($(this).hasClass('tab2'))
		{
			$(this).parent().children('.tab1').css('zIndex', 10);
			$(this).parent().children('.tab2').css('zIndex', 9);
			$(this).parent().children('.tab3').css('zIndex', 8);
			dataContainer = '.tabs_data2';	
		}else if($(this).hasClass('tab3'))
		{
			$(this).parent().children('.tab1').css('zIndex', 8);
			$(this).parent().children('.tab2').css('zIndex', 9);
			$(this).parent().children('.tab3').css('zIndex', 10);
			dataContainer = '.tabs_data3';	
		}

		$(this).css('zIndex', 15);
		$(this).parent().children('.activeTab').removeClass('activeTab');
		$(this).addClass('activeTab');
		
		$(this).parent().parent().children('.tabs_data1').hide();
		$(this).parent().parent().children('.tabs_data2').hide();
		$(this).parent().parent().children('.tabs_data3').hide();
		
		$(this).parent().parent().children(dataContainer).show();
		
		return false;
  }); 
   
   
   if($('#s3slider').length)
   {
	   $('#s3slider').s3Slider({
		  timeOut: 4000
	   });
	}
   
   
  $("a[rel^='prettyPhoto']").prettyPhoto();

   
   
   
   $('#top_menu div').hide();
   
   
   $('#top_menu a').not("#top_menu div a").hover(function() {
   
		$("#top_menu .active").removeClass('active');
		$(this).addClass('active');
		
        $('.menu_padding').css('marginLeft', $(this).position().left);
		$('#top_menu div').hide()
		$(this).next('div').show();
   }); 

	$('#top_menu div').mouseleave(function() {
		$('#top_menu div').hide();
		$("#top_menu .active").removeClass('active');
	});
	

// Notice the use of the each() method to acquire access to each elements attributes
   $('.blogImage').each(function()
   {
      $(this).qtip({
         content: $(this).attr('tooltip'), // Use the tooltip attribute of the element for the content
		    position: {
			  corner: {
				 target: 'leftMiddle',
				 tooltip: 'rightMiddle'
			  }
		   },
		  style: { 
			  name: 'blue',
			  color: '#008FC5',
			  tip: { // Now an object instead of a string
				 corner: 'rightMiddle' // We declare our corner within the object using the corner sub-option
				},
			  border: {
				 width: 3,
				 radius: 5,
				 color: '#EF2E24'
			  }				
		  }
      });
   });


	
});
  

function show(showItem){

	$('.subMenu').slideUp('slow');
	$(showItem).slideToggle('slow');
	  
}




