browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
var agent = navigator.userAgent;

if (agent.indexOf("Opera") > -1) {
	document.writeln("<link rel=stylesheet type=text/css href=\"/common/css/ie.css\">");
}
else if ((browserVer >3) && (browserName == "Microsoft Internet Explorer")) {
	document.writeln("<link rel=stylesheet type=text/css href=\"/common/css/ie.css\">");
}
else if ((browserVer >3) &&(browserName == "Netscape")) {
	document.writeln("<link rel=stylesheet type=text/css href=\"/common/css/nn.css\">");
}

function show(object)
{
 if (document.layers && document.layers[object] != null)
  document.layers[object].visibility = 'visible';
 else if (document.all && document.all[object])
  document.all[object].style.visibility = 'visible';
}
function hide(object)
{

 if (document.layers && document.layers[object] != null)
 document.layers[object].visibility = 'hidden';
 else if (document.all && document.all[object]){
  if (object == 'p1'){document.all[object].innerHTML="";}
  document.all[object].style.visibility = 'hidden';
 }
}
function popup(object,what,e,s) {
var lead = (document.layers) ? "<TABLE cellpadding='0' cellspacing='0'  BORDER='0' ID='pT'><TR><TD class='gr1' bgcolor='#dddddd' NOWRAP>" : "<TABLE cellpadding='0' cellspacing='0' border='0' ID='pT'><TR><TD bgcolor='#dddddd' WIDTH='100%' NOWRAP>" ;
var tail="</TD></TR></TABLE>";
var d = (document.layers) ? "document.layers[" + object + "]":"document.all[" + object +"]";
// what = "xPos>[" + event.x + "] yPos>[" + event.y + "]</TD></TR><TR><TD CLASS='pink'  WIDTH='100%' NOWRAP>scrollTop>[" + document.body.scrollTop + "] scrollLeft>[" + document.body.scrollLeft.y + "]";
// create document
 if (document.layers && document.layers[object] != null){
  document.layers[object].document.open();
  document.layers[object].document.write(lead+what+tail);
  document.layers[object].document.close();
 }
 if (document.all && document.all[object]){
  document.all[object].innerHTML=lead+what+tail;
 }
//set position for NS and IE pop-up and display
 if (document.layers && document.layers[object] != null) {
  xPos=e.pageX + 10;
  yPos=e.pageY - 2;
  if (yPos + document.layers[object].document.height - self.pageYOffset > self.innerHeight){yPos = yPos - document.layers[object].document.height - 2}
  if (xPos + document.layers[object].document.width - self.pageXOffset > self.innerWidth){xPos = xPos - document.layers[object].document.width - 10}
   document.layers[object].moveTo(xPos,yPos);
   document.layers[object].visibility = 'visible';
 }
 else  {
  if (document.all && document.all[object]) {
   xPos=event.x + 10;
   yPos=event.y  + 12;
   if (yPos + document.all['pT'].clientHeight - document.body.scrollTop > document.body.offsetHeight){yPos = yPos - (document.all['pT'].clientHeight - 10)}
   if (xPos + document.all['pT'].clientWidth - document.body.scrollLeft > document.body.offsetWidth){xPos = xPos - (document.all['pT'].clientWidth + 30)}
   document.all[object].style.pixelLeft = xPos + document.body.scrollLeft;
   document.all[object].style.pixelTop = yPos + document.body.scrollTop;
   document.all[object].style.visibility = 'visible';
  }
 }
 var message;
 (typeof s == "number") ? message=m[s]:message = s;
 //window.status=message;
 return true;
}
