 // JavaScript Document -- Drop Down Menu

$(document).ready(function() {


	$('#bottombuttons ol li').click(function() {
		$('#bottombuttons ol li').removeClass();	
		$(this).addClass('buttonselected');
	
	}); 
    
	
});




function initialLoadDropDown(xx, yy) {
	$('#bottombuttons ol li').removeClass();	
	$('#dropdown').show();
    $('#dropdown').animate({
	height:"400px",
	easing: 'swing'
  
  }, 

  1000 );
	
	
	if (xx == 's') {
	    $('#salvagedropdown').addClass('buttonselected');
		changeContent(yy);
	}
	
	if (xx == 't') {
	    $('#titledropdown').addClass('buttonselected');
		changeContent(yy);
	}
	
		if (xx == 'tmu') {
	    $('#tmudropdown').addClass('buttonselected');
		changeContent(yy);
	}
	
		if (xx == 'cfax') {
	    $('#carfaxdropdown').addClass('buttonselected');
		changeContent(yy);
	}
	
	
}

function initialLoadInventoryUpdate() {
	
	$('#inventoryupdate').show();
    $('#inventoryupdate').animate({
	height:"400px",
	easing: 'swing'
  
  }, 

  1000 );
	
	
	
	
}

function changeContent(xx) {



	$('#dropdowniframe').fadeOut('fast');
	
	setTimeout(function() {
		
		
		$('#dropdowniframe').attr('src', xx);
		
	}, 150);

	setTimeout(function() {
		
		
		$('#dropdowniframe').fadeIn('fast');
		
	}, 350);



}

function closeDropDown() {

$('#dropdown').show();
 $('#dropdown').animate({
	height:"0px",
	easing: 'swing'
  
  }, 

  1000 );
  
  setTimeout("$('#dropdown').hide();", 1000);
}

function closeInventoryUpdate(x) {

  if (x == 1) { 
  $('#dropdowntext2').text('Close');
  $('#inventoryclosebutton').attr('onclick','closeInventoryUpdate();');
   $('#inventoryupdate').animate({
	height:"400px",
	easing: 'swing'
  
  }, 

  1000 );
  $('#emailupdates').fadeOut();
   $('#carsearch2').fadeOut();
	 setTimeout("$('.icontent').fadeIn();",350);
  
  return;
  }
$('#inventoryupdate').show();
 $('#inventoryupdate').animate({
	height:"0px",
	easing: 'swing'
  
  }, 

  1000 );
  
  setTimeout(function() {
	  
	  $('#inventoryupdate').hide();
	  $('#carsearch2').hide();
	  $('.icontent').show();
  
  
  }, 1000);
}

function openCarSearch() {
$('.icontent').fadeOut('fast');
$('#dropdowntext2').text('Back');
$('#inventoryclosebutton').attr('onclick','closeInventoryUpdate(1);');

 $('#inventoryupdate').animate({
	height:'480px',
	easing: 'swing'
  
  }, 1000 );
  
setTimeout("$('#carsearch2').fadeIn('fast');", 1100);
	
}

function openEmailUpdates() {
$('.icontent').fadeOut('fast');
$('#dropdowntext2').text('Back');
$('#inventoryclosebutton').attr('onclick','closeInventoryUpdate(1);');
  
setTimeout("$('#emailupdates').fadeIn('fast');", 350);
	
}
