.hidden {
display: none;
position: absolute;
left: 0px;
top: 0px;
}
.shown {
display: block;
position: absolute;
left: 0px;
top: 0px;
}
.center {
width:100%;
margin-left: auto;
margin-right: auto;
}
';
}
/****************** End Defaults to allow StandAlone Debugging ***************/
if (isset($_POST['fctype'])) { # Are we using jQuery???
$forecastType = $_POST['fctype']; # If so, set fctype.
if ($_SERVER["REMOTE_ADDR"]=='127.0.0.1') {
include_once ('Settings.php'); // jQuery forgets these on my localhost!
}
}
if (isset($_POST['useOnClick'])) { # Are we using jQuery???
$useOnClick = $_POST['useOnClick']; # If so, set fctype.
if ($_SERVER["REMOTE_ADDR"]=='127.0.0.1') {
include_once ('Settings.php'); // jQuery forgets these on my localhost!
}
}
if (isset($_POST['divWidth'])) { # Are we using jQuery???
$divWidth = $_POST['divWidth']; # If so, set fctype.
if ($_SERVER["REMOTE_ADDR"]=='127.0.0.1') {
include_once ('Settings.php'); // jQuery forgets these on my localhost!
}
}
if (isset($_POST['checkFileTimes'])) { # Are we using jQuery???
$checkFileTimes = $_POST['checkFileTimes']; # If so, set fctype.
if ($_SERVER["REMOTE_ADDR"]=='127.0.0.1') {
include_once ('Settings.php'); // jQuery forgets these on my localhost!
}
}
if (isset($_POST['standAlone'])) { # Are we using jQuery???
$standAlone = $_POST['standAlone']; # If so, set fctype.
if ($_SERVER["REMOTE_ADDR"]=='127.0.0.1') {
include_once ('Settings.php'); // jQuery forgets these on my localhost!
}
}
?>
=(1+$useDST) && $theHour<(12+$useDST)) || ((($theHour==(0+$useDST)?1:0) && $theMin>$mapChangeMinute) && $theHour<(13+$useDST)) || ((($theHour==(12+$useDST)?1:0) && $theMin<$mapChangeMinute)))?1:0;
$useAMModeAK = (($theHour>=(0+$useDST) && $theHour<(12+$useDST)) || ((($theHour==(0+$useDST)?1:0) && $theMin<$mapChangeMinute) && $theHour<(12+$useDST)) || ((($theHour==(12+$useDST)?1:0) && $theMin<$mapChangeMinute)))?1:0;
$compareWx = false;
if ($forecastType == 'Wx') {
$forecastText = 'Weather';
} else if ($forecastType == 'rpi') {
$forecastText = 'Precipitation Potential';
} else if ($forecastType == 'ppi') {
$forecastText = 'Liquid Potential';
} else if ($forecastType == 'tpi') {
$forecastText = 'Thunder Potential';
} else if ($forecastType == 'spi') {
$forecastText = 'Severe Potential';
} else if ($forecastType == 'fpi') {
$forecastText = 'Frozen Precip. Potential';
} else if ($forecastType == 'nxpin') {
$forecastText = 'Precipitation Intensity';
} else if ($forecastType == 'zpi') {
$forecastText = 'Freezing Temp. Potential';
} else if ($forecastType == 'AWx') {
$forecastText = 'AK Weather';
$forecastType = 'Wx';
$mapDir = 'akwx_imgs';
$locale = 'alaska';
} else if ($forecastType == 'Arpi') {
$forecastText = 'AK Precipitation Potential';
$forecastType = 'rpi';
$mapDir = 'akwx_imgs';
$locale = 'alaska';
} else if ($forecastType == 'Atpi') {
$forecastText = 'AK Thunder Potential';
$forecastType = 'tpi';
$mapDir = 'akwx_imgs';
$locale = 'alaska';
} else if ($forecastType == 'Aspi') {
$forecastText = 'AK Severe Potential';
$forecastType = 'spi';
$mapDir = 'akwx_imgs';
$locale = 'alaska';
} else if ($forecastType == 'Afpi') {
$forecastText = 'AK Frozen Precip. Potential';
$forecastType = 'fpi';
$mapDir = 'akwx_imgs';
$locale = 'alaska';
} else if ($forecastType == 'Anxpin') {
$forecastText = 'AK Precipitation Intensity';
$forecastType = 'nxpin';
$mapDir = 'akwx_imgs';
$locale = 'alaska';
} else if ($forecastType == 'Azpi') {
$forecastText = 'AK Freezing Temp. Potential';
$forecastType = 'zpi';
$mapDir = 'akwx_imgs';
$locale = 'alaska';
// Comparison charts are quite different!
} else if ($forecastType == 'CompWx') {
$forecastText = 'Weather';
$mapDir = 'cocomp_imgs';
$mapMaxN = 40; // Was the only Comp chart with 35 charts - all others used to have 25 but now also maybe??? have 35
$compareWx = true;
} else if ($forecastType == 'CompRA') {
$forecastText = 'Liquid Potential';
$mapDir = 'cocomp_imgs';
$mapMaxN = 32;
} else if ($forecastType == 'CompTSTM') {
$forecastText = 'Thunder Potential';
$mapDir = 'cocomp_imgs';
$mapMaxN = 32;
} else if ($forecastType == 'CompSVR') {
$forecastText = 'Severe Potential';
$mapDir = 'cocomp_imgs';
$mapMaxN = 32;
} else if ($forecastType == 'CompFR') {
$forecastText = 'Frozen Precip. Potential';
$mapDir = 'cocomp_imgs';
$mapMaxN = 32;
} else if ($forecastType == 'CompZR') {
$forecastText = 'Freezing Temp. Potential';
$mapDir = 'cocomp_imgs';
$mapMaxN = 32;
}
$compare = (strpos($forecastType,'Comp')===false?false:true);
date_default_timezone_set("America/New_York"); // The NWS calculations for these charts is GMT
?>
';
* End Debug Code */
if ($nowTime >= $imageTime + $staleSeconds ) {
echo '
Check the Map Times to Confirm Their Status.
style="width:px">
':'');?>
=(1+$useDST) && $theHour<(12+$useDST)) || ((($theHour==(0+$useDST)?1:0) && $theMin>$mapChangeMinute) && $theHour<(13+$useDST)) || ((($theHour==(12+$useDST)?1:0) && $theMin<$mapChangeMinute)))?1:0;
// $useAMMode = 0; // Debug Code
// echo '$useAMMode: '.$useAMMode.', $theHour: '.$theHour.', $theMin: '.$theMin.', $useDST: '.$useDST.',
$theHour==(0+$useDST): '.(($theHour==(0+$useDST))?1:0).'
'; // Debug Code
// $useAMMode represents the 2am to 2pm Eastern Time Map Cycle. It uses the last half of today and pushes into the first half of a new day.
$linkStr = '
';
$dstRange = false;
/* Debug Coge */
echo ($dstRange&&$useDST)?'
(Times Currently are '.($locale=='conus25'?'Eastern':'Alaskan').' '.($useDST?'Daylight':'Standard').' Time - Some Map Times May be '.($useDST?'Standard':'Daylight').' Time.)
':'';
$hrSequence = array(); // Instantiate and populate the 8 or 4 member 'am' and 'pm' arrays, e.g. 2am, 5am, 8am, 11am, 2pm, 5pm, 8pm, 11pm
$hrSequence2 = array();
$amPmSequence4DST = array('2am','8am','2pm','8pm');
$amPmSequence8amDST = array('2am','5am','8am','11am','2pm','5pm','8pm','11pm');
$amPmSequence8pmDST = array('2pm','5pm','8pm','11pm','2am','5am','8am','11am');
$amPmSequence4 = array('1am','7am','1pm','7pm');
$amPmSequence8am = array('1am','4am','7am','10am','1pm','4pm','7pm','10pm');
$amPmSequence8pm = array('1pm','4pm','7pm','10pm','1am','4am','7am','10am');
$hrSequence = ($useAMMode?($useDST?$amPmSequence8amDST:$amPmSequence8am):($useDST?$amPmSequence8pmDST:$amPmSequence8pm));
$hrSequence2 = $useDST?$amPmSequence4DST:$amPmSequence4;
$hrSequence = ($locale=='alaska'?($useAMModeAK?$amPmSequence8am:$amPmSequence8pm):$hrSequence);
$hrSequence2 = ($locale=='alaska'?$amPmSequence4:($useDST?$amPmSequence4DST:$amPmSequence4));
if ( !$compare ) {
echo '
'; // Create link table
for ($mapNo=($locale=='conus25'?1:2); $mapNo<$mapMaxN; $mapNo++) { // Parameters vary with time of day
if ($mapNo==($locale=='conus25'?1:2) || $useAMMode) { // In the AM or if this is the beginning of our array, start with the date
echo 'Outlook '.date("D M j",$chart[$mapNo]).': | '; // Begin table row with 'Outlook'
if ($mapNo==($locale=='conus25'?1:2) && !$useAMMode) {
echo ' | | | | '; // First four cells of first row are blank in PM Mode
}
}
for ($hrNo=0; $hrNo<8; $hrNo++) { // For each 8 forecasts per day
if (!$useAMMode) { // If in PM mode
if ($hrNo==3) { // We've reached the end of the first day, so end row and start a new day and row
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.$hrSequence[$hrNo].' |
'; // End table row
echo 'Outlook '.date("D M j",($chart[($mapNo+3)]+1)).': | '; // and begin another one
} else if ($mapNo<=$mapMaxN) { // Otherwise add a cell/link to current row
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.$hrSequence[$hrNo].' | ';
}
} else { // If in AM mode
if (($hrNo==7 && $mapNo<$mapMaxN)||($hrNo==6&&$mapNo==$mapMaxN)) { // Break at the end of a 8 cells or at the last cell
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.$hrSequence[$hrNo].' | '; // Populate a cell
if ($mapNo!=$mapMaxN) { echo '
'; } // Only end table row if we're creating a new one
} else if ($mapNo<=$mapMaxN) { // Otherwise add another cell
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.$hrSequence[$hrNo].' | ';
}
} $mapNo++;
}
$mapNo--;
} echo '
'; // End of row, body, and table
} else if ($compare) {
if ($forecastType=='CompWx') {
// if ($forecastType=='CompWx'||$forecastType == 'CompRA'||$forecastType == 'CompTSTM'||$forecastType == 'CompSVR'||
// $forecastType == 'CompFR'||$forecastType == 'CompFR'||$forecastType == 'CompZR') { // CompWx was different from the other Comp's.
echo '
'; // Create link table
if ($useAMMode) {
for ($mapNo=1; $mapNo<($mapMaxN); $mapNo++) { // Outer loop
// echo '$mapNo:'.$mapNo; // Eebug Code
if ($mapNo==1 || $mapNo==9 || $mapNo==($compareWx?17:16) || $mapNo==($compareWx?24:20) || $mapNo==($compareWx?28:24) || $mapNo==($compareWx?32:28)|| $mapNo==($compareWx?36:32)) { // AM Mode @ 6:30 AM
echo 'Outlook '.date("D M j",$chart[$mapNo>($compareWx?22:15)?$mapNo+1:$mapNo]).': | '; // Begin table row with 'Outlook'
}
for ($hrNo=0; $hrNo<(($mapNo>($compareWx?23:15))?4:8)&&$mapNo<($mapMaxN); $hrNo++) { // Inner loop for each 8 or 4 forecasts per day
if (($hrNo==($mapNo<($compareWx?24:16)?7:3) && $mapNo<($mapMaxN))||($hrNo==6&&$mapNo==($mapMaxN-1))) { // Break after 8 or 3 cells and the last cell
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.(($mapNo>($compareWx?23:15))?$hrSequence2[$hrNo]:$hrSequence[$hrNo]).' | '; // Populate a cell
if ($mapNo<($mapMaxN)) { echo '
'; } // Only end table row if we're creating a new one
} else if ($mapNo<($mapMaxN)) { // Otherwise add another cell with appropiate table spacing
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.(($mapNo>($compareWx?23:15))?$hrSequence2[$hrNo]:$hrSequence[$hrNo]).' | '.(($mapNo>($compareWx?23:15))?' | ':'');
}
$mapNo++; // Get ready for the next map at end of inner for loop
}
$mapNo--; // Back off non-existent map at end of outer for loop
} echo '
'; // End of row, body, and table
} // End of Use AM Mode
else if (!$useAMMode) {
for ($mapNo=1; $mapNo<($mapMaxN-7); $mapNo++) { // Outer loop
// echo '$mapNo:'.$mapNo; // Eebug Code
if ($mapNo==1 || $mapNo==6 || $mapNo==($compareWx?15:11) || $mapNo==($compareWx?19:16) || $mapNo==($compareWx?24:20) || $mapNo==($compareWx?28:24) || $mapNo==($compareWx?32:28) || $mapNo==($compareWx?36:32)) {
echo '
Outlook '.date("D M j",$chart[$mapNo>($compareWx?19:11)?$mapNo+4:$mapNo]).': | '; // Begin table row with 'Outlook'
if ($mapNo==1 ){
echo ' | | | | '; // First four cells of first row are blank in PM Mode
}
}
for ($hrNo=0; $hrNo<($mapNo>($compareWx?19:11)?4:8)&&$mapNo<($mapMaxN); $hrNo++) { // Inner loop for each 8 or 4 forecasts per day
if ($hrNo==3 || $mapNo==($compareWx?19:11)) { // We've reached the end of the first or third day, so end row and start a new day and row
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.(($mapNo>($compareWx?19:11))?$hrSequence2[$hrNo]:$hrSequence[$hrNo]).' |
'; // End table row
echo (($mapNo>($compareWx?19:11))?'':'
Outlook '.date("D M j",($chart[($mapNo+3)]+1)).': | '); // and begin another one
} else if ($mapNo<($mapMaxN)) { // Otherwise add a cell/link to current row unless $compare is at end of sequence
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.(($mapNo>($compareWx?19:11))?$hrSequence2[$hrNo]:$hrSequence[$hrNo]).' | '.(($mapNo>($compareWx?18:10))?' | ':'');
}
$mapNo++; // Get ready for the next map at end of inner for loop
if ($mapNo==($compareWx?20:12)) {
break;
}
}
$mapNo--; // Back off non-existent map at end of outer for loop
} echo '
'; // End of row, body, and table
} // End of Use PM Mode
} // End of 'CompWx'
else { // All other 'Comp' forecast types
echo '
'; // Create link table
if ($useAMMode) {
for ($mapNo=1; $mapNo<($mapMaxN); $mapNo++) { // Outer loop
if ($mapNo==1 || $mapNo==9 || $mapNo==16 || $mapNo==20 || $mapNo==24 || $mapNo==28 || $mapNo==32 || $mapNo==36) { // AM Mode @ 6:30 AM
echo 'Outlook '.date("D M j",$chart[$mapNo]).': | '; // Begin table row with 'Outlook'
}
for ($hrNo=0; $hrNo<($mapNo<16?8:4)&&$mapNo<($mapMaxN); $hrNo++) { // Inner loop for each 8 or 4 forecasts per day
if (($hrNo==(($mapNo<16?7:3)) && $mapNo<($mapMaxN))||($hrNo==2&&$mapNo==($mapMaxN-1))) { // Break after 3 cells and the last cell
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.($mapNo<16?$hrSequence[$hrNo]:$hrSequence2[$hrNo]).' | '.($mapNo>15?' | ':''); // Populate a cell
if ($mapNo<($mapMaxN)) { echo '
'; } // Only end table row if we're creating a new one
} else if ($mapNo<($mapMaxN)) { // Otherwise add another cell with appropiate table spacing
echo ' at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.($mapNo<16?$hrSequence[$hrNo]:$hrSequence2[$hrNo]).' | '.($mapNo>15?' | ':'');
}
$mapNo++; // Get ready for the next map at end of inner for loop
}
$mapNo--; // Back off non-existent map at end of outer for loop
} echo '
'; // End of row, body, and table
} // End of Use AM Mode
else if (!$useAMMode) {
for ($mapNo=1; $mapNo<($mapMaxN); $mapNo++) { // Outer loop
if ($mapNo==1 || $mapNo==5 || $mapNo==12 || $mapNo==16 || $mapNo==20 || $mapNo==24 || $mapNo==28 || $mapNo==32) {
echo '
Outlook '.date("D M j",$chart[$mapNo]).': | '; // Begin table row with 'Outlook'
if ($mapNo==1 ){
echo ' | | | '; // First four cells of first row are blank in PM Mode
}
}
# $innerLoopCounter = 0; // Debug Code
for ($hrNo=0; ($mapNo<($mapMaxN))&&$hrNo<(($mapNo>3&&$mapNo<13)?8:4); $hrNo++) { // Inner loop for each 8 or 4 forecasts per day
if ($hrNo==(($mapNo>3&&$mapNo<13)?6:3)) { // start a new day and row
echo ' | at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.($mapNo<13?$amPmSequence8amDST[$hrNo]:$hrSequence2[$hrNo]).' |
'.($mapNo>11?'
| ':''); // End table row
} else if ($mapNo<($mapMaxN)) { // Otherwise add a cell/link to current row unless $compare is at end of sequence
echo '
at '.$linkStr.($mapNo<10?'0'.$mapNo:$mapNo).'\')">'.($mapNo<13?$amPmSequence8amDST[$hrNo]:$hrSequence2[$hrNo]).' | '.($mapNo>11?'
| ':'');
}
$mapNo++;
if ($mapNo==5||$mapNo==12) break;
}
$mapNo--; // Back off non-existent map at end of outer for loop
} echo ''; // End of row, body, and table
} // End of Use PM Mode
} // End of All Other Comp forecast types
}
if ( !$compare ) {
echo '
('.($useOnClick?'Click':'Hover over').' a link to display that chart.)
'; ?>
':'').'
'.($divWidth<800?'':'');
} ?>
':'').'
'.($divWidth<800?'':'')?>
('.($useOnClick?'Click':'Hover over').' a link to display that chart.)
'; ?>
':'').'
'.($divWidth<800?'':'');
} ?>
':'').'
'.($divWidth<800?'':'')?>
Click Here to Toggle Legend
';
} else { // Display generic legend except for precipitation intensity
if ($forecastType != 'nxpin') {
echo '
Click Here to Toggle Legend
Probability category |
Potential Index |
None |
0-14 |
Slight chance, Isolated |
15-24 |
Chance, Scattered |
25-54 |
Likely, Numerous |
55-74 |
Definite |
75-100 |
';
}
}?>
Caution! These maps are updated around '
.(date('I')?($locale=='conus25'?'1':'9'):($locale=='conus25'?'12':'8')).':30 to '.(date('I')?($locale=='conus25'?'1':'9'):($locale=='conus25'?'12':'8')).':45 '.($locale=='conus25'?'AM':'PM').' & '.($locale=='conus25'?'PM':'AM').' '.($locale=='conus25'?'Eastern':'Alaskan').' '.(date('I')?'Daylight':'Standard').' Time.
Current maps may be unavailable during this process.
There are MANY images to load.
';
?>