You could store them in the same cookie but I think that would over-complicate things. If you only want to show the message if both questions are "Yes", I would check them before storing the cookie and then set the cookie to "Show" or "Hide".
So your script for the last page would be something like:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// Find the question results
var result1 = '{INSERTANS:11111X22X33}';
var result2 = '{INSERTANS:11111X22X34}';
// Set a cookie with the Show/Hide value
if(result1 == "Yes" && result2 == "Yes") {
document.cookie = 'showMsg=Show';
else {
document.cookie = 'showMsg=Hide';
}
})
</script>
And in the end message:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// A function to get the value of a cookie by name
function getCookie (cookieName) {
var results = document.cookie.match ('(^|;) ?' + cookieName + '=([^;]*)(;|$)');
if (results) {
return (unescape (results[2]));
}
else {
return null;
}
}
// Hide the dynamic message
$('.dynamicMessage').hide();
// Retrieve the cookie value
var showMsg = getCookie ('showMsg');
// Display the message if the cookie is "Show"
if(showMsg == 'Show') {
$('.dynamicMessage').show();
}
});
</script>