function backquestion(){
	answerappendinit=document.getElementById('selectorInfo.answer').value;
	//alert('answerappendinit '+answerappendinit);	
	if(answerappendinit.indexOf('~')>=0){
		answerappendinit=answerappendinit.substring(answerappendinit.indexOf('~')+1,answerappendinit.length);
		if(answerappendinit.indexOf('~')>=0){
			answerappendinit=answerappendinit.substring(answerappendinit.indexOf('~')+1,answerappendinit.length);
			if(answerappendinit.indexOf('~')>=0){
				document.getElementById('selectorInfo.answer').value=answerappendinit;
				answerappendinit=answerappendinit.substring(answerappendinit.indexOf('~')+1,answerappendinit.length);		
				//alert('answerappendinit '+answerappendinit);
			}else{				
				document.getElementById('selectorInfo.answer').value=answerappendinit;
			}
		}else{
			document.getElementById('selectorInfo.answer').value="";
		}	
	}else{
			document.getElementById('selectorInfo.answer').value="";
	}		
	
	questionappendinit=document.getElementById('questionappend').value;
	questionappendinit=questionappendinit.substring(0,questionappendinit.lastIndexOf('~'));
	questionappendinit=questionappendinit.substring(0,questionappendinit.lastIndexOf('~'));
	//alert('questionappendinit '+questionappendinit);
	if(questionappendinit.lastIndexOf('~')>=0){
		document.getElementById('questionappend').value=questionappendinit;
		questionappendinit=questionappendinit.substring(questionappendinit.lastIndexOf('~')+1,questionappendinit.length);
		document.getElementById('question').value=questionappendinit;		
		//alert('questionappendinit '+questionappendinit);
	}else{
		document.getElementById('question').value=questionappendinit;
		document.getElementById('questionappend').value=questionappendinit;
	}
	//document.findYourPad.submit();<br>
	history.go(-1);
}


function backquestion_for_BGUS_product_selector(){
	answerappendinit=document.getElementById('selectorInfo.answer').value;
	//alert('answerappendinit '+answerappendinit);	
	document.getElementById('back_button_clicked').value="Y";
	if(answerappendinit.indexOf('~')>=0){
		answerappendinit=answerappendinit.substring(answerappendinit.indexOf('~')+1,answerappendinit.length);
		if(answerappendinit.indexOf('~')>=0){
			answerappendinit=answerappendinit.substring(answerappendinit.indexOf('~')+1,answerappendinit.length);
			if(answerappendinit.indexOf('~')>=0){
				document.getElementById('selectorInfo.answer').value=answerappendinit;
				answerappendinit=answerappendinit.substring(answerappendinit.indexOf('~')+1,answerappendinit.length);		
				//alert('answerappendinit '+answerappendinit);
			}else{				
				document.getElementById('selectorInfo.answer').value=answerappendinit;
			}
		}else{
			document.getElementById('selectorInfo.answer').value="";
		}	
	}else{
			document.getElementById('selectorInfo.answer').value="";
	}		
	
	questionappendinit=document.getElementById('questionappend').value;
	questionappendinit=questionappendinit.substring(0,questionappendinit.lastIndexOf('~'));
	questionappendinit=questionappendinit.substring(0,questionappendinit.lastIndexOf('~'));
	//alert('questionappendinit '+questionappendinit);
	if(questionappendinit.lastIndexOf('~')>=0){
		document.getElementById('questionappend').value=questionappendinit;
		questionappendinit=questionappendinit.substring(questionappendinit.lastIndexOf('~')+1,questionappendinit.length);
		document.getElementById('question').value=questionappendinit;		
		//alert('questionappendinit '+questionappendinit);
	}else{
		document.getElementById('question').value=questionappendinit;
		document.getElementById('questionappend').value=questionappendinit;
	}
	//document.findYourPad.submit();<br>
	history.go(-1);
}

function preloadanswer(){ 
	preloadanswer=document.getElementById('selectorInfo.answer').value;	
	//preloadanswer=preloadanswer.substring(preloadanswer.indexOf('~')+1,preloadanswer.length);	
	alert('fromback ' + document.getElementById('fromback').value);
	if(preloadanswer.length>0){
		alert('preloadanswer if ' + preloadanswer);
		//document.getElementById('selectorInfo.answer').value=preloadanswer;
		populateThisRadio(document.getElementById('selectorInfo.answer'), preloadanswer)		
	}else{
				document.findYourPad.elements[0].checked=true;
	}

}

  function populateThisRadio(selectedList, valSel)

  {

  	var srcf = document.getElementById("findYourPad").elements[selectedList.id];	

	//var srcf = getRadioArray(selectedList.id);	

	/*for(var i = 0; i < srcf.length; i++) {

		alert("the valsel value is " + srcf[i].id);

		alert("the valsel value is " + srcf[i].value);		

	}*/

	if(valSel>0){

		alert(" the valsel value is  "+ srcf[valSel-1].value);

		srcf[valSel-1].checked="True"; 	

	}	

  } 
