﻿// Slide show images
var images = new Array();

images[0] = "images/100_0161_small.jpg";
images[1] = "images/100_0159_small.jpg";
images[2] = "images/waiting_room.jpg";
images[3] = "images/reception.jpg";
images[4] = "images/dentist_chair.jpg";
images[5] = "images/lab.jpg";

var sleepTime = 4000;   //milliseconds

var index = 0;

// Increments the images slideshow to the next image.
function nextImage()
{
    var slide = document.getElementById("slide");
    
    if(slide != null)
    {
        if(index < images.length)
        {
            slide.src = images[index];
            
            index++;
        }
        else
        {
            index = 0;
        }
    }
    
    setTimeout("nextImage()",sleepTime);
}

// Start slide show on load
setTimeout("nextImage()",sleepTime);



// Used for View Map popup
function popup(mylink, windowname)
{
    if (!window.focus)
    {
        return true;
    }
       
    var href;
    
    if (typeof(mylink) == 'string')
    {
        href = mylink;
    }
    else
    {
        href = mylink.href;
    }
        
    var width = screen.width - (screen.width / 8);   
    var height = screen.height - (screen.height / 8); 
    var left = (screen.width  - width) / 2; 
    var top = (screen.height - height) / 2;
    
    var params = 'width=' + width + ', height=' + height + 
                 ', top=' + top + ', left=' + left + 
                 ', resizable=yes, scrollbars=yes, status=yes';

    var newwin = window.open(href, windowname, params);

    if (window.focus) 
    {
        newwin.focus();
    }

    return false;
}
