function calcHeight() {
	if (document.getElementById('main')) {
	  //find the height of the internal page
	  var the_height=
		document.getElementById('main').contentWindow.
		  document.body.scrollHeight;
	  //change the height of the iframe
	  document.getElementById('main').height=
		  the_height;
	}
}

function get_cookie (cookie_name) {
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}

function delete_cookie (cookie_name) {
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}

function checkLogin() {
	if (! get_cookie ( "loggedin" ) ) {
		ajax_loadContent('LoginForm','login_form.php');;
	} else {
		ajax_loadContent('LoginMessage','login_message.php');
		ajax_loadContent('LoginForm','ssh_message.php');
	}
}
