$(document).ready(function(){
    jQuery.easing.def = 'easeInOutExpo';
    
   /* $("#content .right-panel .section .testimonial").scale9Grid({top:24,bottom:31,left:25,right:10});*/
    
    $("#logo-wrapper #logos .logo").vAlign();
    
    $(".section .title .content").vAlign();
    
    $("a.press-item .blurb").vAlign();
    
    $("#logo-wrapper #logos .logo img").load( function() {
    	$(this).parent().vAlign();	
    });
    
    $("#header .contact .contact-number").vAlign();
    
    $(".jquery-menu ul li ul").hide();
    
    $(".jquery-menu ul li ul").each(function() {
    	var child_height = parseInt($(this).find("a:first").css("height").replace("px","")) + parseInt($(this).find("a:first").css("paddingTop").replace("px","")) + parseInt($(this).find("a:first").css("paddingBottom").replace("px","")) + parseInt($(this).find("a:first").css("marginTop").replace("px","")) + parseInt($(this).find("a:first").css("marginBottom").replace("px",""));
    	var num = $(this).children().size();
    	$(this).height(child_height * num);
    	$(this).attr("rel",child_height * num)
    });
    
    $(".jquery-menu ul li").hover(function(){
    	$(this).find("ul").eq(0).show();
    }, function(){
    	$(this).find("ul").eq(0).hide();
    });
    
    if ($('.image-rotator').css("height"))
    {
    $('.image-rotator').cycle({
        fx:      'fade',
        delay: -3000,
        speed: 4000
    });
    }
    $("#content .right-panel .section .testimonial .middle .item").vAlign();
    if ($('#content .right-panel .section .testimonial .middle').css("height"))
    {
    $('#content .right-panel .section .testimonial .middle').cycle({
        fx:      'fade',
        delay: -3000,
        speed: 4000
    });
    }
    
    $("h1.accordion-item").next("div").hide();
    $("h1.accordion-item").eq(0).next("div").show();
    
    $("h1.accordion-item").hover(function(){
    	$(this).css("color","#fff");
    	$(this).css("backgroundColor","#fa5509");
    }, function(){
    	$(this).css("color","#62C0FF");
    	$(this).css("backgroundColor","transparent");
    });
    
    $("h1.accordion-item").click(function(){
    	$("h1.accordion-item").next("div").slideUp("fast");
    	$(this).next("div").slideDown("fast");
    });
    
});