/*******************************
   Home Page
*******************************/

myPix = new Array(
  "images/barg.jpg",
  "images/joojeh.jpg",
  "images/kubideh.jpg",
  "images/sultani.jpg");
  
myAlt = new Array(
  "Chelo Kabob Barg: Top Choice beef",
  "Joojeh Kabob: Chicken Breast",
  "Chelo Kabob Kubideh: Ground Beef",
  "Chelo Kabob Sultani: Combination");
  
myURL = new Array(
  "dinner.htm",
  "dinner.htm",
  "dinner.htm",
  "dinner.htm");
  
myVisits = new Array(
  false,
  false,
  false,
  false);
  
/*******************************
   About Us
*******************************/

myPix2 = new Array(
  "images/afsy.jpg",
  "images/family.jpg",
  "images/parvaneh.jpg",
  "images/shahriar.jpg",
  "images/amir.jpg",
  "images/mohsen.jpg");
  
myAlt2 = new Array(
  "Afsaneh",
  "The Family",
  "Parvaneh",
  "Shahriar",
  "Amir & Marta",
  "Mohsen");
  
myURL2 = new Array(
  "dinner.htm",
  "dinner.htm",
  "dinner.htm",
  "dinner.htm",
  "dinner.htm",
  "dinner.htm");
  
myVisits2 = new Array(
  false,
  false,
  false,
  false,
  false,
  false)

my = new Array(myPix, myAlt, myURL, myVisits);
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 == 2)
    {
    my = new Array(myPix2, myAlt2, myURL2, myVisits2);
    imgCt = my[0].length; 
    }
    
  
  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.Kiosk.complete && !pauseSlide)
      {
      imgShow = randomNum;
      
      document.Kiosk.src = my[0][imgShow];
      document.Kiosk.alt = my[1][imgShow];
      my[3][imgShow] = true;
      
      randomNum = getNewRandomKiosk(imgShow);
      }
      
    setTimeout("showRandomKiosk()", 3000);
    }
  }
  
/*********************************
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.getFullYear();
    
    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()
    }
    



