var Photos = Array('Yoga-Fitness.jpg','Keenager.jpg','Pilates-Fitness.jpg','Yoga-Manly.jpg','Working-Out.jpg','Keenager-class.jpg','Yoga-Moonrise.jpg','Fitness-Exercises.jpg');
var DisplayFrequency = 7;             // Number of seconds between picture updates
var curPhoto = 0;

function ShowPhotoOfTheMoment()
 {
// curPhoto = Math.floor(Math.random() * Photos.length);
// LoadPhotoOfTheMoment(curPhoto);
 LoadPhotoOfTheMoment(curPhoto);
 var IntervalID = window.setInterval("NextPhotoOfTheMoment()",DisplayFrequency*1000);
 }
 
function NextPhotoOfTheMoment()
 {
// curPhoto = Math.floor(Math.random() * Photos.length);
 if(curPhoto < (Photos.length-1))
  curPhoto++;
 else
  curPhoto = 0;
 LoadPhotoOfTheMoment(curPhoto);
 }

function LoadPhotoOfTheMoment(pointer)
 {
 if(document.layers) {
  document.layers["PhotoOfTheMoment"].src = 'images/'+Photos[pointer];
  }
 else if(document.getElementById)	{
  var obj1 = document.getElementById("PhotoOfTheMoment");
  obj1.src = 'images/'+Photos[pointer];
  }
 else if(document.all)	{
  document.all["PhotoOfTheMoment"].src = 'images/'+Photos[pointer];
  }
 }

function DrawBanner() {
  document.write('<object class="tightfit" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="316" height="104" id="Banner1" align="top">');
  document.write('<param name="allowScriptAccess" value="sameDomain" />');
  document.write('<param name="movie" value="images/Banner1.swf" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="bgcolor" value="#ffffff" />');
  document.write('<embed src="images/Banner1.swf" quality="high" bgcolor="#ffffff" width="316" height="104" name="Banner1" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  document.write('</object>');
  }

function EmailFriend(id) {
    var w,width,height,OptionString;
    width = 512;
    height = 384;
    if( navigator.appName == "Netscape" ) {
        OptionString=""
        w = window.open("EmailFriend.asp?Item="+id,"EmailFriend","scrollbars=yes");
        w.screenX = width;
        w.screenY = height;
        w.innerWidth  = width;
        w.innerHeight = height;
     }   
    else {   
        OptionString="resizable=yes, scrollbars , width="+(width)+", height="+(height);
        OptionString = OptionString+", top="+(((screen.availHeight)-(height))/2)+", left="+((screen.availWidth-(width))/2);
        w= window.open("EmailFriend.asp?Item="+id,"EmailFriend",OptionString);
     }
     w.focus();
 }

function calendarPopUp(id) {
 var w,width,height,OptionString;
 width = 250;
 height = 230;
 if( navigator.appName == "Netscape" ) {
  OptionString=""
  w = window.open("CalendarPopUp.asp?ID="+id,"CalendarPopUp","scrollbars=yes");
  w.screenX = width;
  w.screenY = height;
  w.innerWidth  = width;
  w.innerHeight = height;
  }   
 else {   
  OptionString="resizable=yes, scrollbars , width="+(width)+", height="+(height);
  OptionString = OptionString+", top="+(((screen.availHeight)-(height))/2)+", left="+((screen.availWidth-(width))/2);
  w = window.open("CalendarPopUp.asp?ID="+id,"CalendarPopUp",OptionString);
  }
 w.focus();
 }

function NewWindow(URL,URLname,width,height) {
  var w;
  if(width > screen.availWidth-60) width = screen.availWidth-60;
  if(height > screen.availHeight-80) height = screen.availHeight-80;
  if( navigator.appName == "Netscape" ) {
   OptionString=""
   w = window.open(URL,URLname,"resizable=yes, scrollbars=yes");
   w.screenX = ((screen.availWidth)-(width+33))/2;
   w.screenY = ((screen.availHeight)-(height+30))/2;
   w.innerWidth  = width+20;
   w.innerHeight = height+25;
   }   
  else {   
   OptionString="resizable=yes, scrollbars , width="+(width+38)+", height="+(height+30);
   OptionString = OptionString+", top="+(((screen.availHeight)-(height+30))/2)+", left="+((screen.availWidth-(width+33))/2);
   w = window.open(URL,URLname,OptionString);
   }
  w.focus();
 }

