var PAINTING_CURRENT_KEY = "currentPainting";
var PAINTING_EXPIRATION_WEEKS = 52;
var PAINTING_DISTANT_FUTURE = new Date((new Date()).getTime() + PAINTING_EXPIRATION_WEEKS * 7 * 24 * 60 * 60 * 1000);

var PRODUCT_AVAILABILITY_IN_STOCK = "In Stock";
var PRODUCT_AVAILABILITY_NOT_AVAILABLE = "Not Yet Available";

var PRODUCT_TYPE_GICLEE = "Gicl&eacute;e";
var PRODUCT_TYPE_LITHOGRAPH = "Lithograph";

var PAINTING_THUMBNAIL_ROWS = 2;
var PAINTING_THUMBNAIL_COLUMNS = 3;

var DEFAULT_PAINTING_PAGE = "painting.html";
var DEFAULT_SUBMIT_COMMENT_PAGE = "submitAComment.html";

var paintingSet = null;

var productSet = null;

/*-- Start PaintingSet -------------------------------------------------------------------------*/

function PaintingSet()
{
	var paintings = new Array();	
	var count = 0;

	//
	// Merlin's Oak
	//
	paintings[count] = new Painting(count++,
									"merlinsOak",
									"Merlin's Oak",
									"45\" x 28\"",
									"November 24, 1997",
									new Array(
											new PaintingComment(
													"Stephanie & David",
													"Colorado Springs, CO, U.S.A",
													"Magnificent!!!!",
													"This piece is the very definition of magnificence. Not only am I a HUGE fan of Myles Pinkney's artwork, but I regard him as the absolute best fantasy artist that exists today. Viewing his work online is no comparison to the real thing. The crisp, detailed and flawless beauty can only be appreciated in person."
											),
											new PaintingComment(
													"WI77ARD",
													"Southern Cal, USA",
													"Breathtaking",
													"We have had our print of Merlin's Oak hanging in our living room for about two years now.  What we have been enjoying lately is watching our friends as they stand in front of it making discoveries and speculating on who the girl might be.  It is a pleasure to have artwork that is so engaging and beautiful."
											),
											new PaintingComment(
													"Ricky D. Thorpe",
													"Adelaide, South Australia",
													"Mysterious",
													"This painting challenges my interpretive power and has multiple dimensions to its radiant face. It is a very beautiful piece, I believe it to be Pinkney's finest work. I love this and when I buy it, I will be a happy chappy."
											),
											new PaintingComment(
													"FireDragon",
													"Surrey, B.C., Canada",
													"Amazing",
													"This picture is amazing. It is so beautiful. It must have taken you ages because of all the detail that was put into it. You must love mystery and fantasy because you have put a lot of love into these paintings. Wow!"
											),
											new PaintingComment(
													"enelrad",
													"Maple Ridge, BC, Canada",
													"Breathtaking",
													"What can one really say except to thank you for keeping the magic alive. I have believed in dragons, magicians and magical lands for as long as I can remember. You make it all the more believable. I am now in my sixties and can only say, \"Wow!!! Why weren't you around when I was younger?\" Thank you, thank you, thank you!!!"
											)
										)
									);	
	//
	// The Wizard King
	//
	paintings[count] = new Painting(count++,
									"wizardKing",
									"The Wizard King",
									"24\" x 30\"",
									"September 2, 1997",
									new Array(
											new PaintingComment(
												"Jist",
												"Melbourne, Victoria, Australia",
												"A Fan of Yours",
												"This is, i think, the best painting you have ever created, it has multiple meanings like yin-yan; without the calm, mystic wizard the bold powerful dragon is nothing and also another meaning is that everything no matter how big and violent can be tamed. This painting is big and bold and strong as well as soft and subtle depending on how you look at it. I also like how you always put your symbol somewhere within your painting."
											),
											new PaintingComment(
												"Quarren",
												"Asheboro, North Carolina, USA",
												"Powerful and Enchanting",
												"This is probably my favorite out of Mr. Pinkney’s works.  The title \"The Wizard King\" clearly implies that the depicted wizard is one of tremendous stature and power.  That said, the actual painting relays this message in an interesting way, not by focusing on the wizard himself, but his surroundings.  A marble platform floating on a torrent of lava that seems to just drop out into space.  The combination of these elements, and the fact that they do not seem to bother him, represents some incredible skill with magic.  Also, the circular light formation just behind the wizard seems to be part of his throne, yet another detail that shows his command over the universe.  The gold dragon (I think it’s gold but really up to your imagination) sits behind him serving as a friend or guardian, presumably the former as it is doubtful a wizard of such power would have need of the latter.  As for the wizard, his enormous beard (comparable to a lion’s mane) is a symbol of his age! and position.  His staff seems to be an intricate weaving of some arcane metal (again it’s up to your imagination) perhaps illustrating the complexity of magic.  Overall, this painting is crisp and creative."
											),
											new PaintingComment(
												"J",
												"APortland, Oregon, USA",
												"Comment",
												"I really love the detail within this painting is just amazing, just like all of your other work...good characteristics. Looks like you put your heart to work when you do your drawings. Keep it up."
											)
										)
									);
	//
	// The Astronomer
	//
	paintings[count] = new Painting(count++,
									"astronomer",
									"The Astronomer",
									"42\" x 28\"",
									"2001 (Revised Edition)<br />February 16, 1995 (First Edition)",
									new Array(
											new PaintingComment(
													"Jenny",
													"Hobart, Tasmania, AUSTRALIA",
													"Mesmerising and Magical",
													"I bought a framed copy of \"Merlin\" (I used to call him Copernicus but decided that was too rooted in reality to suit him) in the late 90s.  My copy is 90cm x 60cm and the colours are so intense and gorgeous, and the content so engrossing, that I had to hang it at the foot of my bed so I could gaze at it in comfort!  And the perfect musical accompaniment is the wild and stormy \"In The House of the Mountain King\" from the Peer Gynt Suite."
											),
											new PaintingComment(
													"saorsa",
													"Ellicott City, MD, USA",
													"Puzzle",
													"I found a jigsaw puzzle of your painting on Ebay.  It was unavailable elsewhere.  I was charmed by the mix of fantasy and science, and the search for truth, in the painting."
											),
											new PaintingComment(
												"WI77ARD",
												"Southern Cal, USA",
												"Comment",
												"I have seen this as a puzzle, but I am not really a puzzle person.  I would really like to see the details of this artwork in a print like Merlin's Oak.  I am fascinated by the telescope and other paraphernalia in the wizard's observatory and want to see it up close."
											)
										)
									);
	//
	// Christmas Presence
	//
	paintings[count] = new Painting(count++,
									"christmasPresence",
									"Christmas Presence",
									"23\" x 27\"",
									"May 5, 1997",
									new Array(
											new PaintingComment(
													"CDover",
													"St. Louis, MO, USA",
													"Comment",
													"I purchased this print about 5 years ago and everyone who looks at is amazed at the details.  It is truly a work of art.  I collect Christmas themed pictures and this is by far the most elaborate I have seen to date.  There are more expensive prints and paintings but none quite compare.  Framed and matted this print is timeless and elegant and gets reactions from everyone who looks at it.  A truly wonderful piece by a truly gifted artist."
											),
											new PaintingComment(
													"Santa Tom Myers",
													"Valley of the Sun, Phoenix, AZ, USA",
													"Comment",
													"I find the detail in this Santa extraordinary.  Myles has put the Haddon Sundbloom Coca-Cola Santa image out to pasture with this image.  Only wish I could have a Santa suit like this one in my closet! Ho Ho Ho!"
											),
											new PaintingComment(
													"Adrian Hughes",
													"Wales, UK",
													"Myles the Gentleman",
													"I was in correspondence with Myles via email some years ago, and being the very decent guy he is, he sent my children two signed copies of his Christmas Presence posters and a 2004 signed calender. The children are now 11 and 6 and put up the framed posters every Christmas as decorations and boast to school friends about the prints. Thanks Myles. Christmas is still special with these prints."
											),
											new PaintingComment(
													"Santa Tom Myers",
													"Phoenix, AZ, USA",
													"Comment",
													"This is an amazing depiction of Santa and is my favorite depiction of the jolly old elf.  I believe Myles should supplant the Haddon Sundblom Coca-Cola Santa's with his vision of Santa Claus.  I bought a life size standee made from this print and keep it up in my living room all year long to inspire me."
											),
											new PaintingComment(
													"Sarah",
													"Oregon",
													"Charming Contradictions",
													"I like Christmas Presence better every time I look at it. I have not yet taken it to be framed, so it is sort of a ceremony unrolling it and spreading it out on the dining room table. It is so full of charming contradictions . . . every grownup's vision of what Christmas should be for their children, but never in anyone's actual memory. An ultra realistic technique of a fantastic scene masquerading as a realistic scene. Santa in loving heavy detail, but, I swear, floating a couple inches above the carpet. That gives it a magical element. Its irony is all wrapped up in real maple syrup. All the wretched overblown excesses of American Christmas and with an almost straight face. And a Santa who lets us in on the secret."
													),
											new PaintingComment(
													"Debby",
													"San Francisco",
													"Incredible",
													"Magnificent!!!!!!!!!! I just wanted to relay that I have never seen such a beautiful rendition of Santa Claus! The detail is incredible all the way down to his elf ear!!!!!!!!!! I just finished doing the puzzle and it just kept improving continually! My fiance and his father helped me complete the puzzle. They comented on what a beautiful and colorful picture it was. I bought a beautiful gold frame and it looks stupendous!!!!!!!!!!!!!!!!!!  Yes, I am eventually going to buy some prints! Myles you are talented beyond belief and I am glad you are using your God given talent and sharing it with the world! You bring such joy to my life just gazing on your work! Thanks for all you do and share!"
											)
										)
									);
	
	//
	// Dragonmaster
	//
	paintings[count] = new Painting(count++,
									"dragonmaster",
									"Dragonmaster",
									"26\" x 48\"",
									"August 7, 1994",		
									new Array(
											new PaintingComment(
													"Marc",
													"Denver, CO",
													"Powerful",
													"This painting is awe inspiring. The details are definitely a work of art. Magic dust, flames, smoke and fire are all present as the dragon seemingly resists. The Wizard stands on marble and his flowing robes are purely magical and colorful---belonging only to a Wizard. I have two Myles' Wizards and they are absolutely fabulous. I thought The Dragonmaster was available at one time as a statue, but have not been able to find it. I love these works!"
											),
											new PaintingComment(
													"spiderflight",
													"Austin, TX, USA",
													"Puzzle Lover",
													"I have \"The Astronomer\" puzzle and just love it. For someone who loves to build puzzles and then keep them for display, this one was the kicker to send me looking for more artwork by Myles Pinkney! Just gotta find this picture (Dragonmaster) to complete my collection."
											)
										)
									);
	
	//
	// Santa's Sleigh
	//
	paintings[count] = new Painting(count++,
									"santasSleigh",
									"Santa's Sleigh",
									"23\" x 27\"",
									"2000",
									null
									);
	
	//
	// Babylon
	//
	paintings[count] = new Painting(count++,
									"babylon",
									"Babylon",
									"13\" x 23\"",
									"1991",
									new Array(
											new PaintingComment(
													"Melissa",
													"Indio, CA, USA",
													"What a Beauty",
													"I'm a fan of mystical art, a collector of dragons and wizards. I first came across a Myles Pinkney calendar and honestly I was captivated by the beauty and detail of his work. Every picture I've seen gets me. Every detail as if he were there at that time. A beauty. This is my favorite piece."
											),
											new PaintingComment(
													"Weird",
													"Johnstown, Pennsylvania, USA",
													"Detail",
													"I love any work by Myles Pinkney, but this is just so magnificent! It stands out from all the rest by leaps and bounds. Also, it gives true meaning to that famous quote of Shakespeare's, \"A rose by any other name would smell just as sweet.\""
											),
											new PaintingComment(
													"RebeccaDeWinter",
													"Lowell, MA, USA",
													"My counterpart",
													"It's great, I don't know whether to hang it, tattoo it.  Has been a long wait, but all these new prints are terrific."
											),
											new PaintingComment(
													"Jackie",
													"Corpus Christi, Texas, USA",
													"Gorgeous",
													"This picture is Gorgeous! I love it! It's breath-taking. I love it."
											)
									)
							);
	//
	// Medusa
	//
	paintings[count] = new Painting(count++,
									"medusa",
									"Medusa",
									"13\" x 23\"",
									"September 22, 1999",
									null
							);

	//
	// Moon Magic
	//
	paintings[count] = new Painting(count++,
									"moonMagic",
									"Moon Magic",
									"28&frac12;\" x 48\"",
									"August 17, 1994",
									new Array(
											new PaintingComment(
													"Anonymous",
													"Woodland, California, USA",
													"Amazed",
													"It is the most beautiful thing I have ever seen!!! I love it SSOOOOO much!! It looks so magicial!!!!"
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"She is in complete control of her world. She is unafraid of any winds of change in her life, and her confidence is what keeps her safe from the depths of the waters she rules."
											)
									)
							);

	//
	// Dragon Mountain
	//
	paintings[count] = new Painting(count++,
									"dragonMountain",
									"Dragon Mountain",
									"24\" x 30\"",
									"August, 1998",
									null
							);

	//
	// Conveyor
	//
	paintings[count] = new Painting(count++,
									"conveyor",
									"Conveyor",
									"20\" x 26\"",
									"1998",
									new Array(
											new PaintingComment(
												"Myles Pinkney Fan",
												"Texas",
												"I.Q.",
												"Whenever I look at Mr. Pinkney's artwork, I feel that I am looking at something beautiful and taking an I.Q. test at the same time. So here we have enormous mechanical dragons on an assembly line. I am pleased that they are not the ubiquitous chrome monstrosities that pass for robots elsewhere, but shiver when I consider what their purpose might be."
											)
									)
							);

	//
	// Treasure Dragon
	//
	paintings[count] = new Painting(count++,
									"treasureDragon",
									"Treasure Dragon",
									"19&frac12;\" x 25\"",
									"August 20, 1996 (First Edition)<br />October, 2002 (Revised Edition)",
									new Array(
											new PaintingComment(
													"Aries",
													"Studio City, CA, USA",
													"Comment",
													"I have never seen an image capture the perfect smile of these beautiful creatures.  Clever, proud, sweet, yet bold.  The 'Treasure Dragon' is without a doubt, a masterpiece!"
											),
											new PaintingComment(
													"Oma",
													"Vancouver, Canada",
													"Satisfaction",
													"I see one perfectly satisfied dragon wondering if there was anything he really wanted or needed.  He's a kind dragon, you can see that in his eye, albeit a bit arrogant, but then who wouldn't be with such a treasure?"
											)
									)
							);

	//
	// Dragon's Eye
	//
	paintings[count] = new Painting(count++,
									"dragonsEye",
									"Dragon's Eye",
									"24\" x 30\"",
									"1998",
									new Array(
											new PaintingComment(
													"Chrissie Keelan",
													"England",
													"Comment",
													"Just wanted to say how much I have just enjoyed browsing through your online gallery.  Your artwork is absolutely stunning! It is wonderful to be able to browse and enjoy :)  Thank you so much."
											)
									)
							);

	//
	// Gandalf at Bag End
	//
	paintings[count] = new Painting(count++,
									"gandalfAtBagEnd",
									"Gandalf at Bag End",
									"28\" x 24\"",
									"April 15, 1991 (First Edition)<br />June 1, 1994 (Revised Edition)",
									new Array(
											new PaintingComment(
													"Jen",
													"Pennsylvania, USA",
													"Love this print",
													"I was so happy to receive this print for Christmas.  It truly captures the feeling of Gandalf from the LOTR books - regal, mysterious, knowing.  And I love the imagery in the smoke, as Gandalf was always the expert at creating interesting formations in his smoke trails.  A long time fan, I'm hoping to collect several more prints!"
											)
									)
							);

	//
	// Magic
	//
	paintings[count] = new Painting(count++,
									"magic",
									"Magic",
									"24\" x 30\"",
									"September, 1999",
									new Array(
											new PaintingComment(
													"Sarah",
													"Belgium",
													"AMAZING",
													"This painting is AMAZING, I'm a huge fan of the the fantasy world! I'm doing my IGCSE art and this is one of the pictures which I mention in my coursework. It's so beautiful, I love the idea and the media of it, the colours are mind blowing, this is truly a piece of art worth your time! I only wish I could draw something as amazing as this! :D"
											)
									)
							);

	//
	// Access
	//
	paintings[count] = new Painting(count++,
									"access",
									"Access",
									"24&frac34;\" x 32\"",
									"1988",
									null
							);

	//
	// Dragon's Fire
	//
	paintings[count] = new Painting(count++,
									"dragonsFire",
									"Dragon's Fire",
									"24\" x 30\"",
									"September, 1999",
									new Array(
											new PaintingComment(
													"twen",
													"Rena, Norway",
													"Comment",
													"I have always loved this painting! From the first time I saw it..."
											)
									)
							);

	//
	// The Bridge
	//
	paintings[count] = new Painting(count++,
									"bridge",
									"The Bridge",
									"20\" x 26\"",
									"March 3, 1998",
									new Array(
											new PaintingComment(
													"Midge",
													"Lowell, MA, USA",
													"The only way to heaven is through hell",
													"As soon as I saw this painting, I thought this is a visual of my thoughts. This is hell, if I can make it through, the other world is heaven. This is just an endurance test, I savor the thoughts of the next real world."
											),
											new PaintingComment(
													"RebeccaDeWinter",
													"Lowell, MA, USA",
													"Keeps getting better",
													"What a mind you have, I want them all.  Enough of sorting to find right ones, I want it all."
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"You must go through hell to get to the bridge that you hope will take you to heaven, although it is unknown to you for sure what that will be - you must use your faith to get through the flames in order to experience that which is only a hope."
											)
									)
							);

	//
	// The Knight
	//
	paintings[count] = new Painting(count,
									"knight",
									"The Knight",
									"17&frac12;\" x 58\"",
									"1990",
									new Array(
											new PaintingComment(
													"Marcio Becate",
													"Minas Gerais, Brazil",
													"Beautifull!!!",
													"Uma bela pintura de um cavaleiro triunfante sobre um caminho tortuoso...... Fantástico! It's a Masterpiece!!!"
											)
									)
							);
	paintings[count].setPaintingPage("painting_high.html");
	paintings[count].setSubmitCommentPage("submitAComment_high.html");
	count++;

	//
	// Dragonlands
	//
	paintings[count] = new Painting(count++,
									"dragonlands",
									"Dragonlands",
									"45&frac12;\" x 15&frac12;\"",
									"August 6, 1995",
									null
							);

	//
	// Veils
	//
	paintings[count] = new Painting(count++,
									"veils",
									"Veils",
									"40\" x 30\"",
									"January, 1979",
									new Array(
											new PaintingComment(
													"Christina Coley",
													"Illinois, USA",
													"Sky's Dream",
													"I like this picture.  I looks like she is dressing up the night sky with stars."
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"An Interpretation",
													"A girl as she sees herself in her dreams; the freedom to just 'be.' Floating and dancing without the hindrance of gravity or its constraints. Its simplistic beauty sets it apart and frames it with much grace, entwined with wild imaginings."
											),
											new PaintingComment(
													"Albert Gazeley",
													"Sometimes UK, Sometimes HK",
													"Euphoria",
													"I am retired and poetry is a very serious hobby of mine - I love everything to do with Fairies and Fantasia. I can hear Clair De Lune . . . playing in the background. An amazing painting full of love life and imitation."
											),
											new PaintingComment(
													"Kavita Prashar",
													"West Bromwich, England, United Kingdom",
													"Comment",
													"I think that the painting is good. I like the colours and the combination on the painting. I would like to know more about this painting, e.g. does it mean something, when did you draw it, why did you?"
											)
									)
							);

	//
	// The Elder
	//
	paintings[count] = new Painting(count++,
									"elder",
									"The Elder",
									"28&frac12;\" x 48\"",
									"March 2, 1994 (First Edition)<br />October 2, 2002 (Revised Edition)",
									null
							);

	//
	// Space Cruisers
	//
	paintings[count] = new Painting(count++,
									"spaceCruisers",
									"Space Cruisers",
									"36\" x 24\"",
									"August 17, 1996",
									null
							);

	//
	// Nebula
	//
	paintings[count] = new Painting(count++,
									"nebula",
									"Nebula",
									"18\" x 24\"",
									"1983",
									null
							);

	//
	// Copernicus
	//
	paintings[count] = new Painting(count++,
									"copernicus",
									"Copernicus",
									"48\" x 36\"",
									"1988",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"The perspective just on the floor tile is unbelievable! I like the faint outline of arches in the sky. Of all the planets, one of them is a bubble! That is very cool."
											)
									)
							);

	//
	// The Fleet
	//
	paintings[count] = new Painting(count++,
									"fleet",
									"The Fleet",
									"16\" x 16\"",
									"September, 1999",
									null
							);

	//
	// Moon Dragon
	//
	paintings[count] = new Painting(count++,
									"moonDragon",
									"Moon Dragon",
									"18&frac12;\" x 28\"",
									"October 9, 2002",
									new Array(
											new PaintingComment(
													"twen",
													"Rena, Norway",
													"Comment",
													"Really beautiful painting! And a beautiful setting as well."
											)
									)
							);

	//
	// Starflight
	//
	paintings[count] = new Painting(count++,
									"starflight",
									"Starflight",
									"20\" x 24\"",
									"August 29, 1998",
									null
							);

	//
	// The Archway
	//
	paintings[count] = new Painting(count++,
									"archway",
									"The Archway",
									"20\" x 26\"",
									"September 2, 1997",
									new Array(
											new PaintingComment(
													"Myles Pinkney Fan",
													"Texas",
													"Classic!",
													"Here is a painting that manages to capture the spirit of pulp science fiction from the 1950's while being completely modern at the same time. I imagine the space ship is quite well appointed. And how can you not love the big purple planet with the physics-defying rings?"
											)
									)
							);

	//
	// Coincidence
	//
	paintings[count] = new Painting(count++,
									"coincidence",
									"Coincidence",
									"10&frac12;\" x 15\"",
									"November 26, 1990",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"An alternate universe has a similar product to ours! Wonder why it is a Coke and not a Pepsi?? Seems to be just as thirst quenching, nonetheless."
											)
									)
							);

	//
	// Brainstorm
	//
	paintings[count] = new Painting(count++,
									"brainstorm",
									"Brainstorm",
									"24\" x 30\"",
									"1989",
									new Array(
											new PaintingComment(
													"Colen Garoutte-Carson",
													"Kirkland, WA",
													"I See an Angel",
													"I see an angel, whose soft face is within the bulb/head, surrounded by an aura or electrical field.  I see this representing the divine nature of the mind of man, for which the body is technology.  Through the technology of the body, the spirit is gaining wisdom."
													),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"An interesting way to depict an 'idea'. I see faint sound waves happening in the background sky. I like the detail in his herringbone jacket, and patches of tweed throughout the sky as well. A man known for his 'clear' thinking indeed!!"
											)
									)
							);

	//
	// The Wizard
	//
	paintings[count] = new Painting(count++,
									"wizard",
									"The Wizard",
									"28\" x 42\"",
									"September 1, 1992",
									new Array(
											new PaintingComment(
													"Rosby",
													"Reno, NV, USA",
													"Truly Inspirational",
													"I first saw this artwork upon a Mountain t-shirt and it immediately became my favorite.  I have several, keeping one that I've never worn as a piece of art.  You are quite a talent.  Thank you for such truly inspirational work."
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"An Interpretation",
													"One of my personal favorites. I love the arch in the background, the floating podium, the magic glowing stone that is entwined in the staff, the firebird in his hand, the iridescent robes that change with the light."
											)
									)
							);

	//
	// Earth & Fire
	//
	paintings[count] = new Painting(count++,
									"earthAndFire",
									"Earth &amp; Fire",
									"11&frac12;\" x 15\"",
									"September 2, 1997",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"Only a Wizard could walk on this hot-crusted earth. I love the bright sunset sky with a jetstream of sorts. Could it be that the dragon had freshly annihilated the ground just ahead of where the Wizard walks? The ravens don’t seem to care."
											)
									)
							);

	//
	// The Alchemist
	//
	paintings[count] = new Painting(count++,
									"alchemist",
									"The Alchemist",
									"28\" x 42\"",
									"October, 1993",
									new Array(
											new PaintingComment(
													"Skyler J.",
													"Minnesota, USA",
													"This is most likely my favorite painting",
													"First time I saw it, I was amazed simply at how meticulous it was. I thought to myself \"I need to find this artist\". Every time I look at it, I find something in it that I had not noticed before."
													),
											new PaintingComment(
													"Jamie W",
													"Canberra, Australia",
													"I have this picture",
													"I have had \"The Alchemist\" as a poster now for over 10 years and I still stare at it for some time  noticing, from time to time, things that my eye had not captured before. Unfortunately the poster is a little tattered after moving from house to house, and from wall to wall. I am currently searching for the same poster again and if hopefully I am fortunate to locate another, it will certainly be going in a lovely timber frame! I like the idea of the lizard and the bat’s wing being used as bookmarks, and on the bottom right-hand side there seems to be what looks like a dragon’s tail coming into the picture. As I am writing this very comment, I had another quick look at the poster and noticed a playing card with the spade symbol on it. So there you go - after more than a decade I am still finding things in this wonderful work of art!"
													),
											new PaintingComment(
													"Ashley Taylor-senn",
													"Fort Collins, Colorado, USA",
													"Comment",
													"What I like about your painting and what gives it beauty is its color and its mysterious effect. I am 14 years old and I'd love to paint like that."
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"A floating candle, the wick is becoming very long. Love the swirls of smoke coming off of it. It looks like the outline of a hat just above that candle. The fire on the ring looks like a dragon, and a little flame elf dances before him. The old man looks quite engrossed in his work. The pages of the closed book at the bottom of the stack are quite ornate. Lots of strange little items, bottles and jars adorn this desktop."
											),
											new PaintingComment(
													"Justin Keith",
													"Boston, MA, USA",
													"!",
													"This is the best work he has ever done and I'm not shunning his other work by any means. I could stare at any of his painting for hours and always find new things. The more detail, the better."
											),
											new PaintingComment(
													"Hayley",
													"Tasmania",
													"It's awesome!",
													"I saw this picture hanging in my friend's loungeroom years ago. I thought it was absolutely beautiful and i have been trying to find it ever since my friend moved away. This is my favourite of Myles Pinkney's gallery. The detail and colour and magical essence in this picture has been inspiring to me as i am really into art and am looking at starting some work on magic and enchantment. It is possibly the best piece of artwork i've come across. I really want to know where i can find a poster size copy of it for myself!"
											)
									)
							);

	//
	// Timekeeper
	//
	paintings[count] = new Painting(count++,
									"timekeeper",
									"Timekeeper",
									"30\" x 36\"",
									"(Unfinished)",
									new Array(
											new PaintingComment(
													"Arron Pinkney",
													"Charlotte, NC",
													"The Best Depiction of Father Time",
													"There are no words to describe this image; because that's what it is, an image. It's far more accurate than any painting or drawing. You can see how ageless he is in his eyes and beard to a tee. The Ancient Alignment of Time above his head looks like something only he knows how to tell, thus making him the ultimate Time Keeper!"
											),
											new PaintingComment(
													"DQueenheids77",
													"Australia",
													"stunning in metal!",
													"this image is amazing. the detail is quite well rendered and the metallic theme is quite striking. has anyone thought to approach you to make this into a metal engraving of some kind? i think it would add a new dimension! love it!"
											)
									)
							);

	//
	// Star Chasers
	//
	paintings[count] = new Painting(count++,
									"starChasers",
									"Star Chasers",
									"20&frac34;\" x 28\"",
									"August 20, 1996",
									new Array(
											new PaintingComment(
													"twen",
													"Rena, Norway",
													"Comment",
													"This is such a beautiful setting, this painting always gives me a good fantasy-feeling! I wish I was the one in the balloon.... The calendar-version of this hangs on my bedroom wall!"
											),
											new PaintingComment(
													"Mizz Kitty",
													"Chandler, Arizona, USA",
													"love it",
													"I used to have the puzzle of this picture, a long time ago. Back then I decided that if I ever have the money that I would get this picture tattooed on my back. 10 years and 2 kids later, I am finally able to afford it. When it is complete I would like to submit it to someone affiliated with Mr. Pinkney so that he and his family could see how much people like me appreciate his hard work and talent. Thank You for your vision, it helps us all to see."
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"That’s quite a spectacular harness that adorns the neck of this dragon! The friendly ever-present triple ravens are here again. Another fancy jet stream decorates the sky. Beautiful sunset over the mountains of fire, a little molten river flows below. Dragon seems quite content to pull his basket of master along."
											)
									)
							);

	//
	// Ephesians VI
	//
	paintings[count] = new Painting(count++,
									"ephesiansVI",
									"Ephesians VI",
									"20\" x 26\"",
									"1993",
									null
							);

	//
	// The Tinker
	//
	paintings[count] = new Painting(count++,
									"tinker",
									"The Tinker",
									"14&frac14;\" x 18&frac12;\"",
									"February 14, 1991",
									new Array(
											new PaintingComment(
													"digitalgrey",
													"Ireland",
													"Tinker",
													"I love the slightly darker direction of this one of Myles's master works."
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"I can definitely see the mathematician in this wizard. Compasses, tools, a plumb line perhaps? Is that a syringe in his right hand that he maybe attempts to inject something useful and good into our corrupt world?"
											)
									)
							);

	//
	// Matthew VII
	//
	paintings[count] = new Painting(count++,
									"matthewVII",
									"Matthew VII",
									"20\" x 26\"",
									"January, 1992",
									new Array(
											new PaintingComment(
													"Lillian",
													"Australia",
													"Comment",
													"What can I say!! This is by far my most favourite Myles Pinkney artwork! It's absolutely breathtaking! Now I'm going to have to try and find a print to hang on my wall!"
											),
											new PaintingComment(
													"Ben",
													"Wallingford, Connecticut, USA",
													"Wow",
													"I also have been looking for this for a long time. It's a great piece. Thanks for putting it up."
											),
											new PaintingComment(
													"Anonymous",
													"Danville, PA, USA",
													"Finally located!",
													"I too have been hoping to find this picture that my son took from his Breakaway magazine many years ago to hang on his bedroom wall. He's married & moved on, but I still study the picture often."
											),
											new PaintingComment(
													"AZTROY",
													"Phoenix, AZ, USA",
													"Comment",
													"I have been waiting for this for over 10 years to reappear.  Never a more stunning depiction of the choice that awaits each of us as we travel through this life.  THANK YOU for releasing again!"
											),
											new PaintingComment(
													"AZTROY",
													"Gilbert, AZ, USA",
													"I finally got mine",
													"I waited for many years to find and then actually purchase this piece.  My wife gave this to me for my birthday this year.  A fantastic birthday gift!"
											)
									)
							);

	//
	// The Ambassador
	//
	paintings[count] = new Painting(count++,
									"ambassador",
									"The Ambassador",
									"28\" x 36\"",
									"1989",
									null
							);

	//
	// The Green Knight
	//
	paintings[count] = new Painting(count++,
									"greenKnight",
									"The Green Knight",
									"19 7/8\" x 19&frac12;\"",
									"July, 2002",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"This one just looks like you were having fun when you painted it."
											)
									)
							);

	//
	// Dragon Nebula
	//
	paintings[count] = new Painting(count++,
									"dragonNebula",
									"Dragon Nebula",
									"32\" x 24\"",
									"July 17, 1988",
									null
							);

	//
	// Idle Worship
	//
	paintings[count] = new Painting(count++,
									"idleWorship",
									"Idle Worship",
									"16&frac12;\" x 11&frac12;\"",
									"October 13, 1993",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"This is one I don’t recall ever having seen before. 'They worship the image of the beast.' Kinda gives me chills."
											)
									)
							);

	//
	// Spellbound
	//
	paintings[count] = new Painting(count++,
									"spellbound",
									"Spellbound",
									"18&frac12;\" x 28\"",
									"March 6, 1995 (For Danbury Mint Plate)<br>February 15, 1996 (For Portal Poster)<br>August 29, 1998 (For Franklin Mint Plate and New Portal Poster)",
									new Array(
											new PaintingComment(
													"Hannah Hall",
													"Rapid City, South Dakota",
													"Beautiful Spellbound",
													"I love this picture because it has lots of color. I used to have the poster but I gave it to my daughter and she loves it."
											),
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"Very beautiful. You don’t see the dragon right away. I like all the worn bookmarks hanging out of his book. The candles all look like real flames burning. The way the wax drips is very realistic. I like his traditional wizard hat, all blue with gold stars."
											)
									)
							);

	//
	// Canyonlands
	//
	paintings[count] = new Painting(count++,
									"canyonlands",
									"Canyonlands",
									"13\" x 23\"",
									"2000",
									null
							);

	//
	// Dragonflight
	//
	paintings[count] = new Painting(count++,
									"dragonflight",
									"Dragonflight",
									"24\" x 30\"",
									"2000",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"This is one proud dragon! There are my three favorite ravens! Looks like they are decorating the sky for the Wizard’s 145th birthday party. I love the golden bubbles and tassels, and the streamline vertical cloud clusters."
											)
									)
							);

	//
	// Fire Wizard
	//
	paintings[count] = new Painting(count++,
									"fireWizard",
									"Fire Wizard",
									"24\" x 36\"",
									"2002",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"Very cool design in the sleeves of the outer robe. He seems quite satisfied with his grand entrance."
											)
									)
							);

	//
	// Dragonstorm
	//
	paintings[count] = new Painting(count++,
									"dragonstorm",
									"Dragonstorm",
									"27\" x 40\"",
									"February 15, 1996 (First Edition)<br />1999 (Revised Edition)",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"An Interpretation",
													"Standing on the degrading marble floor, he is trying to capture the dragon? He has lost his pointy little hat, maybe electricity has blown it off and mussed up his hair. I see primarily the two colors, blues and golds. But I presume there are many more colors used to get this effect than what jumps out at me."
											)
									)
							);

	//
	// Raising the Dragon
	//
	paintings[count] = new Painting(count++,
									"raisingTheDragon",
									"Raising the Dragon",
									"24\" x 36\"",
									"August 14, 2003",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"One of the most colorful. I love the teal in the smoky cloud substance. Is he raising the dragon literally in a physical sense; raising his from mythology into life; or raising his from a pup? The dragon seems to be less than happy with his Wizard. The blades of 'glass' that they are in the midst of are difficult to identify."
											)
									)
							);

	//
	// Seer
	//
	paintings[count] = new Painting(count++,
									"seer",
									"Seer",
									"26&frac34;\" x 33\"",
									"August, 2004",
									new Array(
											new PaintingComment(
													"Felicia D. Francis",
													"Colorado Springs, Colorado, USA",
													"Comment",
													"I see lots of familiar faces in the background - A reverse image of the Seer is in the center looking glass, next to the \"symbol\". Lots of different species of eyes are looking out. One side of his face feels hot, the other feels very cool, like nighttime in the late fall, sitting around a campfire. There is a dragon in the puff of heat emanating from his hand. I also see the cute little fairy girl who hides herself in the brim of his hat, nestled in front of that other feather! This one has a lot of hidden details."
											)
									)
							);

	//
	// Travelers
	//
	paintings[count] = new Painting(count++,
									"travelers",
									"Travelers",
									"12&frac12;\" x 14&frac34;\"",
									"July 7, 2005",
									null
							);

	//
	// Petal
	//
	paintings[count] = new Painting(count++,
									"petal",
									"Petal",
									"22\" x 24\"",
									"July 7, 2005",
									new Array(
											new PaintingComment(
													"Sheila",
													"Milky Way Galaxy",
													"Flight of Fantasy",
													"Look at those wings! It is difficult to believe that this painting was done by a mere human. It must have taken forever to get all the detail. How did you get the fairy to sit still so long? Seriously, wherever this is, I want to go."
											),
											new PaintingComment(
													"dave11",
													"U.K.",
													"Cheeky!",
													"Great painting full of life. Wish I could get me hands on a print! Good luck for the future."
											)
									)
							);

	//
	// Planetarius
	//
	paintings[count] = new Painting(count++,
									"planetarius",
									"Planetarius",
									"29\" x 36\"",
									"November 23, 2006",
									new Array(
											new PaintingComment(
													"Lindy Looper",
													"Piedmont",
													"Floored",
													"I am very taken with the blues in this print. It's the floor, though, that I can't stop staring at. Something is peculiar about the perspective, but I haven't been able to figure out what it is. And where is this mage standing? Don't tell me. It's more fun if I don't know the answer."
											)
									)
							);

	//
	// Visionary
	//
	paintings[count] = new Painting(count++,
									"visionary",
									"Visionary",
									"24\" x 38\"",
									"October, 2006",
									new Array(
											new PaintingComment(
													"CthulhuBob Lovely",
													"Missoula, Montana",
													"Thank You",
													"Myles, as is true with all your work, this is beautiful with brilliant detail.  I especially enjoy the detail work in the glasses."
											)
									)
							);

	//
	// The Cauldron
	//
	paintings[count] = new Painting(count++,
									"cauldron",
									"The Cauldron",
									"15\" x 20\"",
									"April, 2006",
									new Array(
											new PaintingComment(
													"Artistlady",
													"Ottawa, Ontario, Canada",
													"Thirsting for more!",
													"I was given a box of 3 puzzles - Travelers, Moon Dragon and The Cauldron. When I finished the last puzzle I realized how much I loved all the details, especially the wizard’s clothing in \"The Cauldron\". That led me searching for more, I cannot imagine how Myles came up with those robes, cloaks and shirts! Fabulous!"
											),
											new PaintingComment(
													"Steph",
													"Visalia, CA, USA",
													"Incredible",
													"My eight year old son and I were transfixed by your beautiful work. We are very happy to have found your site and will recommend it to everyone we know!"
											)
									)
							);

	//
	// Lily
	//
	paintings[count] = new Painting(count++,
									"lily",
									"Lily",
									"15\" x 20\"",
									"October, 2008",
									new Array(
											new PaintingComment(
													"Stephanie & David",
													"Colorado Springs, CO, U.S.A.",
													"Flabbergasted",
													"This piece is absolutely astonishing when up close and personal. The vibrant colors and immaculate attention to detail are intriguing to no end. I especially loved the intricately designed lace on her arms and tassels on her gown."
											)
									)
							);

	//
	// Dragonlands II
	//
	paintings[count] = new Painting(count++,
									"dragonlandsII",
									"Dragonlands II",
									"32&frac12;\" x 24\"",
									"February, 2007",
									new Array(
											new PaintingComment(
													"Cindy",
													"Texas",
													"Comment",
													"I just purchased the 2008 calendar for my son. I am not a dragon fan but he is. However, I was enthralled and enchanted by the beautiful artwork. The detail, richness, hidden images and unmatched color is so powerful. Your art belongs alongside masters like DaVinci. Thank you so much for this wonderful web site that allows us all not only to purchase one of your pieces but lets us view them whenever we need a shot of beauty and imagination."
											)
									)
							);

	//
	// Dragon Escadrille
	//
	paintings[count] = new Painting(count++,
									"dragonEscadrille",
									"Dragon Escadrille",
									"30&frac34;\" x 22&frac34;\"",
									"March, 2009",
									null
							);

	//
	// Wizards Gallery
	//
	paintings[count] = new Painting(count++,
									"wizardsGallery",
									"Wizard's Gallery",
									"30\" x 37&frac12;\"",
									"April, 2009",
									null
							);
	
	//
	// Sorcery
	//
	paintings[count] = new Painting(count++,
									"sorcery",
									"Sorcery",
									"24\" x 36\"",
									"December, 2009",
									null
							);

	this.setPaintings       = PaintingSet_setPaintings;
	this.getPaintings       = PaintingSet_getPaintings;
	this.setPaintings(paintings);
	
	this.getPainting        = PaintingSet_getPainting;
	this.getCurrentPainting = PaintingSet_getCurrentPainting;
	this.getPaintingCount   = PaintingSet_getPaintingCount;
	
	return this;
}

function PaintingSet_setPaintings(paintings)
{
	this.paintings = paintings;
}

function PaintingSet_getPaintings()
{
	return this.paintings;
}

function PaintingSet_getPainting(key)
{
	for (var i = 0; i < this.paintings.length; i++)
	{
		if (this.paintings[i].key == key)
		{
			return this.paintings[i];
		}
	}
	
	return null;
}

function PaintingSet_getCurrentPainting()
{
	return this.findPainting(getCurrentPaintingKey());
}

function PaintingSet_getPaintingCount()
{
	return this.paintings.length;
}

/*-- End PaintingSet -------------------------------------------------------------------------*/

function PaintingComment(author, location, title, comment)
{
	this.author = author;
	this.location = location;
	this.title = title;
	this.comment = comment;
	
	return this;
}

/* Start Painting */

function Painting(sequence, key, title, size, completedDate, comments)
{
	this.setSequence = Painting_setSequence;
	this.getSequence = Painting_getSequence;
	this.setSequence(sequence);

	this.setKey = Painting_setKey;
	this.getKey = Painting_getKey;
	this.setKey(key);

	this.setTitle = Painting_setTitle;
	this.getTitle = Painting_getTitle;
	this.setTitle(title);
	
	this.setSize = Painting_setSize;
	this.getSize = Painting_getSize;
	this.setSize(size);
	
	this.setCompletedDate = Painting_setCompletedDate;
	this.getCompletedDate = Painting_getCompletedDate;
	this.setCompletedDate(completedDate);
	
	/*
	this.setProduct = Painting_setProduct;
	this.getProduct = Painting_getProduct;
	this.setProduct(product);
	*/
	
	this.setComments = Painting_setComments;
	this.getComments = Painting_getComments;
	this.setComments(comments);

	this.setPaintingPage = Painting_setPaintingPage;
	this.getPaintingPage = Painting_getPaintingPage;
	this.setPaintingPage(DEFAULT_PAINTING_PAGE);
	
	this.setSubmitCommentPage = Painting_setSubmitCommentPage;
	this.getSubmitCommentPage = Painting_getSubmitCommentPage;
	this.setSubmitCommentPage(DEFAULT_SUBMIT_COMMENT_PAGE);
	
	this.getUrl = Painting_getUrl;
	
	return this;
}

function Painting_setSequence(sequence)
{
	this.sequence = sequence;
}

function Painting_getSequence()
{
	return this.sequence;
}

function Painting_setKey(key)
{
	this.key = key;
}

function Painting_getKey()
{
	return this.key;
}

function Painting_setTitle(title)
{
	this.title = title;
}

function Painting_getTitle()
{
	return this.title;
}

function Painting_setSize(size)
{
	this.size = size;
}

function Painting_getSize()
{
	return this.size;
}

function Painting_setCompletedDate(completedDate)
{
	this.completedDate = completedDate;
}

function Painting_getCompletedDate()
{
	return this.completedDate;
}

function Painting_getUrl()
{
	return getPaintingUrl(this.getKey(), this.getPaintingPage());
}

/*
function Painting_setProduct(product)
{
	this.product = product;
}

function Painting_getProduct()
{
	return this.product;
}
*/

function Painting_setComments(comments)
{
	this.comments = comments;
}

function Painting_getComments()
{
	return this.comments;
}

function Painting_setPaintingPage(paintingPage)
{
	this.paintingPage = paintingPage;
}

function Painting_getPaintingPage()
{
	return this.paintingPage;
}

function Painting_setSubmitCommentPage(submitCommentPage)
{
	this.submitCommentPage = submitCommentPage;
}

function Painting_getSubmitCommentPage()
{
	return this.submitCommentPage;
}

/* End Painting */

function setCurrentPaintingKey(key)
{
	setCookie(PAINTING_CURRENT_KEY, key, PAINTING_DISTANT_FUTURE, "/");
}

function getCurrentPaintingKey()
{
	return getCookie(PAINTING_CURRENT_KEY);
}

function goToPreviousPainting()
{
	if (arguments[0] != null)
	{
		setCurrentPaintingKey(arguments[0]);
	}
	
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	var painting = paintingSet.getCurrentPainting();
	
	var previousPainting = paintingSet.paintings[painting.getSequence() - 1];
	setCurrentPaintingKey(previousPainting.getKey());
	
	document.location = '../gallery/' + previousPainting.getPaintingPage() + '?painting=' + previousPainting.getKey();
}

function goToCurrentPainting()
{
	if (arguments[0] != null)
	{
		setCurrentPaintingKey(arguments[0]);
	}
	
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	var painting = paintingSet.getCurrentPainting();
//	document.location = '../gallery/' + painting.getKey() + '.html';
	document.location = '../gallery/' + painting.getPaintingPage() + '?painting=' + painting.getKey();
}

function goToNextPainting()
{
	if (arguments[0] != null)
	{
		setCurrentPaintingKey(arguments[0]);
	}
	
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	var painting = paintingSet.getCurrentPainting();
	
	var nextPainting = paintingSet.paintings[painting.getSequence() + 1];
	setCurrentPaintingKey(nextPainting.getKey());
	
	//document.location = '../gallery/' + nextPainting.getKey() + '.html';
	document.location = '../gallery/' + nextPainting.getPaintingPage() + '?painting=' + nextPainting.getKey();
}

function goToCurrentPaintingDetails()
{
	if (arguments[0] != null)
	{
		setCurrentPaintingKey(arguments[0]);
	}
	
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	var painting = paintingSet.getCurrentPainting();
	
	document.location = '../gallery/' + painting.getPaintingPage() + '?painting=' + painting.getKey();
}

function goToCurrentPaintingLarge()
{
	if (arguments[0] != null)
	{
		setCurrentPaintingKey(arguments[0]);
	}
	
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	var painting = paintingSet.getCurrentPainting();
	
	document.location = '../gallery/paintingLarge.html?painting=' + painting.getKey();
}

function submitAComment()
{
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	var painting = paintingSet.getCurrentPainting();
	
	document.location = '../gallery/' + painting.getSubmitCommentPage() + '?painting=' + painting.getKey();
}

function displayCommentSubmissionLink(painting)
{
	if (painting.getComments() == null)
	{
		document.write('Be the first to <a href="' + painting.getSubmitCommentPage() + '?painting=' + painting.getKey() + '">submit a comment</a> about this painting!');
	}
	else
	{
		document.write('<a href="' + painting.getSubmitCommentPage() + '?painting=' + painting.getKey() + '">Submit a comment</a> about this painting.');
	}
}

function displayPaintingProduct(painting)
{
	var product = productSet.getProduct(painting.getKey());
	
	var html =
		'<table border="0" cellspacing="0" cellpadding="0" width="450">' +
			'<tr>' +
				'<td style="vertical-align:top">' +
					'<table border="0" cellspacing="0" cellpadding="0">' +
						'<tr>' +
							'<td class="labelSubdued">Availability:</td>' +
							'<td class="value">' + product.getAvailability() + '</td>' +
						'</tr>';
					if (product.getAvailability() != PRODUCT_AVAILABILITY_NOT_AVAILABLE)
					{
						html +=
						'<tr>' +
							'<td class="labelSubdued">Size:</td>' +
							'<td class="value">' + product.getSize() + '</td>' +
						'</tr>' +
						'<tr>' +
							'<td class="labelSubdued">Type:</td>' +
							'<td class="value">' + product.getType() + '</td>' +
						'</tr>' +
						'<tr>' +
							'<td class="labelSubdued">Edition:</td>' +
							'<td class="value">' + product.getEdition() + '</td>' +
						'</tr>';
					}
					else
					{
						html +=
							'</table>' +
						'</td>';
					}
					
				if (product.getAvailability() != PRODUCT_AVAILABILITY_NOT_AVAILABLE)
				{
					/*
					html +=
					'<td align="center" valign="top" style="padding-left:10px">' +
						'<table border="0" cellspacing="0" cellpadding="0">';
					*/
						if (product.getDiscountPrice() > 0.0)
						{
							html +=
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'List Price:' +
								'</td>' +
								'<td align="left" class="valueInvalid">' +
									formatCurrency(product.getUnitPrice()) + ' (USD)' +
								'</td>' +
							'</tr>' +
							'<tr>' +
								'<td align="right" class="labelForLoud">' +
									'Sale Price:' +
								'</td>' +
								'<td align="left" class="valueLoud">' +
									formatCurrency(product.getDiscountPrice()) +
								'</td>' +
							'</tr>';
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'You Save:' +
								'</td>' +
								'<td align="left" class="value">' +
									formatCurrency(product.getUnitPrice() - product.getDiscountPrice()) +
									' (' + parseInt(100.0 - 100.0 * product.getDiscountPrice() / product.getUnitPrice()) + '%)' +
								'</td>' +
							'</tr>' +
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'Sale Ends:' +
								'</td>' +
								'<td align="left" class="value">' +
									'December 31, 2009' +
								'</td>' +
							'</tr>';
						}
						else
						{
							html +=
							'<tr>' +
								'<td align="right" class="labelForLoud">' +
									'Price:' +
								'</td>' +
								'<td align="left" class="valueLoud">' +
									formatCurrency(product.getUnitPrice()) +
								'</td>' +
							'</tr>';
						}
						html +=
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'Quantity:' +
								'</td>' +
								'<td align="left">' +
									'<input name="quantity" type="text" class="textField" id="quantity" value="1" size="3">' +
								'</td>' +
							'</tr>' +
							'<tr>' +
								'<td align="left" colspan="2" style="padding: 10px 0 0 0	"><a id="buttonAddToCart" href="javascript:addToCartFromField(painting.getKey(), \'quantity\')"><img src="../images/blank.gif" alt="Add this item to your shopping cart" title="Add this item to your shopping cart" onMouseOver="javascript:window.status=\'Add this item to your shopping cart\'" onMouseOut="javascript:window.status=\'\'"></a></td>' +
							'</tr>' +
						'</table>' +
					'</td>';
				}
			html +=
			'</tr>';
			if (product.getAvailability() != PRODUCT_AVAILABILITY_NOT_AVAILABLE)
			{
				if (product.getType() == PRODUCT_TYPE_GICLEE)
				{
					html +=
					'<tr>' +
						'<td colspan="2" class="paintingAddendum">This print is signed by the artist in gold ink and has a white border containing the artist\'s stamp and embossed seal.</td>' +
					'</tr>';
				}
				else
				{
					if (painting.getKey() == "merlinsOak")
					{
						html +=
						'<tr>' +
							'<td colspan="2" class="paintingAddendum">This print is signed and numbered by the artist and comes with a Certificate of Authenticity.</td>' +
						'</tr>';
					}
					else
					{
						html +=
						'<tr>' +
							'<td colspan="2" class="paintingAddendum">This print is signed by the artist in gold ink.</td>' +
						'</tr>';
					}
				}
			}
		html +=
		'</table>';
			
	document.write(html);
}

function displayAbridgedPaintingProduct(painting)
{
	var product = productSet.getProduct(painting.getKey());
	
	var html =
		'<table border="0" cellspacing="0" cellpadding="0">' +
			'<tr>' +
				'<td style="vertical-align: top">' +
					'<table border="0" cellspacing="0" cellpadding="0">' +
						'<tr>' +
							'<td class="labelSubdued">Availability:</td>' +
							'<td class="value">' + product.getAvailability() + '</td>' +
						'</tr>';
					if (product.getAvailability() != PRODUCT_AVAILABILITY_NOT_AVAILABLE)
					{
						html +=
						'<tr>' +
							'<td class="labelSubdued">Size:</td>' +
							'<td class="value">' + product.getSize() + '</td>' +
						'</tr>' +
						'<tr>' +
							'<td class="labelSubdued">Type:</td>' +
							'<td class="value">' + product.getType() + '</td>' +
						'</tr>' +
						'<tr>' +
							'<td class="labelSubdued">Edition:</td>' +
							'<td class="value">' + product.getEdition() + '</td>' +
						'</tr>';
					}
					html +=
					'</table>' +
				'</td>';
				if (product.getAvailability() != PRODUCT_AVAILABILITY_NOT_AVAILABLE)
				{
					html +=
					'<td align="center" valign="top" style="padding-left:50px">' +
						'<table border="0" cellspacing="0" cellpadding="0">';
						if (product.getDiscountPrice() > 0.0)
						{
							html +=						
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'List Price:' +
								'</td>' +
								'<td align="left" class="valueInvalid">' +
									formatCurrency(product.getUnitPrice()) + ' (USD)' +
								'</td>' +
							'</tr>' +
							'<tr>' +
								'<td align="right" class="labelForLoud">' +
									'Our Price:' +
								'</td>' +
								'<td align="left" class="valueLoud">' +
									formatCurrency(product.getDiscountPrice()) +
								'</td>' +
							'</tr>' +
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'You Save:' +
								'</td>' +
								'<td align="left" class="value">' +
									formatCurrency(product.getUnitPrice() - product.getDiscountPrice()) +
									' (' + parseInt(100.0 - 100.0 * product.getDiscountPrice() / product.getUnitPrice()) + '%)' +
								'</td>' +
							'</tr>' +
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'Sale Ends:' +
								'</td>' +
								'<td align="left" class="value">' +
									'December 31, 2009' +
								'</td>' +
							'</tr>';
						}
						else
						{
							html +=
							'<tr>' +
								'<td align="right" class="labelForLoud">' +
									'Price:' +
								'</td>' +
								'<td align="left" class="valueLoud">' +
									formatCurrency(product.getUnitPrice()) +
								'</td>' +
							'</tr>';
						}
							html +=
							'<tr>' +
								'<td align="right" class="labelSubdued">' +
									'Quantity:' +
								'</td>' +
								'<td align="left">' +
									'<input name="quantity" type="text" class="textField" id="quantity" value="1" size="3">' +
								'</td>' +
							'</tr>' +
							'<tr>' +
								'<td align="left" colspan="2" style="padding: 10px 0 0 0	"><a id="buttonAddToCart" href="javascript:addToCartFromField(painting.getKey(), \'quantity\')"><img src="../images/blank.gif" alt="Add this item to your shopping cart" title="Add this item to your shopping cart" onMouseOver="javascript:window.status=\'Add this item to your shopping cart\'" onMouseOut="javascript:window.status=\'\'"></a></td>' +
							'</tr>' +
						'</table>' +
					'</td>';
				}
			html +=
			'</tr>' +
		'</table>';
			
	document.write(html);
}

function displayComments(painting)
{
	if (painting.getComments() != null)
	{
		for (var i = 0; i < painting.getComments().length; i++)
		{
			document.write('<tr><td height="30">&nbsp;</td></tr>');
			document.write('<tr><td class="commentTitle">' + painting.getComments()[i].title + '</td></tr>');
			document.write('<tr><td height="20">Source:&nbsp;<strong>' + painting.getComments()[i].author + '</strong>&nbsp;from&nbsp;' + painting.getComments()[i].location + '</td></tr>');
			document.write('<tr><td>' + painting.getComments()[i].comment + '</td></tr>');
		}
	}
}

function getPreviousPaintingUrl(painting)
{
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	
	var prevPainting = paintingSet.paintings[painting.getSequence() - 1];

//	return ('../gallery/' + prevPainting.getPaintingPage() + '?painting=' + prevPainting.getKey());
	return getPaintingUrl(prevPainting.getKey(), prevPainting.getPaintingPage());
}

function getNextPaintingUrl(painting)
{
	if (paintingSet == null)
	{
		paintingSet = new PaintingSet();
	}
	
	var nextPainting = paintingSet.paintings[painting.getSequence() + 1];

	//return ('../gallery/' + nextPainting.getPaintingPage() + '?painting=' + nextPainting.getKey());
	return getPaintingUrl(nextPainting.getKey(), nextPainting.getPaintingPage());
}

function displayPaintingNavigation(painting)
{
	if (painting.getSequence() == 0)
	{
		document.writeln('<img id="buttonPreviousPaintingDisabled" src="../images/blank.gif" alt=" "><a href="' + getPaintingGalleryUrl(painting) + '" id="buttonGoToGallery"><img src="../images/blank.gif" alt="Go to the gallery where this painting resides"></a><a href="' + getNextPaintingUrl(painting) + '" id="buttonNextPainting"><img src="../images/blank.gif" alt="Go to next painting in gallery"></a>');
	}
	else if (painting.getSequence() == paintingSet.getPaintingCount() - 1)
	{
		document.writeln('<a href="' + getPreviousPaintingUrl(painting) + '" id="buttonPreviousPainting"><img src="../images/blank.gif" alt="Go to previous painting in gallery"></a><a href="' + getPaintingGalleryUrl(painting) + '" id="buttonGoToGallery" alt="Go to gallery page for this painting"><img src="../images/blank.gif" alt="Go to the gallery where this painting resides"></a><img id="buttonNextPaintingDisabled" src="../images/blank.gif">');
	}
	else
	{
		document.writeln('<a href="' + getPreviousPaintingUrl(painting) + '" id="buttonPreviousPainting"><img src="../images/blank.gif" alt="Go to previous painting in gallery"></a><a href="' + getPaintingGalleryUrl(painting) + '" id="buttonGoToGallery" alt="Go to gallery page for this painting"><img src="../images/blank.gif" alt="Go to the gallery where this painting resides"></a><a href="' + getNextPaintingUrl(painting) + '" id="buttonNextPainting"><img src="../images/blank.gif" alt="Go to next painting in gallery"></a>');
	}
}

function displayPaintingTitleImage(painting)
{
	document.write('<img src="../images/title' + capitalize(painting.getKey()) + '.gif" alt="' + painting.title + '">');
}

function displayPaintingSmallImage(painting)
{
	//document.write('<a href="paintingLarge.html?painting=' + painting.getKey() + '"><img src="../thumbnails/' + painting.getKey() + 'LT.jpg" border="0" alt="' + painting.title + ' by Myles Pinkney"></a>');
	document.write('<a href="paintingLarge.html?painting=' + painting.getKey() + '"><img src="../thumbnails/' + painting.getKey() + 'LT.jpg" border="0" alt="Click to enlarge" title="Click to enlarge"></a>');
}

function displayLargePaintingLink(painting)
{
	document.write('<a href="../gallery/paintingLarge.html?painting=' + painting.getKey() + '">See Larger Version</a>');
}

function displayPaintingLargeImage(painting)
{
	document.write('<img src="../paintings/' + painting.getKey() + '.jpg" border="0" alt="' + painting.title + ' by Myles Pinkney">');
}

function displayGalleryThumbnails(page)
{
	var total_paintings = paintingSet.getPaintingCount() ;
	var total_per_page = PAINTING_THUMBNAIL_ROWS * PAINTING_THUMBNAIL_COLUMNS;
	var total_pages = parseInt(total_paintings / total_per_page) + (total_paintings % total_per_page == 0 ? 0 : 1);

	var percentage_per_thumbnail = parseInt(1.0 / PAINTING_THUMBNAIL_COLUMNS * 100.0 + 0.5);
	var start = (page - 1) * total_per_page;
	var end = start + total_per_page - 1;
	if (end >= total_paintings)
	{
		end = total_paintings - 1;
	}

	html = '<table cellspacing="0" cellpadding="0" border="0">' +
				'<tr>';
				for (var i = start; i <= end; i++)
				{
					if (i % PAINTING_THUMBNAIL_COLUMNS == 0)
					{
						if (i != 0)
						{
							html += '</tr>';
							if (i < end)
							{
								html += '<tr>';
							}
						}
					}
		
					html +=
						'<td>' +
							'<table cellspacing="0" cellpadding="0" border="0">' +
								'<tr>' +
									'<td class="thumbnailImageContainer">' +
										'<a href="' + paintingSet.paintings[i].getUrl() + '">' +
											'<img src="../thumbnails/' + paintingSet.paintings[i].getKey() + '.jpg" alt="The painting \'' + paintingSet.paintings[i].getTitle() + '\'">' +
										'</a>' +
									'</td>' +
								'</tr>' +
								'<tr>' +
									'<td class="thumbnailLinkContainer">' +
										'<a href="' + paintingSet.paintings[i].getUrl() + '">' + paintingSet.paintings[i].title + '</a>';
										var product = productSet.getProduct(paintingSet.paintings[i].getKey());
										if (product.getAvailability() == PRODUCT_AVAILABILITY_IN_STOCK)
										{
											html += '<img class="printAvailable" src="../images/blank.gif" alt="print available" title="print available" align="top">';
										}
									html +=
									'</td>' +
								'</tr>' +
							'</table>' +
						'</td>';
				}
	
				html +=
				'</tr>' +
			'</table>';
	
	document.write(html);
}

function getGalleryPageUrl(page)
{
	return ('../gallery/index.html?page=' + page);
}

function getPreviousGalleryPageUrl(page)
{
	return ('../gallery/index.html?page=' + (page - 1));
}

function getNextGalleryPageUrl(page)
{
	return ('../gallery/index.html?page=' + (page + 1));
}

function displayGalleryNavigation(page)
{
	var total_paintings = paintingSet.getPaintingCount() ;
	var total_per_page = PAINTING_THUMBNAIL_ROWS * PAINTING_THUMBNAIL_COLUMNS;
	var total_pages = parseInt(total_paintings / total_per_page) + (total_paintings % total_per_page == 0 ? 0 : 1);

	var html = '<table cellspacing="0" cellpadding="0" border="0"><tr>';
	
	if (page == 1)
	{
		html += '<td><img id="buttonPreviousGalleryPageDisabled" src="../images/blank.gif" alt=" "></td>';
	}
	else
	{
		html += '<td><a href="' + getPreviousGalleryPageUrl(page) + '" id="buttonPreviousGalleryPage"><img src="../images/blank.gif" alt="Go to previous page in gallery"></a></td>';
	}

	for (var i = 1; i <= total_pages; i++)
	{
		if (i == page)
		{
			if (i <= 9)
			{
				html += '<td class="galleryNavigationLinkContainerDisabled">&nbsp;&nbsp;&nbsp;&nbsp;' + page + '&nbsp;&nbsp;&nbsp;&nbsp;</td>';
			}
			else if (i <= 99)
			{
				html += '<td class="galleryNavigationLinkContainerDisabled">&nbsp;&nbsp;' + page + '&nbsp;&nbsp;</td>';
			}
			else
			{
				html += '<td class="galleryNavigationLinkContainerDisabled">&nbsp;' + page + '&nbsp;</td>';
			}
		}
		else
		{
			if (i <= 9)
			{
				html += '<td class="galleryNavigationLinkContainer"><a href="' + getGalleryPageUrl(i) + '" class="galleryNavigationLink">&nbsp;&nbsp;&nbsp;&nbsp;' + i + '&nbsp;&nbsp;&nbsp;&nbsp;</a></td>';
			}
			else if (i <= 99)
			{
				html += '<td class="galleryNavigationLinkContainer"><a href="' + getGalleryPageUrl(i) + '" class="galleryNavigationLink">&nbsp;&nbsp;' + i + '&nbsp;&nbsp;</a></td>';
			}
			else
			{
				html += '<td class="galleryNavigationLinkContainer"><a href="' + getGalleryPageUrl(i) + '" class="galleryNavigationLink">&nbsp;' + i + '&nbsp;</a></td>';
			}
		}
	}

	if (page == total_pages)
	{
		html += '<td><img id="buttonNextGalleryPageDisabled" src="../images/blank.gif" alt=" "></td>';
	}
	else
	{
		html += '<td><a href="' + getNextGalleryPageUrl(page) + '" id="buttonNextGalleryPage"><img src="../images/blank.gif" alt="Go to next page in gallery"></a></td>';
	}
	
	html += '</tr></table>';
	
	document.write(html);
}

function getPaintingGalleryUrl(painting)
{
	var total_paintings = paintingSet.getPaintingCount() ;
	var total_per_page = PAINTING_THUMBNAIL_ROWS * PAINTING_THUMBNAIL_COLUMNS;
	var total_pages = parseInt(total_paintings / total_per_page) + (total_paintings % total_per_page == 0 ? 0 : 1);

	for (var page = 1; page <= total_pages; page++)
	{
		var start = (page - 1) * total_per_page;
		var end = start + total_per_page - 1;
		if (painting.getSequence() >= start && painting.getSequence() <= end)
		{
			break;
		}
	}
	
	return ('../gallery/index.html?page=' + page);
}

function getPaintingUrl(key)
{
	var page = null;
	if (arguments.length == 2)
	{
		page = arguments[1];
	}
	else
	{
		page = DEFAULT_PAINTING_PAGE;
	}
	
	return ('../gallery/' + page + '?painting=' + key);
}