
$(document).ready(function() {
          
    /* dynamic version that pulls the image width and container width
    
    decided to hardcode the width value because the function was running before the image would load, resulting in a value of 0 for the width
    
    ////
    
        var clientImgWidth = $(".clientImage").width(); 
        var clientContainerWidth = $(".clients").width();

        for (i=0;i<=50;i++) {
            $(".clientImage").animate({"left": "-=" + (clientImgWidth - clientContainerWidth)}, 50000);
            $(".clientImage").animate({"left": "+=" + (clientImgWidth - clientContainerWidth)}, 50000);
          }
    */
        
        $('.customInterests label').tipsy({fade: true,gravity: 'e'});
    
    
        $(".contact").validate();

    
        for (i=0;i<=50;i++) {
            $(".clientImage").animate({"left": "-=5770"}, 30000);
            $(".clientImage").animate({"left": "+=5770"}, 5000);
          }
        
                
          
    



$('.customInterests input').click(function() {

  ciCount = $(".customInterests input:checkbox:checked").length;
  $(".ciCount").html("You have choosen " + ciCount);
  
  if (ciCount < 11) {
    $(".ciCountError").hide();
    $(".ciCountOK").show();
    $(".ciCountOK").html("You have " + (10 - ciCount) + " available to choose");
  
    
  } else { 
    $(".ciCountOK").hide();
    $(".ciCountError").show();
    $(".ciCountError").html("You have choosen too many fields, please remove " + (ciCount - 10));
  
  }
}); 
 

$("form.customDataForm").submit(function() {
      if (ciCount < 11) {
        return true;
      }
      return false;
});

// links to other sites open in a new window

$("a[href^=http]").attr("target","_blank");
$("a[href$=pdf]").attr("target","_blank");


// onload
});

