var URL = location.href;
var splitURL = URL.split('/');
var currentLang = splitURL[3];
if (currentLang == '') {
	currentLang = 'uk';
}
var pageLang = new Array();
pageLang[0] = 'uk';
pageLang[1] = 'dk';
pageLang[2] = 'br';

img_on_da = new Image(); img_on_da.src ="/fileadmin/template/main/images/da_over.gif";
img_off_da = new Image(); img_off_da.src="/fileadmin/template/main/images/da.gif";
img_on_br = new Image(); img_on_br.src ="/fileadmin/template/main/images/pt_BR_over.gif";
img_off_br = new Image(); img_off_br.src="/fileadmin/template/main/images/pt_BR.gif";
img_on_uk = new Image(); img_on_uk.src ="/fileadmin/template/main/images/en_over.gif";
img_off_uk = new Image(); img_off_uk.src="/fileadmin/template/main/images/en.gif";

function imageOver(el) {
	if (pageLang[el] == 'dk') {
		onImageSource = img_on_da.src;
	} else if (pageLang[el] == 'br') {
		onImageSource = img_on_br.src;
	} else {
		onImageSource = img_on_uk.src;
	}
	document['imgName'+el].src = onImageSource;
}
function imageOut(el) {
	if (pageLang[el] == 'dk') {
		if (pageLang[el] != currentLang) {
			offImageSource = img_off_da.src;
		} else {
			offImageSource = img_on_da.src;
		}
	} else if (pageLang[el] == 'br') {
		if (pageLang[el] != currentLang) {
			offImageSource = img_off_br.src;
		} else {
			offImageSource = img_on_br.src;
		}
	} else {
		if (pageLang[el] != currentLang) {
			offImageSource = img_off_uk.src;
		} else {
			offImageSource = img_on_uk.src;
		}
	}
	
	document['imgName'+el].src = offImageSource;
}

function currentFlag() {
	if (currentLang == 'dk') {
		imgNameSrc = 'http://' + document.domain + '/fileadmin/template/main/images/da_over.gif';
		document.imgName1.src = imgNameSrc;
	} else if (currentLang == 'br') {
		imgNameSrc = 'http://' + document.domain + '/fileadmin/template/main/images/pt_BR_over.gif';
		document.imgName2.src = imgNameSrc;
	} else {
		imgNameSrc = 'http://' + document.domain + '/fileadmin/template/main/images/en_over.gif';
		document.imgName0.src = imgNameSrc;
	}
}