function EnterKey(e){
//
//if(window.event) // IE
 // {
//  keynum = e.keyCode;
//  }
//else if(e.which) // Netscape/Firefox/Opera
//  {
//  keynum = e.which;
//  }
//
//if (keynum!=13) {
// return 0;
//} else {
// return 1;
//}
//}
var characterCode
if(e && e.which){ // NN4 specific code
e = e
characterCode = e.which
}
else {
e = event
characterCode = e.keyCode // IE specific code
}
if (characterCode == 13) return 1 // Enter key is 13
else return 0
}

function nNumberKey()
// Alow just: 0 1 2 3 4 5 6 7 8 9 , . - +
{
if (((event.keyCode<48) || (event.keyCode>57) )  && (event.keyCode!=46)  && (event.keyCode!=44)  && (event.keyCode!=45)  && (event.keyCode!=43))
event.keyCode = 0;
}

function nCharKey(e)
// Alow just: 0 1 2 3 4 5 6 7 8 9 blank .
{
var keynum;
var keychar;
var numcheck;
if(window.event) // IE
	{
	keynum = e.keyCode;
	}
else if(e.which) // Netscape/Firefox/Opera
	{
	keynum = e.which;
	}
keychar = String.fromCharCode(keynum);
if (keynum==8) {
  return true;
}

if (keychar == ' ') {
numcheck = / /;
return numcheck.test(keychar);
}
numcheck = /\d/;
return numcheck.test(keychar);
}

function nIntegerKey(e)
// Alow just: 0 1 2 3 4 5 6 7 8 9
{
var keynum;
var keychar;
var numcheck;
if(window.event) // IE
    {
    keynum = e.keyCode;
    }
else if(e.which) // Netscape/Firefox/Opera
    {
    keynum = e.which;
    }
keychar = String.fromCharCode(keynum);
if (keychar == '.') {
return false;
}

if (keynum==8) {
  return true;
}

if (keychar == ' ') {
numcheck = / /;
return false; 
}
numcheck = /\d/;
return numcheck.test(keychar);
}

function nDateKey()
// Alow just: 0 1 2 3 4 5 6 7 8 9 .
{
if (((event.keyCode<48) || (event.keyCode>57) )  && (event.keyCode!=46) )
event.keyCode = 0;
}

function showWindow(objectid, v_html) {

  showobj = document.getElementById(objectid);


 // var x = showobj.offsetLeft+showobj.offsetWidth;
  var y = showobj.offsetTop;


 //   x = tempX-585;
 //   y = showobj.offsetTop; //tempY-440;
 //  positionInfo(showobj);


    setElementProperty(showobj, 'display', 'block');
   // setElementProperty(showobj, 'width', '325px');
   // setElementProperty(showobj, 'right', '-150px');
   // setElementProperty(showobj, 'top', '-150px');

//  showobj.innerHTML = '<TABLE>' + printshow + '</TABLE>';
  showobj.innerHTML = v_html ;
}

function clearWindow(objectid) {
  showobj = document.getElementById(objectid);
  setElementProperty(showobj, 'display', 'none');
}

function showWindowHelp(objectid, v_html) {

  showobj = document.getElementById(objectid);


 // var x = showobj.offsetLeft+showobj.offsetWidth;
  var y = showobj.offsetTop;


 //   x = tempX-585;
 //   y = showobj.offsetTop; //tempY-440;
 //  positionInfo(showobj);
    setElementProperty(showobj, 'overflow', 'hidden');
    setElementProperty(showobj, 'height', 'auto');

    setElementProperty(showobj, 'display', 'block');

//  showobj.innerHTML = '<TABLE>' + printshow + '</TABLE>';
  showobj.innerHTML = v_html ;
}

function clearWindowHelp(objectid) {
  showobj = document.getElementById(objectid);
  showobj.innerHTML = '';
  setElementProperty(showobj, 'display', 'none');
}


function showWindowCommon(objectid, v_html, width, height) {

  showobj = document.getElementById(objectid);


 // var x = showobj.offsetLeft+showobj.offsetWidth;
  var y = showobj.offsetTop;


 //   x = tempX-585;
 //   y = showobj.offsetTop; //tempY-440;
 //  positionInfo(showobj);

     setElementProperty(showobj, 'overflow', 'hidden');
     setElementProperty(showobj, 'width', width+'px');
    // setElementProperty(showobj, 'height', height+'px');
     setElementProperty(showobj, 'height', 'auto');

    setElementProperty(showobj, 'display', 'block');


//  showobj.innerHTML = '<TABLE>' + printshow + '</TABLE>';
  showobj.innerHTML = v_html ;
}

function clearWindowCommon(objectid) {
  showobj = document.getElementById(objectid);
  showobj.innerHTML = '';
  setElementProperty(showobj, 'display', 'none');
}


function showWindowData(objectid, v_html, width, height) {

  showobj = document.getElementById(objectid);

 var winW = 630, winH = 460;

 if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 }
}

  //var x = (showobj.offsetLeft+showobj.offsetWidth)/2;
  var y = showobj.offsetTop;
             

 //   x = tempX-585;
 //   y = showobj.offsetTop; //tempY-440;
 //  positionInfo(showobj);
     document.body.style.marginRight='0px';
     

     setElementProperty(showobj, 'overflow', 'auto');
     setElementProperty(showobj, 'width', '834px');
     setElementProperty(showobj, 'height', '717px');
     
    setElementProperty(showobj, 'display', 'block');
    setElementProperty(showobj, 'right', ((winW-992)/2+142+15)+'px');
    setElementProperty(showobj, 'top', '135px');

//document.documentElement.style.overflow = "auto";


//  showobj.innerHTML = '<TABLE>' + printshow + '</TABLE>';
  showobj.innerHTML = v_html ;
}

function clearWindowData(objectid) {
  showobj = document.getElementById(objectid);
  showobj.innerHTML = '';
  setElementProperty(showobj, 'display', 'none');
}
