function changeVAT( priceWithVAT ) {
	
	if( priceWithVAT ) {
		$('#priceWithVAT').attr('checked', true);
		$('#priceWithoutVAT').attr('checked', false);
		$('.productIncVAT').each(function(){
			$(this).show()
		});

		$('.productExcVAT').each(function(){
			$(this).hide()
		});
	}else{
		$('#priceWithVAT').attr('checked', false);
		$('#priceWithoutVAT').attr('checked', true);
		$('.productIncVAT').each(function(){
			$(this).hide()
		});

		$('.productExcVAT').each(function(){
			$(this).show()
		});
	}

	setCookie( 'c_priceWithVAT', priceWithVAT );
}

function checkVATCookie() {
	var cookieVal = getCookie( 'priceWithVAT' );
	
	// if val is true or not previously been set...
	if ( cookieVal != 'false' || cookieVal == 'true' || typeof cookieVal == 'undefined' ) {
		updateVAT(  );
	} else {
		updateVAT( true );
	}
}
function setCookie( name, value ) {
	document.cookie = name + '=' + value + ';path=/;';
}

function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) {
		return null;
	}
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) {
		end = document.cookie.length;
	}
	return unescape( document.cookie.substring( len, end ) );
}
