$(document).ready(function(){
	 if (!$.browser.msie) {var mode='change'}
	 else{var mode='click'}
		$('.act').bind(mode,function(){

		var thisval=$(this).attr('value');
		var thisname=$(this).attr('name');
		//var messageid="#message"+thisname;//alert(messageid);
		//var warningid="#warning"+thisname;//alert(warningid);
		
		if(thisval==1){
		var radioid="#y"+thisname;//alert(warningid);
		var radioidn="#n"+thisname;//alert(warningid);
			//$(messageid).html('you picked yes');
			$(radioid).css("color","#009900");
			$(radioidn).css("color","#000");
			//$(radioid).css("background-color","#E7F4D9");
		}
		else{
		var radioid="#n"+thisname;//alert(warningid);
		var radioidy="#y"+thisname;//alert(warningid);
			//$(messageid).html('you picked no');
			$(radioid).css("color","#FF0000");
			$(radioidy).css("color","000");
			//$(radioid).css("background-color","#FFE6FF");
		}
		var i;
		str='';
		var quesval=parseInt($('#ques').val())-parseInt(1);
		var noofq =parseInt($('#ques').val())+parseInt(1);//alert(noofq);
		for(i=1;i<noofq;i++){
		mystr ='q'+i+'=1&';
		str = str+mystr;
		}
		var formstr = $("form input:radio").serialize();
		//alert(formstr);
		//alert(str);
		var n = $("input:checked").length;
		if (n>quesval){
		if(formstr+'&'==str){$('#well').html('<input type="submit" value="Continue"/>');}
		else{
			$('#well').html('<br /><div>You have answered no to one or more of the eligibility questions, therefore you are unable to purchase this product. If you have other items in in the basket that you wish to buy, please click the "proceed to basket" button below</div><br /><input type="hidden" name="no" value=1" /><input type="submit" value="Proceed to Basket"/>');
		}
		}
		
	})

});
