﻿function changePics(bigId, bigImageFileName, bigImageFileName2)
{
    var bigTargetId = document.getElementById(bigId);
    bigTargetId.src = "images/" + bigImageFileName + ".jpg";
	bigTargetId.title = bigImageFileName2;
}

function popup(url,n,w,h) {
        window.open(url,n,'width='+w+',height='+h+',resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');

} 

function changePicsOnClick(bigId, smallId, bigImageFileName)
{
    var bigTargetId = document.getElementById(bigId);
    imageLocation = "images/" + bigImageFileName + ".jpg";
        bigTargetId.src = imageLocation;

    for (i=1; i<=5; i++)
    {
        var loopId = "small"+i;
        var targetLoop2 = document.getElementById(loopId);
        targetLoop2.className = 'inactive';
    }

    var smallTarget = document.getElementById(smallId);
        smallTarget.className = 'active';

}


function changePicsOnClick3(bigId, smallId, bigImageFileName)
{
    var bigTargetId = document.getElementById(bigId);
    imageLocation = "images/" + bigImageFileName + ".jpg";
        bigTargetId.src = imageLocation;

    for (i=1; i<=3; i++)
    {
        var loopId = "small"+i;
        var targetLoop2 = document.getElementById(loopId);
        targetLoop2.className = 'inactive';
    }

    var smallTarget = document.getElementById(smallId);
        smallTarget.className = 'active';

}

function changePicsOnClick4(bigId, smallId, bigImageFileName)
{
    var bigTargetId = document.getElementById(bigId);
    imageLocation = "images/" + bigImageFileName + ".jpg";
        bigTargetId.src = imageLocation;

    for (i=1; i<=4; i++)
    {
        var loopId = "small"+i;
        var targetLoop2 = document.getElementById(loopId);
        targetLoop2.className = 'inactive';
    }

    var smallTarget = document.getElementById(smallId);
        smallTarget.className = 'active';

}

function changePicsOnClick6(bigId, smallId, bigImageFileName)
{
    var bigTargetId = document.getElementById(bigId);
    imageLocation = "images/" + bigImageFileName + ".jpg";
        bigTargetId.src = imageLocation;

    for (i=1; i<=6; i++)
    {
        var loopId = "small"+i;
        var targetLoop2 = document.getElementById(loopId);
        targetLoop2.className = 'inactive';
    }

    var smallTarget = document.getElementById(smallId);
        smallTarget.className = 'active';

}

function changePicsOnClick7(bigId, smallId, bigImageFileName)
{
    var bigTargetId = document.getElementById(bigId);
    imageLocation = "images/" + bigImageFileName + ".jpg";
        bigTargetId.src = imageLocation;

    for (i=1; i<=7; i++)
    {
        var loopId = "small"+i;
        var targetLoop2 = document.getElementById(loopId);
        targetLoop2.className = 'inactive';
    }

    var smallTarget = document.getElementById(smallId);
        smallTarget.className = 'active';

}


function changePicsOnClick8(bigId, smallId, bigImageFileName)
{
    var bigTargetId = document.getElementById(bigId);
    imageLocation = "images/" + bigImageFileName + ".jpg";
        bigTargetId.src = imageLocation;

    for (i=1; i<=8; i++)
    {
        var loopId = "small"+i;
        var targetLoop2 = document.getElementById(loopId);
        targetLoop2.className = 'inactive';
    }

    var smallTarget = document.getElementById(smallId);
        smallTarget.className = 'active';

}

function changePicsOnClick9(bigId, smallId, bigImageFileName)
{
    var bigTargetId = document.getElementById(bigId);
    imageLocation = "images/" + bigImageFileName + ".jpg";
        bigTargetId.src = imageLocation;

    for (i=1; i<=9; i++)
    {
        var loopId = "small"+i;
        var targetLoop2 = document.getElementById(loopId);
        targetLoop2.className = 'inactive';
    }

    var smallTarget = document.getElementById(smallId);
        smallTarget.className = 'active';

}


function openInOwnWindow()
{
	var targetId = document.getElementById('big');
    var imageName = "images/" + targetId.title + "p.jpg";
    window.open(imageName,'','width=440,height=560,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
}