﻿// JScript File

var count= 0
var timeoutID

//
function showSlide() 
{
    if (document.slide)
    {
	    var imgs = new Array()
	    imgs[1] = new Image()
	    imgs[1].src = "slideshow/pic1.gif"
	    imgs[2] = new Image()
	    imgs[2].src = "slideshow/pic2.gif"
	    imgs[3] = new Image()
	    imgs[3].src = "slideshow/pic3.gif"
	    document.images.slide.style.filter="blendTrans(duration=2)";
	    document.images.slide.style.filter="blendTrans(duration=CrossFadeDuration)";
	    document.images.slide.filters.blendTrans.Apply();
	}

    if (document.slide)
    {
        if (count <3) {++count}
        else {count=1}
        document.slide.src = imgs[count].src
        timeoutID=setTimeout("showSlide()",5000)
        document.images.slide.filters.blendTrans.Play();
    }
}

//
if (document.images)
{
    homeon= new Image();
    homeon.src="images\\ButtonHomeWhite.gif";
    homeoff= new Image();
    homeoff.src="images\\ButtonHome.gif";

    aboutuson= new Image();
    aboutuson.src="images\\ButtonAboutUsWhite.gif";
    aboutusoff= new Image();
    aboutusoff.src="images\\ButtonAboutUs.gif";

    partsandserviceson = new Image();
    partsandserviceson.src = "images\\ButtonPartsandServicesWhite.gif";
    partsandservicesoff = new Image();
    partsandservicesoff.src = "images\\ButtonPartsandServices.gif";

    performancepartson = new Image();
    performancepartson.src = "images\\ButtonPerformancePartsWhite.gif";
    performancepartsoff = new Image();
    performancepartsoff.src = "images\\ButtonPerformanceParts.gif";

    eventson = new Image();
    eventson.src = "images\\ButtonEventsWhite.gif";
    eventsoff = new Image();
    eventsoff.src = "images\\ButtonEvents.gif";

    contactuson = new Image();
    contactuson.src = "images\\ButtonContactUsWhite.gif";
    contactusoff = new Image();
    contactusoff.src = "images\\ButtonContactUs.gif";

    pictureson = new Image();
    pictureson.src = "images\\ButtonPicturesWhite.gif";
    picturesoff = new Image();
    picturesoff.src = "images\\ButtonPictures.gif";
}

function change(imageName)
{
    if (document.images)
    {
        imageOn=eval(imageName + "on.src");
        document[imageName].src= imageOn;
    }
}

function turnoff(imageName)
{
    if (document.images)
    {
        imageOff=eval(imageName + "off.src");
        document[imageName].src= imageOff;
    }
}

// This script opens a new browser window and writes
// HTML to display an image with a title and caption
function show_photo( pFileName, pTitle, pCaption) 
{
	// specify window parameters
	photoWin = window.open( "", "photo","toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=420");

	// wrote content to window
	photoWin.document.write('<html><body><head><LINK rel="stylesheet" type="text/css" href="css/Styles.css"></head>');	
	photoWin.document.write('<BODY>');
	photoWin.document.write('<table align="center"><tr><td>');
	photoWin.document.write('<img src="' + pFileName + '"></td></tr>'); 
	photoWin.document.write('<tr><td><font Class="InfoMedium">' + pCaption + '</font></td></tr>');
	photoWin.document.write('<tr><td align="center" Class="Info"><br><br>Copyright &copy; Corner3 Garage</td></tr></table><p></body></html>');
	photoWin.document.close();
	photoWin.focus();
}