// var popup;
// function pop(url, width, height) {
//   popup = window.open(url, 'meluton_fi_pop', 'location=0,toolbar=0,status=0,menubar=0,width='+width+',height='+height);
//   return popup;
// }

$(document).ready(function(){
  
  if (document.getElementById('slider')) {
    var bullets = $('#position span');
    var slider = new Slider(document.getElementById('slider'), {
      auto: 5500,
      callback: function(e, pos) {
        $(bullets).removeClass('on').eq(pos).addClass('on');
      }
    })

    if(typeof slider !== 'undefined') {
      $('#position > span').each(function(){
        $(this).click(function(e){
          e.preventDefault();
          slider.slide($(this).index());
        });
      });
    }
  }
  
  if($('#carousel').length > 0 && $('#carousel ul li').length > 1) {
    window.carousel = new Slider(document.getElementById('carousel'), {
      // auto: 6000
    });
  }

  $('.contact-btn').click(function(e) {
    e.preventDefault();
    $('.contact-form').lightbox_me({
      centered: true,
      onLoad: function() { 
        $('.contact-form').find('input:first').focus()
      }
    });
  });

});

