btnColorMapping = new Object;
btnColorMapping['button1'] = '0xfff4bc';
btnColorMapping['button2'] = '0xf6f1e3';
btnColorMapping['button3'] = '0x662a66';
btnColorMapping['button4'] = '0xffffff';

btnColorMapping['button5'] = '0x302724';
btnColorMapping['button6'] = '0x341706';
btnColorMapping['button7'] = '0xeefa58';
btnColorMapping['button8'] = '0xfbac01';

btnColorMapping['button9'] = '0x00a4da';
btnColorMapping['button10'] = '0x466f7e';
btnColorMapping['button11'] = '0x5b533e';
btnColorMapping['button12'] = '0xffffff';

btnColorMapping['button13'] = '0xffd201';
btnColorMapping['button14'] = '0xe05c65';
btnColorMapping['button15'] = '0x45afd2';
btnColorMapping['button16'] = '0xed0d9e';

btnColorMapping['button17'] = '0xa5ccc0';
btnColorMapping['button18'] = '0xb33c44';
btnColorMapping['button19'] = '0xffffff';
btnColorMapping['button20'] = '0xffffff';

btnColorMapping['button21'] = '0xb05930';
btnColorMapping['button22'] = '0xc0d700';


$(document).ready(function() {
	
	// STEP ONE - Intention
	$("#stepOneIntention").keyup(function () {
		window.document.buttonFlash.SetVariable("btnTxt", $("#stepOneIntention").val());
	});
	$("#stepOneIntention").focus(function () {
		$("#stepOneIntention").select();
	});
	$("#stepOneIntention").blur(function () {
		window.document.buttonFlash.SetVariable("btnTxt", $("#stepOneIntention").val());
	});

	
	$("#imgLabelRadioMe").click(function () {
		$('#radioMe:radio').val(['m']);
	})

	$("#imgLabelRadioFriend").click(function () {
		$('#radioFriend:radio').val(['f']);
	});



	
	// STEP TWO - Button Selection
	$(".clickable").click(function () {
		/*is a button or a image clicked?*/
		if(this.tagName == 'LABEL')
		{
			newClass = $(this).attr('id');
			$('#radio_' + $(this).attr('id') + ':radio').val([$(this).attr('id').substring(6)]);
		}
		else
		{
			newClass =  $(this).attr('id').substring(6);
		}
		
		if($(this))
		{
			$("#bigButtonWrapper").attr("class",newClass);
		}
		
		if(btnColorMapping[newClass])
		{
			window.document.buttonFlash.SetVariable("btnClr", btnColorMapping[newClass]);
		}
	});

	//STEP THREE - Reminder Selection
	$("#imgLabelReminderDaily").click(function () {
		$('#reminderDaily:radio').val(['daily']);
	});
	$("#imgLabelReminderWeekly").click(function () {
		$('#reminderWeekly:radio').val(['weekly']);
	});
	$("#imgLabelReminderSilvester").click(function () {
		$('#reminderSilvester:radio').val(['silvester']);
	});
	$("#imgLabelReminderMonthly").click(function () {
		$('#reminderMonthly:radio').val(['monthly']);
	});
	$("#imgLabelReminderRandom").click(function () {
		$('#reminderRandom:radio').val(['random']);
	});
	$("#imgLabelReminderNever").click(function () {
		$('#reminderNever:radio').val(['never']);
	});

	
});
