function getNodeText (el) {
	if (el.textContent) {return el.textContent;}
	if (el.innerText) {return el.innerText;}

	if (typeof el.innerHTML == 'string') {
		return el.innerHTML.replace(/<[^<>]+>/g,'');
	}
}

function validateEmail(text){
	apos=text.indexOf("@");
	dotpos=text.lastIndexOf(".");
	if (apos<1||dotpos-apos<2){
		return false;
	}else{
		return true;
	}
}

function name2Rewrite( string ){
	string = string.replace(/ą/g,"a");
	string = string.replace(/ /g,"_");
	string = string.replace(/ż/g,"z");
	string = string.replace(/ź/g,"z");
	string = string.replace(/ć/g,"c");
	string = string.replace(/ń/g,"n");
	string = string.replace(/ł/g,"l");
	string = string.replace(/ó/g,"o");
	string = string.replace(/ę/g,"e");
	string = string.replace(/ś/g,"s");
	string = string.replace(/\./g,"_");
	string = string.replace("\,","_");
	string = string.replace(/\?/g,"_");
	string = string.replace(/\//g,"_");
	return string.toLowerCase();	
}

function changeDisplay( id ) {
	var el = document.getElementById(id);
	if( el.style.display == 'block' ) 
		el.style.display = 'none' ;
	else 
		el.style.display = 'block' ;
}