//scroll top
$(function(){
  $(".totop").click(function() {
    $('html, body').animate({
      scrollTop: 0
    }, 800);
    return false;

  });
});




//header fixed
$(window).scroll(function(){
    if ($(window).scrollTop() >= 180) {
        $('#header').addClass('fixed');
        $("#header .hd-contact").addClass('none');
    }
    else {
        $('#header').removeClass('fixed');
        $("#header .hd-contact").removeClass('none');
    }
});

//ticker
$(function(){
  $('#marquee-vertical').marquee();  
});


//menu toggle
$(function() {
    $("#menu-toggle").click(function() {
    $(".sub_nav ul").slideToggle("slow");
    $(this).toggleClass('open');
    });
    $(".sub_nav ul li a").click(function(){
      $(".sub_nav ul").slideToggle("slow")
      $ (".open").removeClass();
    });
});


// lightbox 
$(function() {
  $('.gallery-img img').each(function() {
    // Iterate through individual images...
    // because we need access to their 'src' attribute
    $(this).colorbox({
      rel: 'images',
      transition: "fade",
      opacity: 0.5,
      rel: 'group1',
      href: $(this).attr('src')
    });
  });
});







