function ChangeGolfHole(imgPath,holeNum,holeDiv,action)
{
    var curNum;

    if(document.getElementById('curNum'))
    {
        if(!(document.getElementById('curNum').value) && holeNum == 0 )
        {
            if(action == 'prev')
                document.getElementById('curNum').value = 1;
            else if(action == 'next')
                document.getElementById('curNum').value = 2;

            holeNum = document.getElementById('curNum').value;
            document.getElementById(holeDiv).src = imgPath + document.getElementById('curNum').value + ".jpg";
        }
        else if(holeNum == 0)
        {

            curNum = document.getElementById('curNum').value;

            if(curNum == 1 && action == 'prev')
                document.getElementById('curNum').value = 18;
            else if(curNum == 18 && action == 'next')
                document.getElementById('curNum').value = 1;
            else if(action == 'prev')
                document.getElementById('curNum').value = parseInt(curNum) - 1;
            else if(action == 'next')
                document.getElementById('curNum').value = parseInt(curNum) + 1;


            document.getElementById(holeDiv).src = imgPath + document.getElementById('curNum').value + ".jpg";
        }
        else
        {
            document.getElementById('curNum').value = holeNum;
            document.getElementById(holeDiv).src = imgPath + holeNum + ".jpg";
        }
        
    }       
 

}


