/* >> Show / hide shipping address */
	/* orderForm */
	LieferAdr = {
		storage: null,
		setStorage: function(){
			var fields = $('#lieferAdrBox').find(':input');
			this.storage = [];
			var self = this;
			fields.each(function(i){
					self.storage.push({'name': $(this).attr('name'), 'value': $(this).attr('value'), 'element': $(this)});
			});
			
		},
		storeAndClear: function(){
			this.setStorage();
			if ($('#lieferadresse').attr('checked') == true){
				lieferAdrBox(null, $('#lieferadresse'));
			}
			else {
				$('#lieferadresse').removeAttr('checked');
				$('#lieferAdrBox').find(':input').val('');
			}
		},
		fillFieldsFromStorage: function(){
			$(this.storage).each(function(i){
					this.element.val(this.value);
			});
		}
	};
	
	function lieferAdrBox(event, el){
		var lieferAdrCheck = $(el).attr('checked');
		var lieferAdrBox = $('#lieferAdrBox');
		if (lieferAdrCheck == true){
			LieferAdr.fillFieldsFromStorage();
			lieferAdrBox.show();
		}
		else if (lieferAdrCheck == false){
			lieferAdrBox.find('input').each(function() {
					$(this).attr('value', '');
			})
			lieferAdrBox.find('select').each(function() {
					var opt = $(this).find('option');
					opt.each(function(i){
						$(this).removeAttr('selected');
						if (i == 0) {
							$(this).attr('selected', 'selected');
						}
					})
			})
			lieferAdrBox.hide();
		}
	}
	
	/* vMode */
	function vMode_lieferAdrBox(){
		var shell = $('#of_vMode_shippingAdr');
		var cb = $('#of_vMode_shippingAdr_value').text();
		
		if (cb == "1") {
			shell.show();
		}
	}
/* << */
