$(document).ready(function() {
	
	$("#menu-red-nav li ul, #menu-blue-nav li ul").hide(); 

	$("#menu-red-nav li, #menu-blue-nav li").hover(
        function () {
		$(this).children("ul").show();
        },function(){
		$(this).children("ul").hide();
	});//hover
	
 $('.hideplayer, .closeplayer').fadeOut("0");
	
	$('.video_image_link').click(function() {
 	 $(this).children('.hideplayer').fadeIn("slow");
 	 $('.closeplayer').fadeIn("slow");
	});
	$('.closeplayer').click(function() {
 	 $('.hideplayer, .closeplayer').fadeOut("slow");
	});
	
	$('#slideshow .textwidget')
	.before('<div id="slide_nav">') 
	.cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout: 15000, 
		pager:  '#slide_nav',
	});
	
	$('.success-stories').cycle({
		fx: 'fade',
		timeout: 9000, // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

$(".tweet_list").tweet({
            username: "accelerance",
            count: 2,
            loading_text: "loading tweet..."
        });
        
        
      
        
$("#tab1").click(function () {
$("#tab2b, #tab3b").hide();
$("#tab1b").show();
$('#tab1').addClass('redlight');
$('#tab2, #tab3').removeClass('redlight');
});
        
$("#tab2").click(function () {
$("#tab1b, #tab3b").hide();
$("#tab2b").show();
$('#tab2').addClass('redlight');
$('#tab1, #tab3').removeClass('redlight');
});        

$("#tab3").click(function () {
$("#tab2b, #tab1b").hide();
$("#tab3b").show();
$('#tab3').addClass('redlight');
$('#tab1, #tab2').removeClass('redlight');
});

$('.wp-paginate').hAlign();
        
});// document ready



$.fn.hAlign = function() {
	return this.each(function(i){
	var ah = $(this).width();
	var ph = $(this).parent().width();
	var mh = (ph - ah) / 2;
	$(this).css('margin-left', mh);
	});
};


