
function inputFocus(input) {
	$(input).parent().css('background-image', 'url(/img/input-bkg-focus.png)');
}
function inputBlur(input) {
	$(input).parent().css('background-image', 'url(/img/input-bkg.png)');
}
function _void() {}

function htmlRadioCheck(el) {
	$('input', el).attr('checked', 'checked').trigger('change');
}
function htmlCheckboxCheck(el) {
	$('input', $(el).parent()).click();
}


var RichSelect = {
	toggle : function(obj, event) {
		var currentState = $('div.pane', obj).css('display');

		if(currentState == 'none' && (event.target || event.srcElement) == $(obj).get(0)) {
			$('div.pane', obj).show();
			$(obj).addClass('rich-select-opened');
		}
		else if((event.target || event.srcElement) == $(obj).get(0)){
			this.close(obj);
		}
	},
	close : function(obj) {
		$('div.pane', obj).hide();
		$(obj).removeClass('rich-select-opened');
	}
}

var EstimatedPrice = {
	basePrice : 0,
	personCount : 1,

	update : function() {
		var amount = EstimatedPrice.basePrice * EstimatedPrice.personCount;
		if(isNaN(amount)) {
			$('#estimated_amount').html('Odhod ni na voljo.');
		}
		else {
			$('#estimated_amount').html('<b>' + amount + '</b> &euro;');
		}
	}
};

