// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// MAG99_evt.js
// Copyright 2010  Maggie's Attic of Florida. All rights reserved.
//
//
//
SEVNTS = ""
aN = /AAAAAA/
iN = /NNNNNN/
sR = /SSSSSS/
hH = /HHHHHH/
seBT = "<table cellpadding='0' cellspacing='0' border='0'>"
seET = "</table>"
seIF = "<tr><td><a name='AAAAAA'>&nbsp;</a><iframe name='NNNNNN' src='SSSSSS.htm' width='690' height='HHHHHH' align='left' frameborder='0' marginwidth='0' marginheight='0' scrolling='no'></iframe></td></tr>"
seIT = ""
// format:
//   start date/end date/iFrame source file(htm)/iFrame hieght necessary(width is fixed)/bookmark anchoe name/
SEV = new Array(
"99999999/xxxxxxxx/0000/iEventxx/Hxxx/xxxxxxxxxxxx" // Bluff item
,"00000000/20100610/0000/iEvent08/H560/earthday" // Expires on 06/10/2010
,"00000000/20100513/0000/iEvent09/H670/md-sushi"  // Expires on 05/13/2010
,"20100722/20100804/0000/iEvent10/H1000/samhouse"  // Expires on 08/04/2010
,"00000000/20100826/1800/iEvent12/H900/saucy-taste"  // Expires on 08/26/2010 6:00 pm (1800 hours)
,"00000000/20100923/1800/iEvent13/H550/goblin-taste"  // Expires on 09/23/2010 6:00 pm (1800 hours) 
//"00000000/20100904/0000/iEvent11/H800/makeover/"  // Expires on 09/04/2010
)
//
function buildSEV(){ymdNow(); hhmmNow(); SEVNTS = ""; seIT = ""; buld = 0;
                    yrmodahhmmNow = yrmodaNow.concat(hrmnNow);
                    Eitms = SEV.length; kk = 1;
                    while(kk < Eitms){splitEV(SEV[kk]);
                    if(strD <= yrmodaNow && endDT >= yrmodahhmmNow){seIT = seIF;     //   yrmodaNow
                    seIT = seIT.replace(aN, anrN);                    // establish anchor name
                    seIT = seIT.replace(iN, "evnt".concat(frmN));     // establish iFrame name
                    seIT = seIT.replace(sR, frmS);                    // establish iFrame source
                    seIT = seIT.replace(hH, frmH);                    // establish necessary iFrame height          && endT >= hrmnNow
                    buld = buld + 1;
                    SEVNTS = SEVNTS.concat(seIT)};
                    kk++;}
                    if(buld > 0){SEVNTS = seBT.concat(SEVNTS);
                                 SEVNTS = SEVNTS.concat(seET);
                                 document.getElementById("SEdsply").innerHTML = SEVNTS;}
                    return}
//
function splitEV(fldsEV){splitA = fldsEV.split("/");  // function to split array item up to sepp values
                         strD = splitA[0];            // begin display date
                         endD = splitA[1];            // end display date
                         endT = splitA[2];            // end display time
                         frmS = splitA[3];            // iFrame source
                         frmN = splitA[3].substr(6)   // event number extracted from iFrame source file name
                         frmH = splitA[4];            // Bookmark anchor name
                         anrN = splitA[5];            // iFrame height needed
                         endDT = endD.concat(endT);   // combined end date and time
                         }
//
evRecent = new Array(
"iEventR01.htm",  // bluff entry
"iEventR04.htm",
"iEventR03.htm",
//"iEventR02.htm",
"iEventR01.htm"
)
function loadEvnt(eCode){evev = eCode.selectedIndex;
                         iRevents.location = evRecent[evev];
                         eCode.selectedIndex = "0";
                         document.body.focus()}
//
function ymdNow(){YMDNow = new Date(); yrmodaNow = "";
                   daNow = YMDNow.getDate().toString();
                   if(daNow.length == 1){daNow = "0".concat(daNow)};
                   moNow = (YMDNow.getMonth() + 1).toString();
                   if(moNow.length == 1){moNow = "0".concat(moNow)};
                   yrNow = YMDNow.getYear().toString(); if(YMDNow.getYear() < 200){yrNow = (YMDNow.getYear() + 1900).toString()};
                   yrmodaNow = (yrNow.concat(moNow.concat(daNow)))}
function hhmmNow(){tNow = new Date(); hrmnNow = "";
                   HHr = tNow.getHours(); if(HHr < 10){HHr = "0".concat(HHr)};
                   MMn = tNow.getMinutes(); if(MMn < 10){MMn = "0".concat(MMn)};
                   hrmnNow = hrmnNow.concat(HHr); hrmnNow = hrmnNow.concat(MMn);}
//
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
