		
		var root_link = "http://www.espagnolsanslimites.com";
		
		var tempContent = "";
		
		var loadedContent = 1;
		
		var currTimeout = "";
		
		var currLib	= "";
		
		var currItem = 0;
		
		var playerHeight = 0;
		
		var commentsOn = 0;
		
		var popupOpen = 0;
		
		var loadingWidth = 0;
		var loadingHeight = 0;
		
		var opacityTimeoutVar = "";
		
		var currDiv = "";
		var currAnchor = "";
		var currFunction = "";
		var secondaryFunction = "";
		var ajaxTimeout = 0;
		
		var divCount = 2;
		var currDiv = 0;
		var openDiv = 0;
		
		var origLeft = new Array();
		var origTop = new Array();
		var currLeft = new Array();
		var currTop = new Array();
		var limitLeft = new Array();
		var limitTop = new Array();
		var offsetLeft = new Array();
		var offsetTop = new Array();
		
		origLeft[0] = 362;
		origLeft[1] = 587;
		origTop[0] = 100;
		origTop[1] = 190;
		
		currLeft[0] = 362;
		currLeft[1] = 587;
		currTop[0] = 100;
		currTop[1] = 190;
		limitLeft[0] = 317;
		limitLeft[1] = 707;
		limitTop[0] = 10;
		limitTop[1] = 10;
		offsetLeft[0] = 5;
		offsetLeft[1] = 10;
		offsetTop[0] = 10;
		offsetTop[1] = 15;
		
		var winW = 0;
		var winH = 0;
		
		// Detect if the browser is IE or not.
		// If it is not IE, we assume that the browser is NS.
		var IE = document.all?true:false
		
		// If NS -- that is, !IE -- then set up for mouse capture
		if (!IE) document.captureEvents(Event.MOUSEMOVE)
		
		// Main function to retrieve mouse x-y pos.s
		
		var tempX = 0;
		var tempY = 0;
		
		// Set-up to use getMouseXY function onMouseMove
		document.onmousemove = getMouseXY;
		
		// Temporary variables to hold mouse x-y pos.s
		var tempMouseX = 0
		var tempMouseY = 0
		
		// Main function to retrieve mouse x-y pos.s
		
		function getMouseXY(e) {
		  if (IE) { // grab the x-y pos.s if browser is IE
			tempMouseX = event.clientX + document.body.scrollLeft
			tempMouseY = event.clientY + document.body.scrollTop
		  } else {  // grab the x-y pos.s if browser is NS
			tempMouseX = e.pageX
			tempMouseY = e.pageY
		  }  
		  // catch possible negative values in NS4
		  if (tempMouseX < 0){tempMouseX = 0}
		  if (tempMouseY < 0){tempMouseY = 0}  
		  // show the position values in the form named Show
		  // in the text fields named MouseX and MouseY
		  
		  if (currFunction != '') {
			
			eval(currFunction);
			
		  }
		  
		  return true
		}
		
		function check_email(email) {
			
			ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
			
			for(i=0; i < email.length ;i++){
				if(ok.indexOf(email.charAt(i))<0){ 
					return (false);
				}	
			}
			
			re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
			re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
			if (!email.match(re) && email.match(re_two)) {
				return (-1);		
			} 
			
		
		}
		
		function getScrollOffset() {
		
			setWindowProps();
		
			tempX = 0;
			tempY = 0;
			
			if (IE) { // grab the x-y pos.s if browser is IE
				tempX = document.body.scrollLeft;
				tempY = document.body.scrollTop;
			} else {
				tempX = window.pageXOffset;
				tempY = window.pageYOffset;
			}
			
			// catch possible negative values in NS4
			if (tempX < 0){tempX = 0}
			if (tempY < 0){tempY = 0}
			
			//alert(tempX + " " + tempY); 
		
		}

		function setWindowProps() {
			
			if (parseInt(navigator.appVersion)>3) {
				if (navigator.appName=="Netscape") {
					winW = window.innerWidth;
					winH = window.innerHeight;
				}
				if (navigator.appName.indexOf("Microsoft")!=-1) {
					winW = (document.body.offsetWidth-21);
					winH = (document.body.offsetHeight-4);
				}
			}
			
		}
		
		function setOpacity(divName,value) {
			document.getElementById(divName).style.opacity = value/10;
			document.getElementById(divName).style.filter = 'alpha(opacity=' + value*10 + ')';
		}
		
		function displayOpacity(divName,value) {
			
			if (value == 10) {
				setOpacity(divName,value);
				clearTimeout(opacityTimeoutVar);
			} else {
				setOpacity(divName,value);
				opacityTimeoutVar = window.setTimeout("displayOpacity('"+divName+"',"+(value+1)+")",15);
			}
			
		}
		
		function init(resize) {
			
			setWindowProps();
			
		}
		
		function setVisit() {
		
			currIp = document.getElementById('CurrIp').value;
			currMember = document.getElementById('CurrMem').value;
			currSession = document.getElementById('CurrSession').value;
		
			currHref = document.location.href;
			
			questionLocation = currHref.indexOf('?');
			
			variables = '';
			currPage = currHref;
			
			if (questionLocation != -1) {
				variables = currHref.split('?');
				currPage = variables[0];
				variables = variables[1].split('&');
			}
			
			//alert("functions.php?PageView=1&currPage="+currPage+"&variables="+variables+"&currMember="+currMember+"&currIp="+currIp+"&currSession="+currSession);
			
			currDiv = 'test';
			sendAjax("functions.php?PageView=1&currPage="+currPage+"&variables="+variables+"&currMember="+currMember+"&currIp="+currIp+"&currSession="+currSession,processAjax);
			
		}
				
		function IsNumeric(sText) {
		
			var ValidChars = "0123456789.,";
			var IsNumber=true;
			var Char;
		 
			for (i = 0; i < sText.length && IsNumber == true; i++) { 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) {
					IsNumber = false;
				}
			}
			
			return IsNumber;
		   
		}

		function nothing() {}
		
		function sendAjax(urlContent,returnFunc) {
		
			if (currLib != '') {
				urlContent	+= "&LibName="+currLib;
			}
			
			var paddingTop = Math.abs((loadingHeight-30)/2);
			var paddingLeft = Math.abs((loadingWidth-30)/2);
			
			document.getElementById(currDiv).innerHTML = '<div align="left" style="width: '+loadingWidth+'px; height: '+loadingHeight+'px; background-color: #FFF;"><img src="'+root_link+'/images/loading.gif" style="margin: '+paddingTop+'px 0px 0px '+paddingLeft+'px"></br></div>';
		
			createRequest();			
			
			request.open("GET", root_link + "/includes/scripts/" + urlContent, true);
			request.onreadystatechange = eval(returnFunc);
			request.send(null);
			
			loadingWidth = 30;
			loadingHeight = 30;
			
			/*
			window.clearTimeout(ajaxTimeout);
			ajaxTimeout = window.setTimeout("request.send(null)",500);
			*/
			
		}
		
		function processAjax() {
		
			if(request.readyState == 4) {
				
				if(request.status == 200) {
				
					//alert(trim(request.responseText));
				
					if((document.getElementById(currDiv)) && (trim(request.responseText) != '')) {
						//alert(document.getElementById('hoverMain').innerHTML);
						document.getElementById(currDiv).innerHTML = trim(request.responseText);
						document.getElementById(currDiv).style.visibility = "visible";
						//setOpacity(currDiv,9.7);
						/*
						clearTimeout(opacityTimeoutVar);
						displayOpacity(currDiv,1);
						*/
						//document.getElementById(currDiv).style.visibility = "visible";
						
						if (secondaryFunction != '') {
							eval(secondaryFunction);
							secondaryFunction = '';
						}
						
						if (currAnchor != '') {
							document.location.href = currAnchor;
							currAnchor = '';
						}
						
						tempContent = '';
						loadedContent = 1;
						
						/*
						if (waitFunction != '') {
							eval(waitFunction);	
						}
						*/
						
					}
					
				}
				
			}
		
		}
		
		function pageScroll() {
			getScrollOffset();
			if ((tempY+winH) < 570) {
				window.scrollBy(0,10); // horizontal and vertical scroll increments
				scrolldelay = setTimeout("pageScroll()",20); // scrolls every 100 milliseconds
			}
		}
		
		function trim(stringToTrim) {
			return stringToTrim.replace(/^\s+|\s+$/g,"");
		}
		
		function check_errors(formName) {
			
			var submitOk = 1;
			var errorContent = '<span style="font-weight: bold;">Erreur :</span> ';
			
			if (formName == 'CommentsForm') {
			
				//var FirstName = document.CommentsForm.FirstName.value;
				//var LastName = document.CommentsForm.LastName.value;
				var Email = document.CommentsForm.Email.value;
				var Comments = document.CommentsForm.Comments.value;
				
				var fieldEntered = 0;
				
				/*
				if (FirstName == '') {
					submitOk = 0;
					errorContent += 'Prenom';
					fieldEntered = 1;
				}
				
				if (LastName == '') {
					submitOk = 0;
					if (fieldEntered == 1)
						errorContent += ', ';
					errorContent += 'Nom';
					fieldEntered = 1;
				}
				*/
				
				if ((Email == '')) {
					submitOk = 0;
					if (fieldEntered == 1)
						errorContent += ', ';
					errorContent += 'Email';
					fieldEntered = 1;
				} else if (!check_email(Email)) {
					submitOk = 0;
					if (fieldEntered == 1)
						errorContent += ', ';
					errorContent += 'Email invalide';
					fieldEntered = 1;
				}
				
				if (Comments == '') {
					submitOk = 0;
					if (fieldEntered == 1)
						errorContent += ', ';
					errorContent += 'Message';
					fieldEntered = 1;
				}
				
			}
			
			if (submitOk == 1) {
				return true;	
			} else {
				/*
				document.location.href = '#formErrors';
				*/
				document.getElementById('formErrorsDiv').style.padding = "5px 0px 5px 13px";
				document.getElementById('formErrorsDiv').style.display = "block";
				document.getElementById('formErrorsDiv').style.color = "#CC0000";
				document.getElementById('formErrorsDiv').innerHTML = errorContent;
				return false;
			}
		
		}
		
		
	function defaultField(fieldValue,fieldObject,fieldState) {
		
		//var fieldObject = eval('document.'+fieldForm+'.'+fieldName);
		//fieldForm,fieldName
		
		if ((fieldState == 0) && (fieldObject.value == fieldValue)) {
			fieldObject.value = '';	
		} else if ((fieldState == 1) && (fieldObject.value == '')) {
			fieldObject.value = fieldValue;	
		}
	
	}
	
	function setPopup(Width,Height) {
	
		getScrollOffset();
		
		leftOffset	= Math.floor((winW-Width)/2)+tempX;
		topOffset	= Math.floor((winH-Height)/2)+tempY;
		
		if (IE) {
			var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
			tempY = iebody.scrollTop;
			topOffset	= tempY+50;
			//alert(document.body.clientHeight + ' ' + tempY + ' ' + (winH-tempY));
			Width += 18;
		}
		
		document.getElementById('temp').style.left = leftOffset + "px";
		document.getElementById('temp').style.top = topOffset + "px";
		document.getElementById('temp').style.width = Width + "px";
		document.getElementById('temp').style.height = Height + "px";
		document.getElementById('temp').style.visibility = "visible";
		
		popupOpen = 1;
	
	}
	
	function closePopup() {
		
		document.getElementById('temp').style.left = "0px";
		document.getElementById('temp').style.top = "0px";
		document.getElementById('temp').style.width = "0px";
		document.getElementById('temp').style.height = "0px";
		document.getElementById('temp').style.visibility = "hidden";
		document.getElementById('temp').innerHTML = '';
		
		popupOpen = 0;
		
	}
	
	function getMonthDisp(Month,Year,UserId) {
		
		loadingWidth = 900;
		loadingHeight = 500;
		
		currDiv = 'calendar';
		//alert(document.getElementById('calendar'));
		//alert("functions.php?getMonth=1&Month="+Month+"&Year="+Year);
		sendAjax("functions.php?getMonth=1&Month="+Month+"&Year="+Year+"&UserId="+UserId,processAjax);
		
	}
	
	function removeItem(ItemId,UserId,Month,Year) {
		currDiv = 'temp';
		sendAjax("functions.php?removeItem=1&ItemId="+ItemId,processAjax);
		closePopup();
		getMonthDisp(Month,Year,UserId);
		
	}
	
	function itemDetails(ItemId,UserId) {
		
		hideDetails();
		
		loadingWidth = 400;
		loadingHeight = 300;
		
		setPopup(500,400);
		currDiv = 'temp';
		//alert(document.getElementById('calendar'));
		//alert("functions.php?itemDetails=1&ItemId="+ItemId+"&UserId="+UserId);
		sendAjax("functions.php?itemDetails=1&ItemId="+ItemId+"&UserId="+UserId,processAjax);
		
	}
	
	function addItem(DateField,UserId,ItemId) {
		
		loadingWidth = 400;
		loadingHeight = 300;
		
		setPopup(500,400);
		//alert(ItemId);
		currDiv = 'temp';
		//alert(document.getElementById('calendar'));
		//alert("functions.php?getMonth=1&Month="+Month+"&Year="+Year);
		sendAjax("functions.php?addItem=1&ItemId="+ItemId+"&DateField="+DateField+"&UserId="+UserId,processAjax);
		
	}
	
	function dispDetails(ItemId) {
	
		if (currItem != ItemId) {
			
			getScrollOffset();
			
			hideDetails();
	
			//var dateDisp = document.getElementById('ItemDate'+ItemId).value;
			var contentDisp = document.getElementById('ItemContent'+ItemId).value;
			
			//alert(tempY + " " + tempMouseY);
			
			if ((winW-(tempMouseX-tempX)) < 400) {
			document.getElementById('tempHover').style.left = ((tempMouseX))-240+"px";
			} else {
			document.getElementById('tempHover').style.left = ((tempMouseX))+20+"px";
			}
			
			if (IE) {
				var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
				tempX = iebody.scrollLeft;
				tempY = iebody.scrollTop;
				document.getElementById('tempHover').style.top = ((tempY+tempMouseY))-20+"px";
			} else {
				document.getElementById('tempHover').style.top = ((+tempMouseY))-20+"px";
			}
			
			
			//dateDisp = '<div style="font-weight: bold; padding-bottom: 10px;">'+dateDisp+'</div>';
			
			if (contentDisp == '') {
				contentDisp = 'pas de détails supplémentaires.';	
			}
			
			document.getElementById('tempHover').innerHTML = contentDisp;
			
			document.getElementById('tempHover').style.visibility = "visible";
			
			currItem = ItemId;
			
		}
		
	
	}
	
	function hideDetails(ItemId) {
			
		document.getElementById('tempHover').innerHTML = "";
		document.getElementById('tempHover').style.visibility = "hidden";
		document.getElementById('tempHover').style.left = "0px";
		document.getElementById('tempHover').style.right = "0px";
		document.getElementById('tempHover').style.top = "0px";
		document.getElementById('tempHover').style.bottom = "0px";
		
		currItem = 0;
		
	}