function selectAll(id) {
    id.focus();
    id.select();
}


function createInstance() {
	var xhr = null;
	if (window.XMLHttpRequest) {
		xhr = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try {
			xhr = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e) {
			try {
				xhr = new ActiveXObject('Microsoft.XMLHTTP');
			} catch (e) {
				alert('XHR not created');
			}
		}
	}
	return xhr;
}

function strpos(haystack, needle, offset) {
	var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
	return i === -1 ? false : i;
}

function tronquer(str, nb) {
	str = str + '';
	
	nbChAv = strpos(str, '.');
	strAv = str.substr(0, nbChAv);
	strAp = str.substr(nbChAv, nb);
	return strAv + strAp;
}

function popwait() {
	$("#action_autre").css("height", $(window).height());
	$("#action_autre").css("width", $(window).width());
	$("#action_autre").css("position", "fixed");
	$("#action_autre").css("z-index", "100");
	$("#action_autre").css("opacity", "0.40");
	$("#action_autre").css("background-color", "#000");
}


$(document).ready(function() {
	setupZoom();
});
