function getHTTPObject() {
	try {
		req = new XMLHttpRequest();
	} catch (err1) {
		try {
			req = new ActiveXObject("Msxml12.XMLHTTP");
		} catch (err2) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (err3) {
				req = false;
			}
		}
	}
	return req;
}
function setStyleMarc(x, color){
	document.getElementById(x).style.background = color;
	document.getElementById(x).focus();
}
function setStyleDesMarc(x, color){
	document.getElementById(x).style.background = color;
}
function stringTrim(strString){
	return strString.replace(/\s+$|^\s+/g,"");
}
function stringLength(strString){
	var strString = stringTrim(strString);
	return strString.length;
}
function openPopup(p, name, w, h, s){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	self.name = "main";
	var winprops = "toolbar=0,location=0,directories=0,status=0, "+"menubar=0,scrollbars="+s+",resizable,width="+w+",height="+h+",top="+wint+",left="+winl+"";
	win = window.open(p, "remote", winprops);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
function closePopup() {
	timer = setTimeout('window.close();', 10);
}
function wMail(x, y){
	var se = '<a href="mailto:'+ x + '@' + y +'">' + x + '@' + y + '</a>';
	document.getElementById("smail").innerHTML = se;
}
function logOut(x){
	var n = 'null';
	switch(x){
		case 0:
			n = '';
			break;
		case 1:
			n = '../';
			break;
		case 2:
			n = '../../';
			break;
	}	
	if(n != 'null'){
		location.href = n + 'login/logout.php';
	}	
}