		
	
		var tempContent = "";
		
		var loadedContent = 1;
		
		var currTimeout = "";
		
		var currListLocation = 0;
		var currSelectLocation = 0;
		
		var currId	= 0;
		
		var currLib	= "";
		
		var keynum = 0;
		
		var selectLocFunc = 0;
		
		var currAbout = 1;
		var currAboutHover = 0;
		
		var currBoxLeft	= 0;
		var currBoxTop	= 0;
		var currBoxWidth	= 550;
		var currBoxHeight	= 500;
		
		var currDiv = "";
		var currAnchor = "";
		var currFunction = "";
		var secondaryFunction = "";
		var ajaxTimeout = 0;
		
		var rightContentMin = 25;
		var rightContentMax = 297;
		var rightContent = 1;
		
		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;
		
		// Set-up to use getMouseXY function onMouseMove
		document.onkeypress = getKeyNum;
		
		// 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 getKeyNum(e) {
			
			if(window.event) { // IE
				keynum = window.event.keyCode;
			}
			else if(e.which) { // Netscape/Firefox/Opera
				keynum = e.which;
			}
			 
		}

		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)+")",50);
			}
			
		}
		
		function init(loadMapGood,resize) {
			
			setWindowProps();
			
			if (loadMapGood != 0) {
				loadMap();
			}
			
			if (document.getElementById('LibName')) {
				currLib = document.getElementById('LibName').value;
			}
			
			document.getElementById('skylineBg').style.width = (winW-20)+"px";
			
		}
		
		function setBoxPosition() {
			
			setWindowProps();
			getScrollOffset();
			
			if (document.getElementById('boxContent')) {
				currBoxLeft = (Math.floor(((winW)-currBoxWidth)/2))+tempX;
				currBoxTop = (Math.floor(((winH)-currBoxHeight)/2))+tempY;
				document.getElementById('boxContent').style.left = currBoxLeft+"px";
				document.getElementById('boxContent').style.top = currBoxTop+"px";
			}
			
		}
		
		function closeBox() {
		
			document.getElementById('boxContent').style.visibility = "hidden";
			document.getElementById('boxContentLeft').innerHTML = "&nbsp;";
			document.getElementById('boxContentRight').innerHTML = "&nbsp;";
		
		}
		
		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)
        {
		
			var root_link = 'http://www.londonerslist.com/';
		
			//alert(urlContent);
		    //debugger;
		    
			if(currLib != '')
				urlContent	+= "&LibName="+currLib;

			
			/*
			if (returnFunc == processAjax) {
		
			thisWidth = document.getElementById(currDiv).style.width.substring(0,((document.getElementById(currDiv).style.width.length*1)-2))*1;
			thisHeight = document.getElementById(currDiv).style.height.substring(0,((document.getElementById(currDiv).style.height.length*1)-2))*1;
			topPadding = Math.round(thisHeight/2);
			leftPadding = Math.round(thisWidth/2);
			
			//document.getElementById(currDiv).innerHTML = '<div align="center" style="padding: '+topPadding+'px 0px 0px '+leftPadding+'px"><img src="'+root_link+'/images/main/ajax-loader.gif"></br></div>';
		
			}
			*/
			
			createRequest();	
			
			request.open("GET", root_link+urlContent, true);
			request.onreadystatechange = eval(returnFunc);
			request.send(null);
			/*
			*/
			/*
			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";
						
						if (currDiv == 'locSelect') {
							//alert(trim(request.responseText));	
						}
						
						//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;
						selectLocFunc = 0;
						
						/*
						if (waitFunction != '') {
							eval(waitFunction);	
						}
						*/
						
					}
					
				}
				
			}
		
		}
		
		function processLogin()
        {
			if(request.readyState != 4)
			 return;
			if(request.status != 200)
			 return;
    		if((trim(request.responseText) == ''))
    		  return;
    			
			if(trim(request.responseText) == 2)
            {
                document.LoginForm.submit();	
			} else {
				setPopupProps(510,470);
				currDiv = 'popupBoxInside';
				sendAjax('functions.php?wrongLogin=1&Type='+trim(request.responseText),processAjax);
			}
		}

		function popProcessLogin()
        {
			if(request.readyState != 4)
			 return;
			if(request.status != 200)
			 return;
    		if((trim(request.responseText) == ''))
    		  return;
    		
            if(trim(request.responseText) == 2)
            {
                document.popLoginForm.submit();	
			} else {
				setPopupProps(510,470);
				currDiv = 'popupBoxInside';
				sendAjax('functions.php?wrongLogin=1&Type='+trim(request.responseText),processAjax);
			}
		}
		
		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 == 'SearchForm') {
			
				var Keyword = document.SearchForm.Keyword.value;
				var TagId = document.SearchForm.TagId.value;
				var AreaId = document.SearchForm.AreaId.value;
			
				if (((Keyword == '') || (Keyword == 'Enter a search term')) && (TagId == 0) && (AreaId == 0)) {
					alert('Please enter a keyword or select a search criteria before submitting.');
				} else {
					document.SearchForm.submit();
				}
				
			} else {
			
				if (formName == 'RegisterForm') {
					
					//alert(formName);
				
					//var Nickname = document.RegisterForm.NicknameValid.value;
					var FirstName = document.RegisterForm.FirstName.value;
					var LastName = document.RegisterForm.LastName.value;
					var FacebookId = document.RegisterForm.FacebookId.value;
					var ConnectAttempt = document.RegisterForm.ConnectAttempt.value;
					var EmailValid = document.RegisterForm.EmailValid.value;
					var Password = document.RegisterForm.Password.value;
					var RepeatPassword = document.RegisterForm.RepeatPassword.value;
					
					submitFunc = 'saveRegister()';
					
					/*
					if ((Nickname == 0)) {
						submitOk = 0;
						document.getElementById('errorNickname').style.visibility = "visible";
					} else {
						document.getElementById('errorNickname').style.visibility = "hidden";
					}
					*/
					
					if ((FirstName == '')) {
						submitOk = 0;
						document.getElementById('errorFirstName').style.visibility = "visible";
					} else {
						document.getElementById('errorFirstName').style.visibility = "hidden";
					}
					
					if ((LastName == '')) {
						submitOk = 0;
						document.getElementById('errorLastName').style.visibility = "visible";
					} else {
						document.getElementById('errorLastName').style.visibility = "hidden";
					}
					
					if ((EmailValid == 0)) {
						submitOk = 0;
						document.getElementById('errorEmail').style.visibility = "visible";
					}
					
					if ((Password == '')) {
						submitOk = 0;
						document.getElementById('errorPassword').style.visibility = "visible";
					} else {
						document.getElementById('errorPassword').style.visibility = "hidden";
					}
					
					if ((RepeatPassword == '')) {
						submitOk = 0;
						document.getElementById('errorPassword2').style.visibility = "visible";
					} else {
						document.getElementById('errorPassword2').style.visibility = "hidden";
					}
					
					if ((Password != RepeatPassword)) {
						submitOk = 0;
						document.getElementById('errorPassword').style.visibility = "visible";
						document.getElementById('errorPassword2').style.visibility = "visible";
					}
					
					if ((submitOk == 1) && (FacebookId == '') && (ConnectAttempt == '')) {
						submitOk = 0;
						document.RegisterForm.ConnectAttempt.value = 1;
						document.getElementById('connectAttemptError').innerHTML = "If you have a Facebook account, please link through Facebook Connect";
					} else {
						document.getElementById('connectAttemptError').innerHTML = "&nbsp;";
					}
					
				}
			
				if (formName == 'InviteFriendForm') {
					
					//alert(formName);
				
					//var Nickname = document.RegisterForm.NicknameValid.value;
					var FullName = document.InviteFriendForm.FullName.value;
					var Email = document.InviteFriendForm.Email.value;
					var Message = document.InviteFriendForm.Message.value;
					
					submitFunc = 'sendInvitation()';
					
					if ((FullName == '')) {
						submitOk = 0;
						document.getElementById('errorName').style.visibility = "visible";
					} else {
						document.getElementById('errorName').style.visibility = "hidden";
					}
					
					if (!check_email(Email)) {
						submitOk = 0;
						document.getElementById('errorEmail').style.visibility = "visible";
					} else {
						document.getElementById('errorEmail').style.visibility = "hidden";
					}
					
					if ((Message == '')) {
						submitOk = 0;
						document.getElementById('errorMessage').style.visibility = "visible";
					} else {
						document.getElementById('errorMessage').style.visibility = "hidden";
					}
					
				}
				
				if (submitOk == 1) {
					eval(submitFunc);
				} 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;
					*/
					document.getElementById('errorField').style.color = "#CC0000";
				}
			
			}
		
		}
		
		function clearSearch() {
			
			document.SearchForm.Keyword.value = 'Enter a search term';
			document.SearchForm.TagId.selectedIndex = 0;
			document.SearchForm.AreaId.selectedIndex = 0;
			
		}
		
		function verifyLogin() {
			var Email = document.LoginForm.Email.value;
			var Password = document.LoginForm.Password.value;
			//alert(Email + ' ' + Password);
			sendAjax('functions.php?verifyLogin=1&Email='+Email+'&Password='+Password,processLogin);
			return false;
		}
		
		function popVerifyLogin() {
			var Email = document.popLoginForm.Email.value;
			var Password = document.popLoginForm.Password.value;
			//alert(Email + ' ' + Password);
			sendAjax('functions.php?verifyLogin=1&Email='+Email+'&Password='+Password,popProcessLogin);
			return false;
		}
		
		function verifyEmail() {
			
			var Email = document.RegisterForm.Email.value;
			
			if (!check_email(Email)) {
				var contentDisp	= '<input type="hidden" name="EmailValid" value="0">';
				contentDisp	+= 'please enter a valid email address.';
				document.getElementById('emailField').style.height = "50px";
				document.getElementById('emailFieldContent').innerHTML = contentDisp;
			} else {
				document.getElementById('emailField').style.height = "80px";
				currDiv = 'emailFieldContent';
				sendAjax('functions.php?verifyEmail=1&Email='+Email,processAjax);
			}
			
		}
		
		function saveRegister() {
			
			var FirstName = document.RegisterForm.FirstName.value;
			var LastName = document.RegisterForm.LastName.value;
			var Email = document.RegisterForm.Email.value;
			var Password = document.RegisterForm.Password.value;
			var FavoriteText = document.RegisterForm.FavoriteText.value;
			
			document.RegisterForm.submit();
			
			//alert('functions.php?saveRegister=1&FirstName='+FirstName+'&LastName='+LastName+'&Email='+Email+'&Password='+Password+'&FavoriteText='+FavoriteText)
			
			//currDiv = 'popupBoxInside';
			//sendAjax('functions.php?saveRegister=1&FirstName='+FirstName+'&LastName='+LastName+'&Email='+Email+'&Password='+Password+'&FavoriteText='+FavoriteText,processAjax);
			
		}
		
		function sendInvitation() {
			
			var UserId = document.InviteFriendForm.UserId.value;
			var FullName = document.InviteFriendForm.FullName.value;
			var Email = document.InviteFriendForm.Email.value;
			var Message = document.InviteFriendForm.Message.value;
			
			//alert('functions.php?saveRegister=1&FirstName='+FirstName+'&LastName='+LastName+'&Email='+Email+'&Password='+Password+'&FavoriteText='+FavoriteText)
			
			currDiv = 'popupBoxInside';
			sendAjax('functions.php?sendInvitation=1&UserId='+UserId+'&FullName='+FullName+'&Email='+Email+'&Message='+Message,processAjax);
			
		}
				
		function savePrivacy() {
			
			//currDiv = 'saveRegister';
			//sendAjax('functions.php?saveRegister=1&FirstName='+FirstName+'&LastName='+LastName+'&Email='+Email+'&Password='+Password+'&FavoriteText='+FavoriteText,processAjax);
			
		}
		
		function privacySettings(UserId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?privacySettings=1&UserId='+UserId,processAjax);
			
		}			
		
		function expandBox(divName,expandType,expandDirection,currValue,limit,offset) {

			if (openDiv == 1) {
		
				document.getElementById(divName).style.visibility = "visible";
			
				window.clearTimeout(currTimeout);
			
				var stopExpand = 0;
			
				if (expandDirection == 0) {
					currValue -= offset;
					if (currValue < limit) {
						currValue = limit;
						stopExpand = 1;
					}
				} else {
					currValue += offset;
					if (currValue > limit) {
						currValue = limit;
						stopExpand = 1;
					}
				}
				
				eval('document.getElementById(\''+divName+'\').style.'+expandType+'= "'+currValue+'px"');
				
				if (stopExpand == 0) {
					currTimeout = window.setTimeout("expandBox('"+divName+"','"+expandType+"',"+expandDirection+","+currValue+","+limit+","+offset+")",10);
				}
			
			}
		
		}
		
		function moveTitleStart(divNum) {
		
			closeComments();
		
			if (currDiv != 0) {
				window.clearTimeout(currTimeout);
				document.getElementById('text'+currDiv).style.visibility = "hidden";
			}
			
			if (openDiv == 0) {
				for (i = 1; i <= divCount; i++) {
					moveTitle(i);
				}
			}
			
			if (divNum != currDiv) {
				window.setTimeout("expandBox('text"+divNum+"','height',1,5,300,5)",100);
				currDiv = divNum;
				openDiv = 1;
			} else {
				currDiv = 0;
				for (i = 1; i <= divCount; i++) {
					moveTitle(i);
				}
				openDiv = 0;
			}
			
			/*
			currDiv = divNum;		
			
			if (openDiv == 0) {
				window.setTimeout("expandBox('text"+divNum+"','height',1,5,300,5)",100);
				openDiv = 1;
			} else {
				document.getElementById('text'+currDiv).style.visibility = "hidden";
				currDiv = 0;
				//expandBox('text'+divNum,'height',0,300,5,5);
				openDiv = 0;
			}
			*/
			
		}
		
		function moveTitle(divNum) {
		
			var index = divNum-1;
		
			if (currTop[index] > limitTop[index]) {
			currTop[index] -= offsetTop[index];
			} else {
			currTop[index] += offsetTop[index];
			}
			if (currLeft[index] > limitLeft[index]) {
			currLeft[index] -= offsetLeft[index];
			} else {
			currLeft[index] += offsetLeft[index];
			}
			
			
			if (currTop[index] != limitTop[index]) {
				window.setTimeout("moveTitle("+divNum+")",10);
			} else {
				limitLeft[index] = origLeft[index];
				limitTop[index] = origTop[index];
				origLeft[index] = currLeft[index];
				origTop[index] = currTop[index];
			}
		
			document.getElementById('title'+divNum).style.left = currLeft[index]+"px";
			document.getElementById('title'+divNum).style.top = currTop[index]+"px";
		
		}
		
		function openComments() {
		
			if (commentsOn == 0) {
			commentsOn = 1;
			document.getElementById('commentsForm').style.visibility = "visible";
			} else {
			closeComments();
			}
		
		}
		
		function closeComments() {
		
			commentsOn = 0;
			document.getElementById('commentsForm').style.visibility = "hidden";
		
		}
	
		function setAboutTab(num) {
		
			document.getElementById('AboutHeader'+currAbout+'Off').style.visibility = "visible";
			document.getElementById('AboutHeader'+currAbout).style.visibility = "hidden";
			document.getElementById('AboutContent'+currAbout).style.visibility = "hidden";
		
			document.getElementById('AboutHeader'+num+'Off').style.visibility = "hidden";
			document.getElementById('AboutHeader'+num).style.visibility = "visible";
			document.getElementById('AboutContent'+num).style.visibility = "visible";
	
			currAbout = num;
		}
		
		function setRightContent(num) {
		
			if (num != rightContent) {
				
				rightContentFunc = document.getElementById('rightContentFunc'+num).value;
				
				document.getElementById('rightContentCornerLeft'+num).style.visibility = 'hidden';
				document.getElementById('rightContentCornerRight'+num).style.visibility = 'hidden';
				
				document.getElementById('rightContentCornerLeft'+rightContent).style.visibility = 'visible';
				document.getElementById('rightContentCornerRight'+rightContent).style.visibility = 'visible';
				
				expandRightContent(rightContent,0,rightContentMax);
				expandRightContent(num,1,rightContentMin);
				rightContent = num;
				
				currDiv = 'rightContentInside'+num;
				sendAjax('functions.php?'+rightContentFunc+'=1',processAjax);
			}
		
		}
		
		function expandRightContent(num,direction,currValue) {
		
			if (direction == 0) {
				currValue -= 20;
				document.getElementById('rightContent'+num).style.height = currValue+"px";
				if (currValue > rightContentMin) {
					window.setTimeout("expandRightContent("+num+","+direction+","+currValue+")",5);
				} else {
					document.getElementById('rightContent'+num).style.height = rightContentMin+"px";
				}
			} else {
				currValue += 20;
				document.getElementById('rightContent'+num).style.height = currValue+"px";
				if (currValue < rightContentMax) {
					window.setTimeout("expandRightContent("+num+","+direction+","+currValue+")",5);
				} else {
					document.getElementById('rightContent'+num).style.height = rightContentMax+"px";
				}
			}
		
		}
		
		function setRightContentProfile(num,UserId,CurrResults) {
		
			//if (num != rightContent) {
				
				rightContentFunc = document.getElementById('rightContentFunc'+num).value;
				rightContentHeight = document.getElementById('rightContentHeight'+num).value*1;
				
				document.getElementById('rightBottomLeft'+num).style.visibility = 'hidden';
				document.getElementById('rightBottomRight'+num).style.visibility = 'hidden';
				
				if (num != rightContent) {
					document.getElementById('rightBottomLeft'+rightContent).style.visibility = 'visible';
					document.getElementById('rightBottomRight'+rightContent).style.visibility = 'visible';
				}
				
				rightContentProfileHeight = (document.getElementById('rightContentCounterHeight').value*1)+(rightContentHeight*1)-20;
				
				document.getElementById('rightContentProfile').style.height = rightContentProfileHeight+'px';
				
				rightContentMax = rightContentHeight;
				
				expandRightContent(rightContent,0,rightContentMax);
				expandRightContent(num,1,rightContentMin);
				rightContent = num;
				
				currDiv = 'rightContentInside'+num;
				//alert('functions.php?'+rightContentFunc+'=1&UserId='+UserId+'&CurrResults='+CurrResults);
				sendAjax('functions.php?'+rightContentFunc+'=1&UserId='+UserId+'&CurrResults='+CurrResults,processAjax);
			//}
		
		}
		
		function setRightContentResto(num,RestoId,CurrResults) {
		
			//if (num != rightContent) {
				
				rightContentFunc = document.getElementById('rightContentFunc'+num).value;
				rightContentHeight = document.getElementById('rightContentHeight'+num).value;
				
				document.getElementById('rightBottomLeft'+num).style.visibility = 'hidden';
				document.getElementById('rightBottomRight'+num).style.visibility = 'hidden';
				
				if (num != rightContent) {
					
					document.getElementById('rightBottomLeft'+rightContent).style.visibility = 'visible';
					document.getElementById('rightBottomRight'+rightContent).style.visibility = 'visible';
				
					rightContentProfileHeight = (document.getElementById('rightContentCounterHeight').value*1)+(rightContentHeight*1)-20;
					
					document.getElementById('rightContentResto').style.height = rightContentProfileHeight+'px';
					//document.getElementById('rightContentProfileRight').style.top = (rightContentProfileHeight-11)+'px';
					//document.getElementById('rightContentProfileLeft').style.top = (rightContentProfileHeight-11)+'px';
					
					rightContentMax = rightContentHeight;
					
					expandRightContent(rightContent,0,rightContentMax);
					expandRightContent(num,1,rightContentMin);
					rightContent = num;
					
				}
				
				currDiv = 'rightContentInside'+num;
				sendAjax('functions.php?'+rightContentFunc+'=1&RestoId='+RestoId+'&CurrResults='+CurrResults,processAjax);
			//}
		
		}
		
		function fieldDefault(fieldValue,fieldObject,fieldAction) {
		
			//alert(fieldValue);
		
			if ((fieldAction == 0) && (fieldObject.value == fieldValue)) {
				fieldObject.value = '';	
			}
		
			if ((fieldAction == 1) && (fieldObject.value == '')) {
				fieldObject.value = fieldValue;	
			}
		
		}
		
		function setPopupProps(Width,Height) {
			
			getScrollOffset();
			
			document.getElementById('searchTag').style.visibility = 'hidden';
			document.getElementById('searchArea').style.visibility = 'hidden';
			
			leftPos = Math.round(((winW-20)-Width)/2);
			topPos = Math.round(((winH-20)-Height)/2);
			
			document.getElementById('popupBoxShadow').style.left = (tempX+leftPos)+"px";
			document.getElementById('popupBoxShadow').style.top = (tempY+topPos)+"px";
			document.getElementById('popupBoxShadow').style.width = Width+"px";
			document.getElementById('popupBoxShadow').style.height = Height+"px";
			
			document.getElementById('popupBox').style.left = (tempX+leftPos+5)+"px";
			document.getElementById('popupBox').style.top = (tempY+topPos+5)+"px";
			document.getElementById('popupBox').style.width = (Width-10)+"px";
			document.getElementById('popupBox').style.height = (Height-10)+"px";
			
			document.getElementById('popupBoxCorners').style.width = (Width-10)+"px";
			document.getElementById('popupBoxCorners').style.height = (Height-10)+"px";
			
			document.getElementById('popupBoxShadow').style.visibility = "visible";
			document.getElementById('popupBox').style.visibility = "visible";
			
		}
		
		function closePopup() {
			
			document.getElementById('searchTag').style.visibility = 'visible';
			document.getElementById('searchArea').style.visibility = 'visible';
			
			document.getElementById('popupBoxShadow').style.left = "0px";
			document.getElementById('popupBoxShadow').style.top = "0px";
			document.getElementById('popupBoxShadow').style.width = "0px";
			document.getElementById('popupBoxShadow').style.height = "0px";
			
			document.getElementById('popupBox').style.left = "0px";
			document.getElementById('popupBox').style.top = "0px";
			document.getElementById('popupBox').style.width = "0px";
			document.getElementById('popupBox').style.height = "0px";
			
			document.getElementById('popupBoxCorners').style.width = "0px";
			document.getElementById('popupBoxCorners').style.height = "0px";
			
			document.getElementById('popupBoxShadow').style.visibility = "hidden";
			document.getElementById('popupBox').style.visibility = "hidden";
			document.getElementById('popupBoxInside').innerHTML = "";
			
		}
		
		function readReviews() {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?readReviews=1',processAjax);
			
		}
		
		function forgotPassword() {
			
			var currEmail = document.LoginForm.Email.value;
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?forgotPassword=1&currEmail='+currEmail,processAjax);
			
		}
		
		function checkPasswordEmail() {
			
			var currEmail = document.getElementById('PasswordEmail').value;
			currDiv = 'verifyPassword';
			sendAjax('functions.php?checkPasswordEmail=1&currEmail='+currEmail,processAjax);
			
		}
		
		function inviteFriend(User) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?inviteFriend=1&UserId='+User,processAjax);
			
		}
		
		function registerMember() {
			
			displayAbout();
			
			/*
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?registerMember=1',processAjax);
			*/
			
		}
		
		function registerMemberAbout(ListId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?registerMemberAbout=1&ListId='+ListId,processAjax);
			
		}
		
		function displayAbout() {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?displayAbout=1',processAjax);
			
		}
		
		function createListAbout() {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?createListAbout=1',processAjax);
			
		}
		
		function createList(UserId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?createList=1&UserId='+UserId,processAjax);
			
		}
		
		function editList(UserId,ListId) {
			//alert(UserId+' '+ ListId);
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?editList=1&UserId='+UserId+'&ListId='+ListId,processAjax);
			
		}
		
		function createPost(UserId,PosterId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?createPost=1&UserId='+UserId+'&PosterId='+PosterId,processAjax);
			
		}
		
		function editFavoriteText(UserId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?editFavoriteText=1&UserId='+UserId,processAjax);
			
		}
		
		function createReview(RestoId,UserId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?createReview=1&UserId='+UserId+'&RestoId='+RestoId,processAjax);
			
		}
		
		function reviewsPopup(RestoId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?reviewsPopup=1&RestoId='+RestoId,processAjax);
			
		}
		
		function reviewsPopupLister(UserId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?reviewsPopupLister=1&UserId='+UserId,processAjax);
			
		}
		
		function viewFansPopup(UserId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?viewFansPopup=1&UserId='+UserId,processAjax);
			
		}
		
		function becomeFan(UserId,FanId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?becomeFan=1&UserId='+UserId+'&FanId='+FanId,processAjax);
			
		}
		
		function listsPopup(RestoId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?listsPopup=1&RestoId='+RestoId,processAjax);
			
		}
				
		function checkNickname() {
			
			Nickname = document.RegisterForm.Nickname.value;
			
			if (trim(Nickname) == '') {
				document.RegisterForm.NicknameValid.value=0;
				document.getElementById('errorNickname').style.width = "25px";
				document.getElementById('errorNicknameContent').innerHTML = "X";
				document.getElementById('errorNickname').style.visibility = "visible";
				check_errors('RegisterForm');
			} else {
				document.RegisterForm.NicknameValid.value=0;
				sendAjax('functions.php?checkNickname='+Nickname,processNickname);
			}
			
		}
		
		function processNickname() {
		
			if(request.readyState == 4) {
				
				if(request.status == 200) {
				
					if((trim(request.responseText) != '')) {
						
						if (trim(request.responseText) == 0) {
							document.RegisterForm.NicknameValid.value=1;
						} else {
							document.RegisterForm.NicknameValid.value=0;
							document.getElementById('errorNickname').style.width = "100px";
							document.getElementById('errorNicknameContent').innerHTML = "Already taken";
						}
						
						check_errors('RegisterForm');
						
					}
					
				}
				
			}
		
		}
		
		function submitRegister() {
		
			alert(1);
		
		}
		
		function dispRestoDetails(RestoId) {
		
			window.clearTimeout(currTimeout);
			if ((currId != 0) && (currId != RestoId)) {
				document.getElementById('RestoBrief'+currId).style.height = '20px';
			}
			currId = RestoId;
			document.getElementById('RestoBrief'+RestoId).style.height = '40px';
		
		}
		
		function hideRestoDetails(RestoId) {
		
			currTimeout = window.setTimeout("document.getElementById('RestoBrief"+RestoId+"').style.height = '20px'",100);
		
		}
		
		function resultsResto(Keyword,TagId,AreaId,CurrResults) {
			
			document.getElementById('searchHeader1Off').style.visibility = "hidden";
			document.getElementById('searchHeader1On').style.visibility = "visible";
			
			if (document.getElementById('searchHeader3Off')) {
			//document.getElementById('searchHeader2Off').style.visibility = "visible";
			//document.getElementById('searchHeader2On').style.visibility = "hidden";
			document.getElementById('searchHeader3Off').style.visibility = "visible";
			document.getElementById('searchHeader3On').style.visibility = "hidden";
			}
			
			currDiv = 'searchResults';
			secondaryFunction = 'loadMap()';
			sendAjax('functions.php?resultsResto=1&Keyword='+Keyword+'&TagId='+TagId+'&AreaId='+AreaId+'&CurrResults='+CurrResults,processAjax);		
			
		}
		
		function resultsMembers(Keyword,CurrResults) {
			
			document.getElementById('searchHeader1Off').style.visibility = "visible";
			//document.getElementById('searchHeader2Off').style.visibility = "visible";
			document.getElementById('searchHeader3Off').style.visibility = "hidden";
			
			document.getElementById('searchHeader1On').style.visibility = "hidden";
			//document.getElementById('searchHeader2On').style.visibility = "hidden";
			document.getElementById('searchHeader3On').style.visibility = "visible";
			
			currDiv = 'searchResults';
			secondaryFunction = 'loadSearchUsers(\''+Keyword+'\',\''+CurrResults+'\')';
            sendAjax('functions.php?resultsMembers=1&Keyword='+Keyword+'&CurrResults='+CurrResults,processAjax);		
		}
		
		function loadSearchUsers(Keyword,CurrResults) {
			
			currDiv = 'googleMap';
			sendAjax('functions.php?loadSearchUsers=1&Keyword='+Keyword+'&CurrResults='+CurrResults,processAjax);	
			
		}
		
		function checkLocName(Num,Keyword) {
			
			if ((keynum == 9) || (keynum == 13)) {
			
				if (document.getElementById('contentLoc'+currSelectLocation)) {
					Location = document.getElementById('contentLocName'+currSelectLocation).value;
					LocationId = document.getElementById('contentLocId'+currSelectLocation).value*1;
					LocationImage = document.getElementById('contentLocImage'+currSelectLocation).value;
					//alert(document.getElementById('contentLocImage'+currSelectLocation));
					setLocName(Location,LocationId,LocationImage);
				} else if (document.getElementById('emptyLoc')) {
					hideLocName();	
				}
				
				event.returnValue=false;
				event.cancel = true;
			
			} else if (keynum == 40) {
				
				//listenSetLocation();
				
				if (document.getElementById('contentLoc'+(currSelectLocation+1))) {
					
					var d = eval('document.CreateListForm.LocationId'+currListLocation);
                    if(d)
                        d.value = 0;
				
					var scrollTop = 0;
					
					if (((currSelectLocation+1)*28 - 60) > 0) {
						scrollTop = ((currSelectLocation+1)*28 - 60);
					}
					
					document.getElementById('contentSelectLoc').scrollTop=scrollTop;
					
					if (currSelectLocation != 0) {
						document.getElementById('contentLoc'+currSelectLocation).style.backgroundColor = '#FFF';
					}
				
					currSelectLocation++;
					document.getElementById('contentLoc'+currSelectLocation).style.backgroundColor = '#CCC';
					
					locationObj = document.getElementById('contentLocId'+currSelectLocation);
				
					if ((locationObj.value == '') || (locationObj.value == 0)) {
						locationObj.value = 0;
					}
					thisValue = locationObj.value;
					setLocArea(currListLocation,thisValue);
					
				}
				
			} else if (keynum == 38) {
				
				//listenSetLocation();
				
				if (currSelectLocation > 1) {
					
					var el = eval('document.CreateListForm.LocationId'+currListLocation);
					if(el)
                        el.value = 0;
					
					var scrollTop = 0;
					
					if (((currSelectLocation-1)*28 - 60) > 0) {
						scrollTop = ((currSelectLocation-1)*28 - 60);
					}
					
					document.getElementById('contentSelectLoc').scrollTop=scrollTop;
					
					document.getElementById('contentLoc'+currSelectLocation).style.backgroundColor = '#FFF';
					currSelectLocation--;
					document.getElementById('contentLoc'+currSelectLocation).style.backgroundColor = '#CCC';
					
					locationObj = document.getElementById('contentLocId'+currSelectLocation);
				
					if ((locationObj.value == '') || (locationObj.value == 0)) {
						locationObj.value = 0;
					}
					thisValue = locationObj.value;
					setLocArea(currListLocation,thisValue);
					
				}
				
			} else {
			
				currListLocation = Num;
				
				topStart = 50;
				
				topStart += (30*((currListLocation*1)-1));
				
				document.getElementById('locSelect').style.top = topStart + "px";
				
				TypeId	= document.CreateListForm.TypeId.value*1;
				
				selectLocFunc = 1;
				
				exclude = '';
				
				for (i = 1; i <= 5; i++) {
					objName = eval('document.CreateListForm.LocationId'+i);
					if ((objName) && (i != Num)) {
						if ((objName.value != '') && (objName.value != 0)) {
							if (exclude == '') {
								exclude = objName.value;
							} else {
								exclude += ','+objName.value;
							}
						}
					}
				}
				
				var root_link = 'http://www.londonerslist.com/';
				
				var contentDisp	= '<div id="contentSelectLoc" style="width: 278px; height: 62px; overflow-y: auto; background-color: #FFF">';
				contentDisp	+= '<div style="float: left; width: 25px; height: 42px;">';
				contentDisp	+= '<div style="padding: 10px 0px 0px 10px; font-style: italic;">';
				contentDisp	+= '<img src="'+root_link+'/images/main/ajax-loader.gif" width="15" height="15"><br>';
				contentDisp	+= '</div>';	
				contentDisp	+= '</div>';
				contentDisp	+= '<div style="float: left; width: 250px; height: 42px;">';
				contentDisp	+= '<div style="padding: 10px; font-style: italic;">';
				contentDisp	+= 'Searching... ';
				contentDisp	+= '</div>';	
				contentDisp	+= '</div>';	
				contentDisp	+= '</div>';
				
				document.getElementById('locSelect').innerHTML = contentDisp;
				document.getElementById('locSelect').style.visibility = "visible";
				
				currDiv = 'locSelect';
				//alert('functions.php?locSelect=1&Keyword='+Keyword+'&TypeId='+TypeId+'&Exclude='+exclude);
				sendAjax('functions.php?locSelect=1&Keyword='+Keyword+'&TypeId='+TypeId+'&Exclude='+exclude,processAjax);
				secondaryFunction = 'setLocArea('+currListLocation+',0)';
				
				return false;
			
			}
			
		}
		
		function setContentBg(Num,bgColor) {
			
			if (currSelectLocation > 0) {
				document.getElementById('contentLoc'+currSelectLocation).style.backgroundColor = '#FFF';
			}
			currSelectLocation = Num;
			
			var e = eval('document.CreateListForm.LocationId'+currListLocation);
            if(e)
                e.value = 0;
			
			document.getElementById('contentLoc'+Num).style.backgroundColor = '#'+bgColor;
			
		}
		
		function hideLocName() {
			
			if (eval('document.CreateListForm.LocationId'+currListLocation)) {
			
				document.getElementById('locSelect').style.visibility = "hidden";
				
				locationObj = eval('document.CreateListForm.LocationId'+currListLocation);
				
				if ((locationObj.value == '') || (locationObj.value == 0)) {
					locationObj.value = 0;
				}
				
				setLocArea(currListLocation,locationObj.value);
				currSelectLocation = 0;
				currListLocation = 0;
			
			}
		}
		
		function setLocName(Location,LocationId,LocationImage) {
			
			//alert(LocationImage);
			
			eval('document.CreateListForm.Location'+currListLocation).value = Location;
			eval('document.CreateListForm.LocationId'+currListLocation).value = LocationId;
			eval('document.CreateListForm.LocationImage'+currListLocation).value = LocationImage;
			
			hideLocName();
			
		}
		
		function setLocArea(LocNum,LocId) {
			
			/*
			if (!document.getElementById('contentLoc1')) {
				document.getElementById('locSelect').style.visibility = "hidden";
			}
			*/
			
			currDiv = 'locInfo'+LocNum;
			sendAjax('functions.php?locInfo=1&LocId='+LocId+'&LocNum='+LocNum,processAjax);
			
		}
		
		function verifyLocSelect() {
		
			if (!document.getElementById('contentLoc1')) {
				var el = eval('document.CreateListForm.LocationId'+currListLocation);
                if(el)
                    el.value = 0;
				hideLocName();
			}
			
		}
		
		function saveListAbout() {
			
			if (selectLocFunc == 0) {
			
				var title = document.CreateListForm.title.value;
				var TypeId = document.CreateListForm.TypeId.value;
				
				var LocationName1 = document.CreateListForm.Location1.value;
				var LocationId1 = document.CreateListForm.LocationId1.value;
				if (document.CreateListForm.AreaId1) {
				var AreaId1 = document.CreateListForm.AreaId1.value;
				} else {
				var AreaId1 = 0;
				}
				var LocationName2 = document.CreateListForm.Location2.value;
				var LocationId2 = document.CreateListForm.LocationId2.value;
				if (document.CreateListForm.AreaId2) {
				var AreaId2 = document.CreateListForm.AreaId2.value;
				} else {
				var AreaId2 = 0;
				}
				var LocationName3 = document.CreateListForm.Location3.value;
				var LocationId3 = document.CreateListForm.LocationId3.value;
				if (document.CreateListForm.AreaId3) {
				var AreaId3 = document.CreateListForm.AreaId3.value;
				} else {
				var AreaId3 = 0;
				}
				var LocationName4 = document.CreateListForm.Location4.value;
				var LocationId4 = document.CreateListForm.LocationId4.value;
				if (document.CreateListForm.AreaId4) {
				var AreaId4 = document.CreateListForm.AreaId4.value;
				} else {
				var AreaId4 = 0;
				}
				var LocationName5 = document.CreateListForm.Location5.value;
				var LocationId5 = document.CreateListForm.LocationId5.value;
				if (document.CreateListForm.AreaId5) {
				var AreaId5 = document.CreateListForm.AreaId5.value;
				} else {
				var AreaId5 = 0;
				}
				
				var Location = LocationName1+'*|*'+LocationName2+'*|*'+LocationName3+'*|*'+LocationName4+'*|*'+LocationName5;
				var LocationId = LocationId1+'*|*'+LocationId2+'*|*'+LocationId3+'*|*'+LocationId4+'*|*'+LocationId5;
				var AreaId = AreaId1+'*|*'+AreaId2+'*|*'+AreaId3+'*|*'+AreaId4+'*|*'+AreaId5;
				
				if ((LocationName1 == '') && (LocationName2 == '') && (LocationName3 == '') && (LocationName4 == '') && (LocationName5 == '')) {
					document.getElementById('errorDiv').style.height = "70px";
				} else {
			
					//alert(Location+ ' ' +LocationId+ ' '+AreaId);
			
					setPopupProps(510,470);
					currDiv = 'popupBoxInside';
					sendAjax("functions.php?saveListAbout=1&title="+title+"&TypeId="+TypeId+"&Location="+Location+"&LocationId="+LocationId+"&AreaId="+AreaId,processAjaxAbout);
				
				}
			
			}
		
		}
		
		function processAjaxAbout() {
		
			if(request.readyState == 4) {
				
				if(request.status == 200) {
				
					if((document.getElementById(currDiv)) && (trim(request.responseText) != '')) {
						
						var ListId = trim(request.responseText);
						
						registerMemberAbout(ListId);
						
					}
					
				}
				
			}
		
		}
		
		function saveList() {
			if (selectLocFunc == 0) {
			
				var title = document.CreateListForm.title.value;
				var FirstName = document.CreateListForm.FirstName.value;
				var UserId = document.CreateListForm.UserId.value;
				var FavoriteText = document.CreateListForm.FavoriteText.value;
				var ListId = document.CreateListForm.ListId.value;
				var TypeId = document.CreateListForm.TypeId.value;
				
				var LocationName1 = document.CreateListForm.Location1.value;
				var LocationId1 = document.CreateListForm.LocationId1.value;
				var LocationName2 = document.CreateListForm.Location2.value;
				var LocationId2 = document.CreateListForm.LocationId2.value;
				var LocationName3 = document.CreateListForm.Location3.value;
				var LocationId3 = document.CreateListForm.LocationId3.value;
				var LocationName4 = document.CreateListForm.Location4.value;
				var LocationId4 = document.CreateListForm.LocationId4.value;
				var LocationName5 = document.CreateListForm.Location5.value;
				var LocationId5 = document.CreateListForm.LocationId5.value;
				/*
				var LocationName6 = document.CreateListForm.Location6.value;
				var LocationId6 = document.CreateListForm.LocationId6.value;
				var LocationName7 = document.CreateListForm.Location7.value;
				var LocationId7 = document.CreateListForm.LocationId7.value;
				var LocationName8 = document.CreateListForm.Location8.value;
				var LocationId8 = document.CreateListForm.LocationId8.value;
				var LocationName9 = document.CreateListForm.Location9.value;
				var LocationId9 = document.CreateListForm.LocationId9.value;
				var LocationName10 = document.CreateListForm.Location10.value;
				var LocationId10 = document.CreateListForm.LocationId10.value;
				*/
			
				contentDisp		= title + ' ' + TypeId + '\n';
				contentDisp		+= LocationName1 + ' ' + LocationId1 + '\n';
				contentDisp		+= LocationName2 + ' ' + LocationId2 + '\n';
				contentDisp		+= LocationName3 + ' ' + LocationId3 + '\n';
				contentDisp		+= LocationName4 + ' ' + LocationId4 + '\n';
				contentDisp		+= LocationName5 + ' ' + LocationId5 + '\n';
				/*
				contentDisp		+= LocationName6 + ' ' + LocationId6 + '\n';
				contentDisp		+= LocationName7 + ' ' + LocationId7 + '\n';
				contentDisp		+= LocationName8 + ' ' + LocationId8 + '\n';
				contentDisp		+= LocationName9 + ' ' + LocationId9 + '\n';
				contentDisp		+= LocationName10 + ' ' + LocationId10 + '\n';
				*/
				
				if ((LocationName1 == '') && (LocationName2 == '') && (LocationName3 == '') && (LocationName4 == '') && (LocationName5 == '')) {
					document.getElementById('errorDiv').style.height = "70px";
				} else if ((document.CreateListForm.AddToFacebook) && (document.CreateListForm.AddToFacebook.checked == true)) {
					testComment(1,UserId,ListId,FirstName,FavoriteText);
				} else {
					document.CreateListForm.submit();
				}
				
				//sendAjax("functions.php?saveList=1&title="+title+"&TypeId="+TypeId+"&LocationName1="+LocationName1+"&LocationId1="+LocationId1+"&LocationName2="+LocationName2+"&LocationId2="+LocationId2+"&LocationName3="+LocationName3+"&LocationId3="+LocationId3+"&LocationName4="+LocationName4+"&LocationId4="+LocationId4+"&LocationName5="+LocationName5+"&LocationId5="+LocationId5+"&LocationName6="+LocationName6+"&LocationId6="+LocationId6+"&LocationName7="+LocationName7+"&LocationId7="+LocationId7+"&LocationName8="+LocationName8+"&LocationId8="+LocationId8+"&LocationName9="+LocationName9+"&LocationId9="+LocationId9+"&LocationName10="+LocationName10+"&LocationId10="+LocationName10,processAjax);
				
				//alert(contentDisp);
			
			}
		
		}
		
		function removePost(PostId) {
			
			currDiv = 'postEdit'+PostId;
			//alert(currDiv);
			sendAjax('functions.php?removePost=1&PostId='+PostId,processAjax);
			
		}
		
		function editPost(PostId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?editPost=1&PostId='+PostId,processAjax);
			
		}
		
		//popup full text
		function popFullText(PostId,type)
		{
		    setPopupProps(510,470);
		    currDiv = 'popupBoxInside';
            sendAjax('functions.php?popFullText=1&PostId='+PostId+'&type='+type,processAjax);
        }
        
		//popup privacy statement
		function popPrivacyStatement()
		{
            setPopupProps(510,470);
            currDiv = 'popupBoxInside';
            sendAjax('functions.php?popPrivacyStatement=1',processAjax);
        }
		
		function savePost(PostId) {
			
			var Text = document.EditPostForm.Text.value;

			closePopup();

			currDiv = 'postContent'+PostId;
			sendAjax('functions.php?saveEditPost=1&PostId='+PostId+'&Text='+Text,processAjax);
			
		}
		
		function wallPosts(UserId,CurrUser,CurrResults) {
			
			currDiv = 'profileWall';
			sendAjax('functions.php?profileWall=1&UserId='+UserId+'&CurrUser='+CurrUser+'&CurrResults='+CurrResults,processAjax);
			
		}
		
		function organiseMeal(LocationId,UserId) {
			
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			
			sendAjax('functions.php?organiseMeal=1&LocationId='+LocationId+'&UserId='+UserId,processAjax);
			
		}
		
		function addMealFriend(friendNum) {
			
			var FirstName = eval('document.OrganiseMealForm.FirstName'+friendNum).value;
			var LastName = eval('document.OrganiseMealForm.LastName'+friendNum).value;
			var Email = eval('document.OrganiseMealForm.Email'+friendNum).value;
			
			var addGood = 1;
			
			if (FirstName == 'First name') {
				addGood = 0;
			}
			if (LastName == 'Last name') {
				addGood = 0;
			}
			if (Email == 'EmailAddress') {
				addGood = 0;
			}
			if (!check_email(Email)) {
				addGood = 0;
			}
			
			if (addGood == 0) {
				document.getElementById('errorFriend'+friendNum).style.visibility = "visible";
			} else {			
				document.getElementById('errorFriend'+friendNum).style.visibility = "hidden";
				document.getElementById('addButton'+friendNum).style.visibility = "hidden";
				eval('document.OrganiseMealForm.FirstName'+friendNum).style.borderColor = "#FFF";
				eval('document.OrganiseMealForm.LastName'+friendNum).style.borderColor = "#FFF";
				eval('document.OrganiseMealForm.Email'+friendNum).style.borderColor = "#FFF";
				currDiv = 'mealFriend'+(friendNum+1);
				sendAjax('functions.php?fieldMealFriend=1&friendNum='+(friendNum+1),processAjax);
			}
			
		}
		
		function saveMeal() {
		
			
			var UserId = document.OrganiseMealForm.UserId.value;
			var LocationId = document.OrganiseMealForm.LocationId.value;
			var EnteredDate = document.OrganiseMealForm.EnteredDate.value;
			var MealHour = document.OrganiseMealForm.MealHour.value;
			var MealMinute = document.OrganiseMealForm.MealMinute.value;
			
			var Time = MealHour+':'+MealMinute;
			
			var friendNum = 1;
			
			var friendsList = '';
			
			while (eval('document.OrganiseMealForm.FirstName'+friendNum)) {
				FirstName = eval('document.OrganiseMealForm.FirstName'+friendNum).value;
				LastName = eval('document.OrganiseMealForm.LastName'+friendNum).value;
				Email = eval('document.OrganiseMealForm.Email'+friendNum).value;
				friendsList += FirstName+"-|-"+LastName+"-|-"+Email+"-||-";
				friendNum++;
			}
			
			//alert(friendsList);
			setPopupProps(510,470);
			currDiv = 'popupBoxInside';
			sendAjax('functions.php?saveMeal=1&UserId='+UserId+'&LocationId='+LocationId+'&EnteredDate='+EnteredDate+'&Time='+Time+'&friendsList='+friendsList,processAjax);
		
		}
		
		function setProfilePic(UserId,FacebookId,profilePic) {
			
			currDiv = 'tempFace';
		  	//alert('functions.php?setProfilePic=1&UserId='+UserId+'&FacebookId='+FacebookId+'&profilePic='+profilePic);
			sendAjax('http://www.londonerslist.com/functions.php?setProfilePic=1&UserId='+UserId+'&FacebookId='+FacebookId+'&profilePic='+profilePic,processAjax);
		
		}
		
		function setRightTopListers(CurrResults) {
			
			currDiv = 'topListers';
			sendAjax('functions.php?rightTopListers=1&CurrResults='+CurrResults,processAjax);
		
		}
		
		function setRightToplocations(CurrResults) {
			
			currDiv = 'toplocations';
			sendAjax('functions.php?toplocationsContent=1&CurrResults='+CurrResults,processAjax);
		
		}
		
		function setPageSimilarRestaurants(num,UserId,currPage,totalCount)
		{
		    for(var i = 1; i<totalCount ; i++)
		    {
                document.getElementById('review'+i).style.display='none';      
            }
            currPage--;
            for(var i = (1+currPage*5); i <= (1+currPage*5)+4; i++)
                if(document.getElementById('review'+i))
                    document.getElementById('review'+i).style.display='block';
        }
        function changeBox()
        {
            document.getElementById('div1').style.display='none';
            document.getElementById('div2').style.display='';
            document.getElementById('password').focus();
        }
        function restoreBox()
        {
            if(document.getElementById('password').value=='')
            {
                document.getElementById('div1').style.display='';
                document.getElementById('div2').style.display='none';
            }
        }
