﻿// JScript File

var slideShowSpeed = 5000
var slideShowSpeed2=4000

var Pic = new Array()
Pic[0] = 'images/home1.jpg'
Pic[1] = 'images/home2.jpg'
Pic[2] = 'images/home3.jpg'
Pic[3] = 'images/home4.jpg'
var t
var t2
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
    preLoad[i] = new Image()
    preLoad[i].src = Pic[i]
}
var logo = new Array()
logo[0]='images/fadelogos.jpg'
logo[1]='images/fadelogos2.jpg'
logo[2]='images/fadelogos3.jpg'
logo[3]='images/fadelogos4.jpg'
logo[4]='images/fadelogos5.jpg'
logo[5]='images/fadelogos6.jpg'
logo[6]='images/fadelogos7.jpg'
logo[7]='images/fadelogos8.jpg'
logo[8]='images/fadelogos9.jpg'
var pl=logo.length
var preLogo = new Array()
for (i=0; i<pl; i++) {
   preLogo[i]= new Image()
   preLogo[i].src=logo[i]
}
var j2=0
function runSlideShow(){
      if (document.all){
          document.images.SlideShow.style.filter="blendTrans(duration=2)"
          document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
          document.images.SlideShow.filters.blendTrans.Apply()
      }
      document.images.SlideShow.src = preLoad[j].src
      if (document.all){
          document.images.SlideShow.filters.blendTrans.Play()
      }
      j = j + 1
      if (j > (p-1)){
         j=0 
      }
      t = setTimeout('runSlideShow()', slideShowSpeed)
}
function runSlideShow2(){
      if (document.all){
          document.images.fadelogos.style.filter="blendTrans(duration=2)"
          document.images.fadelogos.style.filter="blendTrans(duration=crossFadeDuration)"
          document.images.fadelogos.filters.blendTrans.Apply()
      }
      document.images.fadelogos.src=preLogo[j2].src
      if (document.all){
          document.images.fadelogos.filters.blendTrans.Play()
      }
      j2=j2+1
      if (j2 >pl-1) {
         j2=0
      }
      t2 = setTimeout('runSlideShow2()', slideShowSpeed2)
}

var xmlHttp
function showBio(theName) {
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null) {
        alert("Your Browser does not support the viewing of Bio's")
        return
    }
    url=theName+".aspx"
    xmlHttp.onreadystatechange=stateChanged
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}    
function stateChanged() { 
   if (xmlHttp.readyState==4)  { 
      document.getElementById("bio").innerHTML=xmlHttp.responseText;
   }
}

function GetXmlHttpObject() {
   var xmlHttp=null;
   try  { // Firefox, Opera 8.0+, Safari
     xmlHttp=new XMLHttpRequest();
   }
   catch (e) {  // Internet Explorer
      try {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch (e) {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
   }
   return xmlHttp;
}

function updateStatus(someText) {
    window.status=someText    
    return true
}    