$(document).ready(function(){ 
	$('a.button').each(function() {
		var $t = $(this);
		var $span = $('<span/>');
		$span.html($t.html());
		$t.html($span);
	});
	$('#s1').cycle({
	fx: 'fade',
	timeout: 5000,
	});	
	
	$('table + p').css('margin-bottom',0);
	
	$('.ui_tabs').tabs();
	
	$('hr').each(function() {
		var $t = $(this);
		var $d = $('<div/>');
		$d.addClass('hr');
		$d.html('<hr/>');
		$t.after($d).remove();
	});
	
	var i = 0;
	$('.thumbs .thumb').each(function() {
		if (i%2 == 1)
			$(this).addClass('nomargin');
		i++;
	});
	
	$(".fancybox").fancybox({
		'titlePosition'	: 'over',
		showNavArrows:true
	});

	
	$("#tweets").tweet({
      avatar_size: false,
      count: 3,
      loading_text: "searching twitter..."
    });
    
    
	$.extend($.fn.disableTextSelect = function() {
		return this.each(function(){
			if($.browser.mozilla){//Firefox
				$(this).css('MozUserSelect','none');
			}else if($.browser.msie){//IE
				$(this).bind('selectstart',function(){return false;});
			}else{//Opera, etc.
				$(this).mousedown(function(){return false;});
			}
		});
	});
//	$('.person').disableTextSelect();//No text selection on elements with a class of 'noSelect'
	
	
	$('.person').each(function() {
		var $t = $(this);
		$t.find('.inner').hide();
		$t.find('.name').click(function() {
			$('.person.active .inner').slideUp();
			$(this).parent().find('.inner').slideDown();
			$(this).parent().addClass('active');
		}).css('cursor','pointer');
		
	}).first().find('.inner').show();
	$('.person').first().addClass('active').find('.inner').show();
	
	
	
});
