function load() { 
    slideShow();
} 

function toggle(linksDivID,summaryDivID) {
    var linksDiv = document.getElementById(linksDivID);
    var summaryDiv = document.getElementById(summaryDivID);
    if (!linksDiv.state) {linksDiv.state = 'contracted';}
    divToExpand = (linksDiv.state == 'contracted')?linksDiv:summaryDiv;
    var divToHide = (linksDiv.state == 'contracted')?summaryDiv:linksDiv;
   
    divToHide.style.display = 'none';
    divToExpand.style.display = "block";
    
    linksDiv.state = (linksDiv.state == 'contracted')?'expanded':'contracted';
    
    toggleDiv = linksDiv.parentNode.getElementsByTagName("LI")[0];
    if (linksDiv.state == 'contracted') {
        toggleDiv.style.backgroundImage = "url(/david/img/arr_go.gif)";
    } else {
        toggleDiv.style.backgroundImage = "url(/david/img/arr_drop.gif)";
    }
}

function showPhotos(url,h,w) {
    screenWidth = (document.layers)? window.innerWidth:(document.documentElement)?document.documentElement.scrollWidth:document.body.scrollWidth;
    screenHeight = (document.layers)? window.innerHeight:(document.documentElement)?document.documentElement.scrollHeight:document.body.scrollHeight;
    winLeft = (screenWidth - w) / 2;
    winTop = (screenHeight - h) / 2;
    var featureString = 'width=' + w + ',height=' + h + ",top=" + winTop + ",left=" + winLeft + ",scrollbars=yes";
    popWin = window.open(url,'photoBrowser',featureString);
}

function showFlyer(imgUrl,h,w) {

    var myImg = new Image;
    myImg.src = imgUrl;
    
    var scrollTop = (document.documentElement && document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop;
    var IeScreenHeight = (document.documentElement && document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight;
    var IeScreenWidth = (document.documentElement && document.documentElement.clientWidth)?document.documentElement.clientWidth:document.body.clientWidth;
    var screenWidth = document.all?IeScreenWidth:document.documentElement.scrollWidth;
    var screenHeight = document.all?IeScreenHeight:document.documentElement.scrollHeight;  


    var winLeft = (screenWidth > w)?(screenWidth/2) - (w / 2):0;
    var winTop = (screenHeight > h)?(screenHeight/2) - (h / 2):0; 
    winTop += scrollTop/2;
    
    var wrapper = document.createElement("DIV");
    wrapper.id = "inlinePopupWrapper";  
    wrapper.style.top = winTop + "px";
    wrapper.style.left = winLeft + "px"; 
    wrapper.style.width = w + "px";
    
    pImg = document.createElement("IMG");
    pImg.src = imgUrl;

    wrapper.appendChild(pImg);
    
    
    pTxt = document.createElement("DIV");
    pTxt.innerHTML = "Click anywhere in this window to close";

    wrapper.appendChild(pTxt); 
    document.body.appendChild(wrapper);
            
    wrapper.onclick = function() {
        document.body.removeChild(this);
    }

    return false;
}
