/*********************************
Amir Pirzadeh
Tisfoon.com
12/23/2004
*********************************/
function navShow(obj)
  {
  document.getElementById(obj).style.visibility = "visible";
  }

/*********************************
Amir Pirzadeh
Tisfoon.com
12/23/2004
*********************************/
function navHide(obj)
  {
  document.getElementById(obj).style.visibility = "hidden";
  }

/*********************************
Amir Pirzadeh
Tisfoon.com
12/23/2004
*********************************/
FlagEraseSubNav = -1;
function eraseSubNav() 
  {
  if(FlagEraseSubNav == 0)
    {
    navHide('subNav2');
    navHide('subNav3');
    navHide('subNav4');
    
    FlagEraseSubNav = -1;
    }
  else if (FlagEraseSubNav > 0)
    FlagEraseSubNav = FlagEraseSubNav - 1;
  
  setTimeout("eraseSubNav()", 1000);
  }

/*********************************
Amir Pirzadeh
Tisfoon.com
12/23/2004
*********************************/
function showSubNav(d) 
  {
  if(d==2)
     navShow('subNav2')
  else
     navHide('subNav2');
  
  if(d==3)
     navShow('subNav3')
  else
     navHide('subNav3');
  
  if(d==4)
     navShow('subNav4')
  else
     navHide('subNav4');

  FlagEraseSubNav = 10;  //auto erase in 10 secs
  }
  
/*******************************
   Home Page
*******************************/



my1Pix = new Array(
  "BoxesBegone/0.jpg",
  "BoxesBegone/1.jpg");
  
my1Alt = new Array(
  "Boxes transformed to octagons",
  "Boxes transformed to octagons");
  
my1Loaded = new Array(
   false,
   false);
  
my1Visits = new Array(
  false,
  false);



my2Pix = new Array(
  "TrayCeilings/0.jpg",
  "TrayCeilings/1.jpg");
  
my2Alt = new Array(
  "Tray Ceilings in multiple dimensions",
  "Tray Ceilings in multiple dimensions");
  
my2Loaded = new Array(
   false,
   false);
  
my2Visits = new Array(
  false,
  false);


my3Pix = new Array(
  "RoyalWalkway/0.jpg",
  "RoyalWalkway/1.jpg");
  
my3Alt = new Array(
  "The signature walkway",
  "The signature walkway");

my3Loaded = new Array(
   false,
   false);
  
my3Visits = new Array(
  false,
  false);



my4Pix = new Array(
  "Landscaping/0.jpg",
  "Landscaping/1.jpg",
  "Landscaping/2.jpg");
  
my4Alt = new Array(
  "Landscapes make a big impact",
  "Landscapes make a big impact",
  "Landscapes make a big impact");

my4Loaded = new Array(
   false,
   false,
   false);
  
my4Visits = new Array(
  false,
  false,
  false);


my5Pix = new Array(
  "ElegantEntrances/0.jpg",
  "ElegantEntrances/1.jpg");
  
my5Alt = new Array(
  "Entrances make the first impressions",
  "Entrances make the first impressions");

my5Loaded = new Array(
   false,
   false);
  
my5Visits = new Array(
  false,
  false);



my6Pix = new Array(
  "WindowDressing/0.jpg",
  "WindowDressing/1.jpg");
  
my6Alt = new Array(
  "Window Dressing the chic way",
  "Window Dressing the chic way");

my6Loaded = new Array(
   false,
   false);
  
my6Visits = new Array(
  false,
  false);


my7Pix = new Array(
  "BrickLaying1.jpg");
  
my7Alt = new Array(
  "Brick Laying ... Attention to Detail");

my7Loaded = new Array(
   false);
  
my7Visits = new Array(
  false);


my8Pix = new Array(
"images/10227 Governers Dr. Chapel Hill/DSC00467.JPG",  
"images/10227 Governers Dr. Chapel Hill/DSC00468.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00471.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00473.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00475.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00478.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00479.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00481.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00485.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00486.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00488.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00489.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00491.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00493.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00495.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00497.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00498.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00499.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00501.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00504.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00507.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00508.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00509.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00511.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00521.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00888.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00889.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00891.JPG",
"images/10227 Governers Dr. Chapel Hill/DSC00907.JPG",
"images/Westin State Subdivision/IMG_6297.JPG",
"images/Westin State Subdivision/IMG_6303.JPG",
"images/Westin State Subdivision/IMG_6306.JPG",
"images/Westin State Subdivision/IMG_6311.JPG",
"images/Westin State Subdivision/IMG_6318.JPG",
"images/Westin State Subdivision/IMG_6320.JPG");





my8Alt = new Array(
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs",
  "Unique and Elegant Designs");

my8Loaded = new Array(
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false);
  
my8Visits = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false);
  
my9Pix = new Array(
  "house1/0.jpg",
  "house1/1.jpg",
  "house1/2.jpg",
  "house1/3.jpg",
  "house1/4.jpg",
  "house1/5.jpg",
  "house1/6.jpg",
  "house1/7.jpg",
  "house1/8.jpg",
  "house1/9.jpg",
  "house1/10.jpg",
  "house1/11.jpg",
  "house1/12.jpg",
  "house1/13.jpg",
  "house1/14.jpg",
  "house1/15.jpg",
  "house1/16.jpg",
  "house1/17.jpg",
  "house1/18.jpg",
  "house1/19.jpg");
  
my9Alt = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");

my9Loaded = new Array(
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false);
  
my9Visits = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);
  

my10Pix = new Array(
  "house2/0.jpg",
  "house2/1.jpg",
  "house2/2.jpg",
  "house2/3.jpg",
  "house2/4.jpg");
  
my10Alt = new Array(
   "",
   "",
   "",
   "",
   "");

my10Loaded = new Array(
   false,
   false,
   false,
   false,
   false);
  
my10Visits = new Array(
  false,
  false,
  false,
  false,
  false);
  
my11Pix = new Array(
  "house3/0.jpg",
  "house3/1.jpg",
  "house3/2.jpg",
  "house3/3.jpg",
  "house3/4.jpg",
  "house3/5.jpg",
  "house3/6.jpg",
  "house3/7.jpg",
  "house3/8.jpg",
  "house3/9.jpg",
  "house3/10.jpg",
  "house3/11.jpg",
  "house3/12.jpg",
  "house3/13.jpg",
  "house3/14.jpg",
  "house3/15.jpg",
  "house3/16.jpg");
  
my11Alt = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");

my11Loaded = new Array(
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false);
  
my11Visits = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);
  
my12Pix = new Array(
  "house4/0.jpg",
  "house4/1.jpg",
  "house4/2.jpg",
  "house4/3.jpg",
  "house4/4.jpg");
  
my12Alt = new Array(
   "",
   "",
   "",
   "",
   "");

my12Loaded = new Array(
   false,
   false,
   false,
   false,
   false);
  
my12Visits = new Array(
  false,
  false,
  false,
  false,
  false);
  
my13Pix = new Array(
  "house5/0.jpg",
  "house5/1.jpg",
  "house5/2.jpg",
  "house5/3.jpg",
  "house5/4.jpg",
  "house5/5.jpg",
  "house5/6.jpg",
  "house5/7.jpg",
  "house5/8.jpg",
  "house5/9.jpg",
  "house5/10.jpg",
  "house5/11.jpg",
  "house5/12.jpg",
  "house5/13.jpg",
  "house5/14.jpg",
  "house5/15.jpg",
  "house5/16.jpg",
  "house5/17.jpg",
  "house5/18.jpg");
  
my13Alt = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");

my13Loaded = new Array(
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false);
  
my13Visits = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);
  
my14Pix = new Array(
  "house6/0.jpg",
  "house6/1.jpg",
  "house6/2.jpg",
  "house6/3.jpg",
  "house6/4.jpg",
  "house6/5.jpg",
  "house6/6.jpg",
  "house6/7.jpg",
  "house6/8.jpg",
  "house6/9.jpg",
  "house6/10.jpg",
  "house6/11.jpg",
  "house6/12.jpg",
  "house6/13.jpg",
  "house6/14.jpg",
  "house6/15.jpg",
  "house6/16.jpg",
  "house6/17.jpg",
  "house6/18.jpg",
  "house6/19.jpg",
  "house6/20.jpg",
  "house6/21.jpg",
  "house6/22.jpg",
  "house6/23.jpg",
  "house6/24.jpg",
  "house6/25.jpg",
  "house6/26.jpg",
  "house6/27.jpg");

my14Alt = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");

my14Loaded = new Array(
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false);
  
my14Visits = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);
  


my1 = new Array(my1Pix, my1Alt, my1Loaded, my1Visits, false);
my2 = new Array(my2Pix, my2Alt, my2Loaded, my2Visits, false);
my3 = new Array(my3Pix, my3Alt, my3Loaded, my3Visits, false);
my4 = new Array(my4Pix, my4Alt, my4Loaded, my4Visits, false);
my5 = new Array(my5Pix, my5Alt, my5Loaded, my5Visits, false);
my6 = new Array(my6Pix, my6Alt, my6Loaded, my6Visits, false);
my7 = new Array(my7Pix, my7Alt, my7Loaded, my7Visits, false);
my8 = new Array(my8Pix, my8Alt, my8Loaded, my8Visits, false);
my9 = new Array(my9Pix, my9Alt, my9Loaded, my9Visits, false);
my10 = new Array(my10Pix, my10Alt, my10Loaded, my10Visits, false);
my11 = new Array(my11Pix, my11Alt, my11Loaded, my11Visits, false);
my12 = new Array(my12Pix, my12Alt, my12Loaded, my12Visits, false);
my13 = new Array(my13Pix, my13Alt, my13Loaded, my13Visits, false);
my14 = new Array(my14Pix, my14Alt, my14Loaded, my14Visits, false);

my = new Array(my1, my2, my3, my4, my5, my6, my7, my8, my9, my10, my11, my12, my13, my14);

slideCt = my.length;
imgCt = new Array;

imgCt[0] = my[0][0].length; 
imgCt[1] = my[1][0].length; 
imgCt[2] = my[2][0].length; 
imgCt[3] = my[3][0].length; 
imgCt[4] = my[4][0].length; 
imgCt[5] = my[5][0].length; 
imgCt[6] = my[6][0].length; 
imgCt[7] = my[7][0].length; 
imgCt[8] = my[8][0].length; 
imgCt[9] = my[9][0].length; 
imgCt[10] = my[10][0].length; 
imgCt[11] = my[11][0].length; 
imgCt[12] = my[12][0].length; 
imgCt[13] = my[13][0].length; 

tmpImg = new Array;

currSlide = 0;
imgShow = -1;
pauseSlide = false;
randomNum = Math.floor((Math.random() * imgCt[currSlide]));
changeSlide = true;

/**************************
**************************/
function newImage(arg) 
  {
  if (document.images) 
    {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
    }
  }
  
/**************************
**************************/
function preLoadImages(aSlide)
  {
  if(document.images) 
    {
      for(i=0;i<imgCt[aSlide];i++)
        {
        tmpImg[i] = newImage(my[aSlide][0][i]);
        }
    }
  }

/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000

if all images are shown, then will
reset the marker so that they are
reshown
*********************************/
function checkAllShown()
  {
  for(i=0;i<imgCt[currSlide];i++)
    if(my[currSlide][3][i] == false)
      return false;
      
  for(i=0;i<imgCt[currSlide];i++)
    my[currSlide][3][i] = false;
    
  return true;
  }

/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000

if all images are shown, then will
reset the marker so that they are
reshown
*********************************/
function checkAllSlidesShown()
  {
  for(i=0;i<slideCt;i++)
    if(my[i][4] == false)
      return false;
      
  for(i=0;i<slideCt;i++)
    my[i][4] = false;
    
  return true;
  }

/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function getNewRandomKiosk() 
  {
  checkAllShown();

  firstIt = true;
  
  while(firstIt || (my[currSlide][3][aRandomNum] == true))
    {
    aRandomNum = Math.floor((Math.random() * imgCt[currSlide]));
    firstIt = false;
    }
    
  my[currSlide][3][aRandomNum] = true;
    
  return aRandomNum;
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function getNewRandomSlide() 
  {
  checkAllSlidesShown();

  firstIt = true;
  
  while(firstIt || (my[aRandomSlide][4] == true))
    {
    aRandomSlide = Math.floor((Math.random() * slideCt));
    firstIt = false;
    }
    
  my[aRandomSlide][4] = true;
    
  return aRandomSlide;
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function showRandomKiosk(aSlide) 
  {
  if(document.images)
    {
    if(document.Kiosk.complete && !pauseSlide)
      {
      currSlide = aSlide;
      //imgShow = getNewRandomKiosk();

      //imgShow = (imgShow + 1) % imgCt[currSlide]
      imgShow = Math.floor((Math.random() * imgCt[currSlide]));

      //to show something is happening
      document.Kiosk.src = "empty.gif";

      document.Kiosk.src = my[currSlide][0][imgShow];
      document.Kiosk.alt = my[currSlide][1][imgShow];
      my[currSlide][3][imgShow] = true;
      
      //do not give up on preloading images
      //nextImg = (imgShow + 1) % imgCt[currSlide]
      //tmpImg[nextImg] = newImage(my[currSlide][0][nextImg]);
      
      }
      
    if(imgCt[currSlide] > 1)
       setTimeout("showRandomKiosk(currSlide)", 3500);
    }
  }
  

/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function showKiosk() 
  {
  if(document.images)
    {
    if(document.Kiosk.complete && !pauseSlide)
      {
      imgShow = (imgShow + 1) % imgCt[currSlide]
      document.Kiosk.src = my[currSlide][0][imgShow];
      document.Kiosk.alt = my[currSlide][1][imgShow];
      }
      
    setTimeout("showKiosk()", 5000);
    }
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function ChangeSlide(aNum) 
  {
  if(document.images)
    {
    if(document.Kiosk.complete)
      {
      imgShow = aNum;
      document.Kiosk.src = my[currSlide][0][imgShow];
      document.Kiosk.alt = my[currSlide][1][imgShow];
      pauseSlide = true;
      }
    }
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function ResumeSlides()
  {
  pauseSlide = false;
  }
  










  JulMonth = 1;
  JulDay = 5;
  JulYear = 2000;
  
  JulMonthName = new Array(
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December");
  
  /*********************************
  Amir Pirzadeh
  Tisfoon.com
  1/6/2000
  *********************************/
  function UpdateJul()
    {
    now = new Date;
    
    JulMonth = now.getMonth() + 1;
    JulDay = now.getDate();
    JulYear = now.getYear();
    if(JulYear < 2000)
       JulYear = JulYear + 1900;
    
    return JulDay.toString() + ' ' + 
           JulMonthName[JulMonth - 1] + ' ' +
           JulYear.toString();
    }
  
  /*********************************
  Amir Pirzadeh
  Tisfoon.com
  1/6/2000
  *********************************/
  function UpdateTime()
    {
    now = new Date;
    
    return now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds()
    }
    



