function expand(id){
	hideElement(id);
	showElement(id + 'content');
}
function collapse(id){
	hideElement(id + '-morecontent');
	showElement(id + '-more');
}

function selectQuote(id){
	for (i=1;i<=8;i=i+1) {
		document.getElementById('Selector'+i).className = '';
		hideElement('mainQuoteSelector'+i);
	}
	showElement('mainQuote'+id);
	document.getElementById(id).className = 'selected'
}

function hideElement(id){
	var hide =  document.getElementById(id);
	hide.style.visibility = 'hidden';
	hide.style.display = 'none';
}

function showElement(id,type){
	var show = document.getElementById(id);
	show.style.visibility = 'visible';
	if (type == 'block') show.style.display = 'block';
	else show.style.display = 'inline';
}

function enlargeThumb(id,total){
	var enlarged = document.getElementById('enlarged');
	var sel = document.getElementById(id);
	enlarged.src = "http://www.ExperimentulPitesti.org/public/assets/images/photos/" + id + ".jpg";
	for (i=1;i<=total;i++) document.getElementById('imagine-experimentul-pitesti-' + i).className = '';
	sel.className = "selected";
}

function createXMLHttpRequest(){

	// http://www.w3schools.com/Ajax/ajax_example.asp
	var xmlhttp;
	if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject) { // code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	else{
  		alert("Your browser does not support XMLHTTP!");
	}

	return xmlhttp;
}

function displayDonnors(request,languageRequested){
	xmlhttp = createXMLHttpRequest();
	xmlhttp.open("GET","/public/ajax/donnorsList.php?"+request+','+languageRequested,true);
	xmlhttp.send(null);
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4){
			document.getElementById('donnorsList').innerHTML = xmlhttp.responseText;
		}
	}

}