/* Create a Payment option */
function paymentOption(id,payment_option,price) {
	this.id = id;
	this.payment_option = payment_option;
	this.price = price;
}

/* Create a Payment group */
function paymentGroup(id,payment_group,options) {
	this.id = id;
	this.payment_group = payment_group;
	this.options = options.split(",");
}

/***************************************************************************
* Update the payment submission form with the price and item description   *
* When a user selects an option from the list                              *
***************************************************************************/
function updateItemValues(form,id) {
					form.amount.value = paymentOptions[id].price;
			form.item_name.value = (paymentOptions[id].payment_option).replace(/&quot;/g,'"');
					}

/***************************************************************************
* Create the array of payment options. This contains all options for the   *
* site.The options available for a given photo are hardwired into the      *
* photo page whichis why we can't use the quick browse methods on payment  *
* enabled sites                                                            *
***************************************************************************/
var paymentOptions = new Object();
paymentOptions[16058] = new paymentOption(16058,'9 x 6 inch - matt, unmounted','14.00');
paymentOptions[16062] = new paymentOption(16062,'9 x 6 inch - gloss, unmounted','14.00');
paymentOptions[16059] = new paymentOption(16059,'12 x 8 inch - matt, unmounted','19.00');
paymentOptions[16063] = new paymentOption(16063,'12 x 8 inch - gloss, unmounted','19.00');
paymentOptions[16060] = new paymentOption(16060,'16 x 12 inch - matt, unmounted','26.00');
paymentOptions[16061] = new paymentOption(16061,'16 x 12 inch - gloss, unmounted','26.00');
paymentOptions[46534] = new paymentOption(46534,'20 x 16 inch - matt, unmounted','40.00');
paymentOptions[46535] = new paymentOption(46535,'20 x 16 inch - gloss, unmounted','40.00');
paymentOptions[16054] = new paymentOption(16054,'8 x 8 inch - matt, unmounted','14.00');
paymentOptions[16055] = new paymentOption(16055,'8 x 8 inch - gloss, unmounted','14.00');
paymentOptions[65093] = new paymentOption(65093,'10 x 10 inch - matt, unmounted ','19.00');
paymentOptions[65094] = new paymentOption(65094,'10 x 10 inch - gloss, unmounted ','19.00');
paymentOptions[16056] = new paymentOption(16056,'12 x 12 inch - matt, unmounted ','26.00');
paymentOptions[16065] = new paymentOption(16065,'12 x 12 inch - gloss, unmounted','26.00');
paymentOptions[46536] = new paymentOption(46536,'16 x 16 inch - matt, unmounted','40.00');
paymentOptions[46537] = new paymentOption(46537,'16 x 16 inch - gloss, unmounted','40.00');
paymentOptions[46280] = new paymentOption(46280,'12 x 12 inch - Canvas wrap-around print','65.00');
paymentOptions[46281] = new paymentOption(46281,'16 x 16 inch - Canvas wrap-around print','95.00');
paymentOptions[46282] = new paymentOption(46282,'20 x 20 inch - Canvas wrap-around print','145.00');
paymentOptions[46283] = new paymentOption(46283,'12 x 8 inch - Canvas wrap-around print','55.00');
paymentOptions[46284] = new paymentOption(46284,'16 x 12 inch - Canvas wrap-around print','85.00');
paymentOptions[46285] = new paymentOption(46285,'20 x 16 inch - Canvas wrap-around print','135.00');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[4827] = new paymentGroup(4827,'Landscape or Portrait Prints','16058,16062,16059,16063,16060,16061,46534,46535,46283,46284,46285');
			paymentGroups[4826] = new paymentGroup(4826,'Square Prints','16054,16055,65093,65094,16056,16065,46536,46537,46280,46281,46282');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		for (var i in paymentGroups[payment_groups_id].options) {
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - &pound;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


