﻿var dom = document.getElementById?1:0;
var ie4 = document.all && document.all.item;
var opera = window.opera; //Opera
var ie5 = dom && ie4 && !opera; 
var nn4 = document.layers; 
var nn6 = dom && !ie5 && !opera;
var vers=parseInt(navigator.appVersion);


var good_browser = true;


function showwin(txt,w,vis,bgcolor,bordercolor,font)
{
 if(good_browser) {
  var obj =  document.all('win_tooltip');
  var evnt = event;
  var xOffset = document.body.scrollLeft;
  var yOffset = document.body.scrollTop;

  if (bgcolor=='')
    bgcolor="#990099" ;
  if (bordercolor=='')
    bordercolor="#000000" ;
  if (font=='')
    font="<font color=#000000>" ;

  var temp = "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=1 BGCOLOR="+bordercolor+" WIDTH=" + w + "><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 BGCOLOR="+bgcolor+" WIDTH=100%><TR><TD class=s><em>" + font+ txt + "</font></em></TD></TR></TABLE></TD></TR></TABLE>"; 
//  var temp = "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3 BGCOLOR="+bgcolor+" WIDTH=" + w +"><TR><TD class=s>" + txt + "</TD></TR></TABLE>"; 

  if (vis == 1)
  {
   obj.innerHTML = temp;
   obj.style.width = w;
   hor = document.body.scrollWidth - obj.offsetWidth; 
   posHor = xOffset + evnt.clientX + 10; 
   posHor2 = xOffset + evnt.clientX - obj.offsetWidth - 5; 
   posVer = yOffset + evnt.clientY + 5; 

   if (posHor<hor)
    obj.style.posLeft = posHor
   else
    obj.style.posLeft = posHor2;

   obj.style.posTop = posVer;
 
   obj.style.visibility = "visible";
  }
  else {
   obj.style.visibility = "hidden";
   obj.style.posTop = 0;
   obj.style.posLeft = 0;
  }
 }
}


function movewin()
{
 if (good_browser) {
  var obj =  document.all('win_tooltip');
  var evnt = event;
  var xOffset = document.body.scrollLeft;
  var yOffset = document.body.scrollTop;

   hor = document.body.scrollWidth - obj.offsetWidth; 
   posHor = xOffset + evnt.clientX + 10; 
   posHor2 = xOffset + evnt.clientX - obj.offsetWidth - 5; 
   posVer = yOffset + evnt.clientY + 5; 
   
   if (posHor<hor)
    obj.style.posLeft = posHor
   else
    obj.style.posLeft = posHor2;

   obj.style.posTop = posVer;
 }
}


function popup_win(url, width, height) {
	var pop_win = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,scrolling=yes,";	
	if (opera)
		var size = "width="+width+",height="+height;
	else
		var size = "width="+(width+20) +",height="+(height+20);
	var c=window.open(url,'zoom', pop_win+size);
	if (opera)
	{
		var w1 = c.outerWidth;	
		var h1 = c.outerHeight;
	}
	else
	{
		var w1 = width+20;
		var h1 = height+20;
	}
	var x = (document.body.offsetWidth - w1)/2;
	var y = (document.body.offsetHeight - h1)/2;
	c.moveTo(x, y);
	c.focus();
}

