// Create List of Language Text to be Displayed

   languageNamesArray = new Array(' ','Page 1','Page 2','Page 3','Page 4','Page 5','Page 6','Page 7','Page 8','Page 9','Page 10','Page 11');


// Create a 2 Dimensional Array. Dim 1 = Country, Dim 2 = Available languages for that Country

   countryLanguagesArray = new Array(33);

// Built the 2nd Dimension of the Array. This part adds the Available languages for this Country.

   countryLanguagesArray[1] = new Array( 0,1,2 );

   countryLanguagesArray[2] = new Array( 0,1,2,3,4 );

   countryLanguagesArray[3] = new Array( 0,1,2 );

   countryLanguagesArray[4] = new Array( 0,1,2,3,4,5,6,7,8 );

   countryLanguagesArray[5] = new Array( 0,1,2,3 );

   countryLanguagesArray[6] = new Array( 0,1,2 );

   countryLanguagesArray[7] = new Array( 0,1,2,3,4,5,6,7,8,9,10 );

   countryLanguagesArray[8] = new Array( 0,1,2,3,4,5 );

   countryLanguagesArray[9] = new Array( 0,1 );

   countryLanguagesArray[10] = new Array( 0,1,2 );

   countryLanguagesArray[11] = new Array( 0,1,2,3,4,5,6,7,8,9,10 );

// Reset The Languages listed in the "Select Language" box, based on the Country Selected in the "Select Country" box.


   function getLanguagesForThisCountry(CategoryID){
		if (CategoryID > 0){

			// Set Length to Match Current Countries' Language List
			document.Fooey.PageID.options.length = countryLanguagesArray[CategoryID].length - 1;
	
			for (i=1; i < countryLanguagesArray[CategoryID].length; i++) {
				document.Fooey.PageID.options[i - 1].text = languageNamesArray[countryLanguagesArray[CategoryID][i]];
				document.Fooey.PageID.options[i - 1].value = countryLanguagesArray[CategoryID][i];
			}
			document.Fooey.PageID.options[0].selected = true;		// Always re-select the option at the top of the list (query is pre-sorted with the prefered language on top)
		}
	}

	// Verify User has Selected A Country
	function VerifyInput(VerifyCategoryID) {
		if (VerifyCategoryID > 0)
			return true;
		else {
			alert('You must select both a gallery and a page number to continue ');
			return false;
		}
	}
//-->
