/*********************************
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('subNav1');
    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==1)
     navShow('subNav1')
  else
     navHide('subNav1');

  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
  }
  






function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*******************************
   Home Page
*******************************/

myPix1 = new Array(
  "FrontPage1.jpg",
  "FrontPage2.jpg",
  "FrontPage3.jpg");
  
myAlt1 = new Array(
  "Click to Enter",
  "Click to Enter",
  "Click to Enter");
  
myURL1 = new Array(
  "main.html",
  "main.html",
  "main.html");
  
myVisits1 = new Array(
  false,
  false,
  false);
  
/*******************************
*******************************/

myPix2 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg");
  
myAlt2 = new Array(
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh");
  
myURL2 = new Array(
   "",
   "",
   "",
   "");
  
myVisits2 = new Array(
  false,
  false,
  false,
  false);

/*******************************
*******************************/
myPix3 = new Array(
   "kiosk/0.jpg",
   "kiosk/1.jpg",
   "kiosk/2.jpg",
   "kiosk/3.jpg",
   "kiosk/4.jpg",
   "kiosk/5.jpg",
   "kiosk/6.jpg",
   "kiosk/7.jpg",
   "kiosk/8.jpg",
   "kiosk/9.jpg",
   "kiosk/10.jpg",
   "kiosk/11.jpg",
   "kiosk/12.jpg",
   "kiosk/13.jpg",
   "kiosk/14.jpg",
   "kiosk/15.jpg",
   "kiosk/16.jpg",
   "kiosk/17.jpg",
   "kiosk/18.jpg",
   "kiosk/19.jpg",
   "kiosk/20.jpg",
   "kiosk/21.jpg",
   "kiosk/22.jpg",
   "kiosk/23.jpg",
   "kiosk/24.jpg",
   "kiosk/25.jpg",
   "kiosk/26.jpg",
   "kiosk/27.jpg",
   "kiosk/28.jpg",
   "kiosk/29.jpg"
    );
  
myAlt3 = 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");
  
myURL3 = new Array(
   "past/lochmere/index.html",
   "past/crestwood/index.html",
   "past/treyburn/lot60.html",
   "residentialprojects/fallsvillage/index.html",
   "past/crestwood/index.html",
   "past/crestwood/lot10/index.html",
   "past/crestwood/index.html",
   "residentialprojects/fallsvillage/index.html",
   "news/2004.html",
   "past/grahamstone/index.html",
   "commercialprojects/creedmore.html",
   "past/albright/index.html",
   "commercialprojects/georgesgarage.html",
   "past/savannah/index.html",
   "residentialprojects/valleycrest/lot2/index.html",
   "residentialprojects/valleycrest/lot2/index.html",
   "residentialprojects/valleycrest/lot3/index.html",
   "residentialprojects/valleycrest/lot3/index.html",
   "residentialprojects/valleycrest/lot4/index.html",
   "residentialprojects/valleycrest/lot4/index.html",
   "residentialprojects/valleycrest/index.html",
   "residentialprojects/valleycrest/index.html",
   "residentialprojects/tuscanlake/index.html",
   "past/sheffieldmanor/index.html",
   "residentialprojects/fallsvillage/index.html",
   "residentialprojects/fallsvillage/index.html",
   "residentialprojects/valleycrest/lot2/index.html",
   "residentialprojects/valleycrest/lot3/index.html",
   "residentialprojects/valleycrest/lot9/index.html",
   "residentialprojects/fallsvillage/index.html"
   );

  
myVisits3 = 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);

/*******************************
*******************************/
myPix4 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg",
   "4.jpg",
   "5.jpg",
   "6.jpg",
   "7.jpg",
   "8.jpg",
   "9.jpg",
   "10.jpg",
   "11.jpg");
  
myAlt4 = 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");
  
myURL4 = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");
  
myVisits4 = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);

/*******************************
*******************************/
myPix6 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg");
  
myAlt6 = new Array(
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh");
  
myURL6 = new Array(
   "",
   "",
   "",
   "");
  
myVisits6 = new Array(
  false,
  false,
  false,
  false);

/*******************************
*******************************/
myPix8 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg",
   "4.jpg",
   "5.jpg",
   "6.jpg",
   "7.jpg",
   "8.jpg",
   "9.jpg");
  
myAlt8 = new Array(
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh");
  
myURL8 = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");
  
myVisits8 = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);

/*******************************
*******************************/
myPix9 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg",
   "4.jpg",
   "5.jpg",
   "6.jpg",
   "7.jpg",
   "8.jpg",
   "9.jpg",
   "10.jpg",
   "11.jpg",
   "12.jpg",
   "13.jpg");
  
myAlt9 = new Array(
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh");
  
myURL9 = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");
  
myVisits9 = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);

/*******************************
*******************************/
myPix10 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg",
   "4.jpg",
   "5.jpg",
   "6.jpg",
   "7.jpg",
   "8.jpg",
   "9.jpg",
   "10.jpg");
  
myAlt10 = new Array(
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh");
  
myURL10 = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");
  
myVisits10 = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);

myPix11 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg",
   "4.jpg",
   "5.jpg",
   "6.jpg",
   "7.jpg",
   "8.jpg",
   "9.jpg",
   "10.jpg",
   "11.jpg",
   "12.jpg",
   "13.jpg",
   "14.jpg");
  
myAlt11 = new Array(
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh");
  
myURL11 = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");
  
myVisits11 = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);

myPix12 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg",
   "4.jpg");
  
myAlt12 = new Array(
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh",
   "Elegance in North Raleigh");
  
myURL12 = new Array(
   "",
   "",
   "",
   "",
   "");
  
myVisits12 = new Array(
  false,
  false,
  false,
  false,
  false);

/*******************************
*******************************/
myPix13 = new Array(
   "0.jpg",
   "1.jpg",
   "2.jpg",
   "3.jpg",
   "4.jpg",
   "5.jpg",
   "6.jpg",
   "7.jpg",
   "8.jpg",
   "9.jpg",
   "10.jpg",
   "11.jpg",
   "12.jpg",
   "13.jpg",
   "14.jpg",
   "15.jpg",
   "16.jpg",
   "17.jpg",
   "18.jpg");
  
myAlt13 = 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");
  
myURL13 = new Array(
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "",
   "");
  
myVisits13 = new Array(
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false,
  false);

/**************************
**************************/

my  = new Array(myPix1, myAlt1, myURL1, myVisits1);

imgCt = new Array;

imgCt = my[0].length; 

tmpImg = new Array;

imgShow = -1;
pauseSlide = false;
randomNum = Math.floor((Math.random() * imgCt));

/**************************
**************************/
function newImage(arg) 
  {
  if (document.images) 
    {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
    }
  }
  
/**************************
**************************/
function preLoadImages(Page)
  {
  if(Page == 1)
    {
    my = new Array(myPix1, myAlt1, myURL1, myVisits1);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }

  if(Page == 2)
    {
    my = new Array(myPix2, myAlt2, myURL2, myVisits2);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
    

  if(Page == 3)
    {
    my = new Array(myPix3, myAlt3, myURL3, myVisits3);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
    
  
  if(Page == 4)
    {
    my = new Array(myPix4, myAlt4, myURL4, myVisits4);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
    

  if(Page == 6)
    {
    my = new Array(myPix6, myAlt6, myURL6, myVisits6);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
    
  if(Page == 8)
    {
    my = new Array(myPix8, myAlt8, myURL8, myVisits8);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
                                   
  if(Page == 9)
    {
    my = new Array(myPix9, myAlt9, myURL9, myVisits9);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
                                   
  if(Page == 10)
    {
    my = new Array(myPix10, myAlt10, myURL10, myVisits10);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
                                   
  if(Page == 11)
    {
    my = new Array(myPix11, myAlt11, myURL11, myVisits11);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
                                   
  if(Page == 12)
    {
    my = new Array(myPix12, myAlt12, myURL12, myVisits12);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
                                   
  if(Page == 13)
    {
    my = new Array(myPix13, myAlt13, myURL13, myVisits13);
    imgCt = my[0].length; 
    randomNum = Math.floor((Math.random() * imgCt));
    }
                                   
  if(document.images) 
    {
    for(i=0;i<imgCt;i++)
      tmpImg[i] = newImage(my[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;i++)
    if(my[3][i] == false)
      return false;
      
  for(i=0;i<imgCt;i++)
    my[3][i] = false;
    
  return true;
  }

/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function getNewRandomKiosk(oldRandomNum) 
  {
  checkAllShown();
  
  firstIt = true;
  
  while(firstIt || (my[3][aRandomNum] == true) || (aRandomNum == oldRandomNum))
    {
    aRandomNum = Math.floor((Math.random() * imgCt));
    firstIt = false;
    }
    
  my[3][aRandomNum] = true;
    
  return aRandomNum;
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function showRandomKiosk() 
  {
  if(document.images)
    {
     if (document.all)
        {
         document.images.Kiosk.style.filter="blendTrans(duration=2)";
         document.images.Kiosk.style.filter="blendTrans(duration=3)";
         document.images.Kiosk.filters.blendTrans.Apply();
     }


    if(document.Kiosk.complete && !pauseSlide)
      {
      imgShow = randomNum;
      if (document.all)
         {
          document.Kiosk.filters.blendTrans.Play(); 
      }
      document.Kiosk.src = my[0][imgShow];
      document.Kiosk.alt = my[1][imgShow];
      my[3][imgShow] = true;
      
      randomNum = getNewRandomKiosk(imgShow);
      }
      
    setTimeout("showRandomKiosk()", 8000);
    }
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
9/19/2006
*********************************/
function showRandomPic() 
  {
  if(document.images)
    {
    if(document.Kiosk.complete && !pauseSlide)
      {
      imgShow = randomNum;
      
      imgShow = getNewRandomKiosk(imgShow);
      
      document.Kiosk.src = my[0][imgShow];
      document.Kiosk.alt = my[1][imgShow];
      my[3][imgShow] = true;
      
      }
      
    
    }
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function showKiosk() 
  {
  if(document.images)
    {
    if(document.Kiosk.complete && !pauseSlide)
      {
      imgShow = (imgShow + 1) % imgCt
      document.Kiosk.src = my[0][imgShow];
      document.Kiosk.alt = my[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[0][imgShow];
      document.Kiosk.alt = my[1][imgShow];
      pauseSlide = true;
      }
    }
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function ResumeSlides()
  {
  pauseSlide = false;
  }
  
/*********************************
Amir Pirzadeh
Tisfoon.com
1/6/2000
*********************************/
function newLocation()
  {
  document.location.href = my[2][imgShow];
  }
  












  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()
    }
    
/********************************/
function tnOpenWindow(w, h, n) 
{
	var wf = "";	
	wf = wf + " width=" + w;
	wf = wf + ",height=" + h;
	wf = wf + ",resizable=yes";
	wf = wf + ",scrollbars=no";
	wf = wf + ",menubar=no";
	wf = wf + ",toolbar=no";
	wf = wf + ",directories=no";
	wf = wf + ",location=no";
	wf = wf + ",status=no";
   mywindow = window.open(n, n.name, wf);
   mywindow.focus(); 
}

/*************************/
function loadImage(pic) 
 {
	if (document.images) 
		document['home'].src = pic;
}

