// ----------------------------------------------- language

var lng = location.search;
lng = lng.substr(3,3);
if (lng == "") lng = "Ukr";

function txtLngVal(vName, vUkr, vRus, vEng){
  this.valName = vName;
  this.valUkr = vUkr;
  this.valRus = vRus;
  this.valEng = vEng;
}

function getTxtLngValue(valArr, valName){
  var Res = "";
      i = 0;
      iFound = -1;

      vLng = lng;//workLng();

    //alert(vLng);
  while ((i < valArr.length)&&(iFound == -1))  {
    if (eval("valArr[i].valName == valName"))
	  iFound = i;
	 else  
      i++;
  } 
  if (iFound > -1) {
    if (!(eval("valArr[iFound].val"+vLng))) {
      alert("Мова " + vLng + " не підтримується !!!" );
      vLng = 'Ukr';
	}
    Res = eval("valArr[iFound].val"+vLng);
  } else
   alert("Нема значення для " + valName);
   return Res;
}

function txtLngValue(valArr, valName){
  document.write(getTxtLngValue(valArr, valName));
}
// ----------------------------------------------- language

function getImage(iLng){
	//alert(iLng);
	
	if (iLng == "") iLng = 'Ukr'; 
	document.lvivorgres.src = 'images/LvivOrgr_' + iLng + '.gif';
	
	document.about.src = 'images/menu_about_' + iLng + '.gif';
	document.activity.src = 'images/menu_activity_' + iLng + '.gif';
	document.structure.src = 'images/menu_structure_' + iLng + '.gif';
	document.projects.src = 'images/menu_projects_' + iLng + '.gif';
	document.contacts.src = 'images/menu_contacts_' + iLng + '.gif';
	
	if (iLng == 'Eng') {
		document.f_map.alt = 'Site map';
		document.f_email.alt = 'Our e-mail';
		if (document.f_home != null)  document.f_home.alt = 'Home';	
		document.b_map.alt = 'Site map';
		document.b_email.alt = 'Our e-mail';
		if (document.b_home != null) document.b_home.alt = 'Home';
		}
	else 
		if (iLng == 'Rus') {
			document.f_map.alt = 'Карта сайта';
			document.f_email.alt = 'Пишите нам';	
			if (document.f_home != null)  document.f_home.alt = 'На главную';			
			document.b_map.alt = 'Карта сайта';
			document.b_email.alt = 'Пишите нам';	
			if (document.b_home != null) document.b_home.alt = 'На главную';			
			}
		else
			if (iLng == 'Ukr') {
				document.f_map.alt = 'Мапа сайту';
				document.f_email.alt = 'Пишіть нам';
				if (document.f_home != null)  document.f_home.alt = 'На головну';				
				document.b_map.alt = 'Мапа сайту';
				document.b_email.alt = 'Пишіть нам';
				if (document.b_home != null) document.b_home.alt = 'На головну';	
				}
}

function Link(vPath, vLng, vDep){
	if (vLng == "") vLng = 'Ukr';
	if (vPath == "") vPath = location.pathname;
var dep = location.search;
	dep = dep.substr(9);
var d = vDep;
if (d == undefined) vDep = dep;
	window.location.href= vPath + '?l=' + vLng + '&d=' + vDep;
}
