// This function sets the values that go into the homepage popup divs.
function showDetails(data) {

 var productName = new Array()
 var productLink = new Array()
 var productDescription = new Array()
 var productX = new Array()
 var productY = new Array()

 // BEGIN editable //
 // Duplicate one of the blocks below to create information for a new div.

 productName[0] = "The 531 Chair";
 productLink[0] = "http://www.italydesign.com/the531ChairinBlack.html";
 productDescription[0] = "Originally designed by Mies Van der Rohe in 1929 for the German pavilion at the Barcelona International Exhibition. The 531 chair has now become a classic example of modern design and a status symbol of our time.";
 productX[0] = "50px";
 productY[0] = "90px";

 productName[1] = "Article 532 Ottoman";
 productLink[1] = "http://www.italydesign.com/article532Ottoman.html";
 productDescription[1] = "To complement the 531 Chair originally designed by Mies Van der Rohe in 1929. ";
 productX[1] = "160px";
 productY[1] = "110px";

 productName[2] = "Barcelona Bench";
 productLink[2] = "http://www.italydesign.com/barcelonaSofaBench.html";
 productDescription[2] = "The highly stylish modern classic bench by Ludwig Mies van der Rohe is constructed and designed with the same materials as his well known 1929 day bed.";
 productX[2] = "260px";
 productY[2] = "175px";
 
 productName[3] = "Barcelona Bed";
 productLink[3] = "http://www.italydesign.com/product570.html";
 productDescription[3] = "The Barcelona Bed's stately and formal appearance graces the bedroom with refine modernism. Its impeccable craftsmanship embodies the spirit of perfectionism that fueled the Bauhaus style of architecture and design. ";
 productX[3] = "370px";
 productY[3] = "120px";

 // END editable //

 var details = document.getElementById('details')
 var detailsCont = document.getElementById('detailsCont')
 if(details)
 {
   details.style.display='inline';
   details.style.top=productY[data];
   details.style.left=productX[data];
   if(detailsCont)
  	{
     detailsCont.innerHTML = "<h3 style='margin: 0px 0px 5px 0px'>" + productName[data] + "</h3>";
     detailsCont.innerHTML = detailsCont.innerHTML + productDescription[data] + "<br>";
     detailsCont.innerHTML = detailsCont.innerHTML + "<a href='" + productLink[data] + "'>more info</a>";
  	 }
	 }
}

/* 
check all the inputs and make sure a quantity has
been set for at least one field. The function actually
checks to see if the hidden checkboxes have been checked. 
*/
function checkQuantity() {

 var order = document.getElementById('orderingTable').getElementsByTagName('input')
 var validate = false;

 for ( i = 0; i < order.length; i++ ) {

  //alert(order[i].checked);
 
  if ( order[i].checked == true ) {

   validate = true;
   break;
  
  }
 
 }

 if ( validate == false ) {
 
  alert("You must enter a quantity for at least one option.");
 
 }

 return validate;

}

// Show the tell a friend div and center it on the screen.
function taf() {

 var taf = document.getElementById('taf')
 var top = (screen.height / 2) - 300 + "px"
 var left = (screen.width / 2) - 350 + "px"

 taf.style.display='inline';
 taf.style.position='absolute';
 taf.style.top=top;
 taf.style.left=left;

}

function extraItemInfo(content) {

 var extraInfo = document.getElementById('extraItemInfo')

 extraInfo.innerHTML = content;

}

function clearInfo() {

 var extraInfo = document.getElementById('extraItemInfo')

 extraInfo.innerHTML = "";

}
