<!--
function getBounds(element)
{
  var left = element.offsetLeft;
  var top = element.offsetTop;
  for (var parent = element.offsetParent; parent; parent = parent.offsetParent)
  {
    left += parent.offsetLeft;
    top += parent.offsetTop;
  }
  return {left:left,top:top};
}
function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}
function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
function hideMenu(){
   var object = document.getElementById('submenu');
   for (var childItem in object.childNodes){
   	if (object.childNodes[childItem].nodeType == 1)
      	object.childNodes[childItem].style.display='none';
	}
}
function showMenu(submenu,menu,top){
	submenu=submenu+'_sub';
	hideMenu();

	obj=document.getElementById(submenu);
	if(obj){		countMenu=(obj.childNodes.length-1)/2;
		if(navigator.appName=='Microsoft Internet Explorer')
			countMenu+=0.5;

		obj.style.display='block';
		obj.style.left=getBounds(menu).left+'px';
		if(top) {			obj.style.top='37px';
	        document.getElementById('submenu').className='bg_blue';
		}
		else {			obj.style.top=(getBounds(menu).top-countMenu*39)+'px';
	        document.getElementById('submenu').className='bg_red';
		}
	}
}
function showText(){
	document.getElementById('hideDiv').style.display='inline';
	document.getElementById('more').style.display='none';
}
function hideText(){
	document.getElementById('hideDiv').style.display='none';
	document.getElementById('more').style.display='inline';
}
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 setStartPage(ob,url,check)
{
	alert(1);
	if(navigator.appName=='Microsoft Internet Explorer' && !check){
		ob.style.behavior='url(#default#homepage)';
		ob.setHomePage(url);
	}
	else{		if(navigator.appName!='Microsoft Internet Explorer')		ob.style.display='none';
	}
}
function hideItem(id){
	document.getElementById(id).style.display='none';
}
function showItem(id){	document.getElementById(id).style.display='block';
	$(".simple_popup_div").remove();
	$(".simple_popup").click();
}
//AJAX
	function rand()
 	{
          var now=new Date();
          var num=(now.getSeconds());
          var num=num+1;
          return num;
  	}
	function AddWord(new_word) {
	    req=false;
	    try { // определить метод поддержки
	        req=new ActiveXObject('Msxml2.XMLHTTP');
	    } catch (e) {
	        try {
	            req=new ActiveXObject('Microsoft.XMLHTTP'); // сработает в Internet Explorer
	        } catch (e) {
	            if(window.XMLHttpRequest){ // сработает в Mozilla и Safari
	               req=new XMLHttpRequest();
	            }
	        }
	    }
	    if (req){// если какой-то из вариантов поддерживается
	       req.onreadystatechange = readystate; // назначим обработчик событию объекта
	       req.open("GET",'http://nebratenko.ru/modules/search/search_count.php?word='+new_word+'&temp='+rand(), true); // myscript.php – это приведенный выше серверный скрипт
	       req.send(null);
	    }
	}
	function selectMail(id) {
	    req=false;
	    try { // определить метод поддержки
	        req=new ActiveXObject('Msxml2.XMLHTTP');
	    } catch (e) {
	        try {
	            req=new ActiveXObject('Microsoft.XMLHTTP'); // сработает в Internet Explorer
	        } catch (e) {
	            if(window.XMLHttpRequest){ // сработает в Mozilla и Safari
	               req=new XMLHttpRequest();
	            }
	        }
	    }
	    if (req){// если какой-то из вариантов поддерживается
	       req.onreadystatechange = readystate; // назначим обработчик событию объекта
	       req.open("GET",'http://nebratenko.ru/modules/mail/edit_mail_list.php?id='+id+'&temp='+rand(), true); // myscript.php – это приведенный выше серверный скрипт
	       req.send(null);
	    }
	}
	function readystate() {
	    return true;
	}
function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(tables[i].className=='ruler')
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY')
					{
						trs[j].onmouseover=function(){this.className='ruled';return false}
						trs[j].onmouseout=function(){this.className='';return false}
					}
				}
			}
		}
	}
}
//Jquery
$(function() {
    var viewport = {
        o: function() {
            if (self.innerHeight) {
    			this.pageYOffset = self.pageYOffset;
    			this.pageXOffset = self.pageXOffset;
    			this.innerHeight = self.innerHeight;
    			this.innerWidth = self.innerWidth;
    		} else if (document.documentElement && document.documentElement.clientHeight) {
    			this.pageYOffset = document.documentElement.scrollTop;
    			this.pageXOffset = document.documentElement.scrollLeft;
    			this.innerHeight = document.documentElement.clientHeight;
    			this.innerWidth = document.documentElement.clientWidth;
    		} else if (document.body) {
    			this.pageYOffset = document.body.scrollTop;
    			this.pageXOffset = document.body.scrollLeft;
    			this.innerHeight = document.body.clientHeight;
    			this.innerWidth = document.body.clientWidth;
    		}
    		return this;
        },
        init: function(el) {
            $(el).css("left",Math.round(viewport.o().innerWidth/2) + viewport.o().pageXOffset - Math.round($(el).width()/2));
            $(el).css("top",Math.round(viewport.o().innerHeight/2) + viewport.o().pageYOffset - Math.round($(el).height()/2));
        }
    };
    $(".simple_popup_info").each(function(){
        $(".simple_popup").click(function(){
            $(".simple_popup_div").remove();
            var strSimple = "<div class='simple_popup_div'><div class='simple_popup_inner'>";
            strSimple += "<p class='simple_close'><a href='#'>[ x ] Закрыть</a></p>";
            strSimple += $(".simple_popup_info").html();
            strSimple += "</div></div>";
            $("body").append(strSimple);
            viewport.init(".simple_popup_div");
            $(".simple_close").click(function(){
                $(".simple_popup_div").remove();
                return false;
            });
            return false;
        });
    });
});
-->