isDOM=document.getElementById; //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM; //Opera 5+
isOpera6=isOpera && window.print; //Opera 6+
isOpera7=isOpera && document.readyState; //Opera 7+
isMSIE=document.all && document.all.item && !isOpera; //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE; //MSIE 5+
isNetscape4=document.layers; //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape"; //Mozilla или Netscape 6.*
mousex = 0;
mousey = 0;
top_ch = -10;

if(isNetscape4) document.captureEvents(Event.MOUSEMOVE)

if(isMSIE ){
  document.onmousemove=function(){
    mousex=event.clientX+document.body.scrollLeft;
    mousey=event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
    top_=document.documentElement.scrollTop-top_ch;

    return true;
  }
}
else if(isOpera7)
{
    document.onmousemove=function(){
	mousex=event.clientX+document.body.scrollLeft;
	mousey=event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
	top_=0-top_ch;

	return true;
    }
}
else if(isOpera)
{
  document.onmousemove=function(){
    mousex=event.clientX;
    mousey=event.clientY;

    top_=0-top_ch;

    return true;
  }
}
else if(isNetscape4 || isMozilla)
{
  document.onmousemove=function(e){
    mousex = e.pageX;
    mousey = e.pageY;
    
    top_=document.body.scrollTop-top_ch;

    return true;
  }  
}

function showInfo(id)
{
	var el = document.getElementById(id);
	var info = document.getElementById('xobmen_info');
	info.innerHTML = el.innerHTML;
	info.style.display = 'block';	
	info.style.left=(mousex+15)+"px";
	info.style.top=(mousey-top_ch)+"px";
}
function hideInfo()
{
	var info = document.getElementById('xobmen_info');
	info.style.display = 'none';
}
function mchange(){
	var calcform_first = document.getElementById('calcform_first');
	var calcform_change = document.getElementById('calcform_change');
	var mxform_first = document.getElementById('mxform_first');
	var mxform_change = document.getElementById('mxform_change');
	calcform_first.value=mxform_first.value;
	calcform_change.value=mxform_change.value;
}

$(function(){$('#toggle_all').click(function(){
    if($('#AutoNumber4 tr.more10:first').css('display')=='none'){
        $('#toggle_img').attr('src','images/minus.gif');
        $('#toggle_all').html('Только 10');
    }else{
        $('#toggle_img').attr('src','images/edit_add.gif');
        $('#toggle_all').html('Показать все');
    }
    $('#AutoNumber4 tr.more10').toggle();
    return false;
})});



function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}


