function nextStep(productgroupID,questionID,answer,previousQ)
	{
		if(!previousQ)previousQ=0;
		//spinner
		$("#sleepselector").html("<div style=\"padding-top:50px;padding-left:100px;\"><img src=\"img/loading_white.gif\"></div>");

		//jQUery safe
		$.ajax({
		  url: 'presentquestion.php?pgid='+productgroupID+'&qid='+questionID+"&answer="+answer+"&prev="+previousQ,
		  cache: false,
		  success: function(html){
//			$("#sleepselector").hide();
			$("#sleepselector").html(html);
//			$("#sleepselector").fadeIn("fast");
		  }
		});
	} 

function restart()
	{
		//spinner
		$("#sleepselector").html("<div style=\"padding-top:50px;padding-left:100px;\"><img src=\"img/loading_white.gif\"></div>");

		//jQUery safe
		$.ajax({
		  url: 'sleepselectorstart.php?ajax=true',
		  cache: false,
		  success: function(html){
			$("#sleepselector").html(html);
		  }
		});
	} 

function submitForm()
{
	//get values from form
	var result = "";
	$('input:checkbox[name=productgroup]:checked').each( function () {
	  result = result + $(this).val() + ", ";
	});

	if(result!='')
	{
		//jQUery safe
			$.ajax({
			  url: 'presentquestion.php?productgroup='+result,
			  cache: false,
			  success: function(html){
		//		$("#sleepselector").hide();
				$("#sleepselector").html(html);
		//		$("#sleepselector").fadeIn("fast");
			  }
			});
	}
	//nothing selected
	else
	{
		$("#selectionerror").hide();
		$("#selectionerror").fadeIn("fast");
	}
}

banner=1;

function rotateBanner()
{
	if(banner==1)
	{
		$(".rangethumbs").html("<a href=\"lux_pillow.html\"><img src=\"img/novolux_promo1.jpg\" width=\"234\" height=\"400\" alt=\"Novolux\" /></a>");		
		banner=2;
	}
	else
	{
		$(".rangethumbs").html("<a href=\"pure_sheets.html\"><img src=\"img/novopure_promo2.jpg\" width=\"234\" height=\"400\" alt=\"Novopure\" /></a>");
		banner=1;
	}
}
