function myInit() {
		
	$('#archive > li > a').click( function() {		
		$(this).parent().toggleClass("open"); 
		return false;
		});
	
	$('#homePageSlideshow').innerfade({ 
		speed: 500, 
		timeout: 5000, 
		type: 'sequence', 
		containerheight: '299px'
		});

	
	$('#navigation > ul > li:last').css('width','142px');	
	
	$('#navigation > ul > li:has(ul) > a').click( function() {											  
		return false;
		}); 
	
		$("#commentForm").submit(function() {		
		$('#commentForm').attr('method','post');
		errors = '';	
		if (!$('#cf_comment').val()) {
			errors += "Comment\n";
			}
		if (!$('#cf_name').val()) {
			errors += "Name\n";
			}
		if (!$('#cf_email').val()) {
			errors += "Email\n";
			}
		if (errors) {			
			alert("The following fields are required:\n\n"+errors);
			return false;
			} 	
		});

	}

function goback() {
	history.back();
	}
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=376,height=525,left=80,top=80');");
	}
	
function populateModelList (
					listId /* how to find the model list in the html */,
					menuId /* currently selected item in 'make' list */
		) {
	
	var selectList = document.getElementById(listId);
	selectList.options.length = 0;
	selectList.options[0] = new Option('Select Model', '');
	if( modelItems[menuId] ) {
			for( var c = 0; c < modelItems[menuId].length; c++ ) {
				selectList.options[c+1] = new Option( modelItems[menuId][c][0], modelItems[menuId][c][1] );
			} /* for */
	} /* if */
	
	if ('qsmodel' == listId) { populateVariantList('qsvariant','blank'); }
	if ('model' == listId)   { populateVariantList('variant','blank'); }
	
} /* populateModelList */

function populateVariantList( listId, menuId ) {
	var selectList = document.getElementById(listId);
	selectList.options.length = 0;
	if( variantItems[menuId] ) {
		for( var c = 0; c < variantItems[menuId].length; c++ ) {
			selectList.options[c] = new Option( variantItems[menuId][c][0], variantItems[menuId][c][1] );
		}
	}
}

function validatesearch(check)
{
  if(check.make.value == null || check.make.value.length == 0) { 
    alert('Please select a make'); 
    check.make.focus();
    return false;
  }

  if(check.model.value == null || check.model.value.length == 0) { 
    alert('Please select a model'); 
    check.make.focus();
    return false;
  }

  if(check.variant.value == null || check.variant.value.length == 0) { 
    alert('Please select a variant'); 
    check.make.focus();
    return false;
  }

document.searchForm.submit();
}


function validatequicksearch(check)
{
  if(check.qsmake.value == null || check.qsmake.value.length == 0) { 
    alert('Please select a make'); 
    check.qsmake.focus();
    return(false);
  }

  if(check.qsmodel.value == null || check.qsmodel.value.length == 0) { 
    alert('Please select a model'); 
    check.qsmake.focus();
    return(false);
  }

  if(check.qsvariant.value == null || check.qsvariant.value.length == 0) { 
    alert('Please select a variant'); 
    check.qsmake.focus();
    return(false);
  }

document.quicksearchForm.submit();
}
