
////////////////////////////////////////////////////////
///// open up window for membership form and links /////
////////////////////////////////////////////////////////


  var newWindow
  var posX  // posX and posY used to locate the window 
  var posY
  
  function openFormWindow(document)
   {
	newWindow = window.open(document, "", "width=600,height=400,scrollbars,toolbar,resizable") // No spaces between width and height
  }
  
 
///////////////////////////// 
///// close open window /////
/////////////////////////////
 
 
  function closeWindow()
   {
    this.close()
   }  
 
 
///////////////////////////////////////////////  
///// validate name field in survey form //////
///////////////////////////////////////////////
 

function checkSurveyField(survey)
 {
  if (survey.Name.value == "") // check for name
    {
     alert ("Please enter your name")
	 survey.Name.focus()
	 return false
    }
}


//////////////////////////////////////
/////// fade and cycle images ////////
//////////////////////////////////////


// slide show speed
var SlideShowSpeed = 5000 //var SlideShowSpeed = 5000

// fade duration
var FadeDuration = 3 

// create array of images
var CyclingImages = new Array("header/images/firstcyclingimage.jpg",
                              "header/images/secondcyclingimage.jpg", 
                              "header/images/thirdcyclingimage.jpg",
                              "header/images/fourthcyclingimage.jpg")

// timeout
var timeout

// increment image
var IncrementImage = 0

// image count
var ImageCount = CyclingImages.length

// preload images
var PreLoad = new Array() 

for (i = 0; i < ImageCount; i++) 
{
    PreLoad[i] = new Image()
    PreLoad[i].src = CyclingImages[i]
}


////////////////////////////////////////////


function FadeAndCycleImages() 
{
    if (document.all) 
    {
        // apply filter
        document.images.cyclingimage.style.filter = "blendTrans(duration=2)"
        document.images.cyclingimage.style.filter = "blendTrans(duration=FadeDuration)"
        document.images.cyclingimage.filters.blendTrans.Apply()
    }

    // get image
    document.images.cyclingimage.src = PreLoad[IncrementImage].src
    
    // filter image
    if (document.all) 
    {
        document.images.cyclingimage.filters.blendTrans.Play()
    }

    // increment image 
    IncrementImage = IncrementImage + 1
    
    // check image count
    if (IncrementImage > (ImageCount - 1)) 
    {
        // back to first image
        IncrementImage = 0
    }
    
    // timeout
    timeout = setTimeout('FadeAndCycleImages()', SlideShowSpeed)
}



