function emails(){
	ispis_email(document.getElementById('mail'));
	if(document.getElementById('mail1'))
	ispis_email(document.getElementById('mail1'));
}

function ispis_email(element){
  email = element.innerHTML;
  email = str_replace(email, '{dot}','.');
	email = str_replace(email, '{at}','@');
	element.innerHTML = email;
	element.href= 'mailto:'+email;
}

function str_replace(string, search, replace){
	while(true){
		pos = string.indexOf(search);
		if(pos == -1) break;
		string = string.substr(0, pos) + replace 
			+ string.substr(pos+search.length);
	}
	return string;
}
