jQuery.noConflict();

//function $(a){return document.getElementById(a);}
function $$(a){return document.getElementsByTagName(a);}

xAddEventListener(window,"load", function()
{
	resize();
	document.getElementById("logo").onclick=function()
	{
		location.href="/";
	}

});

xAddEventListener(window,"resize", function()
{
	resize();
});

function resize()
{
	if(xClientWidth()<910)
	{
		xHeight("citata",0);
	}else
	{
		xHeight("citata",32);
	}
}

function add_script(f)
{
	var h=$$("head")[0];
	var script=document.createElement("script");      
	script.src=f;
	script.type="text/javascript";            
  h.appendChild(script);
}

function add_style(f)
{
	var h=$$("head")[0];
	var link=document.createElement("link");
	link.href=f;
	link.rel="stylesheet";
	link.type="text/css";      
	h.appendChild(link); 
}

var url="http://www.tmei.ru"
var title="Îôèöèàëüíûé ñàéò ÒÈÓèÝ"

function addBookmark()
{
  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;
}
