
// Javascript function to put focus on a specific input box
var FocusNeeded = true;	// set a global flag
function placeFocus(){
	// Set the focus to the 1st screen field
	if (FocusNeeded) {
		document.getElementById('txtbox1').focus();
	}
}

// Javascript to check the number of characters in a box
// Thanks to http://javascript.internet.com and Kojak
function RemainingChars(fn,rn,mc) {
  var len = fn.value.length;
  if (len > mc) {
    fn.value = fn.value.substring(0,mc);
    len = mc;
  }
  document.getElementById(rn).innerHTML = mc - len;
}

// Javascript to find out the size of a browser window
function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
	 //Non-IE
	 myWidth = window.innerWidth;
	 myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	 //IE 6+ in 'standards compliant mode'
	 myWidth = document.documentElement.clientWidth;
	 myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	 //IE 4 compatible
	 myWidth = document.body.clientWidth;
	 myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}

// Javascript to change window location from a drop down list
function changeLocation( menuObj ){
   var i = menuObj.selectedIndex;

   if( i > 0 ){
      window.location = menuObj.options[i].value;
   }
}

