// Ajax Documents
function getXMLHttpRequest() {
	var xhr = null;
	
	if (window.XMLHttpRequest || window.ActiveXObject) {
		if (window.ActiveXObject) {
			try {
				var xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				var xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
		} else {
			var xhr = new XMLHttpRequest(); 
		}
	} else {
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
		return null;
	}	
	return xhr;
}

function refresh_photo_cv(id_photo,callback,id_cv){
	var xhr = getXMLHttpRequest();
	var id_photo = id_photo;
	var id_cv = id_cv;
	xhr.open("GET", "cv_refresh_photo.php?id_photo="+id_photo+"&id_cv="+id_cv+"&"+Math.random(), true);				
	xhr.send(null);
	xhr.onreadystatechange = function() {
		if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
			callback(xhr.responseText);
		}
	};				
}


function readDataRefresh(sData) {
	document.getElementById("une_photo_cv").innerHTML = sData;
}

function refresh_video_cv(id_video,callback,id_cv){
	var xhr = getXMLHttpRequest();
	var id_video = id_video;
	var id_cv = id_cv;
	xhr.open("GET", "cv_refresh_video.php?id_video="+id_video+"&id_cv="+id_cv+"&"+Math.random(), true);				
	xhr.send(null);
	xhr.onreadystatechange = function() {
		if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
			callback(xhr.responseText);
		}
	};				
}


function readDataRefreshVideo(sData) {
	document.getElementById("une_video_cv").innerHTML = sData;
}


