$(function(){
	$('a').click(function(){
		this.blur();
	});

	var at = 250; // animation time

	// ie fuckers
	if($.browser.msie){
		var version = parseInt($.browser.version);
		// tabs...
		var first = true;
		var first2 = true;

		$('#tabcont > li > a').each(function(){
			txt = $(this).attr('href');
			$(txt).addClass('tab')//.children('h3:first').css('display','none');
			if(window.location.hash.length > 0){
				var hash = window.location.hash;
				if(hash == txt){
					$(this).addClass('active');
				}else{
					$(txt).css('display','none');
				}
			}else{
				if(first){
					first = false;
					$(this).addClass('active');
				}else{
					$(txt).css('display','none');
				}
			}
		});

		//$('.tab h2:first, .tab h3:first').css('display','none');

		$('#tabcont a').click(function(e){
			txt = $(this).attr('href');
			$('.tab').css('display','none');
			$(txt).css('display','block');
			getCrossObject();
			show_arrows();
			$('#tabcont a').removeClass('active');
			$(this).addClass('active');
			e.preventDefault();
		});


		$('#tabcont a.active, .subtabcont a.active').click(function(e){
			e.preventDefault();
		})

	}else{
		// tabs...
		var first = true;
		var first2 = true;

		$('#tabcont > li > a').each(function(){
			txt = $(this).attr('href');
			$(txt).addClass('tab')//.children('h3:first').css('display','none');
			if(window.location.hash.length > 0){
				var hash = window.location.hash;
				if(hash == txt){
					$(this).addClass('active');
				}else{
					$(txt).css('display','none');
				}
			}else{
				if(first){
					first = false;
					$(this).addClass('active');
				}else{
					$(txt).css('display','none');
				}
			}
		});


		//$('.tab h2:first, .tab h3:first').css('display','none');

		$('#tabcont a').click(function(e){
			txt = $(this).attr('href');
			$('.tab:not(:hidden):not('+txt+')').fadeOut(at,function(){
				$('.tab2:not(:hidden)').css('display','none');

				$(txt).fadeIn(at,function(){
						getCrossObject();
						show_arrows();
				});
			});
			$('#tabcont a').removeClass('active');
			$(this).addClass('active');
			e.preventDefault();
		});


		$('#tabcont a.active, .subtabcont a.active').click(function(e){
			e.preventDefault();
		})
	}


});
