﻿// JScript File

// This javascript file is responsible for processing the swap image that will change the colors of the
// apparel pictures.  Of course, this code is generic and could be used to swap the src of any image tag
// as long as a new src is given and the img tag has an ID. 

var countDownTimer = 0;
var tss;

function stopCountDown()
{
    countDownTimer = 0;    
}

function changeImageSrc_onHover(whichImage,newGraphic) 
{
    if (countDownTimer == 1)
    {        
        setTimeout("stopCountDown()", 2000);
        countDownTimer = 2;        
    }
    if (document.images && countDownTimer == 0)
    {
        document.getElementById(whichImage).src = newGraphic;    
    }
}

function changeImageSrc_onClick(whichImage,newGraphic) 
{
    if (document.images) 
    {
        document.getElementById(whichImage).src = newGraphic;
        //startCountDown();
        countDownTimer = 1;
    }
}
