
// Edit and upload this file to add new languages to the site
// Author: David Ariens, 2008


// Do not edit the following line.
var transFiles = new Array(); var transBasis = new Array(); var transOther = new Array(); var languages = new Array();


// START HERE !
// MORE INFORMATION IN THE HOW_TO_GUIDE.DOC

// The list with translated pages:
// To add a new language, copy 1 block (do not copy this example, due to the comments, it will not work)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//     addLanguage("home",					<-- This is the filename without .html or .lang.html
//			       "en",                    <-- This is the default language, this is the language of the home.html file
//			       new Array("en", "nl")    <-- These are the available translations, in this case home.html (english default) and home.nl.html (translation)
//		           );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


// The possible languages are: (No other languages available for the moment)
// en = "English";  	nl = "Nederlands"; 		fr = "français";
// de = "Deutsch";  	hu = "Hungarian";  		it = "Italian";
// li = "Lithuanian";  	pol = "Polish";  		po = "Portuguese";
// ro = "Switzerdutch"; ru = "Russian"; 		esp = "Spanish";
// tu = "Turkish"; 		uk  = "Ukrainian";


addLanguage("home",
			"en", 
			new Array("en", "nl")
		    );

addLanguage("home_paulkoeck",
			"en", 
			new Array("en", "nl", "fr", "esp", "hu", "pol", "po")
			);

addLanguage("training_assertiviteit",
			"en", 
			new Array("en", "nl")
		    );

addLanguage("privacy",
			"en", 
			new Array("en","fr")
		    );

addLanguage("home_contact",
			"en", 
			new Array("en", "nl")
		    );

// To add a new language, copy 1 block (do not copy this example, due to the comments, it will not work)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//     addLanguage("home",					<-- This is the filename without .html or .lang.html
//			       "en",                    <-- This is the default language, this is the language of the home.html file
//			       new Array("en", "nl")    <-- These are the available translations, in this case home.html (english default) and home.nl.html (translation)
//		           );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////






/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT edit below this line
// DO NOT edit below this line


function addLanguage(fileName, basis, other){
	transFiles.push(fileName);
	transBasis.push(basis);
	transOther.push(other);
}

// How to display the languages
languages['en'] = "English";
languages['nl'] = "Nederlands";
languages['fr'] = "fran&ccedil;ais";
languages['de'] = "Deutsch";
languages['hu'] = "Hungarian";
languages['it'] = "Italian";
languages['li'] = "Lithuanian";
languages['pol'] = "Polish";
languages['po'] = "Portuguese";
languages['ro'] = "Switzerdutch";
languages['ru'] = "Russian";
languages['esp'] = "Spanish";
languages['tu'] = "Turkish";
languages['uk'] = "Ukrainian";



Array.prototype.find = function (element) 
{
    for (var keys in this) 
    {
        if (this[keys] == element) 
        {
            return keys;
            break;
        }  
    }
    return -1;
};

var sPath = window.location.pathname;
var sPageFull = sPath.substring(sPath.lastIndexOf('/') + 1);

var sPage = new Array();
var sPage = sPageFull.split(".");


var foundIndex = transFiles.find(sPage[0]);
if (foundIndex != -1){
	
	if (sPage.length == 2){
		// Basis page
		var currentLang = transBasis[foundIndex]
		
	}else if (sPage.length == 3){
		// With language extention
		var currentLang = sPage[1]
	}
	
	if (transOther[foundIndex].length > 1){
		document.write("<span style=\"color:#BBBBBB\">" + languages[currentLang] + "</span> &nbsp; ");
		
		for (j=0;j<transOther[foundIndex].length;j++) {
			lang = transOther[foundIndex][j];
			
			if (lang != currentLang){
				
				if (sPage.length == 2){
					if (lang == transBasis[foundIndex])
						document.write("<a href=\""+sPage[0]+"."+sPage[1]+"\" class=\"slogan_a\">" + languages[lang] + "</a> &nbsp; ");
					else
						document.write("<a href=\""+sPage[0]+"."+lang+"."+sPage[1]+"\" class=\"slogan_a\">" + languages[lang] + "</a> &nbsp; ");
				
				}else if (sPage.length == 3){
					if (lang == transBasis[foundIndex])
						document.write("<a href=\""+sPage[0]+"."+sPage[2]+"\" class=\"slogan_a\">" + languages[lang] + "</a> &nbsp; ");
					else
						document.write("<a href=\""+sPage[0]+"."+lang+"."+sPage[2]+"\" class=\"slogan_a\">" + languages[lang] + "</a> &nbsp; ");
				}
				
			}
		}
	}
}