﻿$(document).ready(function () {
    var isCurrent = false;
    //main navigation
    $('.main_nav ul li .dropdown li:first-child').addClass('first');
    $('.main_nav ul li .dropdown li:last-child').addClass('last');

    $('.main_nav ul li').mouseover(function () {
        $(this).addClass('hover');
        $(this).children('div.invisible_line').show();
        $(this).children('div.dropdown').show();
    }).mouseout(function () {
        $(this).removeClass('hover');
        $(this).children('div.invisible_line').hide();
        $(this).children('div.dropdown').hide();
    });

    // news and blog title hover
    $('ul.list_01 li .contet_block .thumb_holder .title_info_wrapper').hover(
      function () {
          $(this).addClass('hover');

      },
      function () {
          $(this).removeClass('hover');
      }
    );

    //top bar slide
    $('.top_nav ul li a').bind('click', function () {
        if ($(this).parent().hasClass('active')) {
            $('.top_bar').children().hide();
            $('.top_bar_wrapper').animate({ height: '5px' }, 300);
            $('.top_bar').hide();
            $(this).parent().parent().children().removeClass('active');
        } else {
            $(this).parent().parent().children().removeClass('active')
            $('.top_bar_wrapper').animate({ height: '45px' }, 300);
            $('.top_bar').children(':visible').hide();
            $('.top_bar').show();
            var selector = $(this).parent().attr('class');
            $('.top_bar').find('.' + selector).fadeIn(600);
            $(this).parent().addClass('active');
        }
    });

    // bind change event to select    
    $('#mobile_select').bind('change', function () {
        var url = $(this).val(); // get selected value
        if (url) { // require a URL
            window.location = url; // redirect
        }
        return false;
    });

    //gallery

    /* This is basic - uses default settings */

    $("a#single_image").fancybox();

    /* Using custom settings */

    $("a#inline").fancybox({
        'hideOnContentClick': true
    });

});



