$pg = 1; if (isset($_GET['pg'])) { $pg = $_GET['pg']; } $pgm1 = $pg - 1; while (($pgm1 >= 1) && ($title[$pgm1][1] == "")) { $pgm1 = $pgm1 - 1; } $pgp1 = $pg + 1; while (($pgp1 < count($title)) && ($title[$pgp1][1] == "")) { $pgp1 = $pgp1 + 1; } ?>