// JavaScript Document
window.onload = init;
// Christopher S. Ryckman is a physician who began painting as a hobby in 1990.
// After beginning by studying under a local portrait artist, the late Marvine Triguba,
// he now specializes in paintings dealing with family, religious, and holiday themes.
// Chris is married with four daughters and currently resides in Southeastern Ohio.
// based on The Theology of The Body, Pope John Paul II's interpretation of St. Paul's letter to the Ephesians
/*<p style="font-size:6pt"><br></p>*/
var titleArray = new Array("As Christ Loved the Church",
													 "Santa's Real Helper",
													 "Snow Day",
                           "The Body of Christ",
                           "It is Finished",
                           "Give Me Strength",
													 "After Christmas",
                           "Night Watch");
var subTitleArray = new Array("",
													    "St. Mary of the Assumption Catholic Church - Lancaster, OH",
													    "Lancaster, OH",
                              "",
                              "",
                              "",
                              "",
                              "");
var sizeArray = new Array("Original Oil on Canvas - 36'' x 48''",
													"Original Oil on Canvas - 30'' x 40''",
													"Original Oil on Canvas - 12'' x 16''",
                          "Original Oil on Canvas - 36'' x 48''",
                          "",
                          "",
                          "",
                          "");
var printArray = new Array("Signed Lithograph Print (18'' x 24'') - $85.00",
													 "Signed Lithograph Print (16'' x 20'') - $85.00",
													 "Photographic Print (12'' x 16'') - $50.00",
                           "",
                           "",
                           "",
                           "",
                           "");
var cardArray = new Array("",
													"Christmas Card (5'' x 6.75'') - 10 for $9.99",
													"Christmas Card (5'' x 6.75'') - 10 for $9.99",
                          "",
                          "",
                          "",
                          "",
                          "Christmas Card (5'' x 6.75'') - 10 for $9.99");
var cardGreetingArray = new Array("",
																	"Greeting: ''May the everlasting light of Christ shine in your heart throughout the year.''",
																	"(No Greeting)",
                                  "",
                                  "",
                                  "",
                                  "",
                                  "May the gift of the season fill your heart with peace and love throughout the love.");
function init()
{
  for(var i = 0; i < document.images.length; i++)
  {
    if(document.images[i].alt == "thumbnail")
    {
      setupPainting(document.images[i]);
    }
  }
	for(i = 0; i < document.links.length; i++)
	{
		if(document.links[i].id == "Artist Bio" ||
		   document.links[i].id == "Holiday" ||
		   document.links[i].id == "Religious")
		//if(document.links[i].href == "file:///Users/Dave/Documents/CSRyckman/index2.htm#"href == "file:///Users/Dave/Documents/CSRyckman/index2.htm#" ||
		//	 document.links[i].href == "file://localhost/Users/Dave/Documents/CSRyckman/index2.htm#")
		{
			setupTab(document.links[i]);
		}
	}
}

function setupRollover(thisImage)
{
  thisImage.outImage = new Image();
  thisImage.outImage.src = thisImage.src;
  thisImage.onmouseout = rollOut;
  
  thisImage.overImage = new Image();
  thisImage.overImage.src = "Pictures/" + thisImage.title + "2.jpg";
  thisImage.onmouseover = rollOver;
}

function setupPainting(thisImage)
{
  setupRollover(thisImage);

	if(thisImage.alt == "thumbnail")
  {
    thisImage.onmousedown = paintingSelect;
		thisImage.bigImage = new Image();
	  thisImage.bigImage.src = "Pictures/" + thisImage.title + "Big.jpg";
  }
}

function setupTab(thisLink)
{
	//alert("setupTab");
	thisLink.onmousedown = groupSelect;
}

function paintingSelect()
{
	// add the title
	/*var paintingTitle = document.createTextNode(this.attributes.paintingTitle.nodeValue);
	var newP = document.createElement("p");
	newP.appendChild(paintingTitle);
	var temp = document.getElementById("bigPictureTitle");*/
	//document.getElementById("bigPictureTitle").firstChild.textContent = this.attributes.paintingTitle.nodeValue;
	//temp.replaceChild(temp.firstChild, newP);
	//alert("Yo!");
	//alert(paintingTitleArray[this.id]);
	//firstChild.textContent
	file:///Users/Dave/Documents/CSRyckman/Pictures/PaintingSantaHelper2.jpg//alert(innerHTML = this.attributes.paintingTitle.nodeValue);
	document.getElementById("bigPictureTitle").innerHTML = titleArray[this.id];
	//alert(this.bigImage.src);
	document.getElementById("bigPicture").firstChild.src = this.bigImage.src;
	document.getElementById("bigPictureSubTitle").innerHTML = subTitleArray[this.id];
	document.getElementById("bigPictureSize").innerHTML = sizeArray[this.id];
	document.getElementById("bigPicturePrint").innerHTML = printArray[this.id];
	document.getElementById("bigPictureCard").innerHTML = cardArray[this.id];
	document.getElementById("bigPictureCardGreeting").innerHTML = cardGreetingArray[this.id];
/*			
	// add the painting
	var newImg = document.createElement("img");
	var myImage = new Image();
	newImg.appendChild(myImage);
	newImg.src = this.bigImage.src;
	document.getElementById("bigPicture").appendChild(newImg);
	
	// add the size
	var paintingSize = document.createTextNode(this.attributes.paintingSize.nodeValue);
	var sizeP = document.createElement("p");
	sizeP.appendChild(paintingSize);
	document.getElementById("bigPictureData").replaceChild(
			document.getElementById("bigPictureData").firstChild, sizeP);
*/
	//document.getElementById("bigPicture").innerHTML = "<img src=" + this.bigImage.src + "></img>";//"<img src='Pictures\Home.gif'></img>";
	//document.getElementById("bigPictureTitle").innerHTML = paintingTitle;
	//document.getElementById("originalData").innerHTML = originalDataArray;
}

function groupSelect()
{
	if(this.title == "Artist Bio")
	{
		//document.getElementById("Artist Bio").style.backgroundColor = "#FFF";
		//document.getElementById("Artist Bio").style.backgroundPosition = "0% -42px";
		document.getElementById("thumbnailGroup").innerHTML = "<div class='artistBio'>Christopher S. Ryckman is a physician who began painting as a hobby in 1990. After beginning his studies under a local portrait artist, the late Marvine Triguba, he now specializes in paintings dealing with family, religious, and holiday themes. Chris is married with four daughters and currently resides in Southeastern Ohio.</div>";
	}
	else if(this.title == "Holiday")
	{
		document.getElementById("thumbnailGroup").innerHTML =
		"<div id='right'>\
			<div class='thumbnail'><img src='Pictures/PaintingSantaHelper.jpg' align='middle' id='1' title='PaintingSantaHelper' alt='thumbnail'>\
			</div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingAfterChristmas.jpg' align='middle' id='6' alt='thumbnail' title='PaintingAfterChristmas'>\
      </div>\
			\
    </div>\
		\
    <div id='left'>\
    \
      <div class='thumbnail'>\
        <img src='Pictures/PaintingSnowday.jpg' align='middle' alt='thumbnail' id='2' title='PaintingSnowday' style='vertical-align:bottom'>\
      </div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingGiveMeStrength.jpg' align='middle' id='5' alt='thumbnail' title='PaintingGiveMeStrength'>\
      </div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingNightWatch.jpg' align='middle' id='7' alt='thumbnail' title='PaintingNightWatch'>\
      </div>\
  	\
    </div>";
		init();
	}
	else if(this.title == "Religious")
	{
		document.getElementById("thumbnailGroup").innerHTML =
		"<div id='right'>\
			<div class='thumbnail'><img src='Pictures/PaintingTheologyOfTheBody.jpg' align='middle' id='0' title='PaintingTheologyOfTheBody' alt='thumbnail'>\
			</div>\
    	\
    </div>\
		\
    <div id='left'>\
    \
      <div class='thumbnail'>\
        <img src='Pictures/PaintingItIsFinished.jpg' align='middle' alt='thumbnail' id='4' title='PaintingItIsFinished'>\
      </div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingTheBodyOfChrist.jpg' align='middle' id='3' alt='thumbnail' title='PaintingTheBodyOfChrist'>\
      </div>\
  	\
    </div>";
		init();
	}
}

function rollOver()
{
  this.src = this.overImage.src;
}

function rollOut()
{
  this.src = this.outImage.src;
}

/*<div id="right">

  <div class="thumbnail">
    <img src="Pictures/PaintingSantaHelper.jpg" align="middle" id="1" title="PaintingSantaHelper" alt="thumbnail">
  </div>

  <div class="thumbnail">
    <img src="Pictures/PaintingAfterChristmas.jpg" align="middle" id="6" alt="thumbnail" title="PaintingAfterChristmas">
  </div>

  <div class="thumbnail">
    <img src="Pictures/PaintingTheBodyOfChrist.jpg" align="middle" alt="thumbnail" id="3" title="PaintingTheBodyOfChrist">
  </div>

</div>

<div id="left">

  <div class="thumbnail">
    <img src="Pictures/PaintingSnowday.jpg" align="middle" alt="thumbnail" id="2" title="PaintingSnowday" style="vertical-align:bottom">
  </div>

  <div class="thumbnail">
    <img src="Pictures/PaintingGiveMeStrength.jpg" align="middle" id="5" alt="thumbnail" title="PaintingGiveMeStrength">
  </div>

  <div class="thumbnail">
    <img src="Pictures/PaintingNightWatch.jpg" align="middle" id="7" alt="thumbnail" title="PaintingNightWatch">
  </div>

  <div class="thumbnail">
    <img src="Pictures/PaintingItIsFinished.jpg" align="middle" alt="thumbnail" id="4" title="PaintingItIsFinished">
  </div>

  <div class="thumbnail">
    <img src="Pictures/PaintingTheologyOfTheBody.jpg" align="middle" alt="thumbnail" id="0" title="PaintingTheologyOfTheBody">
  </div>

</div>*/
