$(function() {
  // submits
  $('a#submit_btn').click(function() {
    $('a#submit_btn').parents('form').submit();
  }); 

  // menu
  $('ul').jdMenu(
    { disableLinks : false }
  );

  // new window links
  $('a.new').click(function(){
    window.open(this.href);
    return false;
  });
  
  // testimonial - add clear left to evens
  $('div.testimonials').find('div.testimonial').each(function(i, el) {
    addClearToEven(i, el);       
  });
  
  if (window.location.href.match(/portfolio\/?$/)) {
    $('div.wp-caption').each(function(i, el) {
      addClearTo3(i, el);
    });
  }
  
  
});


function doNothing() {
  return false;
}

function addClearToEven(i, el) {
  if (i % 2 == 0) {
    $(el).css("clear", "left");
  };
}

function addClearTo3(i, el) {
  if (i % 3 == 0) {
    $(el).css("clear", "left");
  };
}