$(document).ready(function(){
   
   // hide these
   $('.hidden').hide();
   
   // home slideshow (automatic)
   //$('.home-video').delay(48900).fadeOut(1500);
   
   //$('.main-slideshow-automatic').cycle({
     //fx: 'scrollHorz', 
     //speed: "fast",
     //next:   '#right-arrow', 
     //prev:   '#left-arrow',
     //pager:  '#cycle-nav',
     //timeout: 48900,
     //cleartype: true, 
     //cleartypeNoBg: true
 	//});
 	
 	// all other slideshows (manual)
   $('.main-slideshow').cycle({ 
     fx: 'scrollHorz', 
     speed: "slow",
     next:   '#right-arrow', 
     prev:   '#left-arrow',
     pager:  '#cycle-nav',
     timeout: 8000,
     cleartype: true, 
     cleartypeNoBg: true
 	});
 	
 	// .header-ad, 
 	// header ad
 	$('.blog .header-ad, .ad1of2, .ad2of2').cycle({ 
    fx: 'fade', 
    speed: 1500,
    timeout: 5000,
    random: 1,
    cleartype: true, 
    cleartypeNoBg: true
	});
	
	// page message (on slideshow pages)
	$('.homemessage-jq').cycle({ 
    fx: 'fade', 
    speed: 1500,
    timeout: 10000,
    random: 1,
    cleartype: true, 
    cleartypeNoBg: true
	});
 	
 	// drop downs
  $('.main-nav .main-link-drop').hover(function() {
    clearTimeout($(this).data('timeout'));
    $(this).addClass("dropdown");
    $("ul",this).slideDown("fast");
  }, function() {
    var hover = $("ul", this);
    var li_hover = $(this);
    var t = setTimeout(function() {
    $(hover).hide();
    $(li_hover).removeClass("dropdown");
  }, 200);     
    $(this).data('timeout', t);
  });
  
 	
 	// hover for secondary nav (social networks)
  $('.secondary-nav ul .hover').hover(function(){
    // variables
    var li_class = $(this).attr("class");
    var full_class = li_class + "-hover";
    var li_original = $(this).attr("id");
    // actions
    $(this).addClass(full_class);
    $(this).removeClass(li_class);
  }, function(){
    // variables
    var li_class = $(this).attr("class");
    var full_class = li_class + "-hover";
    var li_original = $(this).attr("id");
    // actions
    $(this).removeClass(li_class);
    $(this).addClass("hover");
    $(this).addClass(li_original);
  });
});
