// Nivo Slider
$(window).load(function() {
  $('#slider').nivoSlider({
    effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
    slices:50,
    animSpeed:500,
    pauseTime:10000,
    startSlide:0, //Set starting Slide (0 index)
    directionNav:true, //Next & Prev
    directionNavHide:true, //Only show on hover
    controlNav:true, //1,2,3...
    controlNavThumbs:false, //Use thumbnails for Control Nav
    controlNavThumbsFromRel:false, //Use image rel for thumbs
    controlNavThumbsSearch: '.jpg', //Replace this with...
    controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
    keyboardNav:true, //Use left & right arrows
    pauseOnHover:false, //Stop animation while hovering
    manualAdvance:false, //Force manual transitions
    captionOpacity:1, //Universal caption opacity
    beforeChange: function(){},
    afterChange: function(){},
    slideshowEnd: function(){} //Triggers after all slides have been shown
  });
});




// Slider Caption
$('.nivo-slice').each(function(){
  text = '<span class="links-inner">'+$(this).html()+ '</span>';
  $(this).html(text);
});


// Tabs
$(document).ready(function() {

  //Default Action
  $(".tab_content").slideUp("slow"); //Hide all content
  $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  $(".tab_content:first").slideDown("slow"); //Show first tab content
  
  //On Click Event
  $("ul.tabs li").click(function() {
  $("ul.tabs li").removeClass("active"); //Remove any "active" class
  $(this).addClass("active"); //Add "active" class to selected tab
  $(".tab_content").slideUp("slow"); //Hide all tab content
    var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
    $(activeTab).slideDown("slow"); //Fade in the active content
      return false;
    });
});


// News Ticker
$(document).ready(function() {
  if ($("#news-ticker").length > 0) {
    var options = {
      newsList : "#news-ticker",
      tickerRate: 100,
      startDelay : 100,
      loopDelay: 3000,
      placeHolder1: "_",
      placeHolder2: ""
    }
    $().newsTicker(options);
  }
});


// Featured Slideshow
$(document).ready(function(){
  $('#slider').hover(function(){
    $(".nivo-caption", this).stop().animate({bottom:'0'},{queue:false,duration:600});},
  function() {
    $(".nivo-caption", this).stop().animate({bottom:'0'},{queue:false,duration:500});
  });

});;


// Superfish Menu
$(document).ready(function() { 
  $('ul.sf-menu').superfish({ 
    delay:       1000,                            // one second delay on mouseout 
    animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
    speed:       'fast',                          // faster animation speed 
    autoArrows:  false,                           // disable generation of arrow mark-up 
    dropShadows: false                            // disable drop shadows 
  }); 
});


// Adding CSS3 Property by jquery inorder to validate the CSS
$(document).ready(function(){
  $("ul.pager a, ul.pager li.pager-current, #featured .nivo-controlNav, #breadcrumbs-inner").css("-webkit-border-radius","3px").css("-moz-border-radius","3px");
  $("form input.form-submit").css("-webkit-border-radius","4px").css("-moz-border-radius","4px");
  $("#search-box .form-submit").css("-webkit-border-radius","0").css("-moz-border-radius","0");
});


// Jquery Social Icons
$(document).ready(function() {
	$('.extra-nav').hover(function() { //mouse in
		$(this).animate({ marginTop:'-17px'}, 150);
	}, function() { //mouse out
		$(this).animate({ marginTop:"0"}, 150);
	});
});
