$(document).ready(function(){

  $(".username").defaultValue({ value : "Email Address" });
  $(".password").defaultValue({ value : "Password" });
  
  $("#cNavigation > li:last-child a").css({"border-right":"0"});
  
$("#cNavigation > li > ul:last").css({"width":"250px"});
   
  if($("#cSplashBannerContainer .banners img").length < 1)
  {
    $("#cSplashBannerContainer").hide();
  }

if($("#cSubBannerContainer .banners img").length < 1)
{
  $("#cSubBannerContainer").hide();
  $("#cBodyContainer").css({"padding-top":"15px"});
}

  
  $('#cSplashBannerContainer .banners').cycle({
        timeout: 6000,
        prev:    '#prev',
        next:    '#next',
        pager:   '#cRotatorDots'
    });
    
    function pagerFactory(idx, slide) {
        var s = idx > 2 ? ' style="display:none"' : '';
        return '<a href="#" '+s+'></a>';
    };

	$('#cSubBannerContainer .banners').cycle({
        timeout: 6000,
        prev:    '#prev',
        next:    '#next',
        pager:   '#cRotatorDots'
    });
    
    function pagerFactory(idx, slide) {
        var s = idx > 2 ? ' style="display:none"' : '';
        return '<a href="#" '+s+'></a>';
    };


   if($("#cRotatorDots a").length < 1)
   {
     $("#cRotatorControls").hide();
   }

$(".openLinks").click(function(e){
  
  e.preventDefault();
  $("#cExpandingLinks .links").slideToggle("fast");
  
  for(x = 1; x < 5; x++)
  {
    $(".c" + x).each(function(){
        $(".column" + x).append($(".c" + x).html()).append("<br /><br />");
        $(this).remove();
    });
  }
  
  
});


$('.youTube').fancybox({
	'width'				: 450,
	'height'			: 375,
    'autoScale': true,
    'transitionIn': 'none',
    'transitionOut': 'none',
    'type': 'iframe'        
});

$("a[href*=youtu.be]").fancybox({
	'width'				: 450,
	'height'			: 375,
    'autoScale': true,
    'transitionIn': 'none',
    'transitionOut': 'none',
    'type': 'iframe'        
});


});

$(function(){

    var config = {    
         sensitivity: 333, // number = sensitivity threshold (must be 1 or higher)    
         interval: 200,  // number = milliseconds for onMouseOver polling interval    
         over: doOpen,   // function = onMouseOver callback (REQUIRED)    
         timeout: 200,   // number = milliseconds delay before onMouseOut    
         out: doClose    // function = onMouseOut callback (REQUIRED)    
    };
    
    function doOpen() {
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    }
 
    function doClose() {
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    }

    $("ul.dropdown > li").hoverIntent(config);
});

