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

  //IMAGE PRELOADER 
(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)
    
jQuery.preLoadImages("autoImg.jpg", "autoImg.jpg");  
jQuery.preLoadImages("homeImg.jpg", "homeImg.jpg");  
jQuery.preLoadImages("businessImg.jpg", "businessImg.jpg");  
jQuery.preLoadImages("lifeImg.jpg", "lifeImg.jpg");  
  
  
//SLIDE-DOWN-PANEL
  $("#open").click(function(){
    $("div#panel").slideDown("slow");
  });  
  $("#close").click(function(){
    $("div#panel").slideUp("slow");  
  });    
  $("#toggle a").click(function () {
    $("#toggle a").toggle();
  });
  
//SWAPPER
  $('#menu1').hover(
    function(){ $("#menuimage").attr("src", "/autoImg.jpg")},
    function(){ $("#menuimage").attr("src", "/autoImg.jpg");
      });      
  $('#menu2').hover(
    function(){ $("#menuimage").attr("src", "/homeImg.jpg")},
    function(){ $("#menuimage").attr("src", "/homeImg.jpg");
      });
  $('#menu3').hover(
    function(){ $("#menuimage").attr("src", "businessImg.jpg")},
    function(){ $("#menuimage").attr("src", "/businessImg.jpg");
      });
  $('#menu4').hover(
    function(){ $("#menuimage").attr("src", "/lifeImg.jpg")},
    function(){ $("#menuimage").attr("src", "/lifeImg.jpg");
    });
  
});
