// JavaScript Document
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Sandeep Gangadharan | http://www.sivamdesign.com/scripts/ */

function changer(link) {
  if (link=="") {
    return; }

var contString; //Continent-stringvariabele voor 'Select a Country in <continent'
//======================
// Edit this portion below.
// Change the name of the continent and the countries.
// Make sure the spelling of the Continent is the same in the IF statement and in the link.
  if (link=="Africa") {
	contString = "Africa";	  
    document.theForm.theContinent.value="Africa";
    var theOptions=new Array ("South Africa"); }
  else if (link=="Asia") {
	contString = "Asia";	  
    document.theForm.theContinent.value="Asia";
    var theOptions=new Array ("India", "Malaysia"); }
  else if (link=="Australia") {
	contString = "Australia";	  
    document.theForm.theContinent.value="Australia";
    var theOptions=new Array ("Australia"); }
  else if (link=="Europe") {
	contString = "Europe";	  
    document.theForm.theContinent.value="Europe";
    var theOptions=new Array ("Belgium", "Croatia", "France", "Germany", "The Netherlands", "Poland", "Portugal", "Slovakia", "Spain", "Switzerland", "Turkey", "United Kingdom"); }
  else if (link=="NorthAmerica") {
	contString = "North America";	  
    document.theForm.theContinent.value="NorthAmerica";
    var theOptions=new Array ("Canada", "Mexico"); }
  else if (link=="SouthAmerica") {
	contString = "South America";	  
    document.theForm.theContinent.value="SouthAmerica";
    var theOptions=new Array (""); }

  var conts = document.getElementById('conti').getElementsByTagName('li'); //De lijst met continenten
		
  for (i=0; i<conts.length; i++) {
	if (conts[i].innerHTML == contString) {
		conts[i].className = 'linkActive';	} 
	else { conts[i].className = 'linkList'; }
  }
  
// Do not edit anything below this line:
//======================

  i = document.theForm.secondChoice.options.length;
    if (i > 0) {
      document.theForm.secondChoice.options.length -= i; 
	  document.theForm.secondChoice.options[i] = null;
    }

  var theContinent=1;
  	document.theForm.secondChoice.options[0] = new Option();
    document.theForm.secondChoice.options[0].text = 'Select a Country in ' + contString;
    document.theForm.secondChoice.options[0].value = 'x';	
  for (e=0; e<theOptions.length; e++) {
    document.theForm.secondChoice.options[theContinent] = new Option();
    document.theForm.secondChoice.options[theContinent].text = theOptions[e];
    document.theForm.secondChoice.options[theContinent].value = e;
    theContinent=theContinent+1; }
}
//  NOTE: [document.theForm.theContinent.value] will get you the name of the state,
//  and [document.theForm.secondChoice.value] the name of the city chosen

function redirect() {
	var list = document.theForm.secondChoice;
	var selected = list.value;
	if (selected != 'x') {
		var links; //Links-array, wordt gevuld per continent
		var cont = document.theForm.theContinent.value;
		if (cont == "Africa") {
			links = Array('http://www.sportslawyersnetwork.com/Africa/south.africa.htm');
		} else if (cont == "Asia") {
			links = Array('http://www.sportslawyersnetwork.com/Asia/india.htm', 'http://www.sportslawyersnetwork.com/Asia/malaysia.htm' );
		} else if (cont == "Australia") {
			links = Array('http://www.sportslawyersnetwork.com/Australia/australia.htm');
		} else if (cont == "Europe") {
			links = Array('http://www.sportslawyersnetwork.com/Europe/belgium.htm', 'http://www.sportslawyersnetwork.com/Europe/croatia.htm', 'http://www.sportslawyersnetwork.com/Europe/france.htm','http://www.sportslawyersnetwork.com/Europe/germany.htm', 'http://www.sportslawyersnetwork.com/Europe/the.netherlands.htm', 'http://www.sportslawyersnetwork.com/Europe/poland.htm', 'http://www.sportslawyersnetwork.com/Europe/portugal.htm', 'http://www.sportslawyersnetwork.com/Europe/slovakia.htm', 'http://www.sportslawyersnetwork.com/Europe/spain.htm', 'http://www.sportslawyersnetwork.com/Europe/switzerland.htm', 'http://www.sportslawyersnetwork.com/Europe/turkey.htm', 'http://www.sportslawyersnetwork.com/Europe/united.kingdom.htm' );
		} else if (cont == "NorthAmerica") {
			links = Array('http://www.sportslawyersnetwork.com/North.America/canada.htm', 'http://www.sportslawyersnetwork.com/North.America/mexico.htm');
		} else if (cont == "SouthAmerica") {
			links = Array('');
		}
		window.location = links[selected];
	}
}