function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function getLanguage(){
	var x = readCookie('luplanguage');
	if (x) {
		if(x=="Spanish")spanish();
		if(x=="French")french();
		if(x=="English")english();
		if(x=="German")german();
	}
}

function x(ele,wd){
	document.getElementById(ele).innerHTML=wd;
}

function spanish(){	
	x('town_parent',"Pueblo");
	x('harbor',"Bahia");
	x('sightseeing',"El Pais");
	x('officials',"Funcionarios");
	x('contact',"Contacto");
	x('forum',"Foro");
	x('tourism',"Turismo");
	x('customs',"Aduanera");
	x('special',"Qué está pasando");
	x('touring',"Excursionismo");
	x('touring2',"Moverse");
	x('history',"Historia");
	x('harbor1',"Mapa");
	x('harbor2',"La Población Local");
	x('harbor3',"Información General");
	x('harbor5',"Actividades");
	x('harbor6',"Puesto Puerto");
	x('harbor7',"Anuncios");
	x('clima',"El tiempo en Luperón");
	x('town1',"Mapa");
	x('town2',"Paginas Amarillo");
	x('town3',"Hoteles");
	x('contact2',"Contáctenos");
}

function french(){	
	x('town_parent',"La Ville");
	x('harbor',"Baie");
	x('sightseeing',"Le Pays");
	x('officials',"Fonctionnaires");
	x('contact',"Contact");
	x('forum',"Forum");
	x('tourism',"Le Tourisme");
	x('customs',"Douanières");
	x('special',"Ce qui se passe");
	x('touring',"Touring");
	x('touring2',"Se déplacer");
	x('history',"Histoire");
	x('harbor1',"Plan");
	x('harbor2',"Les gens du pays");
	x('harbor3',"Information générale");
	x('harbor5',"Activités");
	x('harbor6',"port mail");
	x('harbor7',"Annonces");
	x('clima',"Météo Luperon");
	x('town1',"Plan");
	x('town2',"Pages Jaunes");
	x('town3',"Hôtels");
	x('contact2',"Contactez-nous");
}

function english(){	
	x('town_parent',"Town");
	x('harbor',"Harbor");
	x('sightseeing',"Country");
	x('officials',"Officials");
	x('contact',"Contact");
	x('forum',"Forum");
	x('tourism',"Tourism");
	x('customs',"Customs");
	x('special',"What's Happening");
	x('touring',"Sightseeing");
	x('touring2',"Getting Around");
	x('history',"History");
	x('harbor1',"Map");
	x('harbor2',"The Locals");
	x('harbor3',"General Information");
	x('harbor5',"Activities");
	x('harbor6',"Port Mail");
	x('harbor7',"Classifieds");
	x('clima',"Luperón Weather");
	x('town1',"Map");
	x('town2',"Yellow Pages");
	x('town3',"Hotels");
	x('contact2',"Contact Us");
}

function german(){	
	x('town_parent',"Stadt");
	x('harbor',"Harbor");
	x('sightseeing',"Land");
	x('officials',"Beamte");
	x('contact',"Kontakt");
	x('forum',"Forum");
	x('tourism',"Tourismus");
	x('customs',"Brauchtum");
	x('special',"Was ist los");
	x('touring',"Sightseeing");
	x('touring2',"Getting Around");
	x('history',"Geschichte");
	x('harbor1',"Karte");
	x('harbor2',"Die Einheimischen");
	x('harbor3',"Allgemeine Informationen");
	x('harbor5',"Aktivitäten");
	x('harbor6',"Port Mail");
	x('harbor7',"Kleinanzeigen");
	x('clima',"Luperón Wetter");
	x('town1',"Karte");
	x('town2',"Gelbe Seiten");
	x('town3',"Hotels");
	x('contact2',"Kontakt");
}
