function maximizeWin() {
if (window.screen) {
   var aw = screen.availWidth;
   var ah = screen.availHeight;
   window.moveTo(0, 0);
   window.resizeTo(aw, ah);
   }
}
function popupcenter2(url,xinput,yinput)
{
   x1=(screen.width-xinput)/2;
   y1=(screen.height-yinput)/2;
   temp = url.substr(0,5);
  popup= window.open(url,temp,"status=no,resizable=no,scrollbars=no,top="+y1+",left="+x1+",width="+xinput+",height="+yinput+",menubar=no,toolbar=no,alwaysRaised=yes");
}
                    
function popupcenter(url,xinput,yinput)
{
   x1=(screen.width-xinput)/2;
   y1=(screen.height-yinput)/2;
   temp = url.substr(0,5);
  popup= window.open(url,temp,"status=yes,resizable=yes,scrollbars=yes,top="+y1+",left="+x1+",width="+xinput+",height="+yinput+",menubar=no,toolbar=no,alwaysRaised=yes");
}
function paste2(theField){
var theField=Form1.select;
therange=theField.createTextRange();
therange.execCommand("Paste");
var s=escape(theField.value);
var strlist= new Array();
s=s.substr(0,s.length-6);
var sline= new Array();
sline=s.split("%0D%0A");
var v=0;
for (var j=0; j<sline.length;j++)
{
  strlist=sline[j].split("%09");
  for (var i=0; i<strlist.length;i++)
  {
    
   Form1.elements[v].value=unescape(strlist[i]);
   v=v+1;
//  alert(strlist[i]);
   }
}
}

function copyField ( fieldSource, fieldSourceDestination)
{
fieldSourceDestination.value = fieldSource.value 
}

function clearandpop(wfrom,wcombo,url,obj){
var strlist= new Array();
var formValue = '';
strlist=wfrom.split(";");
for (var i=0; i<strlist.length;i++)
{formValue=formValue+document.Form1[strlist[i]].value;}
if (obj.value != "")
{
for (i=document.Form1[wcombo].options.length;i>=0;i--){document.Form1[wcombo].options[i]=null;}
    msgWindow=window.open(url+'?key='+formValue+'&combo='+wcombo,"tmpWindow","toolbar=no,scrollbars=no,width=1,height=1");
    msgWindow.focus();
}    
}

function newoption(wcombo,i,xitem){
document.Form1[wcombo].options[i]= new Option(xitem,xitem);
}

function updateparent(wcombo,StringArg){
var strlist= new Array();
strlist=StringArg.split(";");
for (var i=0; i<strlist.length;i++){window.opener.newoption(wcombo,i,strlist[i]);}
self.close();
}

function win_fillin(v1,xno)
{
var objParent = window.opener;
var title=objParent.document.title;
var strlist= new Array();
strlist=v1.split(";",xno);
for (var i=0; i<strlist.length;i++)
{objParent.document.Form1(strlist[i]).value = document.FormX(strlist[i]).value;}
objParent.document.title=title.replace("*","");
window.close();
}
function onclose()
{
var objParent = window.opener;
var title=objParent.document.title;
objParent.document.title=title.replace("*","");
}

function keydown(f2,f7,f8,f9,f12,fesc,fpup,fpdown)
{
if ((window.event.keyCode==27) && (fesc!=null))
     {if (fesc=='cancel')
         {setTimeout("document.Form1(fesc).click()",100); }                                   
      else if (fesc=='close')
         {setTimeout("window.close()",100);}
      else   
         {setTimeout("showwin(fesc)",100);}
     }          
else if ((window.event.keyCode==113) && (f2 != null))
 {showwin(f2); }  
else if (window.event.keyCode==118) 
  if (f7 != null)
     {showwin(f7); }                          
  else
     {document.anchors[0].focus(); } 
else if (window.event.keyCode==119) 
  if (f8 != null)
     {showwin(f8); }                          
  else
  {document.anchors[document.anchors.length-1].focus(); }      
else if ((window.event.keyCode==120) && (f9 != null))
 {popupcenter2(f9,500,300); }      
else if ((window.event.keyCode==123) && (f12 != null))
  {if (f12=='save')
      {document.Form1(f12).click(); }                          
  else
      {document.Form1.action=f12;
       document.Form1.submit();}
  }     
else if ((window.event.keyCode==33) && (fpup != null))
 {showwin(fpup); }      
else if ((window.event.keyCode==34) && (fpdown != null))
 {showwin(fpdown); }    
//  else { alert("D"+window.event.keyCode); }
}
                         
function findtr(scrx,pcolor)
{
for(var i=0; i <scrx.parentNode.parentNode.childNodes.length; i++)
scrx.parentNode.parentNode.childNodes[i].bgColor =pcolor;
//alert(scrx.parentNode.parentNode.childNodes[i].tagName);
//scrx.parentNode.parentNode.childNodes[i].CLASS ='sum';
//  scrx.parentNode.parentNode.click(); 
}
function dbclick(src){
var s=src.name.substr(1,6);
for(var i=0; i <document.anchors.length; i++)
{if (s==document.anchors[i].name)
    {document.anchors[i].click();}
}
}
function movr(src,clrOver){
var s=src.name.substr(1,6);
for(var i=0; i <document.anchors.length; i++)
{if (s==document.anchors[i].name)
    {document.anchors[i].focus();}
}
}
function leave(src,pcolor) {
for(var i=0; i <src.parentNode.parentNode.childNodes.length; i++)
src.parentNode.parentNode.childNodes[i].bgColor =pcolor;
}    
function history(x1)
{
var t=x1.value;
var strlist= new Array();
strlist=t.split(",");
for(var i=0; i <strlist.length; i++)
{ if (document.Form1.elements[i].type =='checkbox')
     { if (strlist[i]=="")
       {document.Form1.elements[i].checked=false;}
       else
      {document.Form1.elements[i].checked=true;}
     }
  else
     {document.Form1.elements[i].value=strlist[i];}
}
}
function objdown(key)
{
 if (window.event.keyCode==13)
  {window.event.keyCode=9;}
}
function linkdown(key)
{
 if (window.event.keyCode==40)
    { var x=parseInt(key.name)+1;
    for(var i=0; i <document.anchors.length; i++)
    {
    if (x==document.anchors[i].name)
       {document.anchors[i].focus();}
    }
    }
 if (window.event.keyCode==38)
    { var x=parseInt(key.name)-1;
    for(var i=0; i <document.anchors.length; i++)
    {
    if (x==document.anchors[i].name)
       {document.anchors[i].focus();}
    }
    }
}
                              
function ttt(x,y)
{
  window.location=menu[x][y].href;
}
function mult(x1,x2,x3,z)
{
 if (x3=="")
  { document.Form1(z).value=document.Form1(x1).value*document.Form1(x2).value;}
 else
  { document.Form1(z).value=document.Form1(x1).value*document.Form1(x2).value*document.Form1(x3).value;}  
}

function mult2(x1,z,zd)
{
 var sa= new Array();
 var x=1;
 sa=x1.split(',');
 for (var j=0; j<sa.length;j++)
{x=x*document.Form1(sa[j]);}
 document.Form1(z)=rnd(x,zd);
}

function rnd ( number,zd)
{	
        number = Math.pow(10,zd) * number
        number = Math.round(number) / Math.pow(10,zd) ;
	return number
}


function clock() {
if (!document.layers && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var years = digital.getYear();
var months = digital.getMonth();
var dates = digital.getDate();
//var amOrPm = "AM";
//if (hours > 11) amOrPm = "PM";
//if (hours > 12) hours = hours - 12;
monName = new Array ("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC")
if (hours == 0) hours = 12;
if (hours <= 9) hours = "0" + hours;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
if (months <=9) months = "0" + months;
if (dates <=9) dates = "0" + dates;
dispTime = hours + ":" + minutes + ":" + seconds + " " + monName[months] + " " +dates;
//dispTime = Date();
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
function putFocus(formInst, elementInst) 
{
 if (document.forms.length > 0) 
 {
  for (var i=elementInst;i<document.forms[formInst].length;i++)
  {  if ((document.forms[formInst].elements[i].disabled)==false)
    {document.forms[formInst].elements[i].focus();
     break;
    }    
  }
 }
}
function askdelete(MenuID) 
{
  var fn = window.confirm("Confirm Delete !");
  if (fn == true) 
  {
    window.location = MenuID;
  }
  else
  {
  return(false);
  }
}
function showPopup(MenuID)
{
  popup = window.open(MenuID, null,"status=yes,resizable=yes,scrollbars=yes,top=0,left=0,width=790,height=550");
}
function showwin2(MenuID)
{
 var id=MenuID.substr(0,6);
  popup = window.open(MenuID, id,"status=yes,resizable=yes,scrollbars=yes,top=0,left=0,width=790,height=550,menubar=yes,toolbar=yes");
}
function smallpopup(MenuID,x,y)
{
 var id=MenuID.substr(0,6);
  popup = window.open(MenuID, id,"status=yes,resizable=yes,scrollbars=yes,top=0,left=0,width=x,height=y");
}
function showPopup1(MenuID,PassID)
{
var title=document.title
var s=escape(PassID.value);
if (PassID.value =="") 
  {
  }
  else
  {
   if (title.indexOf("*")==-1)
   {
   var id=MenuID.substr(0,6);
   document.title=document.title+"*";
   popup = window.open(MenuID+s+"&action=popup&menu=0", id,"top=1000,left=0,resizable=yes,scrollbars=yes,status=yes");
   }
  }
}
function showCheck(MenuID,PassID)
{
if (PassID.value =="") 
  {
  }
  else
  {
  popup = window.open(MenuID+PassID.value+"&action=check", null,"top=0,left=0,width=0,resizable=yes,scrollbars=yes,status=yes");
  }
}
function setpos(ID)
{
    document.Form1(ID).focus();
}
function showwin(x)
{
  window.location = x;
}
function showerr(x)
{
  alert(x);
}
function checkinput(textobj,fform,ffield)
{
  if (textobj.value =="")
  {
    alert("Input cannot be blank !");
    document.all(fform).all(ffield).focus();
  }
}
function PopUpDate(strControl)
{
var strURL = "mv6_1.asp?CTRL=" + strControl;
var strCurDate = document.Form1(strControl).value;
if (strCurDate.length > 0)
strURL += "&INIT=" + strCurDate;
windowDatePicker = window.open(strURL,"dp","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0," + "width=190,height=170,left=" + (window.event.screenX - 16) + ",top=" + (window.event.screenY - 100));
windowDatePicker.focus();
return false;
}
function chk_dig(cont)
{
var data = new Array();
data[1] = 10;
data[2] = 12;
data[3] = 13;
data[4] = 14;
data[5] = 15;
data[6] = 16;
data[7] = 17;
data[8] = 18;
data[9] = 19;
data[10] = 20;
data[11] = 21;
data[12] = 23;
data[13] = 24;
data[14] = 25;
data[15] = 26;
data[16] = 27;
data[17] = 28;
data[18] = 29;
data[19] = 30;
data[20] = 31;
data[21] = 32;
data[22] = 34;
data[23] = 35;
data[24] = 36;
data[25] = 37;
data[26] = 38;
var tot = 0;
var y = 0;
var x = 1;
cont.value = cont.value.toUpperCase();
for(var pos=1; pos <=10; pos++)
{
  if (cont.value.charCodeAt(pos-1) >= 65)
  {
    y = data[cont.value.charCodeAt(pos-1)-64];
  }
  else
  {
    y = parseInt(cont.value.charAt(pos-1));
  }
  tot = y * x + tot;
  x = x * 2;
}
y = tot % 11
if (y == 10)
{
  y = 0;
}
if (cont.value != "")
{
if (parseInt(cont.value.charAt(10)) != y) 
{
  alert("Check Digial should be "+y+" !!!");
}
}
}

function chk_dig2(cont)
{
var data = new Array();
data[1] = 10;
data[2] = 12;
data[3] = 13;
data[4] = 14;
data[5] = 15;
data[6] = 16;
data[7] = 17;
data[8] = 18;
data[9] = 19;
data[10] = 20;
data[11] = 21;
data[12] = 23;
data[13] = 24;
data[14] = 25;
data[15] = 26;
data[16] = 27;
data[17] = 28;
data[18] = 29;
data[19] = 30;
data[20] = 31;
data[21] = 32;
data[22] = 34;
data[23] = 35;
data[24] = 36;
data[25] = 37;
data[26] = 38;
var tot = 0;
var y = 0;
var x = 1;
cont.value = cont.value.toUpperCase();
for(var pos=1; pos <=10; pos++)
{
  if (cont.value.charCodeAt(pos-1) >= 65)
  {
    y = data[cont.value.charCodeAt(pos-1)-64];
  }
  else
  {
    y = parseInt(cont.value.charAt(pos-1));
  }
  tot = y * x + tot;
  x = x * 2;
}
y = tot % 11
if (y == 10)
{
  y = 0;
}
if (cont.value != "")
{
if (parseInt(cont.value.charAt(10)) != y) 
{
  //alert("Check Digial should be "+y+" !!!");
   if (confirm("Warning! Check Digit should be "+y+" !!!\n\nReturn Back?"))
   {cont.focus();}
}
}
}

function checkdate(objName,xtype) {
var s=objName.value;
if ((xtype==1) && (objName.value==""))
{
alert("Error ! Cannot be blank");
return false;
}
var datefield = objName;
var digital = new Date();
var years = digital.getYear();
var months = digital.getMonth()+1;
if ((s.length==2) || (s.length==1))
   {objName.value=s+'/'+months+'/'+years}
else if (s.length==4)
   {objName.value=s.substring(0,2)+'/'+s.substring(2,4)+'/'+years}
else if (s.length==6)
   {objName.value=s.substring(0,2)+'/'+s.substring(2,4)+'/20'+s.substring(4,6)};
if ((s.length==3) || (s.length==5))
{   datefield.select();
   alert("That date is invalid.  Please try again.");
   datefield.focus();
   return false;
}
else if (chkdate(objName) == false) {
   datefield.select();
   alert("That date is invalid.  Please try again.");
   datefield.focus();
   return false;
}
}

function chkdate(objName) {
//var strDatestyle = "US"; //United States date style
var strDatestyle = "EU";  //European date style
var strDate;
var strDateArray;
var strDay;
var strMonth;
var strYear;
var intday;
var intMonth;
var intYear;
var booFound = false;
var datefield = objName;
var strSeparatorArray = new Array("-"," ","/",".");
var intElementNr;
var err = 0;
var strMonthArray = new Array(12);
strMonthArray[0] = "01";
strMonthArray[1] = "02";
strMonthArray[2] = "03";
strMonthArray[3] = "04";
strMonthArray[4] = "05";
strMonthArray[5] = "06";
strMonthArray[6] = "07";
strMonthArray[7] = "08";
strMonthArray[8] = "09";
strMonthArray[9] = "10";
strMonthArray[10] = "11";
strMonthArray[11] = "12";
strDate = datefield.value;
if (strDate.length < 1) {
return true;
}
for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
strDateArray = strDate.split(strSeparatorArray[intElementNr]);
if (strDateArray.length != 3) {
err = 1;
return false;
}
else {
strDay = strDateArray[0];
strMonth = strDateArray[1];
strYear = strDateArray[2];
}
booFound = true;
   }
}
if (booFound == false) {
if (strDate.length>5) {
strDay = strDate.substr(0, 2);
strMonth = strDate.substr(2, 2);
strYear = strDate.substr(4);
   }
}
if (strYear.length == 2) {
var mToday = new Date();
var checkYear = mToday.getFullYear() + 30; 
var mCheckYear = '20' + strYear;
if (mCheckYear >= checkYear)
strYear = '19' + strYear;
else
strYear = '20' + strYear;
}
// US style
if (strDatestyle == "US") {
strTemp = strDay;
strDay = strMonth;
strMonth = strTemp;
}
intday = parseInt(strDay, 10);
if (isNaN(intday)) {
err = 2;
return false;
}
intMonth = parseInt(strMonth, 10);
if (isNaN(intMonth)) {
for (i = 0;i<12;i++) {
if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
intMonth = i+1;
strMonth = strMonthArray[i];
i = 12;
   }
}
if (isNaN(intMonth)) {
err = 3;
return false;
   }
}
intYear = parseInt(strYear, 10);
if (isNaN(intYear)) {
err = 4;
return false;
}
if (intMonth>12 || intMonth<1) {
err = 5;
return false;
}
if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
err = 6;
return false;
}
if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
err = 7;
return false;
}
if (intMonth == 2) {
if (intday < 1) {
err = 8;
return false;
}
if (LeapYear(intYear) == true) {
if (intday > 29) {
err = 9;
return false;
}
}
else {
if (intday > 28) {
err = 10;
return false;
}
}
}
if (strDatestyle == "US") {
datefield.value = strMonthArray[intMonth-1] + "/" + intday+"/" + strYear;
}
else {
datefield.value = intday + "/" + strMonthArray[intMonth-1] + "/" + strYear;
}
return true;
}
function LeapYear(intYear) {
if (intYear % 100 == 0) {
if (intYear % 400 == 0) { return true; }
}
else {
if ((intYear % 4) == 0) { return true; }
}
return false;
}
function doDateCheck(from, to) {
if (Date.parse(from.value) <= Date.parse(to.value)) {
alert("The dates are valid.");
}
else {
if (from.value == "" || to.value == "") 
alert("Both dates must be entered.");
else 
alert("To date must occur after the from date.");
   }
}
function imgidclick(imgID,divid)
{
if (document.all(divid).style.display == "none")
   {
    document.all(divid).style.display="";
    document.all(imgID).src="minus.gif";
   }
else
   {
    document.all(divid).style.display="None";
    document.all(imgID).src="plus.gif";
   }
}   
function movecombo(fbox, tbox) {
var arrFbox = new Array();
var arrTbox = new Array();
var arrLookup = new Array();
var i;
for (i = 0; i < tbox.options.length; i++) {
arrLookup[tbox.options[i].text] = tbox.options[i].value;
arrTbox[i] = tbox.options[i].text;
}
var fLength = 0;
var tLength = arrTbox.length;
for(i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options[i].text] = fbox.options[i].value;
if (fbox.options[i].selected && fbox.options[i].value != "") {
arrTbox[tLength] = fbox.options[i].text;
tLength++;
}
else {
arrFbox[fLength] = fbox.options[i].text;
fLength++;
   }
}
arrFbox.sort();
arrTbox.sort();
fbox.length = 0;
tbox.length = 0;
var c;
for(c = 0; c < arrFbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrFbox[c]];
no.text = arrFbox[c];
fbox[c] = no;
}
for(c = 0; c < arrTbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrTbox[c]];
no.text = arrTbox[c];
tbox[c] = no;
   }
}            
function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}
function getSty(id) {
return (isNS4 ? getRef(id) : getRef(id).style);
} 
function popOver(menuNum, itemNum) {
clearTimeout(popTimer);
hideAllBut(menuNum);
litNow = getTree(menuNum, itemNum);
changeCol(litNow, true);
targetNum = menu[menuNum][itemNum].target;
if (targetNum > 0) {
thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);
with (menu[targetNum][0].ref) {
left = parseInt(thisX + menu[targetNum][0].x);
top = parseInt(thisY + menu[targetNum][0].y);
visibility = 'visible';
zIndex=100;
      }
   }
}
function popOut(menuNum, itemNum) {
if ((menuNum == 0) && !menu[menuNum][itemNum].target)
hideAllBut(0)
else
popTimer = setTimeout('hideAllBut(0)', 500);
}
function getTree(menuNum, itemNum) {

itemArray = new Array(menu.length);

while(1) {
itemArray[menuNum] = itemNum;
if (menuNum == 0) return itemArray;
itemNum = menu[menuNum][0].parentItem;
menuNum = menu[menuNum][0].parentMenu;
   }
}

function changeCol(changeArray, isOver) {
for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
if (changeArray[menuCount]) {
newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
with (menu[menuCount][changeArray[menuCount]].ref) {
if (isNS4) bgColor = newCol;
else backgroundColor = newCol;
zIndex=100;
         }
      }
   }
}
function hideAllBut(menuNum) {
var keepMenus = getTree(menuNum, 1);
for (count = 0; count < menu.length; count++)
if (!keepMenus[count])
{
menu[count][0].ref.visibility = 'hidden';
menu[count][0].ref.zIndex = 100;	
}
changeCol(litNow, false);
}

function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
this.isVert = isVert;
this.popInd = popInd
this.x = x;
this.y = y;
this.width = width;
this.overCol = overCol;
this.backCol = backCol;
this.borderClass = borderClass;
this.textClass = textClass;
this.parentMenu = null;
this.parentItem = null;
this.ref = null;
this.zIndex = 100;
}

function Item(text, href, frame, length, spacing, target) {
this.text = text;
this.href = href;
this.frame = frame;
this.length = length;
this.spacing = spacing;
this.target = target;
this.ref = null;
}

function writeMenus() {
if (!isDOM && !isIE4 && !isNS4) return;

for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
var str = '', itemX = 0, itemY = 0;

for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
var itemID = 'menu' + currMenu + 'item' + currItem;

var w = (isVert ? width : length);
var h = (isVert ? length : width);

if (isDOM || isIE4) {
str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; z-index:100; ';
if (backCol) str += 'background: ' + backCol + '; ';
str += '" ';
}
if (isNS4) {
str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' +  w + '" height="' + h + '" visibility="inherit" zindex=100; ';
if (backCol) str += 'bgcolor="' + backCol + '" ';
}
if (borderClass) str += 'class="' + borderClass + '" ';

str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')" onclick="ttt('+currMenu+','+currItem+')">';

str += '<table style="z-index:100" width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td style="z-index:100" align="left" height="' + (h - 7) + '">' + '<a class="' + textClass + '">' + text + '</a></td>';
if (target > 0) {

menu[target][0].parentMenu = currMenu;
menu[target][0].parentItem = currItem;

if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
}
str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');

if (isVert) itemY += length + spacing;
else itemX += length + spacing;
}
if (isDOM) {
var newDiv = document.createElement('div');
document.getElementsByTagName('body').item(0).appendChild(newDiv);
newDiv.innerHTML = str;
ref = newDiv.style;
ref.position = 'absolute';
ref.visibility = 'hidden';
ref.zIndex=100;
}

if (isIE4) {
document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden;z-index:100">' + str + '</div>');
ref = getSty('menu' + currMenu + 'div');
}

if (isNS4) {
ref = new Layer(0);
ref.document.write(str);
ref.document.close();
}

for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
itemName = 'menu' + currMenu + 'item' + currItem;
if (isDOM || isIE4) menu[currMenu][currItem].ref = getSty(itemName);
if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
   }
}
with(menu[0][0]) {
ref.left = x;
ref.top = y;
ref.visibility = 'visible';
ref.zIndex = 100;
   }
}                                      

function tdshow(e,helpmsg){
  if(document.layers){
    x = e.pageX+window.pagexOffset;
    y = e.pageY+window.pageYOffset;
    document.layers[0].document.open();
    document.layers[0].document.write(helpmsg);
    document.layers[0].document.close();
    document.layers[0].moveTo(x + 10, y + 20);
    document.layers[0].visibility = "SHOW";
    document.layers[0].style.zIndex =100;
	
  }
  else if(document.all){
    x = event.clientX+document.body.scrollLeft;
    y = event.clientY+document.body.scrollTop;
    document.all("lay").innerHTML = helpmsg;
    document.all["lay"].style.pixelLeft = x+10;
    document.all["lay"].style.pixelTop = y+20;
    document.all["lay"].style.visibility = "visible";
    document.all["lay"].style.zIndex =100;
     }
}

function tdhide(){
  if(document.layers){
    document.layers[0].visibility = "HIDE";
  }
  else if(document.all){
    document.all["lay"].style.visibility = "hidden";
  }
}

if(document.layers){
  document.write('<LAYER visibility="hide" bgcolor="#ffffcc"></LAYER>');
}else if(document.all){
  document.write('<DIV id="lay" style="position:absolute;background-color:#ffffcc"></DIV>');
}



function popcenter(inputWindow,x,y)
{
	popup = window.open(inputWindow,"","status=yes,resizable=no,scrollbars=no,top=" + (screen.height-x)/2 + ",left=" + (screen.width-y)/2 + ",width=" + x + ",height=" + y + ",menubar=no,toolbar=no");
}