jQuery.noConflict();
jQuery(function($) {
		$(".omgcalendarclass").datepicker({ defaultDate: +3, dateFormat: 'yymmdd', minDate: '+' + calendardisable + 'd' });
		$('#ecom--coform--customsix').after('<p class="omg_deliverynotice">If you are experiencing a problem ordering, please call us at +65 6348 2838</p>');
		
		
		var shipoption = $('#shipping_options_omg input[type=radio]:checked').val();
		if(shipoption != 0) {
			$('#delivery_info_head, #delivery_info_sect').show();
		} else {
			$('#delivery_info_head, #delivery_info_sect').hide();
		}
		$('#shipping_options_omg input[type=radio]').click(function(){
				
				var valopt = $(this).val();
				var opttext = $(this).parent().text().split(' - ');
				var selectedprice = opttext[1].split('$');
				
				var subtotal = $('#subtotal_total_omg').text().split('$');
				var deliverytotal = $('#delivery_total_omg').text().split('$');
				var total = $('#total_disp_omg').text().split('$');
				
				if(typeof selectedprice[1] === 'undefined') {
					$('#delivery_total_omg').text('$0.00');
					$('#total_disp_omg').text('$' + subtotal[1]);
				} else {
					$('#delivery_total_omg').text('$' + selectedprice[1]);
					$('#total_disp_omg').text('$' + $.number_format( ((parseFloat(selectedprice[1]) + parseFloat(subtotal[1])) * 100), {precision: 2} ));
				}
				
				if(valopt != 0) {
					$('#delivery_info_head, #delivery_info_sect').fadeIn(500);
				} else {
					$('#delivery_info_head, #delivery_info_sect').slideUp(500);
				}
		});
		
//		var homephonefield = $('#ecom--coform--customfive');
//		homephonefield.parent('fieldset').hide();
//		$('.formsecthead').each(function(){
//			var formsectval = $(this).text();
//			if(formsectval == 'Recipient Handphone') {
//				$(this).hide();
//			}
//		});
//		var phonedata = homephonefield.parent('fieldset').html();
//		
//		$('#delivery_info_sect tr:eq(1) td:eq(0)').append(phonedata);

		var recipienthead = $('#coform--recipienthandphone--d').prev('div');
		var recipientsect = $('#coform--recipienthandphone--d');
		
		var deliveryinfo = $('#delivery_info_sect tr:eq(1) td:eq(0)').append(recipientsect);
		
		recipienthead.hide();
		
		
});

