jQuery(document).ready(function() {
							
								

	var $ = jQuery.noConflict();
	
	
	
	//now with cookie suppport
		function myTabs(div){
			//check if cookie exists
			var cookie = $.cookie(div + '_tabs');
			//if cookie is not null show the conresponding tab
			if(cookie)
			{
				//if so hide others and add active class to link
				$('.' + div + '_tab:not(#'+cookie+')').addClass('tab-hide');
				$('#'+cookie).removeClass('tab-hide');
				$('a[href="#'+cookie+'"]').addClass('tab-current').parent('li').addClass('tab-current');			
			}
			else //if cookie doesnt exist show first tab
			{
				//if this is not the first tab, hide it
				$('.' + div + '_tab:not(:first)').addClass('tab-hide');
				//to fix u know who
				$('.' + div + '_tab:first').removeClass('tab-hide');
				//ad active class to first link
				$('ul#' + div + '_htabs li:first').find('a').addClass('tab-current');
				$('ul#' + div + '_htabs li:first').addClass('tab-current');
			}
	
		 //when we click one of the tabs
		 $('ul#' + div + '_htabs li a').click(function(){
			
			$('ul#' + div + '_htabs li').removeClass('tab-current');
			$(this).parents('li').addClass('tab-current');
			//add an active class to the links							   
			$(this).parents('ul#' + div + '_htabs').find('li a.tab-current').toggleClass('tab-current');
			$(this).toggleClass('tab-current');
										   
										   
			 //get the ID of the element we need to show
			 stringref = $(this).attr("href").split('#')[1];
			 //write a cookie with the div id name
			  $.cookie(div + '_tabs', stringref);

			 //hide the tabs that doesn't match the ID
			 $('.' + div + '_tab:not(#'+stringref+')').addClass('tab-hide');
			 //fix
			 if ($.browser.msie && $.browser.version.substr(0,3) == "6.0") 
			 {
				$('.' + div + '_tab#' + stringref).removeClass('tab-hide');
			 }
			 else
			 {
				 //display our tab fading it in
				 $('.' + div + '_tab#' + stringref).removeClass('tab-hide');
			 }
			

			 //stay with me
			 return false;
		 });
	}
	myTabs('tabbed');
	myTabs('tabbed2');




});
