// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// SRC="MAG_global.js"
// Application: maggiesattic.us
//
// Copyright 2007-2011, brymar.net - All rights reserved.
// Copyright 2007-2011  Maggie's Attic of Florida. All rights reserved.
//
//
businBegan = "2006"
//
//
avWdth = screen.availWidth; if(!avWdth){avWdth = 800}
popOK = 0; isIE = 0; isNS = 0; isOP = 0;
if(navigator.appName == "Microsoft Internet Explorer"){
isIE = 1; if(navigator.appVersion.charAt(0) >= 4){popOK = 1}};
if(navigator.appName == "Netscape"){
isNS = 1; if(navigator.appVersion.charAt(0) >= 5){popOK = 1}};
if(navigator.appName == "Opera"){
isOP = 1; if(navigator.appVersion.charAt(0) >= 9){popOK = 1}};
//
//
function mapUp(){focusFind("mainTxt"); document.getElementById("map_view").style.display = "inline"; initializeGM();}
function mapDown(){document.getElementById("map_view").style.display = "none"}
function focusTop(){parent.location.hash = "theTop";}     //  window
function focusFind(goToo){parent.location.hash = goToo}     //  window
clubURL = "http://maggiesattic.us/clubs"
function goWC(wcURL){wcURL.href = clubURL; wcURL.blur()}
function GoLink(webPage){window.open(webPage)}
function goWMF(){window.open("http://brymar.net/WMSTR/WMF_feedbk.htm", "", "status")}
function goWM(){window.open("http://brymar.net/WM_email.htm", "", "status")}
function LinkClsGo(webPage){window.open(webPage); window.close();}
function pgPrint(){window.print()}
function pgClose(){window.close()}
function pgPrintCls(){window.print(); window.close()}
function goBackDelay(retrn){gotopg = retrn; setTimeout("document.location = gotopg", 1800)}
// function goBackDelay(retrn){setTimeout("parent.location = retrn", 1500)}
function GoStore(){window.open("http://shop.maggiesattic.us")}
function loadNL(NLD){newshtm = "MAnews_archive/".concat(NLD).concat("_manews.htm"); MAnews.location = newshtm}
function splash(splashit){document.getElementById(splashit).style.display = "inline";
                          SplashIntrv = setInterval("closeSplash('splashPOP')", 7200)}
function closeSplash(splashit){document.getElementById(splashit).style.display = 'none'}
function imgV(imgElem){document.getElementById(imgElem).style.display = "inline"}
function imgH(imgElem){document.getElementById(imgElem).style.display = "none"}
//
function menuV(menuElem){if(popOK){document.getElementById(menuElem).style.display = "inline"}}
function menuH(menuElem){if(popOK){document.getElementById(menuElem).style.display = "none"}}
//function iSide(){sbarPix.location = "iSbar.htm"}
function iniCONT(){iniV(); buildHL();}
function iniGALL(){buildHL(); pixLoad();}
function iniTASTE(){buildHL(); summerTime();}
function iniCALN(){buildHL(); currCal();}
//
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//
dowList = new Array(7)
dowList[0] = "Sunday"
dowList[1] = "Monday"
dowList[2] = "Tuesday"
dowList[3] = "Wednesday"
dowList[4] = "Thursday"
dowList[5] = "Friday"
dowList[6] = "Saturday"
//
function dateNow(){dateNow = new Date();
                   daNow = dateNow.getDate().toString().concat("-");
                   moNow = (dateNow.getMonth() + 1).toString().concat("-");
                   yrNow = dateNow.getYear().toString();
                   if(dateNow.getYear() < 200){
                   yrNow = (dateNow.getYear() + 1900).toString()};
                   dowNow = dowList[dateNow.getDay()].concat("&nbsp;&nbsp;");
                   dowmdyNow = (dowNow.concat(moNow.concat(daNow))).concat(yrNow)}
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//
dd = "maggiesattic"
tt = "us"
ss = ""
nnList = new Array()
nnList[0] = "webmaster"
nnList[1] = "info"
nnList[2] = "terry"
nnList[3] = "jerome"
nnList[4] = "cellarmaster"
nnList[5] = "clubs"
nnList[6] = "recipeshare"
//
function sendTo(thisObj, nn, subj){ss = "";  realThing = thisObj.href;
                             if(subj){ss = "?subject=" + subj};
                             thisObj.href = "mailto:" +nnList[nn] + "@" + dd + "." + tt + ss;
                             return true}
// -----------------------------------------------------------------------------------
//
stSite = "From Maggie's Link:"   // set to name of the site
stHide = "z5@9f"
stLevel = new Array()
stLevel[0] = "xxx"
stLevel[1] = "com"
stLevel[2] = "us"
stLevel[3] = "org"
stLevel[4] = "biz"
stLevel[5] = "net"
stWho = new Array()
stWho[0] = "rofnicisabz"
stWho[1] = "5allirebldk"
stWho[2] = "qocihsusarodtms"
stWho[3] = "ggnivilyhtlaeh47"
stWho[4] = "120yllohybsemohp"
stWho[5] = "zyriqni9"
stWho[6] = "yttocstz"
stWho[7] = "qnebttobbah"
stWho[8] = "3erahsepicerx"
stDN = new Array()
stDN[0] = "??????????"
stDN[1] = "yahoo"
stDN[2] = "comcast"
stDN[3] = "aol"
stDN[4] = "beachrentalsofdaytona"
stDN[5] = "embarqmail"
stDN[6] = "tscottwalker"
stDN[7] = "ymail"
stDN[8] = "maggiesattic"
function stIsto(Ann)
               {stAt = stHide.substr(2, 1);
                ln = stWho[Ann].length - 1; k = ln;
                stWhois = ""; wkWho = stWho[Ann].substr(1, ln-1);
                while(k > -1){stWhois = stWhois.concat(wkWho.substr(k, 1)); k=k-1;};
                }
function AnySendTo(thisObj, stL, stW, stD, stS)
         {ss = "";  realThing = thisObj.href;
          if(stS == ""){stS = stSite};
          ss = "?subject=" + stS;
          stIsto(stW);
          thisObj.href = "mailto:" + stWhois + stAt + stDN[stD] + "." + stLevel[stL] + ss;
          return true}
// ---------------------------------------------------------------------------------------
//      iContact E-mail sign-up form validation.
//
nameB = "                                                                                                                                                                    "
function verifyRequired(signup) {
  if (!signup.fields_email.value){
      alert("The E-mail field is required.");
      signup.fields_email.focus();
      return false;}
  val_emSignUP(signup.fields_email.value);
  if (errEM == 1){
      alert("The E-mail address appears invalid, please re-enter.");
      signup.fields_email.focus();
      return false;}
      // Validate First Name  -----------------------------------------
      //
      nameL =  signup.fields_fname.value.length
  if (!signup.fields_fname.value){                                                  // First name can not be blank
      alert("The First Name field is required.");
      signup.fields_fname.focus();
      return false;}
  if (signup.fields_fname.value.length < "2"){                                      // First name must be at least 2 characters
      alert("Please enter your full First Name.");
      signup.fields_fname.focus();
      return false;}
  if (signup.fields_fname.value.substr(0, nameL) == nameB.substr(0, nameL)){        // First name can not be all spaces
      alert("The First Name field is required.");
      signup.fields_fname.focus();
      return false;}
  if (signup.fields_fname.value.substr(0, 1) == " "){                              // No leading space on first name
      alert("The First Name field, leading spaces not allowed.");
      signup.fields_fname.focus();
      return false;}
      // Validate Last Name ----------------------------------
      nameL =  signup.fields_lname.value.length
  if (!signup.fields_lname.value){                                                 // Last name can not be blank
      alert("The Last Name field is required.");
      signup.fields_lname.focus();
      return false;}
  if (signup.fields_lname.value.length < "2"){                                      // Last name must be at least 2 characters
      alert("Please enter your full Last Name.");
      signup.fields_lname.focus();
      return false;}
  if (signup.fields_lname.value.substr(0, nameL) == nameB.substr(0, nameL)){        // Last name can not be all spaces
      alert("The Last Name field is required.");
      signup.fields_lname.focus();
      return false;}
  if (signup.fields_lname.value.substr(0, 1) == " "){                              // No leading space on last name
      alert("The Last Name field, leading spaces not allowed.");
      signup.fields_lname.focus();
      return false;}
      //
      return true;}
function val_emSignUP(ckaddr){
                      badStuff = " /:,;"; i=0; errEM=0;
                      while(i < badStuff.length){badChar = badStuff.charAt(i); i++;
                      if(ckaddr.indexOf(badChar) > -1){errEM = 1; return }};
                      at = ckaddr.indexOf("@", 1); if(at <= 0){errEM = 1; return };
                      dot = ckaddr.indexOf(".", at); if(dot < 0){errEM = 1; return };
                      ln = ckaddr.length; if(dot == ln - 2){errEM = 1;  return };
                      return}
// ----------------------------------------------------------------------------------------
//
