$(document).ready(function(){
	$("#top_10>li>ol").hide();
	$("#top_10>li>a").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	$("#top_10>li>a").click(function(){
		$(this).next("#top_10>li>ol").slideToggle("slow,");
	});
	// rotate banner in header
	$('#banner').innerfade({
		speed: 'slow',
		timeout: 4000,
		type: 'sequence',
		containerheight: '34px'
	});	
	// Toggle All Models
	$("#toggle_all_models ul").hide();		
	$("#toggle_models").click(function () {
		$("#toggle_all_models ul").slideToggle();
	});	
	// IMPROVE THIS PAGE
	// get the improvePage link and (using javascript) append the pop=1 param
	$('a#improvePage').each(function(intIndex){
		var theURL = $(this).attr("href");
		var newURL = theURL + "&pop=1";
		$(this).attr("href",newURL);	
	});	
	// when the improve page form is submitted
	$('form[name=improvePageForm]').live('submit',function(){
		var formData = $('form[name=improvePageForm]').serialize(); $.ajax({type: 'POST',url: '/contact/action/improve.cfm',cache: false,data: formData,dataType: 'script',beforeSend:function(){$('div#formOutput').remove();},success: function(data){if(error){$('form[name=improvePageForm]').before(output);}else{ $('form[name=improvePageForm]').before(output); $('form[name=improvePageForm]').remove(); } },error: function(xhr){alert(xhr.StatusText);}}); return false;
	});	
});