function showMember(idMember){
	var w = window.open(APP_URL+"site/popup/showMember.php?idMember="+idMember,'showMember','scrollbars=yes,status=yes,menubar=no,left=20,width=1024,top=20,location=no,directories=no,toolbar=no,resizable=yes');
	w.focus();
}


function reportError(){
	if(confirm("Dear Visitor,\n\nan error occured when processing your request. Do you want to report this error?")){
		window.open(MCFA_ERROR_REPORT_URL,"error_report","");
	}else{
		window.location.href = APP_URL;
	}
}

function errorReport(){
	return reportError();
}


function underDevelopment(){
	var text = "Dear Visitor,\n\nsite you want to see is currently under reconstruction. Requested page will be available in the close future. In case of any questions feel free to use Question form.\n\nDo you want use our Question form NOW? ";
	if(confirm(text)){
		window.location.href=MCFA_YOUR_QUESTIONS;
	}
}



function sendStatusMessage(text){
	window.status = " ......... MCFA SYSTEM MESSAGE : " + text;
}



function ltrim(str) {
	for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
	return str.substring(k, str.length);
}
function rtrim(str) {
	for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
	return str.substring(0,j+1);
}
function trim(str){
	return ltrim(rtrim(str));
}

function startsWith(str,prefix){
	len = prefix.length;
	foo = str.substring(0,len);
	return (foo == prefix);
}


function isWhitespace(charToCheck) {
	var whitespaceChars = " \t\n\r\f";
	return (whitespaceChars.indexOf(charToCheck) != -1);
}

function testingFill(){
	var inputs = document.getElementsByTagName("input");
	for(var i in inputs){
		if(typeof(inputs[i].id)!="undefined"){
			if(startsWith(inputs[i].id,"form_")){
				if(inputs[i].type == "checkbox"){
					inputs[i].checked = true;
				}else if(inputs[i].type == "text"||inputs[i].type == "password"){
					inputs[i].value = "test_string_for@"+inputs[i].id+".cz";
				}else if(inputs[i].type == "radio"){
					inputs[i].checked = true;
				}
			}
		}
	}
	document.getElementById('form_password').value='testPassword';
	document.getElementById('form_verifyPassword').value='testPassword';

}
