
function removeFromBasket(el_id, el_count, current_value, new_value) {
	jQuery("input[name='product[" + el_id + "][info][serials][]']").each(function(i, val) {
		if(i == el_count) jQuery(this).remove();
	});
}

function serialChange(form_selector) {
	jQuery(form_selector).find('.submitButton').hide();
}

function serialValid(resp, form_selector) {
	jQuery(form_selector).find('.serialErrorIcon').hide();
	jQuery(form_selector).find('.serialValidIcon').show();
	jQuery(form_selector).find('.submitButton').show();
	jQuery(form_selector).find('.shop_item_voucher_invalid').html('');
	jQuery(form_selector).find('.shop_item_voucher_invalid').hide();
	jQuery(form_selector).find('.shop_item_voucher_valid').css('display', 'table');
}

function serialInValid(resp, form_selector) {
	jQuery(form_selector).find('.shop_item_voucher_valid').hide();
	jQuery(form_selector).find('.serialValidIcon').hide();
	jQuery(form_selector).find('.serialErrorIcon').show();
	jQuery(form_selector).find('.shop_item_voucher_invalid').html( $(resp).find('#error-list').html() );
	jQuery(form_selector).find('.shop_item_voucher_invalid').css('display', 'table');
}

function showRates(url) {
	var b_url = cmsClient.host_url;
	if(typeof(url) != 'undefined') cmsClient.host_url = url;
	if(jQuery('input[name=call_from]').val().length > 1 && jQuery('input[name=call_to]').val().length ) {
		cmsClient.postForm('travelsim', 'rates', 'rates-find-form', '', function(response) {
			jQuery('.rates_box').html(response);
			jQuery('.rates_box').show();
		});
	} else {
		cmsClient.showError($t('err_travelsim.rates_select_country'));
	}
	if(typeof(url) != 'undefined') cmsClient.host_url = b_url;
}

$(document).ready( function (){
	$('[title]').tooltip({position: {my: "left bottom", at: "left top", offset: "-3"}});
});