  	function checkForm(f) {
		if (f.host.value == "") {
			alert("Please supply a host to connect to.");
			return false;
		}
		if (f.port.value == "") {
			alert("Please supply the VNC port. (Usually 5900)");
			return false;			
		}
		if (f.screenwidth.value == "") {
			alert("Err.. I already detect the screen size for you. Why did you delete it? Put in a width.");
			return false;			
		}		
		if (f.screenheight.value == "") {
			alert("Err.. I already detect the screen size for you. Why did you delete it? Put in a height.");
			return false;			
		}	
		return true;
	}
	
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth - 20;
    myHeight = window.innerHeight - 20;
    // alert('ff');
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth - 20;
    myHeight = document.documentElement.clientHeight - 20;
    // alert('ie');
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight - 30;
    // alert('other');
  }
  document.getElementById("screenwidth").value = myWidth;
  document.getElementById("screenheight").value =  myHeight;