function Refresh(selectID){
	/*$('#'+selectID).parents('.jquery-selectbox').unselectbox();
	$('#'+selectID).selectbox();*/

}

function form_reset()
{
    
    $('#tabs select').val('');
    
}

function hideLayer(ss)
{
    $('#make').toggle();
}

$(document).ready(function()
{

    $('#make').hide();
	$('.belt').width(0);
	$('.belt >li').each(function(){$('.belt').width($('.belt').width()+ $(this).width()+1)});

	var searchTab = "#Used"
    if(document.location.href.indexOf('new_cars')>=1){
        opened='eq(1)';
    	searchTab = "#New";
    }
    else if(document.location.href.indexOf('demo')>=1)
    {
        opened='eq(2)';
   		searchTab = "#Demo";
    }
    else
        opened='first';

	
	$('#tabs .TabBlock').hide(); // Hide all divs
	
	$('#tabs .TabBlock:'+opened).show(); // Show the first div
	$('#tabs .TabBlock').hide();
	$(searchTab).show();
	
    $('#tabs ul li:'+opened).addClass('active'); // Set the class of the first link to active
	$('#tabs ul li:not(:gt(2)) a').click(function(){ //When any link is clicked
		$('#tabs ul li').removeClass('active'); // Remove active class from all links
		$(this).parent().addClass('active'); //Set clicked link class to active
		var currentTab = $(this).attr('href');
		
		// Set variable currentTab to value of href attribute of clicked link
		$('#tabs .TabBlock').hide(); // Hide all divs
		$(currentTab).show(); // Show div with id equal to variable currentTab
		return false;
	});

	var height = Math.max($('.BottomGrad').height(),$('.SideBar').height());
//	$('.BottomGrad').height(height);
	$('.SideBar').height(height);

});


function initMenu() {
	$('#menu ul').hide();
	$('#menu ul:first').show();
	$('#menu li a').click(
	function() {
		var checkElement = $(this).next();
		if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
			return false;
		}
		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
			$('#menu ul:visible').slideUp('normal');
			checkElement.slideDown('normal');
			return false;
		}
	}
	);
}
$(document).ready(function() {initMenu();});


