
// --------------------------------------------------------------------------------------------
// DO NOT ADD ADDITIONAL ISS VARIABLES, THERE ARE THE CORRECT NUMBER FOR 12 MONTHS OF ISSUES!
//
// The iss[] variables will need to have the year portion changed as a new year arrives:
// "2008|01|01" will change to "2009|01|01" when the 1st edition of 2009 is archived.  So
// each edition made active will need the year changed.  The order of these variables is not
// important.   The script will sort them newest to oldest automatically.
// --------------------------------------------------------------------------------------------

var iss = new Array()
//iss[1] = "20080101"
iss[2] = "20100115"
iss[3] = "20100201"
iss[4] = "20100215"
iss[5] = "20100301"
iss[6] = "20090315"
iss[7] = "20090401"
iss[8] = "20090415"
iss[9] = "20090501"
iss[10] = "20090515"
iss[11] = "20090601"
iss[12] = "20090615"
iss[13] = "20090701"
iss[14] = "20090715"
iss[15] = "20090801"
iss[16] = "20090815"
iss[17] = "20090901"
iss[18] = "20090915"
iss[19] = "20091001"
iss[20] = "20091015"
iss[21] = "20091101"
iss[22] = "20091115"
iss[23] = "20091201"
iss[24] = "20091215"


//------------------------------------------------------------
// Add as many s[] variables as you need each must have a unique number, they
// do not have to be in numeric order, although that will help you to know the
// next number to add.
// The format is: s[number] = "final date|sponsor name|logo filename|sponsor url"
// number and logo filename must be complete, sponsor url can be left blank
// url must begin with http://
// if there different url's for same sponsor, use multiple s[]'s placing
// the correct s[] in a particular meeting.
//------------------------------------------------------------

var s = new Array()
s[1] = "2099-01-01|American Office Services, Inc.|AmOffice.jpg|http://www.iaam.org/iaam_news/pages/track/AmericanOffice.htm"
s[2] = "2099-01-01|Staff Pro|staff_pro.gif|http://www.iaam.org/IAAM_News/Pages/track/staffpro.htm"
s[3] = "2099-01-01|Access Pass & Design|APDGreen.gif|http://www.iaam.org/IAAM_News/Pages/track/accesspasses.htm"
s[4] = "2099-01-01|Contemporary Services Corporation|csc.jpg|http://www.iaam.org/IAAM_News/Pages/track/csc.htm"
s[5] = "2099-01-01|Ticketmaster|ticketmaster.jpg|http://www.iaam.org/iaam_news/pages/track/tm.htm"
s[6] = "2099-01-01|Guard Dog Cable Protector|checkersind.jpg|http://www.iaam.org/iaam_news/pages/track/checkersind.htm"
s[7] = "2099-01-01|VenuWorks|VenuWorks.gif|http://www.iaam.org/iaam_news/pages/track/vw.htm"
s[8] = "2099-01-01|Venues Today|venuestoday.jpg|http://www.iaam.org/iaam_news/pages/track/venuestoday.htm"
s[9] = "2099-01-01|Nutech Industries|nutech.jpg|http://www.iaam.org/IAAM_News/Pages/track/nutech.htm"
s[10] = "2099-01-01|Panstadia|panstadia.gif|http://www.iaam.org/IAAM_News/Pages/track/panstadia.htm"
s[11] = "2099-01-01|MTS Seating|MTS.gif|http://www.iaam.org/iaam_news/pages/track/mts.htm"
s[12] = "2099-01-01|Bird-X|BirdXRev.jpg|http://www.iaam.org/iaam_news/pages/track/birdx.htm"
s[13] = "2099-01-01|coloredge CRUSH|coloredge.jpg|http://www.iaam.org/iaam_news/pages/track/coloredge.htm"
s[14] = "2099-01-01|Radius Display Products|radius.jpg|http://www.iaam.org/iaam_news/pages/track/radiusdp.htm"
s[15] = "2099-01-01|Budweiser Select|budselect.jpg|http://www.iaam.org/iaam_news/pages/track/budselect.htm"
s[16] = "2099-01-01|IAAM Advertising|Brenda_Banner3.gif|mailto:brenda.pennington@iaam.org"
s[17] = "2099-01-01|Access Pass & Design|APDGreen.jpg|http://www.iaam.org/IAAM_News/Pages/track/accesspasses.htm"
s[18] = "2099-01-01|AwareManager|awaremanager.gif|http://www.iaam.org/IAAM_News/Pages/track/awaremanager.htm"
s[19] = "2099-01-01|Ovations Food Services|Ovations.jpg|http://www.ovationsfoodservices.com"
s[20] = "2099-01-01|Spec Seating|specseating.gif|http://www.specseatsinc.com/"
s[21] = "2099-01-01|Certified Facilities Executive|cfe_banner.gif|"
s[22] = "2008-07-29|83rd Annual IAAM Conference and Trading Show|conference_banner08.jpg|"
s[23] = "2099-01-01|IAAM Foundation Annual Giving Campaign|Foundation_banner08.jpg|"
s[24] = "2099-01-01|IAAM Member Value|membership216_08.jpg|"
s[25] = "2099-01-01|Basketball Products International|BPI-AD2.gif|http://www.basketballproductsinternational.com/"
s[26] = "2099-01-01|PanStadia Publishing Co. Ltd |PanStadiaBanner.gif|http://www.panstadia.com"
s[27] = "2099-01-01|Irwin Seating|IrwinBanner.gif|http://www.irwinseating.com/"
s[28] = "2099-01-01|Schelde|ScheldeAd1a.gif|http://www.scheldesports.com/"
s[29] = "2099-01-01|Preferred Concrete Polishing|IAAM_banner_ad.jpg|http://www.preferredconcretepolishing.com"
s[30] = "2099-01-01|BOK Center|Tulsa.gif|http://www.bokcenter.com"
s[31] = "2099-01-01|Frontline Placement|IAAM_Newsletter_Ad_1e.jpg|http://www.frontlineplacement.com/eventbooking"
s[32] = "2099-01-01|IAAM_Conf|IAAM_conf_ad.jpg|http://www.iaam.org/2009_conf/home.asp"
s[33] = "2099-01-01|TicketsWest|ticketswest.jpg|http://www.ticketswest.com/"
s[34] = "2099-01-01|Access Pass & Design|APD09_216x144.gif|http://www.iaam.org/IAAM_News/Pages/track/accesspasses.htm"
s[35] = "2099-01-01|IAAM Arena Management Conference|216p_amc.jpg|http://www.iaam.org/2009_meetings/amc/home.asp"
s[36] = "2099-01-01|VenuWorks|VenuWorks_216x144.gif|http://www.venuworks.com"
s[37] = "2099-01-01|IAAM International Crowd Management Conference|ICMC_216_09.jpg|http://www.iaam.org/2009_meetings/icmc/home.asp"
s[38] = "2099-01-01|Populous|Populous_animation.gif|http://www.populous.com/"
s[39] = "2099-01-01|IAAM International Stadium Management Conference|150ISMC_banner10.jpg|http://www.iaam.org/2010_meetings/ismc/home.asp/"
s[40] = "2099-01-01|IAAM Performing Arts Managers Conference|PAMC_Banner216.jpg|http://www.iaam.org/2010_meetings/pamc/home.asp"
s[41] = "2099-01-01|SONY1020_PT|Banner_FacilityManager_Sony-13695_PTS_216x144pxl_Dec-Jan_rev2.gif|http://www.go-dove.com/Auctions/AuctionDetail.asp?auctionID=13695&utm_source=iaam.org&utm_medium=enewsletter&utm_campaign=216x144"
s[42] = "2099-01-01|Celayix Software|Celayix Ad.JPG|http://www.celayix.com/"





// ------------------------------------------------------------
// sponsor variable format: var sponsor = new Array(number,number)
// example: var xxx_sponsor = new Array(36,12,42) 
// sponsor images are stored in this same folder called 'banners'
// sponsor items are displayed in the order listed, add ',number' as needed
//------------------------------------------------------------


// change date to current issue date & sponsors (date format "YYYYMMDD")
current="20100315"
current_sponsor = new Array(42,5,28,2,26,4,19,38,29,16)

// change date to the most recent past issue date & sponsors (date format "YYYYMMDD")
last1 = "20100301"
last1_sponsor = new Array(40,28,2,26,4,19,38,29,5,16)

// change date to the second most recent past issue date & sponsors (date format "YYYYMMDD")
last2 = "20100215"
last2_sponsor = new Array(40,2,26,4,19,38,29,5,28,16)

// enter ad numbers to appear on all issues remaining
old_sponsor = new Array(21,22,23,24,16)




//------------------------------------------------------------
//DO NOT CHANGE ANYTHING BELOW
//------------------------------------------------------------

var sponsor_date = ""
var currentTime = new Date()
var month = currentTime.getMonth() + 1
if (month < 10) month="0" + month
var day = currentTime.getDate()
if (day < 10) day = "0" + day
var year = currentTime.getFullYear()
today = year + "-" + month + "-" + day
var mon = new Array('','January','February','March','April','May','June','July','August','September','October','November','December');

function sponsors() {
  if (sponsor_date==current || !sponsor_date) var sponsor = current_sponsor
  else if (sponsor_date==last1) sponsor = last1_sponsor
  else if (sponsor_date==last2) sponsor = last2_sponsor
  else sponsor = old_sponsor

  for (x=0;x<100;x++){
    xx=sponsor[x]

    if (s[xx]) {
      date1 = explode(s[xx],0,'|')
      alt1 = explode(s[xx],1,'|')
      image1 = explode(s[xx],2,'|')
      link1 = explode(s[xx],3,'|')
      if (today <= date1) {
        if (link1) document.write('<a href="'+link1+'" target="_blank" title="'+alt1+'">')
        document.write('<img src="http://www.iaam.org/IAAM_News/banners/'+image1+'" border="0">')
        if (link1) document.write('</a>')
        document.write('<br><br>')
      }
    }
  }
}

function issuelist(){
  var yr, mo, dy, mo1, dy1
  issue=iss.sort(descending);
  for (x=0;x<24;x++){
    if (issue[x]>'') {
      yr = issue[x].substring(0,4)
      mo = issue[x].substring(4,6)
      dy = issue[x].substring(6,8)
      mo1=mo; 
      dy1=dy;
      if (mo<10) mo1=mo.substring(1);
      if (dy<10) dy1=dy.substring(1);
      if (yr && mo && dy) {
        document.write('&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.iaam.org/images/globesmall.gif" border="0">&nbsp;&nbsp;<a href="http://www.iaam.org/IAAM_news/pages/'+yr+'/'+mo+'_'+dy+'/NLmenu.htm" target="_blank">'+mon[mo1]+' '+dy1+', '+yr+'</a><br><br>');
      }
    }
  }
}

function explode(string,item,delimiter) {
 tempArray=new Array(1);
 var Count=0;
 var tempString=new String(string);
 while (tempString.indexOf(delimiter)>0) {
  tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter));
  tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1);
  Count=Count+1
 }
 tempArray[Count]=tempString;
 return tempArray[item];
}

function descending(a,b){ return b-a; }
