function switchLanguage(lang) {
      window.location.href = '../'+lang+'/'+urlTo;
}


function closeNav(divcssname)
{
	var x = document.getElementsByTagName('A');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].className == divcssname)
			{
			//alert("ok:"+divcssname);
			x[i].style.display = 'none';
			}
	}
}

function openNav(divcssname)
{
	var x = document.getElementsByTagName('A');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].className == divcssname)
			x[i].style.display = 'block';
	}
}

function surfto_do_language_toggle_dropdown(form,url) {
        var myindex=form.select1.selectedIndex;
        if (form.select1.options[myindex].value == "10035") location="../fr/"+url;
        if (form.select1.options[myindex].value == "10000") location="../en/"+url;
}

var urlTo="ev.php-URL_ID="+static_ko+"&URL_DO=DO_TOPIC&URL_SECTION="+static_section+".html";

	
//Value by default:
if(typeof(setLanguage)=="undefined") {
	var setLanguage="en,fr,es";
}

var arrayLanguageList=setLanguage.split(",");
var setLanguageFirst=0;
	
if(typeof(newtemplate)=="undefined") {


document.write('<form  name="do_language_toggle_dropdown">');
document.write('<select name="select1" onChange="surfto_do_language_toggle_dropdown(this.form,urlTo)" class="lang_menu">');
document.write('<option SELECTED>-- Idiomas --</option>');
document.write('<option value="10000"> English</option>');
document.write('<option value="10035"> Fran\xe7ais </option>');
document.write('</select>');
document.write('</form>');


}else{
//New TEMPLATE - 20060930
	var displayToggleLanguage="";

	var displayToggleLanguageEn="";
	var displayToggleLanguageFr="";
	var displayToggleLanguageEs="";


	for(var loop=0;loop<arrayLanguageList.length; loop++){
	  //put the separator.
	    if(arrayLanguageList[loop]=="en" && static_langue != "en") {
		if(setLanguageFirst++ >0) {
	  	  displayToggleLanguage += ' - ';
	        }
		openNav("CSS-CS-UTILITIES-languages-english");
		displayToggleLanguageEn='<a class="langlink" href="../en/'+urlTo+'">English</a>';
		displayToggleLanguage += displayToggleLanguageEn;
		}
	    else if(arrayLanguageList[loop]=="fr" && static_langue != "fr") {
		if(setLanguageFirst++ >0) {
	  	  displayToggleLanguage += ' - ';
	    	}
		openNav("CSS-CS-UTILITIES-languages-francais");
		displayToggleLanguageFr = '<a class="langlink" href="../fr/'+urlTo+'">Français</a>';
                displayToggleLanguage += displayToggleLanguageFr;

	    } 
	    if(arrayLanguageList[loop]=="es" && static_langue != "es") {
		if(setLanguageFirst++ >0) {
	  	  	displayToggleLanguage += ' - ';
	    	}
		openNav("CSS-CS-UTILITIES-languages-espanol");
		displayToggleLanguageEs += '<a class="langlink" href="../es/'+urlTo+'">Español</a>';
                displayToggleLanguage += displayToggleLanguageEs;
	    }
	}

	if(typeof(setNotDisplayToggleLanguage)=="undefined") {
		document.write(displayToggleLanguage);
	} 
}


