/*******************************
Custom Javascript
*******************************/

function customOnLoad1() {
	
	$(document).ready(function() {
							   
		//alert ('Page 1');
		
		// Function to allow randomization of all answers except the last one in Multiple options and List/radio questions
		function partRand(sID, gID, qID) { 
			
			// Find the number of answers
			var ansCount = ''
			$( 'div#question' + qID + ' td.answer li' ).each(function(i) {
				ansCount = (i + 1);
			});
		
			// Place the last answer created at the end of the list
			$( 'input#answer' + sID + 'X' + gID + 'X' + qID + ansCount + '' ).parent().appendTo($( '#question' + qID + ' td.answer ul' ));
			
		}
		
		// Call the function with the SID, GID and QID
		partRand(89344, 72, 242);
		partRand(89344, 72, 243);
		
		// Function to allow randomization of all answers except the last one in List/dropdown questions
		function partRandDD(sID, gID, qID) { 
			
			// Find the number of answers
			var ansCount = ''
			$( 'div#question' + qID + ' select option' ).each(function(i) {
				ansCount = i;
			});
		
			// Place the last answer created at the end of the list
			$( 'option[value="' + ansCount + '"]' ).appendTo($( 'div#question' + qID + ' select' ));
			
		}
		
		partRandDD(89344, 72, 244);
	
	});
}




