// <![CDATA[

	var format = function(num, options) {

		options.point	= options.point || '.';

		options.group	= options.group || ' ';

		options.places	= options.places || 2;

		options.suffix	= options.suffix || '';

		options.prefix	= options.prefix || '';

		

		regex = /(\d+)(\d{3})/;

		result = ((isNaN(num) ? 0 : Math.abs(num)).toFixed(options.places)) + '';

		

		for (result = result.replace(',', options.point); regex.test(result) && options.group; result = result.replace(regex, '$1'+options.group + '$2')) {};

		

		return (num < 0 ? '-' : '') + options.prefix + result + options.suffix;

	};

function CommaFormatted(amount) {
	var delimiter = ","; // replace comma if desired
	var a = amount.split('.',2)
	var d = a[1];
	var i = parseInt(a[0]);
	if(isNaN(i)) { return ''; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	var n = new String(i);
	var a = [];
	while(n.length > 3) {
		var nn = n.substr(n.length-3);
		a.unshift(nn);
		n = n.substr(0,n.length-3);
	}
	if(n.length > 0) { a.unshift(n); }
	n = a.join(delimiter);
	if(d.length < 1) { amount = n; }
	else { amount = n + '.' + d; }
	amount = minus + amount;
	return amount;
}


	if (window.jQuery) {

		$(document).ready( function() {

			$('a.blank').attr('target', '_blank');

			$('a.parent').attr('target', '_parent');

			

			$('a[rel*="gallery"]').colorbox();

			

			$('input.inventory_qty').bind('keyup', function() {

				var ITEM = $(this).attr('id').replace('qty', '')

				var VOL = $(this).attr('class').replace('inventory_qty item_', '');

				

				var QTY = $(this).val();

				var CFT = 0;

				var CBM = 0;

				

				if (isNaN(QTY) == false && Math.floor(QTY) >= 0) {

					CFT = QTY * VOL;

					CBM = CFT * 0.02832;

					CBM = format(CBM, { places: 3 });
					

				};

				

				$('input#cft' + ITEM).val(CFT);

				$('input#cbm' + ITEM).val(CBM);

			});

			

			$('input.inventory_cft').bind('keyup', function() {

				var ITEM = $(this).attr('id').replace('cft', '')

				var VOL = $(this).val();

				

				var QTY = $('input#qty' + ITEM).val();

				var CFT = 0;

				var CBM = 0;

				

				if (isNaN(QTY) == false && Math.floor(QTY) >= 0) {

					CFT = QTY * VOL;

					CBM = CFT * 0.02832;

					

					CBM = format(CBM, { places: 3 });

				};

				

				$('input#cbm' + ITEM).val(CBM);

			});

			

			$('button#Next').bind('click', function() {

				var msg = '';

				var foc = '';

				

				if ($('input#First_name').val() == '') { msg += '\n- First name'; if (foc == '') { foc = 'First_name' }; };

				if ($('input#Last_Name').val() == '') { msg += '\n- Last Name'; if (foc == '') { foc = 'Last_Name' }; };

				if ($('input#Home_phone').val() == '') { msg += '\n- Home phone'; if (foc == '') { foc = 'Home_phone' }; };

				if ($('input#E-mail').val() == '') { msg += '\n- E-mail'; if (foc == '') { foc = 'E-mail' }; };

				if ($('input#Cur_City').val() == '') { msg += '\n- City (Current Address)'; if (foc == '') { foc = 'Cur_City' }; };

				if ($('select#Cur_Country option:selected').val() == '') { msg += '\n- Country (Current Address)'; if (foc == '') { foc = 'Cur_Country' }; };

				if ($('input#Des_City').val() == '') { msg += '\n- City (Destination Address)'; if (foc == '') { foc = 'Des_City' }; };

				if ($('select#Des_Country option:selected').val() == '') { msg += '\n- Country (Destination Address)'; if (foc == '') { foc = 'Des_Country' }; };

				if ($('input#Month').val() == '') { msg += '\n- Month'; if (foc == '') { foc = 'Month' }; };

				if ($('input#Year').val() == '') { msg += '\n- Year'; if (foc == '') { foc = 'Year' }; };

				if ($('input[name="Full_packing_of_fragile_and_non_fragile_items"]:checked').length == 0) { msg += '\n- Full packing of fragile and non fragile items'; };

				if ($('input[name="Packing_of_only_fragiles/dishes"]:checked').length == 0) { msg += '\n- Packing of only fragiles/dishes'; };

				if ($('input[name="Unpack_of_all_boxes_at_destination"]:checked').length == 0) { msg += '\n- Unpack of all boxes at destination'; };

				if ($('input[name="Assembly/disassembly_of_furniture"]:checked').length == 0) { msg += '\n- Assembly/disassembly of furniture'; };

				if ($('input[name="Payment"]:checked').length == 0) { msg += '\n- Payment'; };

				

				if (msg != '') {

					window.alert('Please fill the required fields:\n' + msg + '\n');

					

					if (foc != '') {

						$('#' + foc).focus();

					};

					

					return false;

				};

			});

		} );

	};

// ]]>
