var slideShowSpeed = 7000;
var crossFadeDuration = 4;
var t;
var j = 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();
  }
  if (document.all || document.getElementById)
    document.images.SlideShow.src = preLoad[j].src;
  else
    document.FloatSlideShow.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 opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 101); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function currentOpac(id, opacEnd, millisec) { 
    //standard opacity is 100 
    var currentOpac = 100; 
     
    //if the element has an opacity set, get it 
    if(document.getElementById(id).style.opacity < 100) { 
        currentOpac = document.getElementById(id).style.opacity * 100; 
    } 

    //call for the function that changes the opacity 
    opacity(id, currentOpac, opacEnd, millisec) 
} 

var curPho = 0;


function currentOpCall(theImg, theAlignment) {

  currentOpac('MainImage', 100, 300);
}

var offsetxpoint=-2 
var offsetypoint=25 
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
var divobj = document.getElementById("ThumbImageDiv");
var thumbobj = document.getElementById("ThumbImage");

function ietruebody(){
  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(theImg){
  thumbobj.src="/photos/" + theImg + ".jpg";
  enabletip=true;
  return false;
}

function positiontip(e){
  if (enabletip){
    var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
    var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
    //Find out how close the mouse is to the corner of the window
    var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
    var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

    var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

    //if the horizontal distance isn't enough to accomodate the width of the context menu
    if (rightedge<divobj.offsetWidth)
    //move the horizontal position of the menu to the left by it's width
    divobj.style.left=ie? ietruebody().scrollLeft+event.clientX-thumbobj.offsetWidth+"px" : window.pageXOffset+e.clientX-thumbobj.offsetWidth+"px"
    else if (curX<leftedge)
    divobj.style.left="5px"
    else
    //position the horizontal position of the menu where the mouse is positioned
    divobj.style.left=curX+offsetxpoint+"px"

    //same concept with the vertical position
    if (bottomedge<thumbobj.offsetHeight)
    divobj.style.top=ie? ietruebody().scrollTop+event.clientY-thumbobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-thumbobj.offsetHeight-offsetypoint+"px"
    else
    divobj.style.top=curY+offsetypoint+"px"
    divobj.style.visibility="visible"
  }
}

function HideThumb(){
  enabletip=false
  divobj.style.visibility="hidden"
  divobj.style.left="-1000px"
  document.getElementById('ThumbImage').src = "/images/spacer.gif";
}

document.onmousemove=positiontip;








      