function popopen( url, name, width, height ) {
	var options = "width=" + width + ",height=" + height + ",directories=no,location=no,menubar=no,personalbar=no,resizable=no,screenX=0,screenY=0,scrollbars=yes,titlebar=yes,toolbar=no";
	window.open( url, name, options );
}

function checkEmail( field ) {
	// This function performs simple e-mail address checks
	var theString = new String( field );
	if( theString.match( /^[^@]+@[^@]+\.[^@]+$/ ) ) {
		return( true );
	}
	return( false );
}

function encodeString( s ) {
  // This function takes a plain text string and encodes
  // it as Unicode characters into an Array object.
  var theString = new String( s );
  var aEncoded  = new Array;
  for( i = 0 ; i < theString.length ; i++ ) {
    aEncoded.push( theString.charCodeAt(i) );
  }
  return( aEncoded );
}

function decodeString( aEncoded ) {
  // This function takes an Array of Unicode values
  // and constructs a plain text string.
  var sDecoded = "";
  for( i = 0 ; i < aEncoded.length ; i++ ) {
    sDecoded += String.fromCharCode( aEncoded[i] );
  }
  return( sDecoded );
}

function showHide( id ) {
  var style = document.getElementById(id).style;
  if( ! style.display ) {
    style.display = "block";
  } else {
    if( style.display == "none" ) {
      style.display = "block";
    } else {
      style.display = "none";
    }
  }
  return( true );
}

function submitOnReturn ( form ) {
	if( window.event.keyCode == 13 ) {
		form.submit();
	}
}
