//APPLE

function external(){
	$('a[rel="external"], #accesorios dd a, .comprar_int a').attr('target', '_blank');
}

function porquemac(){
	$('#porquemac').css('display','none');
	var isVentajas = false;
	$('#porquemac_ext h2')
		.attr('title', 'mostrar')
		.css({'background-position':'0 0', 'cursor':'pointer'})
		.toggle(
			function(){
				$(this).css('background-position','0 -30px');
				$(this).attr('title', 'ocultar');
			},
			function(){
				$(this).css('background-position','0 0');
				$(this).attr('title', 'mostrar');
			}
		)
		.click(function(){
			$('#porquemac').slideToggle(300);
		});
}

function comprar(){
	$('.comprar .comprar_int').hide();
	$('.comprar .btbuy').click(function(){
		$(this).parent().find('.comprar_int').slideToggle();
		return false;
	});
	$('.comprar').clone(true).appendTo('#contenido');
}

function tabs(){
	$('div.pag').hide();
	var prevTab = $('div.pag:first')
	prevTab.show();
	$('.tabs li:first a').addClass('tabon');
	$('.tabs li a').click(function(){
		$('.tabs li a').removeClass('tabon');
		$(this).addClass('tabon');
		var currentTab = $(this).attr('href');
		$(prevTab).slideUp('fast');
		$(currentTab).slideDown('fast');
		prevTab = $(this).attr('href');
		return false;
	});
}

function acce(){
	$('#accesorios dd:last').addClass('accebot')
}

$(document).ready(function(){
	porquemac();
	external();
	comprar();
	tabs();
	acce();
});