// 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",
							"Santa's Last Supper",
							"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'') - $90.00",
						"Signed Lithograph Print (16'' x 20'') - $90.00",
						"",
						"Photographic Print (12'' x 16'') - $55.00",
                           "",
                           "",
                           "Signed Lithographic Print: (14'' x 14'' print on 18.5'' x 18.5'' double matte) - $65.00",
                           "Signed Lithographic Print: (14'' x 14'' print on 18.5'' x 18.5'' double matte) - $65.00",
                           "");

var cardArray = new Array("",
						"Christmas Card (5'' x 6.75'') - 10 for $10.99",
						"Christmas Card (5'' x 6.75'') - 10 for $10.99",
						"Christmas Card (5'' x 6.75'') - 10 for $10.99",
                          "",
                          "",
                          "",
                          "",
                          "Christmas Card (5'' x 6.75'') - 10 for $10.99");

var cardGreetingArray = new Array("",
								"Greeting: ''May the everlasting light of Christ shine in your heart throughout the year.''",
								"Greeting: ''Who is in my chair?''",
								"(No Greeting)",
                                  "",
                                  "",
                                  "",
                                  "",
                                  "May the gift of the season fill your heart with peace and love throughout the love.");

/*var purchaseCardArray = new Array("",
								"<form target=\"paypal\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\"><input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"><input type=\"hidden\" name=\"hosted_button_id\" value=\"THTU4FFXGUMXC\"><input type=\"image\" src=\"https://www.paypalobjects.com/en_US/i/btn/btn_cart_SM.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\"><img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\"></form>",
								"Greeting: ''Who is in my chair?''",
								"(No Greeting)",
                                  "",
                                  "",
                                  "",
                                  "",
                                  "May the gift of the season fill your heart with peace and love throughout the love.");

var purchasePrintArray = new Array("",
								"TEST",
								"Greeting: ''Who is in my chair?''",
								"(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];
	
	//document.getElementById("bigPicturePurchasePrint").innerHTML = purchasePrintArray[this.id];
	//document.getElementById("bigPicturePurchaseCard").innerHTML = purchaseCardArray[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 = /*"<p>TEST</p>";*/
		
		"<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/PaintingSnowday.jpg' align='middle' alt='thumbnail' id='3' title='PaintingSnowday' style='vertical-align:bottom'>\
      </div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingAfterChristmas.jpg' align='middle' id='7' alt='thumbnail' title='PaintingAfterChristmas'>\
      </div>\
			\
    </div>\
		\
    <div id='left'>\
    \
      <div class='thumbnail'>\
        <img src='Pictures/PaintingSantasLastSupper.jpg' align='middle' alt='thumbnail' id='2' title='PaintingSantasLastSupper' style='vertical-align:bottom'>\
      </div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingGiveMeStrength.jpg' align='middle' id='6' alt='thumbnail' title='PaintingGiveMeStrength'>\
      </div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingNightWatch.jpg' align='middle' id='8' 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='5' title='PaintingItIsFinished'>\
      </div>\
    	\
      <div class='thumbnail'>\
        <img src='Pictures/PaintingTheBodyOfChrist.jpg' align='middle' id='4' 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>*/


