window.onload = function(){
	catModeToggleInit();
}



function catModeToggleInit(){
	var byPart = document.getElementById('part'),	
		byModel = document.getElementById('part_for_models'),
		wraper = document.getElementById('homeCatSwitcher'),
		byPartList = document.getElementById('part_list'),
		byModelList = document.getElementById('part_for_models_list');
		
	wraper.onclick = function(e) {
		e = e || window.event;
		var t = e.target || e.srcElement;
		switch(t.parentNode.parentNode){
			case byPart:
				byPartList.className = 'cur';
				byModelList.className = '';
				byPart.className = 'switcherBlock_cur';
				byModel.className = 'switcherBlock';
			break;
			case byModel:
				byPartList.className = '';
				byModelList.className = 'cur';
				byPart.className = 'switcherBlock';
				byModel.className = 'switcherBlock_cur';
			break;
		}
	}
}



function do_search(text){
	var search_line = document.getElementById('sline');
	if(text)
		search_line.value = text;
	
	if(search_line.value)
		document.forms['web'].submit();
}










	
