// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// SRC="MAG_gallery.js"
// Application: maggiesattic.us
//
// Copyright 2007-2010, brymar.net - All rights reserved.
// Copyright 2007-2010  Maggie's Attic of Florida. All rights reserved.
//
//
function showShow(zzz){document.getElementById(zzz).style.display = "inline"}
function hideShow(zzz){document.getElementById(zzz).style.display = "none"; isViz = 0}
//
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// images must be uniform size at 400w x 250h
showPix = new Array(
//
"MAGimg/GALimg/gall_2010_06_casa_1_001.jpg#1%'Maggie's In Motion' - wine tasting event hosted by Casa Mia Cafe in Tavares   June 2010",
"MAGimg/GALimg/gall_2010_06_casa_2_001.jpg#1%'Maggie's In Motion' - wine tasting event hosted by Casa Mia Cafe in Tavares   June 2010",
"MAGimg/GALimg/gall_2010_06_casa_3_001.jpg#1%'Maggie's In Motion' - wine tasting event hosted by Casa Mia Cafe in Tavares   June 2010",
//
"MAGimg/GALimg/gall_2010_05_mdbwf_002.jpg#1%2010 Mt. Dora Blues & Wine Festival - Maggie's Attic pouring station",
"MAGimg/GALimg/gall_2010_05_mdbwf_001.jpg#1%2010 Mt. Dora Blues & Wine Festival - Maggie's Attic 1st Place WINNER For Best White Wine",
//
"MAGimg/GALimg/gall_2010_13_sushi_1_001.jpg#1%'Maggie's In Motion' - wine tasting hosted by Mt. Dora Sushi and Steaks   May 2010",
"MAGimg/GALimg/gall_2010_13_sushi_4_001.jpg#1%'Maggie's In Motion' - wine tasting hosted by Mt. Dora Sushi and Steaks   May 2010",
"MAGimg/GALimg/gall_2010_13_sushi_6_001.jpg#1%'Maggie's In Motion' - wine tasting hosted by Mt. Dora Sushi and Steaks   May 2010",
//
//"MAGimg/GALimg/gall_2010_05_wt_1_001.jpg#1%May 2010 wine tasting in our breeze way",
"MAGimg/GALimg/gall_2010_05_wt_2_002.jpg#1%Florida Star winner Lisa Maree & keyboard artist Tony preform May 2010 wine tasting",
//"MAGimg/GALimg/gall_2010_05_wt_3_002.jpg#1%Florida Star winner Lisa Maree & keyboard artist Tony preform May 2010 wine tasting",
"MAGimg/GALimg/gall_2010_05_wt_4_001.jpg#1%May 2010 wine tasting at 'Piece of Mind' tasting station",
"MAGimg/GALimg/gall_2010_05_wt_5_001.jpg#1%May 2010 wine tasting at 'Emz on Fifth' tasting station",
//
"MAGimg/GALimg/gall_2010_02_art-wt_004.jpg#1%2010 Art Show Weekend and Wine Tasting (Maggie's Tasting Station)",
"MAGimg/GALimg/gall_2010_02_wt_001.jpg#1%Wine Tasting station at 'Piece of Mine'",
"MAGimg/GALimg/gall_2010_02_art-wt_001.jpg#1%The Party's Here - 2010 Art Show Weekend and Wine Tasting",
"MAGimg/GALimg/gall_2010_02_art-wt_002.jpg#1%Fun At The 2010 Art Show Weekend and Wine Tasting",
"MAGimg/GALimg/gall_2009_005.jpg#1%Great Wine Tastings Twice Each Monthly '09",
"MAGimg/GALimg/gall_2008_001.jpg#1%Great Wine Tastings Twice Each Monthly '08",
"MAGimg/GALimg/gall_2009_002.jpg#1%Fun Times At The Wine Tastings",
"MAGimg/GALimg/gall_2010_02_wdw_001.jpg#1%Great Entertainment at Wine Tastings and Wine Down Wednesdays (T Scott Walker)",
"MAGimg/GALimg/gall_2010_02_wdw_002.jpg#1%Great Entertainment at Wine Tastings and Wine Down Wednesdays (T Scott Walker)",
"MAGimg/GALimg/gall_2010_02_wdw_003.jpg#1%Great Entertainment at Wine Tastings and Wine Down Wednesdays (Port Barlow)",
"MAGimg/GALimg/gall_2008_004.jpg#1%Great Entertainment at Wine Tastings and Wine Down Wednesdays (Jim Rast)",
"MAGimg/GALimg/gall_2009_004.jpg#1%Great Entertainment at Wine Tastings and Wine Down Wednesdays (Robert Harris)",
"MAGimg/GALimg/gall_2009_003.jpg#1%Relax with your favorite wine or beer in the breeze way",
"MAGimg/GALimg/gall_xmas_003.jpg#1%Cheers",
"MAGimg/GALimg/gall_xmas_002.jpg#1%Cheers",
"MAGimg/GALimg/gall_2009_001.jpg#1%Fun Times During The Holiday Season",
"MAGimg/GALimg/gall_xmas_001.jpg#1%Great Times During The Hoilday Season",
"MAGimg/GALimg/gall_xmas_004.jpg#1%Christmas And The Hoidays at Maggie's"
//

//"MAGimg/GALimg/gall_2010_02_art-wt_003.jpg#1%2010 Art Show Weekend and Wine Tasting",
)
isViz = 0
picN = 0
picL = 0
notready = "Images are still loading, try again."
// dir: p = previous, n = next, s = start at indicated idx
// idx: index of pict to dsply, if null goes by script.
function pictShow(thisImg, dir, idx){if(!document.images){alert(notready); return}
                                     if(picL == 0){alert(notready); return}
                  if(isViz == 0){showShow('showtime'); isViz = 1};
                  if(dir == "s"){picN = idx;
                                 sepp = showPix[picN].indexOf("#"); // end of img source
                                 seppD = showPix[picN].indexOf("%");  // begin img desc
                                 document.showThis.src = showPix[picN].substr(0, sepp);
                                 document.getElementById("picD").value =
                                                            showPix[picN].substr(seppD+1);
                                 return}
                  if(dir == "n"){picN++};
                  if(dir == "p"){picN--};
                  if(picN > showPix.length - 1){picN = 0};
                  if(picN < 0){picN = showPix.length - 1};
                  sepp = showPix[picN].indexOf("#");  // end of img source
                  seppD = showPix[picN].indexOf("%");  // begin img desc
                  document.showThis.src = showPix[picN].substr(0, sepp);
                  document.getElementById("picD").value = showPix[picN].substr(seppD+1);
                  }
function pictLoad(){picL = 1}
//
// <img src="MAGimg/GALimg/gall_2010_02_art-wt_004.jpg" width="500" height="315" onclick = "javascript:pictshow(this, 's', '0')" class="imgTN">
//
htmlSegg = "<img src='IMGIMG' width='500' height='315' onclick = 'javascript:pictShow(this, &quot;s&quot;, &quot;NNN&quot;)' class='imgTN' onLoad='javascript:allLoaded()'>"
imgsrc = /IMGIMG/
imgseq = /NNN/
htmlWrk = ""
wrkSegg = ""
iLoaded = 0
// buildGall parameter is the gallery segment number.
function pixLoad(){buildGall('1'); picL = 1; return}
//
function buildGall(segg){Asize = showPix.length; jj = 0; htmlWrk = "";
                         iLoaded = 0; rCnt = 0; iCnt = 0;
                         while(jj < Asize){
                         thisSeq = showPix[jj].charAt(showPix[jj].indexOf("#")+1)
                         if(thisSeq == segg){
                         wrkSegg = htmlSegg;
                         srcval = showPix[jj].substr(0, showPix[jj].indexOf("#"));
                         wrkSegg = wrkSegg.replace(imgsrc, srcval);
                         wrkSegg = wrkSegg.replace(imgseq, jj);
                         htmlWrk = htmlWrk.concat(wrkSegg);
                         iCnt++; rCnt++;
                         if(rCnt == 6){rCnt = 0; htmlWrk = htmlWrk.concat("<br>")};
                         jj++ };
                         }
                         // insert html into division
                         document.getElementById("galsegg").innerHTML = htmlWrk;
                         }
//
function allLoaded(){iLoaded++;
            if(iLoaded == iCnt){document.getElementById('loadng').style.display = "none"
            }}
//
// -------------------------------------------------------------------------------

//
//