<!--

//the above doc.write thing pulls in an object called "PaintMasterObj"
//this code converts PaintMasterObj to JSON
Object.toJSON(PaintMasterObj);

//check the total number of pictures available.
//subtract out picture 0, cuz I hate using 0.
//note: you must load in the picture array code in IM to do this!
var totalPictures = PaintMasterObj.PaintingArray.length - 1;

//set "thisPainting object to chosen object in PaintingArray
var thisPainting = PaintMasterObj.PaintingArray[thisPaintingNum];

//safety for the 'thisPaintingNum' and 'seriesStart' arg
if (thisPaintingNum == 0){thisPaintingNum = 1;}
if (seriesStart == 0){seriesStart = thisPaintingNum;}
if (thisPaintingNum == -1){thisPaintingNum = 1;}
if (thisPaintingNum > totalPictures){thisPaintingNum = 1;}
if (seriesStart > totalPictures){seriesStart = 1;}

//-->

