function setZoomingIndex(iSize) {	
	if(iSize) {
		if(parseInt(iSize)) {
			if (!(iSize >= 1 && iSize <= 3)) {
				setZoomingIndex(2)
			}
		}
		
		document.textZoomingIndex = iSize;					
	}
	else {		
		if (Get_Cookie('ReseauSelection_TextZoomingIndex')) {				
			document.textZoomingIndex = parseInt(Get_Cookie('ReseauSelection_TextZoomingIndex'));	
		}
		else {
			// No iSize, no cookie then set default text zooming index
			document.textZoomingIndex = 2;
		}
	}
	Set_Cookie('ReseauSelection_TextZoomingIndex', document.textZoomingIndex, 365);
	doZooming();
}

function imgTextZoomingOut_click(e) {
	if (e.target || e.srcElement) {
		var textZoomingIndex
				
		textZoomingIndex = document.textZoomingIndex
				
		if (textZoomingIndex) {
			switch(parseInt(textZoomingIndex)) {
				case 1:
					setZoomingIndex(1);
					break;				
				case 2:
					setZoomingIndex(1);
					break;
				case 3:
					setZoomingIndex(2);
					break;
				default:
					setZoomingIndex(2);						
			}		
		}
		else {
			setZoomingIndex(2);
		}		
	}
}

function imgTextZoomingIn_click(e) {
	if (e.target || e.srcElement) {
		var textZoomingIndex
				
		textZoomingIndex = document.textZoomingIndex
				
		if (textZoomingIndex) {
			switch(parseInt(textZoomingIndex)) {
				case 1:
					setZoomingIndex(2);
					break;				
				case 2:
					setZoomingIndex(3);
					break;
				case 3:
					setZoomingIndex(3);
					break;
				default:
					setZoomingIndex(2);						
			}		
		}
		else {
			setZoomingIndex(2);
		}		
	}
}

function doZooming() {
	var objMainContainer = document.getElementById('section_text');
	var objFooterContainer = document.getElementById('f');
	var objResidencesContainer = document.getElementById('module_residences');
	
	if(!objMainContainer) {
		objMainContainer =  document.getElementById('l');
	}
	
	if(!objMainContainer) {
		objMainContainer =  document.getElementById('divResidences');
	}	
	
	if (objMainContainer && objFooterContainer) {
		switch(parseInt(document.textZoomingIndex)) {
			case 1 :
				objMainContainer.className = 'textZooming1';
				objFooterContainer.className = 'textZooming1';
				if(objResidencesContainer != null) {objResidencesContainer.className = 'textZooming1';}
				break;
			case 2 :
				objMainContainer.className = 'textZooming2';
				objFooterContainer.className = 'textZooming2';
				if(objResidencesContainer != null) {objResidencesContainer.className = 'textZooming2';}
				break;				
			case 3 :
				objMainContainer.className = 'textZooming3';
				objFooterContainer.className = 'textZooming3';
				if(objResidencesContainer != null) {objResidencesContainer.className = 'textZooming3';}
				break;
		}
	}
}