var xCurrentItem=0;

function xLoaded() {
	xBodyIsLoaded();
}

function xPrint() {
	self.print();
}

function xMenuOver(xBtnMenu) {
	var xId = getBtnId(xBtnMenu);
	
	var xIdActif = 0;
	if (xSection < 5) xIdActif = xSection;
	if (xSection == 0 && xSousSection == 3) xIdActif = "5";
	if (xSection == 0 && xSousSection == 4) xIdActif = 6;
		
	if (xId == 5 && xLg != "en") {
		xMouseOver("menuBtn5_1");
		xMouseOver("menuBtn5_2");
	} else {
		xMouseOver(xBtnMenu);
	}
	
	
	var xSep1 = document.images["btnSep"+(xId-1)];
	var xSep2 = document.images["btnSep"+(xId)];
	
	if (!xSep1) xSep1 = xGetObject("btnSep"+(xId-1));
	if (!xSep2) xSep2 = xGetObject("btnSep"+(xId));
	
	var xSepId = 1;
	(xIdActif == xId-1)?xSepId=3:xSepId=1;
	if (xId > 1) {
		xSep1.src = "/images/interface/btnSep_"+xSepId+".gif"
	}
	if (xId > 5 && xId <= 6) {
		
		if (xLg != "en") {
			xSep1.src = "/images/interface/btnSep2_"+xSepId+".gif"
		} else {
			xSep1.src = "/images/interface/btnSep3_"+xSepId+".gif"
		}
	}
	
	var xSepId = 2;
	(xIdActif == xId+1)?xSepId=3:xSepId=2;
	if (xId < 5) {
		xSep2.src = "/images/interface/btnSep_"+xSepId+".gif"
	}
	if (xId >= 5 && xId < 6 ) {
		if (xLg != "en") {
			xSep2.src = "/images/interface/btnSep2_"+xSepId+".gif"
		} else {
			xSep2.src = "/images/interface/btnSep3_"+xSepId+".gif"
		}
	}
		
}


function xMenuOut(xBtnMenu) {
	var xId = getBtnId(xBtnMenu);
	
	var xIdActif = 0;
	if (xSection < 5) xIdActif = xSection;
	if (xSection == 0 && xSousSection == 3) xIdActif = "5";
	if (xSection == 0 && xSousSection == 4) xIdActif = 6;
	
	if (isSectionOut(xId) == true) {
		
		
		if (xId == 5 && xLg != "en") {
			xMouseOut("menuBtn5_1");
			xMouseOut("menuBtn5_2");
		} else {
			xMouseOut(xBtnMenu);
		}
		
		var xSep1 = document.images["btnSep"+(xId-1)];
		var xSep2 = document.images["btnSep"+(xId)];
	
		if (!xSep1) xSep1 = xGetObject("btnSep"+(xId-1));
		if (!xSep2) xSep2 = xGetObject("btnSep"+(xId));
	
			var xSepId = 0;
			(xIdActif == xId-1)?xSepId=2:xSepId=0;
			if (xId > 1) {
				xSep1.src = "/images/interface/btnSep_"+xSepId+".gif"
			} 
			if (xId > 5 && xId <= 6 ) {
				if (xLg != "en") {
					xSep1.src = "/images/interface/btnSep2_"+xSepId+".gif"
				} else {
					xSep1.src = "/images/interface/btnSep3_"+xSepId+".gif"
				}
			}
			
			var xSepId = 0;
			(xIdActif == xId+1)?xSepId=1:xSepId=0;
			if (xId < 5) {
				xSep2.src = "/images/interface/btnSep_"+xSepId+".gif"
			}
			if (xId >= 5 && xId < 6 ) {
				if (xLg != "en") {
					xSep2.src = "/images/interface/btnSep2_"+xSepId+".gif"
				} else {
					xSep2.src = "/images/interface/btnSep3_"+xSepId+".gif"
				}
			}
	}
}

function isSectionOut(xId) {
	if (xId == xSection && xSection < 5) return false;
	if (xId == 5 && xSection == 0 && xSousSection == 3) return false;
	if (xId == 6 && xSection == 0 && xSousSection == 4) return false;
	return true;
}

function getBtnId(xBtn) {
	if (xBtn) {
		return parseInt(xBtn.id.substr(7,1));
	} else {
		return -1;
	}
}

function getSectionBtn(){
	var btnNum = 0;
	if (xSection < 5) btnNum = xSection;
	if (xSection == 0 && xSousSection == 3) btnNum = "5_1";
	if (xSection == 0 && xSousSection == 4) btnNum = 6;
	
	var xBtnMenuActif = xGetObject("menuBtn"+btnNum);
	if (xBtnMenuActif) {
		if (!xBtnMenuActif.oSrc) {
			tabFile = getFileName(xBtnMenuActif.src);
			xBtnMenuActif.oSrc = tabFile["xFilePath"]+tabFile["xFileName"].substring(0,tabFile["xFileName"].length - 2 )+"."+tabFile["xFileType"];
		}
		return(xBtnMenuActif);
	} else {
		return;
	}
}

function xGetNumByName(xString,xName)
{
	var xRegExp = new RegExp("^"+xName, "i") 
	var xNum = xString.replace(xRegExp,"");
	return xNum;
}