﻿document.onreadystatechange = fnStartInit;

function fnStartInit() {
   if (document.readyState == "complete") {
      StartUp(); // Finish initialization.
   }
}
    
function getHeight() {
   if (window.innerHeight && window.scrollMaxY) {// Firefox
      yWithScroll = window.innerHeight + window.scrollMaxY;
   } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
      yWithScroll = document.body.scrollHeight;
   } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
      //yWithScroll = document.body.offsetHeight;
      yWithScroll = document.getElementsByTagName('html')[0].scrollHeight;
   }
   return yWithScroll;
}

function StartUp() {
   var x = getHeight();
   //alert("x = " + x);
   document.getElementById("page").style.height = (x - 250) + 'px';
}

function StyleOnBlur(objThis) {
   //alert(objThis);

   objThis.style.padding = '1px';
   objThis.style.borderWidth = '1px';
}

function StyleOnFocus(objThis) {
   //alert(objThis);

   objThis.style.padding = '0';
   objThis.style.borderWidth = '2px';
}

function ValidateRequired(field, alerttxt) {
   with (field) {
      if (value == null || value == '') {
         alert(alerttxt);
         return false;
      } else {
         return true;
      }
   }
}

