﻿<!--

function trim(str) {
	return str.replace(/^\s*/,'').replace(/\s*$/,'');
}

function cf(){
//	document.search_form.str.focus();
}	
function insertEG() {
	document.sform.q.value = 'honda accord';
}

function DoSubmit() {
                var q;
		var vibor;
		var add;
		q = document.sform.q;
		vibor = document.getElementById('UrlSearchId').value;
		if(vibor == 1) add = ''; //Поиск повсюду
                if(vibor == 2) add = ' more:auto_obzor';
		if(vibor == 3) add = ' more:auto_tech';
		if(vibor == 4) add = ' more:auto_news';
		if(vibor == 5) add = ' more:auto_forums';
		q.value = q.value + add;
	        if(trim(document.sform.q.value).length<1) return false;
		}

function DoSubmitResult() {
                if(trim(document.sform.q.value).length<1) return false;
		}
	
function setSearchLoc (id) {
	        document.getElementById('UrlSearchId').value = id;
		if (document.getElementById('loc' + selectID)) {
			document.getElementById('loc' + selectID).className = '';
		}
	}

	function InitSearchService (){
		document.getElementById('UrlSearchId').value = selDefault;
		if (document.getElementById('loc' + selectID)) {
			document.getElementById('loc' + selectID).className = '';
		}
		document.getElementById('loc' + selDefault).className = 'active';
	}

	function changeLoc (id) {
		setSearchLoc(id);
		
		selectID = id;
		searchID = id;

		document.getElementById('loc' + id).className = 'active';
		return false;
	}

function addBookmark(url, title)
{
  if (!url) url = location.href;
  if (!title) title = document.title;
  
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
  else if (typeof window.external == "object") window.external.AddFavorite(url, title);
  else if (window.opera && document.createElement)
  {
	var a = document.createElement('A');
	if (!a) return false; //IF Opera 6
    a.setAttribute('rel','sidebar');
    a.setAttribute('href',url);
    a.setAttribute('title',title);
    a.click();
  }
  else return false;
  
  return true;
}

//-->
