

jQuery(document).ready(function($){
	$('#tab2').css('display', 'none');
	$('#caps h2').css('cursor', 'pointer').click(function(){
		//alert( $(this).attr('rel') );
		$('.tab').css('display', 'none');
		$('#caps h2').removeClass('selecionado');
		$(this).addClass('selecionado');
		$( '#'+$(this).attr('rel') ).css('display', 'block')
		return false;
	});
	
	function promo_tabs(){
		show_hide_tabs( $('#promo .promo_tab:first') );
		
		$('.change_tab').click(function(){
			//alert($(this).attr('href'));
			show_hide_tabs( $(this).attr('href') );
			return false;
		});
	}
	
	function show_hide_tabs( obj ){
		$('#promo .promo_tab').each(function(){
			//alert($(this).text());
			$(this).hide();
		});
		$( obj ).show();
	}
	
	if($('#promo').length > 0){
		promo_tabs();
	}
	
	
	if($("form[action='http://www.theliberty.com.br/wp-pass.php']").length > 0){
		$("input[value='Responder as perguntas']").hide();
	}
});



// cookie functions http://www.quirksmode.org/js/cookies.html
function createCookie(name,value,days){
	if (days){
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name){
	createCookie(name,"",-1);
}
// /cookie functions