
/**
	***---------------------------------------------------------***
	*	CardClass.js
	***---------------------------------------------------------***
	*	Artware Studios
	*	Send A Blessing
	*	18 June 2006	tb
	*
	*	This file contains the client-side Card Class.
	*/

function Card(
	thecardID,
	thecardName,
	thedisplayName,
	thethumbOrder,
	thebackgroundColor,
	themsgFieldColor,
	themsgTextColor,
	theblurb,
	thedescription,
	themusicInfo,
	themusicLink,
	thecomposerLink,
	thecategoriesBitMask,
	theHasAbout,
	theposted)
{//function Card   Creates a new instance of the Card class.
	this.cardID = thecardID;
	this.cardName = thecardName;
	this.displayName = thedisplayName;
	this.thumbOrder = thethumbOrder;
	this.backgroundColor = thebackgroundColor;
	this.msgFieldColor = themsgFieldColor;
	this.msgTextColor = themsgTextColor;
	this.blurb = theblurb;
	this.description = thedescription;
	this.musicInfo = themusicInfo;
	this.musicLink = themusicLink;
	this.composerLink = thecomposerLink;
	this.categoriesBitMask = thecategoriesBitMask;
	this.hasAbout = theHasAbout;
	this.posted = theposted;
}//function Card

//Card.constructCardList = function(var theCardArray)
//{//For use in  personalizeCardPage.php .
//	var theChoices = document.personalizeCardForm.cardList;
//	for (var i=0; i<numberOfCards; i++)
//	{
//		var theName = theCardArray[i].cardName;
//alert("theName: " + theName);
//		var theValue = theCardArray[i].cardID;
//alert("theValue: " + theValue);
//		var theOption = new Option(theName, theValue, false, false);
//		theChoices.options[theChoices.options.length] = theOption;
//	}
//};//Card.constructCardList = function()

//NOTE: This doesn't need to be a function of the JS class Card.
//Maybe better to put it in  PersonalizeTools.js  and expand it to rebuild the  greetingArray .
Card.changeCard = function()	
{//For use in  personalizeCardPage.php .
	var theIndex = document.personalizeCardForm.cardList.selectedIndex;
	var theCardIndex = document.personalizeCardForm.cardList.options[theIndex].value;
	var theIndexNumber = parseInt(theCardIndex, 10);	//To take account of discrepancy between array & <select>.
	var theName = cardArray[theIndexNumber].cardName;
	var theThumbnailFile = "http://www.sendablessing.com/images/thumbnails/" + theName + "_Th.gif";
	document.personalizeCardForm.cardThumb.src = theThumbnailFile;
};//Card.changeCard = function()

