


$(document).ready(function() {         
  
 //TWITTER
  $("#twitter").getTwitter({               
    userName: "",               
    numTweets: 1,               
    loaderText: "Loading tweets...",               
    slideIn: true,               
    showHeading: true,               
    headingText: "Follow Us On Twitter",               
    showProfileLink: false         
  });


//SLIDE-DOWN-PANEL
  $("#open").click(function(){
    $("div#panel").slideDown("slow");
  });  
  $("#close").click(function(){
    $("div#panel").slideUp("slow");  
  });    
  $("#toggle a").click(function () {
    $("#toggle a").toggle();
  });
  
//SLIDER
$('#coda-slider-1').codaSlider({
              dynamicArrows: false,
              dynamicTabs: false,
              autoSlide: true, 
              autoSlideInterval: 6000, 
              autoSlideStopWhenClicked: true
               });

  //HOME PAGE FORM VALIDATION
    jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
    phone_number = phone_number.replace(/\s+/g, "");
  return this.optional(element) || phone_number.length > 9 &&
    phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
}, "Please specify a valid phone number");
 
  
  jQuery.validator.addMethod(   
    "insType",   
   function(value, element) {   
      if (element.value == " ")   
     {  return false;  }
      else return true;   
    },   
    "Please Select a Product"
 );
  jQuery.validator.addMethod(   
    "stateSelect",   
   function(value, element) {   
      if (element.value == " ")   
     {  return false;  }
      else return true;   
    },   
    "Please Select a State"
 );
  
  
$("#cForm").validate({
  rules: {
    phone: {
      required: true,
      phoneUS: true,
      stateSelect: true,
      insType: true
    }
  }
  });
  


});