			$(window).load(function() {
				Cufon.replace('a, span').CSS.ready(function() {
				    var $wrapper = $('#wrapper');
				    //var cur = 1;*/
				$('#home').track({event_name: 'mouseover'});
				$('#info').track({event_name: 'mouseover'});
				$('#quote').track({event_name: 'mouseover'});
				$('#faq').track({event_name: 'mouseover'});
				$('#media').track({event_name: 'mouseover'});
				  if ($.browser.webkit){
				        $('#steps form p').css({'padding':'2px','margin': '5px 0px 5px 100px'});
				        $('#steps form input').css({'padding':'2px'});
				        $wrapper.css({'margin': '3px 0px 0px 175px'});
				        $('.form_phone').css({'top':'2px'});
				        //$('#tab_instructions').css({'height':'215px','top':'356px'});
				        }
                                 /* if ($.browser.msie) {
                                        alert("We don't currently support any version of Internet Explorer less than version 9. For the best experience, use Firefox or Chrome! If you can't update your browser then copy and paste this link and install google chrome frame for IE http://code.google.com/chrome/chromeframe/ Thanks!");}*/
				        //$("form.jqtransform").jqTransform();
				        $(window).bind('hashchange', function (){
                                             var hash = location.hash;
                      hash = hash.replace(/^#/, '');
                     switch (hash) {
        case 'home':
            $("#" + hash).trigger("mouseenter").trigger("click");
            break;
        case 'quote':
            $("#" + hash).trigger("mouseenter").trigger("click");
            break;
        case 'info':
            $("#" + hash).trigger("mouseenter").trigger("click");
            break;
        case 'faq':
            $("#" + hash).trigger("mouseenter").trigger("click");
            break;
        case 'media':
            $("#" + hash).trigger("mouseenter").trigger("click");
            break;
        /*case 'reviews':
            $("#" + hash).trigger("mouseenter").trigger("click");
            break;*/
    }});
                    $(':input').autotab_magic();
				   var currentPosition = 0;

  var slideWidth = 755;
  var slides = $('.slide');
  var numberOfSlides = slides.length;

  // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
  slides
    .wrapAll('<div id="slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth
    });

  // Set #slideInner width equal to total width of all slides
  $('#slideInner').css('width', slideWidth * numberOfSlides);

  // Insert controls in the DOM
  $('#slideshow')
    .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
    .append('<span class="control" id="rightControl">Clicking moves right</span>');

  // Hide left arrow control on first load
  manageControls(currentPosition);

  // Create event listeners for .controls clicks
  $('.control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
    
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $('#slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
  });

  // manageControls: Hides and Shows controls depending on currentPosition
  function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
	// Hide right arrow if position is last slide
    if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  }	
				  $('input[type="text"]').focus(function() {  
                         if(this.value == this.defaultValue){  
                                this.value = '';  
                            }  
                         else if(this.value != this.defaultValue){  
                             this.select();  
                                }  
                    });  
                  $('input[type="text"]').blur(function() {
                        var string = this.value
                         string = $.trim(string)    
                        if (string == ''){  
                            this.value = (this.defaultValue ? this.defaultValue : '');  
                              }  
                      }); 
                       		
				    $($.date_input.initialize);
					var $menu 		= $("#slidingMenu");
					var $quote_pg =  $('#quote_page');
					var $info_pg =  $('#info_page');
					var $faq_pg =  $('#faq_page');
					var $media_pg =  $('#media_page');
					var $contact_pg =  $('#contact_page');
					var page = new Array();
					page = [$quote_pg,$info_pg,$faq_pg,$media_pg];//,$contact_pg];
					/**
					* the first item in the menu, 
					* which is selected by default
					*/
					var $selected	= $menu.find('li:first');
					if (!$selected.hasClass('currently')) {
					    $selected = $menu.find('li.currently');
					 }; 
					
					/**
					* this is the absolute element,
					* that is going to move across the menu items
					* it has the width of the selected item
					* and the top is the distance from the item to the top
					*/
					var $moving		= $('<li />',{
						className	: 'move',
						top			: $selected[0].offsetTop + 'px',
						width		: $selected[0].offsetWidth + 'px'
					});
					     
				      var $checking = $('#slidingMenuDesc');
					/*
					* append the absolute div to the menu;
					* when we mouse out from the menu 
					* the absolute div moves to the top (like innitially);
					* when hovering the items of the menu, we move it to its position 
					*/
					var prev = 0;
					var i = 0;
					$menu.bind('mouseleave',function(){
							moveTo($menu.find('li.currently'),400);
						  })
						 .append($moving)
						 .find('li')
						 .not('.move')
						 .bind('mouseenter',function(){
							var $this = $(this);
							moveTo($this,400);
						  })						 
						 .bind('click',function(){
							var $this = $(this);
							$.trackPageview('/'+$this.attr('id'));
				            var cur = $('li.currently').index();
							if (!$this.hasClass('currently')){
							    if ($this.index() == 0){
							        $('#social_logos').fadeIn('slow');
							        }
							    if (i !=0){
							    $checking.find('.current').stop().children().hide().parent().animate({'width':'0px'},500).removeClass('current');
							    $('#truck'+parseInt(cur)).animate({'left':'-15px'});
							    
							    }
							    /*if (prev == 5){
							        $('#social_logos').fadeOut('fast');
							        }*/
							    $menu.find('li.currently').removeClass('currently'); //order of animation might cause issues 
							    $this.addClass('currently'); 
							    cur = $this.index();
							    if (cur < 5 & cur > 0){
							    $('#truck'+parseInt(cur)).animate({'left':'950px'});
							    $('#social_logos').fadeOut('fast');
							    if ((cur-1) >= 0){
							    page[cur-1].addClass('current').stop().animate({'width':'950px'},'easeInExpo').children().delay(250).fadeIn("slow");
							    i++;
							       }
							     }
							    /*if (cur == 5){
							     $('#social_logos').fadeIn('slow');}
							     prev = cur;*/
							    }
							    	});
							//'+parseInt(cur)+')
					
					/**
					* moves the absolute div, 
					* with a certain speed, 
					* to the position of $elem
					*/
					function moveTo($elem,speed){
						$moving.stop(true).animate({
							top		: $elem[0].offsetTop + 'px',
							width	: $elem[0].offsetWidth + 'px'
						}, speed, 'easeOutExpo');
					}
					
					$('a.quote_link').bind('click',function(){ 
					    $('#quote').trigger("mouseenter").trigger("click");
					    });
					
					$('a.call_link').bind('click',function(){ 
					    $('#home').trigger("mouseenter").trigger("click");
					    });
					    
					    $('a.faq_link').bind('click',function(){ 
					    $('#faq').trigger("mouseenter").trigger("click");
					    });
			
					        
     
		$(window).trigger("hashchange");

				}) ;
			});

