function addBookmark(url, title)
{
  if (!url) url = location.href;
  if (!title) title = document.title;
 
  //Gecko
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
  //IE4+
  else if (typeof window.external == "object") window.external.AddFavorite(url, title);
  //Opera7+
  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;
}


function set_homepage(ref){
	isDOM=document.getElementById
	isOpera=isOpera5=window.opera && isDOM
	isOpera6=isOpera && window.print
	isOpera7=isOpera && document.readyState
	isMSIE=document.all && document.all.item && !isOpera
	isMSIE5=isDOM && isMSIE
	isNetscape4=document.layers
	isMozilla=isDOM && navigator.appName=="Netscape"

	if (isMSIE)
	{
			if (typeof(document.all) != 'undefined')
			{
				ref.style.behavior = 'url(#default#homepage)';
				ref.setHomePage('http://www.chimtrade.com.ua');
			}
			return false;
	}

	else
	{
		alert("Ваш браузер не поддерживает данную функцию");
	}

}
function checkSrch()
	{
	
		p = document.getElementById('srch');
		if(p.value)
		{
			if(p.value.length < 3)
			{
				alert('Длина поискового слова должна составлять не менее 3 символов');
				return false;
			}
			return true;
		}
		else alert('Введите текст для поиска');
		return false;
	}
function ch_bg(el, color)
{
	el.style.background = color;
}
/*function set_homepage(ref)
{ if(navigator.appName == 'Microsoft Internet Explorer')

		{
			if (typeof(document.all) != 'undefined')
			{
				ref.style.behavior = 'url(#default#homepage)';
				ref.setHomePage('http://www.chimtrade.com.ua');
			}
			return false;
		}
else alert('Ваш браузер не поддерживает эту функцию');
}*/