
function framesCheck(check, currentURL) {
  if ( check != 1 ) return false;

	if( ! ( top.topFrame ) ) {
    top.location.replace( '../index.php?mainframe='+currentURL );
  }
}

function urlencode( str ) {
  str = escape( str );
  str = str.replace('+', '%2B');
  str = str.replace('%20', '+');
  str = str.replace('*', '%2A');
  str = str.replace('/', '%2F');
  str = str.replace('@', '%40');
  return str;
}