 // Scramble puzzle differently
 function scramblePuzzle() {
	//alert('picked ' + document.imageShuffleForm.pickPuzzle.value);
	var rowxcol = document.imageShuffleForm.pickPuzzle.value;
	var cols = parseInt(rowxcol);
	var pos = rowxcol.indexOf('x');
	if (pos > -1) 
		rows = parseInt(rowxcol.substring(pos+1));
	else {
		rows = cols = 3;
	}
	//var imgPick = document.getElementById('imgPick').value;
	// Pick a random image so don't pass imgPick
	
	document.imageShuffleForm.action = "imageShuffle.htm" + "?rows=" +  rows + "&cols=" + cols;
	document.imageShuffleForm.submit();
 }

 // Reset to the way the puzzle looked before the user did anything
 function resetPuzzle() {
	initGame();
	return false;
 }

  function pickedImage() {
	//alert('picked ' + document.imageShuffleForm.pickPuzzle.value);
	var rowxcol = document.imageShuffleForm.pickPuzzle.value;
	var cols = parseInt(rowxcol);
	var pos = rowxcol.indexOf('x');
	if (pos > -1) 
		rows = parseInt(rowxcol.substring(pos+1));
	else {
		rows = cols = 3;
	}
	
	var imgPick = document.getElementById('imgPick').value;
	
	document.imageShuffleForm.action = "imageShuffle.htm" + "?rows=" +  rows + "&cols=" + cols + "&imgPick=" + imgPick;
	document.imageShuffleForm.submit();
 }

