//redirect to korean KMDstart
countryURL = document.location.href
country = getCookie('country');
if (country == "de" || country == "fr" || country == "es" || country == "kr" || country == "it" || country == "pt" || country=="uy" ||  country =="ve" ||   country == "pe"  || country =="pa"  || country =="py"  || country =="mx"  || country =="cl"  || country == "co"  || country == "cr"  || country == "bo"  || country == "ar"  || country == "cu"  || country == "do"  || country == "ec" || country == "sv" || country =="pr"  || country == "gt" || country == "ad"  || country == "sm" || country =="br" || country =="au" || country =="ca" || country =="in"  || country =="ie" || country =="nl" || country =="se" || country =="gb" || country =="at" || country =="mc" || country =="lu" )
		{
			existingCountry = true;
		}	else {
			existingCountry=false;
		}	
		

  document.write( "<form name=\"countrySelector\">\n" );
  document.write( "<select name=\"countrySelect\" onChange=\"navigateCountry(this[selectedIndex].value);\" style='height:14px;font-size:10px;'>\n" );
  document.write( "<option value=\"Language\">Select Language</option>\n" );
  document.write( "<option value=\"us\">English(US)</option>\n" );
     document.write( "<option value=\"de\">German</option>\n" );
  document.write( "<option value=\"fr\">French</option>\n" );
   document.write( "<option value=\"it\">Italian</option>\n" );
  document.write( "<option value=\"kr\">Korean</option>\n" );
  document.write( "<option value=\"pt\">Portuguese</option>\n" );
    document.write( "<option value=\"es\">Spanish</option>\n" );

  
  document.write( "\n" );
  document.write( "</select>\n" );
   document.write( "</form>" );


//redirect to Spanish KMDstart
if ( countryURL.indexOf("/us/kmdstart.htm") != -1  && existingCountry==true) {

	location.replace("/index.htm");
	
}




//language naviguessor
function navigateCountry(countryCode) 
{
	if (countryCode != "Language") {
	document.cookie = "country=" + countryCode + "; path=/";
	location.replace("/index.htm");
	}
	

}









//select current country in the dropdown or select us if country blank
countryForm = document.forms.countrySelector.countrySelect;

for (i=0;i<countryForm.length;i++)
{

	if (country == countryForm[i].value) {
		countryForm[i].selected = true;
	} else {
	
		if (country == "" || country=="undefined") {
			
			for (x=0;x<countryForm.length;x++) {
				if (countryForm[x].value == "us") {
				countryForm[x].selected = true;
			}
			
			}
			
			
		}
	
	}

}
