function displaySection(the_section, newclass){
	if (the_section == 'all') {
		for (i=0;i<section_array.length;i++){
			var my_section = document.getElementById(section_array[i]);
			my_section.className = "section";
		}
	} else {
		if (document.getElementById(the_section).className != newclass){
		   document.getElementById(the_section).className = "hide";
		}
		for (i=0;i<section_array.length;i++){
		   var my_section = document.getElementById(section_array[i]);
		   my_section.className = "hide";
		 }
		document.getElementById(the_section).className = "section";
	}
}

function getSectionIndex(sectionName) {
	if (sectionName == 'all') {
		displaySection('all', 'section');		
	} else {
		var index = sectionName.selectedIndex;
		if (index == -1)
			return;
		var selected_section =  sectionName.options[index].value;
		if (selected_section == "")
			return;
		displaySection(selected_section, 'section');
	}
}
function getQueryValue(field) {
  var queryString = window.location.search.substring(1);
  var queryPairs = queryString.split("&");
  for (var i = 0; i < queryPairs.length; i++) {
	var thisPair = queryPairs[i].split("=");
	if (thisPair[0] == field) {
	  return thisPair[1];
	}
  } 
  return false;
}
function photoAtLoad() {
	thecountry = getQueryValue("country");
	if (!thecountry) {
		displaySection('all', 'section');
	} else {
		displaySection(thecountry, 'section');
	}
}