function addQuotation (aQuotation)
{
	var myQuotationHtml = $.cookie('quotationhtml');
	myQuotationHtml = (myQuotationHtml == null) ? '' : myQuotationHtml;
	var myShowAlert = (myQuotationHtml == '');
	
	myQuotationHtml = myQuotationHtml + '<br />' + '<a href="' + document.URL + '">' + aQuotation + '</a>';
	$.cookie('quotationhtml', myQuotationHtml, {path: '/'});
	
	var myQuotationTxt = $.cookie('quotationtxt');
	myQuotationTxt = (myQuotationTxt == null) ? '' : myQuotationTxt;
	myQuotationTxt = myQuotationTxt +  "\n" + aQuotation;
	$.cookie('quotationtxt', myQuotationTxt, {path: '/'});

	showQuotation('fade');

	if (myShowAlert)
	{
		$('body').append($('.jqmWindow')); // IE6 fix
		$('#quotationdialog').jqm().jqmShow();
	}
}

function showQuotation(doFade)
{
	var myQuotationHtml = $.cookie('quotationhtml');

	if ((myQuotationHtml == null) || (myQuotationHtml == ''))
	{
		$('#offerteNotification p').html('');
	}

	if (doFade)
	{
		jQuery('#offerteNotification').fadeIn('slow', function()
		{
			updateQuotationNotification(myQuotationHtml);
			jQuery('#offerteNotification').delay(1000).fadeOut('slow');
		});
	}
	else
	{
		updateQuotationNotification(myQuotationHtml);
	}
}

function updateQuotationNotification(qtnHtml)
{
	jQuery('#offerteNotification p').html(qtnHtml);
	var offerteAantal = jQuery('#offerteNotification p a').length;
	jQuery('#quotationQty').html(offerteAantal);
	if (offerteAantal)
	{
		jQuery('#requestQuote').show();
	}
	else
	{
		jQuery('#requestQuote').hide();
	}
}

function resetQuotation() { $.cookie('quotationhtml', '', {path: '/'}); $.cookie('quotationtxt', '', {path: '/'}); showQuotation('fade'); }
