/* 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[51513] = new paymentOption(51513,'Who´s the Daddy : Exclusive 20&quot;x 24&quot; mounted P+P Inc.','495.00');
paymentOptions[51518] = new paymentOption(51518,'Lighting the cloth : Exclusive 20&quot;x 26&quot; mounted P+P Inc.','230.00');
paymentOptions[51519] = new paymentOption(51519,'Cerebral : Exclusive 20&quot;x 26&quot;  mounted P+P Inc.','230.00');
paymentOptions[53639] = new paymentOption(53639,'Print of the month : P+P Inc.','98.00');
paymentOptions[54474] = new paymentOption(54474,'Finished','0.00');
paymentOptions[49616] = new paymentOption(49616,'Collectors Edition  :  8&quot;x 10 &quot;','35.00');
paymentOptions[63338] = new paymentOption(63338,'A','5.00');
paymentOptions[63339] = new paymentOption(63339,'B','10.00');
paymentOptions[49617] = new paymentOption(49617,'Connesieur :  12&quot;x 16&quot; mounted P+P Inc : €55','55.00');
paymentOptions[49618] = new paymentOption(49618,'Master :  20&quot;x 26&quot; mounted P+P Inc : €168','168.00');
paymentOptions[63340] = new paymentOption(63340,'C','20.00');
paymentOptions[63341] = new paymentOption(63341,'D','50.00');
paymentOptions[49619] = new paymentOption(49619,'Wraiths : Exclusive  20&quot;x 26&quot; mounted P+P Inc.','280.00');
paymentOptions[63342] = new paymentOption(63342,'E','40.00');
paymentOptions[63343] = new paymentOption(63343,'F','100.00');
paymentOptions[63344] = new paymentOption(63344,'G','200.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[15668] = new paymentGroup(15668,'Cerebral','51519,63339');
			paymentGroups[16531] = new paymentGroup(16531,'Finished','54474');
			paymentGroups[15667] = new paymentGroup(15667,'Lighting the cloth','51518');
			paymentGroups[19378] = new paymentGroup(19378,'Mobile Portal','63338,63339,63340,63341,63343,63344');
			paymentGroups[15179] = new paymentGroup(15179,'paypal','');
			paymentGroups[16259] = new paymentGroup(16259,'Print of the month','53639');
			paymentGroups[15073] = new paymentGroup(15073,'prints Standard','49617,49618');
			paymentGroups[15665] = new paymentGroup(15665,'Who´s the Daddy','51513');
			paymentGroups[15664] = new paymentGroup(15664,'Wraiths','49619');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		$.each(paymentGroups[payment_groups_id].options, function(i){
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - &euro;' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


