// JavaScript Document
// Ken Barrett 2009
// For Dance Expressions


var imageDB ;
// alert("Welcome to Dance Expessions") ;


// =============================================================================
// Author : Ken Barrett (www.barrettken.com)
// pre-load images to prevent display delays
function preLoadImages() { // ==================================================
  if (document.images) {
	imageDB = new Array() ;
    for(i=0 ; i < 8 ; i++) {
      imageDB[i] = new Image() ;
      imageDB[i].src = "slide_show/dancing" + i + ".jpg" ;
    }
  }
} // ===========================================================================

var index  = 0 ;

// =============================================================================
// Author : Ken Barrett (www.barrettken.com)
// Run the slide show.
function startSlideShow() { // =================================================
  if (document.getElementById && document.images) {
    if (index > 7) index = 0 ;
	document.picture.src = imageDB[index++].src ;
	setTimeout("startSlideShow()",3000) ;
  }
} // ===========================================================================

// =============================================================================
// spamless email
//function MaryanneEmail() // =====================================================
//{ 
//  if (document.getElementById)
//  { 
//    var em   = document.getElementById("eMaryanne") ;
//	    em.innerHTML = "HELLO" ;
//	/*var addy = "contactus@danceexpressions5678.com" ;
//	em.innerHTML = '<a href="mailto:' + addy +
//		           '?subject=Dancing interest">eMail Us HERE</a>' ;
//				   alert("Email " + addy) ;*/
//  }
//} // ===========================================================================

// =============================================================================
// rotate messages - Feb. 2010 - Ken Barrett
var msgArray = new Array(4) ;
msgArray[0] = "EXPRESS YOURSELF<br />THROUGH DANCE!" ;
msgArray[1] = "MAKE NEW FRIENDS!" ;
msgArray[2] = "ALL LEVELS WELCOME!" ;
msgArray[3] = "LET'S DANCE!" ;
var msgIndex = 0 ;

function rotateMessages() { // =================================================
  if (document.getElementById) {
	//  alert("called") ;
    var rotMsg = document.getElementById("message") ;
	if (msgIndex > 3) msgIndex = 0 ;
	rotMsg.innerHTML = msgArray[msgIndex++] ;
	setTimeout("rotateMessages()",3000) ;
  }
} // ===========================================================================
