var userEmail;var t;var t1;var t2;var t3;var t4;var t5;var t6;var xmlHttp=false;var xmlHttp2=false;var xmlHttp3=false;var xmlHttp4=false;var xmlHttp5=false;var xmlHttp6=false;var moved=false;var basketCount;var dragOn=true;var currency="uk";var counter=0;var help=true;var showAllGlen=false;var removedSearchPlot=false;var eaf=false;var overOwnedGlobal=false;var editingPlot=false;var unlimitedOwner=false;function IE6hit(){xmlHttp5=createXmlHttpRequest();readXmlFile("ie6hit")}function createXmlHttpRequest(){try{xmlHttp=new XMLHttpRequest()}catch(c){try{xmlHttp=new ActiveXObject("Microsoft.XMLHttp")}catch(c){var a=new Array("MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");for(var b=0;b<a.length&&!xmlHttp;b++){try{xmlHttp=new ActiveXObject(a[b])}catch(c){}}}}if(!xmlHttp){alert("Error creating the XMLHttpRequest object.")}else{return xmlHttp}}document.getElementsByClassName=document.getElementsByClassName||function(g){g=g.replace(/\s+/g," ").replace(/^\s|![A-Za-z0-9-_\s]|\s$/g,"").split(" ");for(var e=0,h=this.getElementsByTagName("*"),c=h.length,a=[],f=g.length,k=true;e<c;e++,k=true){for(var d=0;d<f&&k;d++){k=(new RegExp("(^|\\s)"+g[d]+"(\\s|$)","i")).test(h[e].className)}if(k){a.push(h[e])}}return a};function addEvent(b,d,c){if(typeof b[d]!="function"||typeof b[d+"_num"]=="undefined"){b[d+"_num"]=0;if(typeof b[d]=="function"){b[d+0]=b[d];b[d+"_num"]++}b[d]=function(h){var g=true;h=(h)?h:window.event;for(var f=0;f<b[d+"_num"];f++){if(b[d+f](h)===false){g=false}}return g}}for(var a=0;a<b[d+"_num"];a++){if(b[d+a]==c){return}}b[d+b[d+"_num"]]=c;b[d+"_num"]++}function removeEvent(b,e,c){if(typeof b[e]!="function"||typeof b[e+"_num"]=="undefined"||b[e+"_num"]==0){return}var d=false;for(var a=0;a<b[e+"_num"];a++){if(!d){d=b[e+a]==c}if(d&&(a+1)<b[e+"_num"]){b[e+a]=b[e+(a+1)]}}if(d){b[e+"_num"]--}}function isEmpty(a){return((a==null)||(a.length==0))}function isDigit(a){return((a>="0")&&(a<="9"))}function isInteger(b){var a;if(isEmpty(b)){if(isInteger.arguments.length==1){return 0}else{return(isInteger.arguments[1]==true)}}for(a=0;a<b.length;a++){var d=b.charAt(a);if(!isDigit(d)){return false}}return true}function setCookie(b,d,h,g,c,f){var a=new Date();a.setTime(a.getTime());if(h){h=h*1000*60*60}var e=new Date(a.getTime()+(h));document.cookie=b+"="+escape(d)+((h)?";expires="+e.toGMTString():"")+((g)?";path="+g:"")+((c)?";domain="+c:"")+((f)?";secure":"")}function getCookie(b){var g=document.cookie.split(";");var c="";var e="";var f="";var d=false;for(var a=0;a<g.length;a++){c=g[a].split("=");e=c[0].replace(/^\s+|\s+$/g,"");if(e==b){d=true;if(c.length>1){f=unescape(c[1].replace(/^\s+|\s+$/g,""))}return f;break}c=null;e=""}if(!d){return null}}function deleteCookie(a,c,b){if(getCookie(a)){document.cookie=a+"="+((c)?";path="+c:"")+((b)?";domain="+b:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}function updateBasketListCookie(e,d){e=e.split("_");e=e[1];var f=getCookie("basket_list");if(d=="add"){if(f===null||f==""){f=e}else{f=f+","+e}setCookie("basket_list",f,24,"/","","")}else{if(d=="del"){if(f!=null&&f!=""){var a=f.split(",");f="";var b=0;for(var c=0;c<a.length;c++){if(a[c]!=e){if(b!==0){f=f+","+a[c]}else{f=a[c]}b++}}setCookie("basket_list",f,24,"/","","")}}}}function jsUpload(b){var c=/\.jpg|\.bmp|\.png|\.gif/i;var a=b.value;if(a.search(c)==-1){alert("File does not have image(jpg, png, gif, bmp) extension");b.form.reset();return false}b.form.submit();if(b.name=="editMyPlotImage"){document.getElementById("editMyPlotImageUploadStatus").innerHTML="uploading file..."}b.disabled=true;return true}function checkLoginInfo(a){if(a.email.value==""){alert("please enter your email to login");a.email.focus();return false}else{if(a.password.value==""){alert("please enter your password to login");a.password.focus();return false}else{return true}}}function logout(){deleteCookie("owner_id","/","");if(getCookie("landing_page")){window.location="/index.php?p="+getCookie("landing_page")}else{window.location="/index.php"}}function tabClick(b){var c=document.getElementById("book").getElementsByTagName("div");if(b=="return"){c[8].style.display="block";c[17].style.display="block";if(c[18].style.display!="block"){showIntro("show")}c[2].style.display="none"}else{c[8].style.display="none";c[17].style.display="none";if(c[18].style.display!="block"){showIntro("hide")}c[2].style.display="block";for(var a=4;a<7;a++){c[a].style.display="none"}if(b=="howToBuy"){document.getElementById("tabPagesNavName").innerHTML="How to Buy";c[4].style.display="block"}else{if(b=="tellAFriend"){document.getElementById("tabPagesNavName").innerHTML="Tell a Friend";c[5].style.display="block"}else{if(b=="joinFree"){document.getElementById("tabPagesNavName").innerHTML="Join Free";c[6].style.display="block"}}}}}function changeLeftPage(a){var b=document.getElementById("book").getElementsByTagName("div");if(a=="op"||a=="ops"||a=="opl"){if(b[18].style.display!="block"&&b[2].style.display!="block"){showIntro("hide")}b[10].style.display="block";if(a=="opl"){b[12].style.display="none";b[13].style.display="none";b[14].style.display="none";b[11].style.display="block"}else{b[11].style.display="none";b[12].style.display="block";if(a=="ops"){b[13].style.display="none";b[14].style.display="block"}else{if(a="op"){b[13].style.display="block";b[14].style.display="none"}}}}else{if(b[18].style.display!="block"&&b[2].style.display!="block"){showIntro("hide")}b[10].style.display="none"}}function makeOffer(){if(getCookie("owner_id")){var a=document.makeSellerOfferForm.elements;var c=true;if(a[0].checked==true){if(a[1].value==""||a[0].value=="Name"){c=false;alert("please enter a name, this will appear on the Title Deed")}}if(!isInteger(a[2].value)){c=false;alert("please enter valid value into the offer field")}if(c){var b=document.getElementById("highlightedRow").innerHTML;if(b!=""){b=b.split("_");if(a[0].checked==true){var d="gift="+a[0].value}else{var d="gift=n"}d+="&name="+a[1].value;d+="&offer="+a[2].value;d+="&text="+a[3].value;d+="&id="+b[1];xmlHttp3=createXmlHttpRequest();readXmlFile("makeAnOffer",d)}}}else{alert('Please login before making an offer. Or if you are not a member please sign up for free using the link at the top of the book titled "Join Free"')}}function offerAsGift(a){var b=document.getElementById("offerName");if(a==true){b.style.display="block"}else{b.style.display="none"}}function tellAFriend(b){if(b=="send"){var a=document.getElementById("tellAFriendForm");var c="yn="+a.elements[1].value;c=c+"&ye="+a.elements[2].value;c=c+"&fn="+a.elements[4].value;c=c+"&fe="+a.elements[5].value;c=c+"&m="+a.elements[6].value;xmlHttp3=createXmlHttpRequest();readXmlFile("tellAFriend",c)}}function joinFree(b){if(document.getElementById("fmEmailChecker").innerHTML=="passed"){if(document.getElementById("fmUsernameChecker").innerHTML!="failed"||document.getElementById("new_s_n").value==""){if(document.getElementById("new_p").value==document.getElementById("new_p_2").value){var a="e="+document.getElementById("new_e").value;a=a+"&p="+document.getElementById("new_p").value;a=a+"&p2="+document.getElementById("new_p_2").value;a=a+"&sn="+document.getElementById("new_s_n").value;xmlHttp3=createXmlHttpRequest();readXmlFile("joinFree",a)}else{alert("Unfortunately the passwords you have entered do not match.")}}else{alert("Unfortunately the Screen Name you have chosen has already been taken.")}}else{alert("Unfortunately the email you have entered is not valid.")}}function editMyPlot(a){saveViewerPosition();a=a.split("_");window.location="/index.php?edit_plot="+a[1]}function editMyPlotSubmit(){if((document.form_plot_text.plot_text.value)&&(document.form_plot_text.plot_text.value!="Upload a personal message here...")){document.form_plot.plot_text.value=document.form_plot_text.plot_text.value}document.form_plot.submit()}function viewOwnerProfile(b,a){changeLeftPage("op");if(a){var c=a.split("_")}else{var c=document.getElementById("highlightedRow").innerHTML;c=c.split("_")}if(b=="public"){var d=document.getElementById("book").getElementsByTagName("div");if(!document.getElementById("plot_thumb_"+c[4])){var f=d[15].getElementsByTagName("img");f[0].id="";f[0].src="/scripts/timthumb.php?src=/images/camera.png&h=130&zc=0"}xmlHttp2=createXmlHttpRequest();var e="id="+c[1]+"&d="+new Date().getTime();readXmlFile("plotInfo",e)}else{if(b=="private"){xmlHttp4=createXmlHttpRequest();var e="id="+c[1]+"&pass="+hex_md5(document.getElementById("viewOwnerProfilePassword").value);readXmlFile("viewPrivateOwnerProfile",e)}}}function checkInput(c,a,b){if(a=="email"){if(c.search(/^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)<=-1){document.getElementById(b+"EmailChecker").innerHTML="failed"}else{xmlHttp3=createXmlHttpRequest();readXmlFile("inputChecker","v="+c+"&t="+a+"&f="+b)}}else{xmlHttp3=createXmlHttpRequest();readXmlFile("inputChecker","v="+c+"&t="+a+"&f="+b)}}function plotHelpText(a){var c=document.getElementById("plot_status");var b=c.className;b=b.split("_");if(b[1]=="0"){changeLeftPage("h")}else{if(b[1]=="1"){plotId=document.getElementById("highlightedRow").innerHTML;plotId=plotId.split("_");changeLeftPage("op",plotId[1]);var d="id="+plotId[1];xmlHttp4=createXmlHttpRequest();readXmlFile("viewOwnerProfile",d)}else{if(b[1]=="11"){plotId=document.getElementById("highlightedRow").innerHTML;plotId=plotId.split("_");changeLeftPage("opo");var d="id="+plotId[1];xmlHttp4=createXmlHttpRequest();readXmlFile("viewOwnerProfile",d)}else{if(b[1]=="2"){plotId=document.getElementById("highlightedRow").innerHTML;plotId=plotId.split("_");changeLeftPage("ops",plotId[1]);var d="id="+plotId[1];xmlHttp4=createXmlHttpRequest();readXmlFile("viewOwnerProfile",d)}else{if(b[1]=="21"){plotId=document.getElementById("highlightedRow").innerHTML;plotId=plotId.split("_");changeLeftPage("opo");var d="id="+plotId[1];xmlHttp4=createXmlHttpRequest();readXmlFile("viewOwnerProfile",d)}else{if(b[1]=="3"){plotId=document.getElementById("highlightedRow").innerHTML;plotId=plotId.split("_");changeLeftPage("opu");var d="id="+plotId[1];xmlHttp4=createXmlHttpRequest();readXmlFile("viewOwnerProfile",d)}else{if(b[1]=="31"){}else{if(b[1]=="4"){}}}}}}}}}function sendMessage(){if(getCookie("owner_id")){var a=document.getElementById("highlightedRow").innerHTML;if(a!=""){a=a.split("_");a=a[1];window.location="/owner/owner_messages.php?task=new&plot_id="+a}}else{alert("please log in to use this feature")}}function landingPage(c,b){var a=document.getElementById("rightSide").getElementsByTagName("div");if(c==8){a[2].style.display="block";a[7].style.background="url(/images/v2/100-mag-glass.png)";a[27].style.display="none";a[20].style.display="block";a[23].style.display="block";if(!showAllGlen){a[24].style.display="block"}a[25].style.display="block";a[26].style.display="block";if(document.getElementById("introImage")){document.getElementById("introImage").src="/images/blank.gif"}}else{if(c==7){a[2].style.display="none";a[7].style.background="url(/images/v2/75-mag-glass.png)";a[20].style.display="none";a[23].style.display="none";a[26].style.display="none";a[25].style.display="block";if(!showAllGlen){a[24].style.display="block"}a[27].style.display="block";if(document.getElementById("introImage")){document.getElementById("introImage").src="/images/blank.gif"}}else{if(c==5){a[2].style.display="none";a[7].style.background="url(/images/v2/25-mag-glass.png)";if(document.getElementById("basketDiv").style.display!="block"&&document.getElementById("tabPages").style.display!="block"){a[0].style.display="block"}a[20].style.display="none";a[23].style.display="none";if(!showAllGlen){a[24].style.display="block"}a[25].style.display="block";a[26].style.display="none";a[27].style.display="block";if(document.getElementById("introImage")){document.getElementById("introImage").src="/images/v2/start-here.jpg"}}}}}function searchPlot(c){var e;if(c){e=c}else{e=document.getElementById("searchField").value}if(e==""){alert("please input a plot number into the search field")}else{while(e.indexOf("0")===0){e=e.substr(1)}var a=document.getElementById("links").getElementsByTagName("div");var d;for(var b=0;b<a.length;b++){d=a[b].id;if(d.match("plot_"+e+"_")){var g=a[b];b=a.length}}if(g){tabClick("return");removeSearchedPlot();if(g.className=="outBasket"){g.className="searchedInBasket";getUnsponsoredplot(g.id);updateBasketListCookie(g.id,"add")}else{if(g.className=="sponsored"){g.className="searchedSponsoredInBasket";selectSponsoredplot(g.id);updateBasketListCookie(g.id,"add")}else{if(g.className=="userPlot"){g.className="searchedUserPlot";showUserPlot(g.id)}else{if(g.className=="inBasket"){g.className="searchedInBasket"}else{if(g.className=="sponsoredInBasket"){g.className="searchedSponsoredInBasket"}else{if(g.className=="forSaleInBasket"){g.className="searchedForSaleInBasket"}else{if(g.className=="forSale"){g.className="searchedForSaleInBasket";selectForSaleplot(g.id);updateBasketListCookie(g.id,"add")}}}}}}}}else{clearInnerHTML(document.getElementById("searchedPlot"));document.getElementById("searchedPlot").appendChild(document.createTextNode(e));xmlHttp=createXmlHttpRequest();var f="q="+e;readXmlFile("create",f)}}return false}function basketListSearch(b){var a=b.split("_");a.splice(0,1,"plot");b=a.join("_");var d=document.getElementById(b);if(d){removeSearchedPlot();if(d.className=="inBasket"){d.className="searchedInBasket"}else{if(d.className=="sponsoredInBasket"){d.className="searchedSponsoredInBasket"}else{if(d.className=="userPlot"){d.className="searchedUserPlot"}else{if(d.className=="forSaleInBasket"){d.className="searchedForSaleInBasket"}}}}}else{clearInnerHTML(document.getElementById("searchedPlot"));document.getElementById("searchedPlot").innerHTML=a[1];xmlHttp=createXmlHttpRequest();var c="q="+a[1];readXmlFile("create",c)}}function removeListLock(f){if(!editingPlot){var e=document.getElementById("highlightedRow").innerHTML;if(e!=""&&e!=null){if(document.getElementById(e)){var g=document.getElementById(e);var a;var d;var c=g.getElementsByTagName("td");for(var b=1;b<5;b++){if(b==3){c[b].className="currency columnHL"}else{c[b].className="columnHL"}}a=e.split("_");a.splice(0,1,"plot");e=a.join("_");d=document.getElementById(e);if(d){if(d.className=="searchedInBasket"){d.className="inBasket"}else{if(d.className=="searchedSponsoredInBasket"){d.className="sponsoredInBasket"}else{if(d.className=="searchedUserPlot"){d.className="userPlot"}else{if(d.className=="searchedForSaleInBasket"){d.className="forSaleInBasket"}}}}}if(!f){changeLeftPage("h")}}}}}function clearBook(a){if(!editingPlot){var c=document.getElementById("book").getElementsByTagName("div");var d=c[15].getElementsByTagName("img");d[0].id="";d[0].src="/scripts/timthumb.php?src=/images/camera.png&h=130&zc=0";if(!a){c[9].innerHTML="";c[9].className="";for(var b=11;b<14;b++){c[b].style.display="none"}document.getElementById("ownerImage").src="/images/temp-owner.png"}if(c[18].style.display!="block"&&c[2].style.display!="block"){showIntro("show")}}}function showIntro(b){var a=document.getElementById("rightSide").getElementsByTagName("div");if(b=="show"){a[0].style.display="block";document.getElementById("bookBody").style.backgroundImage="none";document.getElementById("pictureContainer").style.display="none"}else{a[0].style.display="none";document.getElementById("bookBody").style.backgroundImage="url(/images/v2/left-white-panel.jpg)";document.getElementById("pictureContainer").style.display="block"}}function removeSearchedPlot(){var a=document.getElementById("links");var b=document.getElementsByClassName("searchedInBasket",a);if(b.length>0){b[0].className="inBasket"}else{b=document.getElementsByClassName("searchedOutBasket",a);if(b.length>0){b[0].className="outBasket"}else{b=document.getElementsByClassName("searchedSponsoredInBasket",a);if(b.length>0){b[0].className="sponsoredInBasket"}else{b=document.getElementsByClassName("searchedSponsored",a);if(b.length>0){b[0].className="sponsored"}else{b=document.getElementsByClassName("searchedUserPlot",a);if(b.length>0){b[0].className="userPlot"}else{b=document.getElementsByClassName("searchedForSale",a);if(b.length>0){b[0].className="forSale"}else{b=document.getElementsByClassName("searchedForSaleInBasket",a);if(b.length>0){b[0].className="forSaleInBasket"}}}}}}}}function surfaceOut(){}function isMouseLeaveOrEnter(a){if(typeof(a)=="undefined"&&typeof(window.event)!="undefined"){a=window.event}if(typeof(window.event)!="undefined"){a.cancelBubble=true}else{a.stopPropagation()}}function switchInput(a){if(a.name=="password_temp"){var b=document.getElementById("password");a.style.display="none";b.style.display="inline";b.focus()}else{var b=document.getElementById("password_temp");a.style.display="none";b.style.display="inline";b.focus()}}function plotClick(f){if(!f){var f=window.event}var d;if(f.target){d=f.target}else{if(f.srcElement){d=f.srcElement}}if(d.nodeType===3){d=d.parentNode}tabClick("return");var g=false;if(d.className=="outBasket"||d.className=="searchedOutBasket"){var c=document.basketForm.elements;var a=0;for(var b=0;b<c.length;b++){if(c[b].type=="checkbox"){a++}}d.className="inBasket";getUnsponsoredplot(d.id);g=true;updateBasketListCookie(d.id,"add")}else{if(!g&&(d.className=="sponsored"||d.className=="sponsored"||d.className=="searchedSponsored")){d.className="sponsoredInBasket";selectSponsoredplot(d.id);g=true;updateBasketListCookie(d.id,"add")}else{if(!g&&(d.className=="inBasket"||d.className=="searchedInBasket")){d.className="outBasket";removeUnsponsoredplot(d);g=true;updateBasketListCookie(d.id,"del")}else{if(!g&&(d.className=="sponsoredInBasket"||d.className=="searchedSponsoredInBasket")){d.className="sponsored";removeSponsoredplot(d);g=true;updateBasketListCookie(d.id,"del")}else{if(!g&&(d.className=="forSale"||d.className=="searchedForSale")){d.className="forSaleInBasket";selectForSaleplot(d.id);g=true;updateBasketListCookie(d.id,"add")}else{if(!g&&(d.className=="forSaleInBasket"||d.className=="searchedForSaleInBasket")){d.className="forSale";removeForSaleplot(d);g=true;updateBasketListCookie(d.id,"del")}else{if(!g&&(d.className=="userPlot"||d.className=="searchedUserPlot")){d.className="searchedUserPlot";showUserPlot(d.id)}}}}}}}}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"}}function plotOver(c){if(!c){var c=window.event}var a;if(c.target){a=c.target}else{if(c.srcElement){a=c.srcElement}}if(a.nodeType===3){a=a.parentNode}if(t2){window.clearTimeout(t2)}if(t3){window.clearTimeout(t3)}if(!removedSearchPlot){removeSearchedPlot();removedSearchPlot=true}var b=a.id;b=b.split("_");if(!document.getElementById("plot_thumb2_"+b[4])){var d=document.getElementById("pictureContainer2").getElementsByTagName("img");d[0].id="plot_thumb2_"+b[4];d[0].setAttribute("src","/scripts/timthumb.php?src=/images/sub_regions/"+b[4]+".jpg&w=130&zc=0")}if(!editingPlot){if(a.className=="sponsored"||a.className=="searchedSponsored"){if(t6){window.clearTimeout(t6)}t5=window.setTimeout("plotInfoLock('"+a.id+"',false,true,true);",200);tabClick("return")}else{if(a.className=="inBasket"||a.className=="searchedInBasket"||a.className=="sponsoredInBasket"||a.className=="searchedSponsoredInBasket"||a.className=="forSaleInBasket"||a.className=="searchedForSaleInBasket"){removeListLock(true);document.getElementById("highlightedRow").innerHTML="basket_"+b[1]+"_"+b[2]+"_"+b[3]+"_"+b[4];t5=window.setTimeout("highlightLastRow('show')",200)}}}}function plotOut(b){if(!b){var b=window.event}var a;if(b.target){a=b.target}else{if(b.srcElement){a=b.srcElement}}if(a.nodeType===3){a=a.parentNode}if(!editingPlot){highlightLastRow("hide")}t3=window.setTimeout("hideHoverImage();",200);window.clearTimeout(t5)}function viewOwnerMessage(){xmlHttp4=createXmlHttpRequest();var a="id="+document.getElementById("ownerOverId").innerHTML;readXmlFile("viewOwnerMessage",a)}function hideHoverImage(){var a=document.getElementById("pictureContainer2").getElementsByTagName("img");a[0].id="";a[0].setAttribute("src","/scripts/timthumb.php?src=/images/camera.png&w=130&zc=0")}function highlightLastRow(g){if(g=="show"){var f=document.getElementById("highlightedRow");var a=f.innerHTML;if(a!=""&&a!=null&&a!="null"&&a!="undefined"&&a!=undefined&&a!=""){if(document.getElementById(a)){var k=document.getElementById(a);var h=k.getElementsByTagName("td");if(h[2].className=="columnHL"){for(var c=1;c<5;c++){if(c==3){h[c].className="currency lockedColumnHL"}else{h[c].className="lockedColumnHL"}}plotInfoLock(a,false,true)}}else{clearBook()}}}else{if(g=="hide"){var j=document.getElementById("highlightedRow");var b=j.innerHTML;if(b!=""&&b!=null){if(document.getElementById(b)){var k=document.getElementById(b);var d;var e;var h=k.getElementsByTagName("td");for(var c=1;c<5;c++){if(c==3){h[c].className="currency columnHL"}else{h[c].className="columnHL"}}d=b.split("_");d.splice(0,1,"plot");b=d.join("_");e=document.getElementById(b);if(e){if(e.className=="searchedInBasket"){e.className="inBasket"}else{if(e.className=="searchedSponsoredInBasket"){e.className="sponsoredInBasket"}else{if(e.className=="searchedUserPlot"){e.className="userPlot"}else{if(e.className=="searchedForSaleInBasket"){e.className="forSaleInBasket"}}}}}}}clearBook()}}}function highlightLastPlot(){var e=document.getElementById("basketTableDiv");var d=e.getElementsByTagName("tr");if(d.length>1){var a=document.getElementById("highlightedRow");var h=a.innerHTML;if(h==""){var g=d[d.length-1];var f=g.getElementsByTagName("td");var c=g.getElementsByTagName("a");f[3].className="lockedListLinksCol";c[0].className="lockedListLinks";a.innerHTML=h=g.id}else{if(!document.getElementById(h)){var g=d[d.length-1];var f=g.getElementsByTagName("td");var c=g.getElementsByTagName("a");f[3].className="lockedListLinksCol";c[0].className="lockedListLinks";a.innerHTML=h=g.id}}plotInfoLock(h,false,true)}else{clearBook()}var b=document.getElementById("pictureContainer2").firstChild;b.id="plot_thumb2_"+plotId[4];b.setAttribute("src","/scripts/timthumb.php?src=/images/camera.png&w=130&zc=0")}function pictureClick(c){if(!c){var c=window.event}var b;if(c.target){b=c.target}else{if(c.srcElement){b=c.srcElement}}if(b.nodeType===3){b=b.parentNode}if(b.className=="thumb"){var a=b.id;a=a.split("_");window.open("more_information.php?sr="+a[2])}}function basketClick(g){if(!g){var g=window.event}var d;if(g.target){d=g.target}else{if(g.srcElement){d=g.srcElement}}if(d.nodeType===3){d=d.parentNode}if(d.name=="plot_id[]"){var c=d.parentNode.parentNode.parentNode.parentNode.parentNode;var a=0;for(var b=0;b<c.elements.length;b++){if(c.elements[b].checked==true){a++}}}else{if(d.className=="lockedColumnHL"||d.className=="currency lockedColumnHL"){var f=d.parentNode.id;f=f.split("_");window.open("more_information.php?id="+f[1]);if(d.className=="currency lockedColumnHL"){d.className="currency columnHL"}else{d.className=="columnHL"}}}}function basketOver(d){if(!editingPlot){if(!d){var d=window.event}var b;if(d.target){b=d.target}else{if(d.srcElement){b=d.srcElement}}if(b.nodeType===3){b=b.parentNode}if(b.className=="columnHL"||b.className=="currency columnHL"){removeListLock(true);plotInfoLock(b.parentNode.id,false);var c=b.parentNode.getElementsByTagName("td");for(var a=1;a<5;a++){if(a==3){c[a].className="currency lockedColumnHL"}else{c[a].className="lockedColumnHL"}}document.getElementById("highlightedRow").innerHTML=b.parentNode.id}}}function goToPlot(b){var c=b.id;var a=c.split("_");a.splice(0,1,"plot");var f=a.join("_");if(document.getElementById(f)){var e=document.getElementById(f);removeSearchedPlot();if(e.className=="outBasket"){e.className="searchedInBasket";getUnsponsoredplot(e.id);updateBasketListCookie(e.id,"add")}else{if(e.className=="sponsored"){e.className="searchedSponsoredInBasket";selectSponsoredplot(e.id);updateBasketListCookie(e.id,"add")}else{if(e.className=="userPlot"){e.className="searchedUserPlot";showUserPlot(e.id)}else{if(e.className=="inBasket"){e.className="searchedInBasket"}else{if(e.className=="sponsoredInBasket"){e.className="searchedSponsoredInBasket"}else{if(e.className=="forSaleInBasket"){e.className="searchedForSaleInBasket"}else{if(e.className=="forSale"){e.className="searchedForSaleInBasket";selectForSaleplot(e.id);updateBasketListCookie(e.id,"add")}}}}}}}}else{clearInnerHTML(document.getElementById("searchedPlot"));document.getElementById("searchedPlot").innerHTML=a[1];xmlHttp=createXmlHttpRequest();var d="q="+a[1];readXmlFile("create",d)}}function plotInfoLock(b,i,f,a){if(!editingPlot){overOwnedGlobal=a;var h=b.split("_");var c=document.getElementById("book").getElementsByTagName("div");if(!a){if(!document.getElementById("plot_thumb_"+h[4])){var e=c[15].getElementsByTagName("img");e[0].id="plot_thumb_"+h[4];e[0].src="/scripts/timthumb.php?src=/images/sub_regions/"+h[4]+".jpg&h=130&zc=0"}}else{var e=c[15].getElementsByTagName("img");e[0].id="";e[0].src="/scripts/timthumb.php?src=/images/camera.png&h=130&zc=0"}xmlHttp2=createXmlHttpRequest();var d="id="+h[1]+"&d="+new Date().getTime();readXmlFile("plotInfo",d);if(i){basketListSearch(b)}else{if(!f){region_name=h[2].replace(/-/," ");var g=document.getElementById("plot_"+h[1]+"_"+h[2]+"_"+h[3]+"_"+h[4]);if(g){if(g.className=="inBasket"){g.className="searchedInBasket"}else{if(g.className=="sponsoredInBasket"){g.className="searchedSponsoredInBasket"}else{if(g.className=="userPlot"){g.className="searchedUserPlot"}else{if(g.className=="forSaleInBasket"){g.className="searchedForSaleInBasket"}}}}}}}}}function focusRow(){var a=document.getElementById("highlightedRow").innerHTML;document.getElementById(a).focus()}function getUnsponsoredplot(n){removeListLock(true);plotInfoLock(n,false,true);var b=document.getElementById("basket");var l=b.parentNode.parentNode.parentNode.parentNode;if(l.style.display!="block"){l.style.display="block";document.getElementById("countrySelectionContainer").style.display="block";showIntro("hide")}var e=n.split("_");var c=document.createElement("tr");var m=document.createElement("td");var k=document.createElement("td");var j=document.createElement("td");var h=document.createElement("td");var g=document.createElement("td");var f=document.createElement("td");var d=document.createElement("td");var u=document.createElement("a");var x=document.createElement("a");var w=document.createElement("a");var s=document.createElement("input");var z=document.createElement("img");var v=document.createElement("img");s.setAttribute("type","checkbox");s.setAttribute("name","plot_id[]");s.setAttribute("value",e[1]);var y=document.basketForm;var r=6-e[1].length;var o;var q;for(var p=r;p>0;p--){if(!o){o="0"}else{o+="0"}}if(o){q=o+e[1]}else{q=e[1]}u.className="removeLink";u.href="#";u.onclick=function(){removePlot(this);return false};z.src="/images/v2/cross.jpg";u.appendChild(z);x.className="goto";x.href="#";x.onclick=function(){goToPlot(this.parentNode.parentNode);return false};v.className="goto";v.src="/images/v2/tick.jpg";x.appendChild(v);w.href="/more_information.php?id="+e[1];w.target="_blank";w.appendChild(document.createTextNode("more info"));m.appendChild(s);if(!editingPlot){j.className="lockedColumnHL";h.className="currency lockedColumnHL";g.className="lockedColumnHL"}else{j.className="columnHL";h.className="currency columnHL";g.className="columnHL"}k.appendChild(w);j.appendChild(document.createTextNode(e[2]));g.appendChild(document.createTextNode(q));f.appendChild(u);d.appendChild(x);c.id="basket_"+e[1]+"_"+e[2]+"_"+e[3]+"_"+e[4];if(!editingPlot){document.getElementById("highlightedRow").innerHTML=c.id}c.appendChild(m);c.appendChild(k);c.appendChild(j);c.appendChild(h);c.appendChild(g);c.appendChild(f);c.appendChild(d);b.appendChild(c);document.getElementById(c.id).focus();h.innerHTML=currencyConvertor(e[3])}function removeUnsponsoredplot(d){var e=d.id;var a=e.split("_");var f=document.getElementById("basket_"+a[1]+"_"+a[2]+"_"+a[3]+"_"+a[4]);var c=f.parentNode;c.removeChild(f);var b=c.getElementsByTagName("td");if(b.length===0){c.parentNode.parentNode.parentNode.parentNode.style.display="none";showIntro("show");document.getElementById("countrySelectionContainer").style.display="none"}clearInnerHTML(document.getElementById("highlightedRow"));clearBook()}function selectSponsoredplot(n){removeListLock(true);plotInfoLock(n,false,true);var b=document.getElementById("basket");var l=b.parentNode.parentNode.parentNode.parentNode;if(l.style.display!="block"){l.style.display="block";document.getElementById("countrySelectionContainer").style.display="block";showIntro("hide")}var e=n.split("_");var c=document.createElement("tr");var m=document.createElement("td");var k=document.createElement("td");var j=document.createElement("td");var h=document.createElement("td");var g=document.createElement("td");var f=document.createElement("td");var d=document.createElement("td");var s=document.createElement("a");var w=document.createElement("a");var v=document.createElement("a");var x=document.createElement("img");var u=document.createElement("img");var r=6-e[1].length;var o;var q;for(var p=r;p>0;p--){if(!o){o="0"}else{o+="0"}}if(o){q=o+e[1]}else{q=e[1]}s.className="removeLink";s.href="#";s.onclick=function(){removePlot(this);return false};x.src="images/v2/cross.jpg";s.appendChild(x);w.className="goto";w.href="#";w.onclick=function(){goToPlot(this.parentNode.parentNode);return false};u.className="goto";u.src="images/v2/tick.jpg";w.appendChild(u);v.href="/more_information.php?id="+e[1];v.target="_blank";v.appendChild(document.createTextNode("more info"));m.appendChild(document.createTextNode("Sold"));if(!editingPlot){k.className="lockedColumnHL";j.className="lockedColumnHL";h.className="currency lockedColumnHL";g.className="lockedColumnHL"}else{k.className="columnHL";j.className="columnHL";h.className="currency columnHL";g.className="columnHL"}k.appendChild(v);j.appendChild(document.createTextNode(e[2]));g.appendChild(document.createTextNode(q));f.appendChild(s);d.appendChild(w);c.id="basket_"+e[1]+"_"+e[2]+"_"+e[3]+"_"+e[4];if(!editingPlot){document.getElementById("highlightedRow").innerHTML=c.id}c.appendChild(m);c.appendChild(k);c.appendChild(j);c.appendChild(h);c.appendChild(g);c.appendChild(f);c.appendChild(d);b.appendChild(c);document.getElementById(c.id).focus();h.innerHTML=currencyConvertor(e[3])}function removeSponsoredplot(d){var e=d.id;var a=e.split("_");var f=document.getElementById("basket_"+a[1]+"_"+a[2]+"_"+a[3]+"_"+a[4]);var c=f.parentNode;c.removeChild(f);var b=c.getElementsByTagName("td");if(b.length===0){c.parentNode.parentNode.parentNode.parentNode.style.display="none";showIntro("show");document.getElementById("countrySelectionContainer").style.display="none"}clearBook();clearInnerHTML(document.getElementById("highlightedRow"))}function selectForSaleplot(n){removeListLock(true);plotInfoLock(n,false,true);var b=document.getElementById("basket");var l=b.parentNode.parentNode.parentNode.parentNode;if(l.style.display==""||l.style.display=="none"){l.style.display="block";document.getElementById("countrySelectionContainer").style.display="block";showIntro("hide")}var e=n.split("_");var c=document.createElement("tr");var m=document.createElement("td");var k=document.createElement("td");var j=document.createElement("td");var h=document.createElement("td");var g=document.createElement("td");var f=document.createElement("td");var d=document.createElement("td");var s=document.createElement("a");var w=document.createElement("a");var v=document.createElement("a");var x=document.createElement("img");var u=document.createElement("img");var r=6-e[1].length;var o;var q;for(var p=r;p>0;p--){if(!o){o="0"}else{o+="0"}}if(o){q=o+e[1]}else{q=e[1]}s.className="removeLink";s.href="#";s.onclick=function(){removePlot(this);return false};x.src="images/v2/cross.jpg";s.appendChild(x);w.className="goto";w.href="#";w.onclick=function(){goToPlot(this.parentNode.parentNode);return false};u.className="goto";u.src="images/v2/tick.jpg";w.appendChild(u);v.href="/more_information.php?id="+e[1];v.target="_blank";v.appendChild(document.createTextNode("more info"));m.appendChild(document.createTextNode("For Sale"));if(!editingPlot){k.className="lockedColumnHL";j.className="lockedColumnHL";h.className="currency lockedColumnHL";g.className="lockedColumnHL"}else{k.className="columnHL";j.className="columnHL";h.className="currency columnHL";g.className="columnHL"}k.appendChild(v);j.appendChild(document.createTextNode(e[2]));g.appendChild(document.createTextNode(q));f.appendChild(s);d.appendChild(w);c.id="basket_"+e[1]+"_"+e[2]+"_"+e[3]+"_"+e[4];if(!editingPlot){document.getElementById("highlightedRow").innerHTML=c.id}c.appendChild(m);c.appendChild(k);c.appendChild(j);c.appendChild(h);c.appendChild(g);c.appendChild(f);c.appendChild(d);b.appendChild(c);document.getElementById(c.id).focus();h.innerHTML=currencyConvertor(e[3])}function removeForSaleplot(d){var e=d.id;var a=e.split("_");var f=document.getElementById("basket_"+a[1]+"_"+a[2]+"_"+a[3]+"_"+a[4]);var c=f.parentNode;c.removeChild(f);var b=c.getElementsByTagName("td");if(b.length===0){c.parentNode.parentNode.parentNode.parentNode.style.display="none";showIntro("show");document.getElementById("countrySelectionContainer").style.display="none"}clearBook();clearInnerHTML(document.getElementById("highlightedRow"))}function showUserPlot(b){removeListLock(true);plotInfoLock(b,false,true);var a=b.split("_");a.splice(0,1,"basket");a=a.join("_");if(!editingPlot){document.getElementById("highlightedRow").innerHTML=a;highlightLastRow("show")}}function fixBrokenImages(){var a=document.images;for(var b=0;b<a.length;b++){a[b].onerror=function(){this.src="/images/null/none.png"};a[b].src=a[b].src}}function removePlot(d){var f=d.parentNode.parentNode;var g=f.id;var c=f.parentNode;var h=g.split("_");h.splice(0,1,"plot");var e=h.join("_");var a=document.getElementById(e);if(a){if(a.className=="inBasket"||a.className=="searchedInBasket"){a.className="outBasket"}else{if(a.className=="sponsoredInBasket"||a.className=="searchedSponsoredInBasket"){a.className="sponsored"}else{if(a.className=="forSaleInBasket"||a.className=="searchedForSaleInBasket"){a.className="forSale"}}}}c.removeChild(f);var b=c.getElementsByTagName("td");if(b.length===0){c.parentNode.parentNode.parentNode.parentNode.style.display="none";document.getElementById("countrySelectionContainer").style.display="none"}clearBook();if(e==document.getElementById("highlightedRow").innerHTML){clearInnerHTML(document.getElementById("highlightedRow"))}updateBasketListCookie(e,"del")}function checkList(){var c=false;if(document.basketForm.elements){var b=document.basketForm.elements;var d=b.length-1;for(var a=d;a>-1;a--){if(b[a].checked){c=true;if(b[a].name=="plot_id[]"){a=-1;document.basketForm.action="/river_checkout.php";document.basketForm.method="POST";document.basketForm.target="_self";document.basketForm.submit()}}}}if(!c){alert("Please tick a plot or plots from the list to indicate the ones you want to Buy")}}function countrySelector(e){var d=currency;var c;currency=e;var a=document.getElementsByClassName("currency");for(var b=0;b<a.length;b++){c=a[b].innerHTML;if(c!=""&&c!=" - "){c=c.substr(1);c=parseFloat(c)}if(!isNaN(c)&&c!=""){a[b].innerHTML=currencyConvertor(c,d)}}}function showHideEditMessage(b,c){var a=b.getElementsByTagName("td");var d=a.length-1;if(a.item(d).style.visibility=="visible"){a.item(d).style.visibility="hidden";c.innerHTML="edit message"}else{a.item(d).style.visibility="visible";c.innerHTML="hide message"}}function getEvent(a){if(a==undefined){return window.event}return a}function prepareViewer(j,m,p){for(var d=j.firstChild;d;d=d.nextSibling){if(d.className=="surface"){j.activeSurface=d;d.imageViewer=j}else{if(d.className=="well"){j.tileWell=d;d.imageViewer=j}else{if(d.className=="status"){j.status=d;d.imageViewer=j}}}}var c=j.offsetWidth;var n=j.offsetHeight;var h;var k;if(getCookie("viewer_position")){var o=getCookie("viewer_position");o=o.split(",");h=parseInt(o[2],10);if(parseInt(o[2],10)==8){k=false}else{k=true}}else{h=5;k=true}var e=p*2*Math.pow(2,5);while(e<Math.max(c,n)){h+=1;e*=2}var b={x:((e-c)/-2),y:((e-n)/-2)};j.style.width=c+"px";j.style.height=n+"px";var l=0;var g=0;for(var f=j;f;f=f.offsetParent){l+=f.offsetTop;g+=f.offsetLeft}var a=390;var i=2090;if(getCookie("viewer_position")){if(o[3]!=m){j.dimensions={width:c,height:n,top:l,left:g,tileDir:"images/map/summer",tileSize:p,zoomLevel:h,x:parseInt(o[0],10),y:parseInt(o[1],10),resetX:(b.x+a),resetY:(b.y+i),cx_bi:c/2/e,cy_bi:n/2/e,dragActive:k,fullSize:e}}else{j.dimensions={width:c,height:n,top:l,left:g,tileDir:m,tileSize:p,zoomLevel:h,x:parseInt(o[0],10),y:parseInt(o[1],10),resetX:(b.x+a),resetY:(b.y+i),cx_bi:c/2/e,cy_bi:n/2/e,dragActive:k,fullSize:e}}}else{j.dimensions={width:c,height:n,top:l,left:g,tileDir:m,tileSize:p,zoomLevel:h,x:(b.x+a),y:(b.y+i),resetX:(b.x+a),resetY:(b.y+i),cx_bi:c/2/e,cy_bi:n/2/e,dragActive:k,fullSize:e}}j.start={x:0,y:0};j.previous={x:0,y:0};j.pressed=false;if(document.body.imageViewers==undefined){document.body.imageViewers=[j];document.body.onmouseup=releaseViewer}else{document.body.imageViewers.push(j)}prepareTiles(j);landingPage(h);if(h==8){createPlots(j)}}function prepareTiles(a){resetTiles(a);a.activeSurface.onmousedown=pressViewer;positionWell(a,{x:0,y:0},true)}function positionWell(D,k,a,h,q){var C=D.tiles;var v=D.dimensions;var b=D.previous;var u=D.getElementsByTagName("div");var f=parseInt(u[0].style.left);var o=parseInt(u[0].style.top);var d=f;var m=o;var x=C[0].length;var z=C.length;var y=0;var w=0;var e;if(!a){if(h||q){if(h){o+=h;D.previous.y+=h}else{f+=q;D.previous.x+=q}k=D.previous}else{f+=(k.x-b.x);o+=(k.y-b.y);D.previous=k}u[0].style.left=f+"px";u[0].style.top=o+"px"}else{D.previous=k}var l=Math.floor(f/v.tileSize);var p=Math.floor(o/v.tileSize);var s=Math.floor(d/v.tileSize);var g=Math.floor(m/v.tileSize);if(l!=s){if(l>s){e=l-s;for(w=0;w<e;w++){for(var n=0;n<x;n+=1){var E=C[C.length-1][n];E.x-=v.tileSize*z;E.c-=z;setTileImage(E,true);setTileImage(E,false);E.img.style.left=E.x+"px"}var A=C.pop();C.unshift(A)}}else{if(l<s){e=s-l;for(w=0;w<e;w++){for(var n=0;n<x;n+=1){var E=C[0][n];E.x+=v.tileSize*z;E.c+=z;setTileImage(E,true);setTileImage(E,false);E.img.style.left=E.x+"px"}var A=C.shift();C.push(A)}}else{}}}if(p!=g){if(p>g){e=p-g;for(w=0;w<e;w++){for(var B=0;B<z;B+=1){var E=C[B][x-1];E.y-=v.tileSize*x;E.r-=x;setTileImage(E,true);setTileImage(E,false);E.img.style.top=E.y+"px";var A=C[B].pop();C[B].unshift(A)}}}else{if(p<g){e=g-p;for(w=0;w<e;w++){for(var B=0;B<z;B+=1){var E=C[B][0];E.y+=v.tileSize*x;E.r+=x;setTileImage(E,true);setTileImage(E,false);E.img.style.top=E.y+"px";var A=C[B].shift();C[B].push(A)}}}else{}}}miniMap(D)}function setTileImage(b,a){var c=b.imageViewer.dimensions;var d=c.tileDir+"/tile-"+c.zoomLevel+"-"+b.c+"-"+b.r+".jpg";b.img.src=d}function tileRetry(a){a.onerror=function(){a.src="http://www.myglengarry.com/images/null/none.png"};a.src=a.src}function localizeCoordinates(a,b){var c={x:b.x,y:b.y};for(var d=a;d;d=d.offsetParent){c.x-=d.offsetLeft;c.y-=d.offsetTop}return c}function updateImageViewerCoordinates(a,b){var c={x:b.x,y:b.y};for(var d=a;d;d=d.offsetParent){c.x-=d.offsetLeft;c.y-=d.offsetTop}var e=a.dimensions;if(c.x<0){e.x=e.x+c.x}else{if(c.x>476){e.x=e.x+(476-c.x)}else{if(c.y<0){e.y=e.y+c.y}else{if(c.y>400){e.y=e.y+(400-c.y)}}}}return c}function slideViewer(f){if(!f){var f=window.event}var c;if(f.target){c=f.target}else{if(f.srcElement){c=f.srcElement}}if(c.nodeType===3){c=c.parentNode}if(c.id=="slideUp"||c.id=="slideDown"||c.id=="slideLeft"||c.id=="slideRight"){var a=document.getElementById("imageViewer");var d=a.dimensions;var b=192;var g=document.getElementById("links");while(g.firstChild){g.removeChild(g.firstChild)}switch(c.id){case"slideUp":positionWell(a,undefined,false,b);d.y+=b;break;case"slideDown":positionWell(a,undefined,false,-b);d.y-=b;break;case"slideLeft":positionWell(a,undefined,false,false,b);d.x+=b;break;case"slideRight":positionWell(a,undefined,false,false,-b);d.x-=b;break}if(!d.dragActive){if(t1){window.clearTimeout(t1)}if(!showAllGlen){t1=window.setTimeout("createPlots();",200)}}}}function miniMap(h){var k=h.dimensions;var n=-k.y;var o=-k.x;var b=document.getElementById("minimap");var c=78;var m=182;var l=400;var f=476;var g=(Math.pow(2,k.zoomLevel)*c)/l;var j=(Math.pow(2,k.zoomLevel)*m)/f;var i=c/g;var a=m/j;var d=n/Math.pow(2,k.zoomLevel);var e=o/Math.pow(2,k.zoomLevel);if(k.zoomLevel===4){b.style.height=i/2+"px";b.style.width=a/2+"px";b.style.top=d+6.25+"px";b.style.left=e+7.4375+"px"}else{if(k.zoomLevel===5){b.style.height=i+"px";b.style.width=a+"px";b.style.top=d+"px";b.style.left=e+"px"}else{if(k.zoomLevel===7){b.style.height=i*4+"px";b.style.width=a*4+"px";b.style.top=d-4.6875+"px";b.style.left=e-5.578125+"px"}else{if(k.zoomLevel===8){b.style.height=i*8+"px";b.style.width=a*8+"px";b.style.top=d-4.6875+"px";b.style.left=e-5.578125+"px"}}}}}function miniMapMoved(c){var a=document.body.imageViewers[0];var d=a.dimensions;if(d.zoomLevel===5){d.y=-(parseInt(c.style.top,10)*Math.pow(2,d.zoomLevel));d.x=-(parseInt(c.style.left,10)*Math.pow(2,d.zoomLevel));var b={x:d.width/2,y:d.height/2};a.start=b;zoomImage(a,b,0)}else{if(d.zoomLevel===7){d.y=-((parseInt(c.style.top,10)+4.6875)*Math.pow(2,d.zoomLevel));d.x=-((parseInt(c.style.left,10)+5.578125)*Math.pow(2,d.zoomLevel));var b={x:d.width/2,y:d.height/2};a.start=b;zoomImage(a,b,0)}else{if(d.zoomLevel===8){d.y=-((parseInt(c.style.top,10)+4.6875)*Math.pow(2,d.zoomLevel));d.x=-((parseInt(c.style.left,10)+5.578125)*Math.pow(2,d.zoomLevel));var b={x:d.width/2,y:d.height/2};a.start=b;zoomImage(a,b,0);createPlots(a)}}}}function pressViewer(d){var a=this.imageViewer;var e=a.dimensions;if(t1){window.clearTimeout(t1)}var c=getEvent(d);var b=localizeCoordinates(a,{x:c.clientX,y:c.clientY});a.pressed=true;a.tileWell.style.cursor=a.activeSurface.style.cursor="move";a.previous=b;a.start=b;this.onmousemove=moveViewer}function moveViewer(b){var c=this.imageViewer;var e=c.dimensions;var h=getEvent(b);var f=localizeCoordinates(c,{x:h.clientX,y:h.clientY});if(e.dragActive){positionWell(c,f)}else{var i=Math.abs(c.start.x-f.x);var g=Math.abs(c.start.y-f.y);if(i>9||g>9){if(t1){window.clearTimeout(t1)}var a=document.getElementById("links");while(a.firstChild){a.removeChild(a.firstChild)}var d=document.getElementById("pictureContainer2").getElementsByTagName("img");d[0].id="";d[0].setAttribute("src","/scripts/timthumb.php?src=/images/camera.png&w=130&zc=0");positionWell(c,f);moved=true}}}function releaseViewer(d){if(document.body.imageViewers){var c=getEvent(d);var a=document.body.imageViewers[0];var e=a.dimensions;if(a.pressed){if(e.dragActive){var b=updateImageViewerCoordinates(a,{x:c.clientX,y:c.clientY})}else{var b=localizeCoordinates(a,{x:c.clientX,y:c.clientY})}a.activeSurface.onmousemove=null;a.pressed=false;if(moved||e.dragActive){var b=updateImageViewerCoordinates(a,{x:c.clientX,y:c.clientY});e.x+=(b.x-a.start.x);e.y+=(b.y-a.start.y);if(!e.dragActive){if(t1){window.clearTimeout(t1)}if(!showAllGlen){t1=window.setTimeout("createPlots(); resetTiles();",750)}}moved=false}window.setTimeout("removeHL()",400)}if(!dragDropMiniMap.draggedObject){miniMap(a)}}}function removeHL(){var a=document.getElementById("searchField");a.focus();a.blur()}function displayStatus(a,b){a.status.innerHTML=b}function dumpInfo(a){var f=a.dimensions;var b=a.tiles;var e=["imageViewer "+document.body.imageViewers.length+". current window position: "+f.x+","+f.y+".","----"];for(var g=0;g<b.length;g+=1){for(var d=0;d<b[g].length;d+=1){e.push("image ("+g+","+d+") has tile ("+f.zoomLevel+","+b[g][d].c+","+b[g][d].r+")")}}alert(e.join("\n"))}function createPlots(a){if(a==undefined){var a=document.body.imageViewers[0]}if(a!=undefined){var b=a.dimensions;if(b.zoomLevel===8){b.dragActive=false;xmlHttp=createXmlHttpRequest();var c="x="+b.x+"&y="+b.y+"&d="+new Date().getTime();readXmlFile("create",c)}}}function showHidePlots(){var a=document.body.imageViewers[0];var b=a.dimensions;if(b.zoomLevel===7){showPlots(a)}else{if(b.zoomLevel===8){hidePlots(a)}}return false}function showPlots(a,b){if(b){zoomImage(a,undefined,b)}else{zoomImage(a,undefined,1)}if(!showAllGlen){createPlots(a)}}function hidePlots(a,b){var c=a.dimensions;c.dragActive=true;var d=document.getElementById("links");while(d.firstChild){d.removeChild(d.firstChild)}if(b){zoomImage(a,undefined,b)}else{zoomImage(a,undefined,-1)}}function glenToggle(b){if(getCookie("owner_id")){var a=document.body.imageViewers[0];var c=a.dimensions;if(b.name=="exploreGlen"){document.getElementById("seasonContainer").style.display="none";showAllGlen=true;if(c.tileDir=="images/map/summer"){c.tileDir="images/map/all_glen_summer"}else{if(c.tileDir=="images/map/winter"){c.tileDir="images/map/all_glen_summer"}}b.src="/images/v2/normal-glen-view-on.jpg";b.name="normalGlen";b.onmouseover=function(){this.src="images/v2/normal-glen-view-on.jpg"};b.onmouseout=function(){this.src="images/v2/normal-glen-view-off.jpg"};zoomImage(a,undefined,0);if(c.zoomLevel==8){c.dragActive=true;var d=document.getElementById("links");while(d.firstChild){d.removeChild(d.firstChild)}}}else{if(b.name=="normalGlen"){document.getElementById("seasonContainer").style.display="block";showAllGlen=false;if(c.tileDir=="images/map/all_glen_summer"){if(document.getElementById("season").name=="winter"){c.tileDir="images/map/summer"}else{c.tileDir="images/map/winter"}}else{if(c.tileDir=="images/map/all_glen_winter"){c.tileDir="images/map/winter"}}b.src="/images/v2/show-all-glen-on.jpg";b.name="exploreGlen";b.onmouseover=function(){this.src="images/v2/show-all-glen-on.jpg"};b.onmouseout=function(){this.src="images/v2/show-all-glen-off.jpg"};if(c.zoomLevel==8){createPlots(a)}else{zoomImage(a,undefined,0)}}}}else{alert("Please log in as a member to see the whole glen. Registration is free.")}}function gridToggle(b){var a=document.body.imageViewers[0];var d=a.dimensions;if(d.zoomLevel===8){var c=document.getElementById("owner_grid_control_button");if(c.name=="showOwners"){if(b.name=="hideGrid"){changeStyle("hidePlots");b.name="showGrid";b.src="images/v2/show-grid-on.jpg";b.onmouseover=function(){this.src="images/v2/show-grid-on.jpg"};b.onmouseout=function(){this.src="images/v2/show-grid-off.jpg"}}else{changeStyle("hideOwners");b.name="hideGrid";b.src="images/v2/hide-grid-on.jpg";b.onmouseover=function(){this.src="images/v2/hide-grid-on.jpg"};b.onmouseout=function(){this.src="images/v2/hide-grid-off.jpg"}}}else{if(b.name=="hideGrid"){changeStyle("justOwners");b.name="showGrid";b.src="images/v2/show-grid-on.jpg";b.onmouseover=function(){this.src="images/v2/show-grid-on.jpg"};b.onmouseout=function(){this.src="images/v2/show-grid-off.jpg"}}else{changeStyle("allPlots");b.name="hideGrid";b.src="images/v2/hide-grid-on.jpg";b.onmouseover=function(){this.src="images/v2/hide-grid-on.jpg"};b.onmouseout=function(){this.src="images/v2/hide-grid-off.jpg"}}}}else{alert("you need to be at 100% zoom for the grid to appear")}}function ownerGridToggle(b){var a=document.body.imageViewers[0];var c=a.dimensions;if(c.zoomLevel===8){var d=document.getElementById("grid_control_button");if(d.name=="showGrid"){if(b.name=="hideOwners"){changeStyle("hidePlots");b.name="showOwners";b.src="images/v2/show-owners-on.jpg";b.onmouseover=function(){this.src="images/v2/show-owners-on.jpg"};b.onmouseout=function(){this.src="images/v2/show-owners-off.jpg"}}else{changeStyle("justOwners");b.name="hideOwners";b.src="images/v2/hide-owners-on.jpg";b.onmouseover=function(){this.src="images/v2/hide-owners-on.jpg"};b.onmouseout=function(){this.src="images/v2/hide-owners-off.jpg"}}}else{if(b.name=="hideOwners"){changeStyle("hideOwners");b.name="showOwners";b.src="images/v2/show-owners-on.jpg";b.onmouseover=function(){this.src="images/v2/show-owners-on.jpg"};b.onmouseout=function(){this.src="images/v2/show-owners-off.jpg"}}else{changeStyle("allPlots");b.name="hideOwners";b.src="images/v2/hide-owners-on.jpg";b.onmouseover=function(){this.src="images/v2/hide-owners-on.jpg"};b.onmouseout=function(){this.src="images/v2/hide-owners-off.jpg"}}}}else{alert("you need to be at 100% zoom for the owner plots to appear")}}function dumpAllInfo(){for(var a=0;a<document.body.imageViewers.length;a+=1){dumpInfo(document.body.imageViewers[a])}}function changeSeason(b){var a=document.body.imageViewers[0];var c=a.dimensions;if(b.name=="summer"){c.tileDir="images/map/summer";b.src="images/v2/winter-view-on.jpg";b.name="winter";b.onmouseover=function(){this.src="images/v2/winter-view-on.jpg"};b.onmouseout=function(){this.src="images/v2/winter-view-off.jpg"};zoomImage(a,undefined,0)}else{if(b.name=="winter"){c.tileDir="images/map/winter";b.src="/images/v2/summer-view-on.jpg";b.name="summer";b.onmouseover=function(){this.src="images/v2/summer-view-on.jpg"};b.onmouseout=function(){this.src="images/v2/summer-view-off.jpg"};zoomImage(a,undefined,0)}}}function getSeason(){if(document.getElementById("season").name=="winter"){if(showAllGlen){return"images/map/all_glen_summer"}else{return"images/map/summer"}}else{if(document.getElementById("season").name=="summer"){if(showAllGlen){return"images/map/all_glen_summer"}else{return"images/map/winter"}}}}function zoomImage(a,b,d){if(t1){window.clearTimeout(t1)}var c=a.dimensions;c.cx_bi=((c.width/2)-c.x)/c.fullSize;c.cy_bi=((c.height/2)-c.y)/c.fullSize;c.zoomLevel+=d;c.fullSize=c.fullSize*Math.pow(2,d);c.x=-((c.cx_bi*c.fullSize)-(c.width/2));c.y=-((c.cy_bi*c.fullSize)-(c.height/2));resetTiles(a);landingPage(c.zoomLevel,c.tileDir)}function resetTiles(b){if(b==undefined){b=document.getElementById("imageViewer")}var f=b.tileWell;var d=b.dimensions;var j=2;b.tiles=[];f.innerHTML="";if(d.x>0){f.style.left=((d.x%d.tileSize)-d.tileSize)+"px"}else{f.style.left=(d.x%d.tileSize)+"px"}if(d.y>0){f.style.top=((d.y%d.tileSize)-d.tileSize)+"px"}else{f.style.top=(d.y%d.tileSize)+"px"}var k=Math.ceil(d.height/d.tileSize)+(2*j);var i=Math.ceil(d.width/d.tileSize)+(2*j);for(var g=-j;g<i-j;g+=1){var h=[];for(var a=-j;a<k-j;a+=1){var e={c:0,r:0,img:document.createElement("img"),imageViewer:b};e.img.className="tile";e.x=(g*d.tileSize);e.c=Math.floor((e.x-d.x)/d.tileSize);e.y=a*d.tileSize;e.r=Math.floor((e.y-d.y)/d.tileSize);e.img.style.top=e.y+"px";e.img.style.left=e.x+"px";setTileImage(e,true);f.appendChild(e.img);h.push(e)}b.tiles.push(h)}}function zoomImageIn(a,b){if(a==undefined){a=document.body.imageViewers[0]}var c=a.dimensions;if(c.zoomLevel===5){zoomImage(a,b,2)}else{if(c.zoomLevel===7){showPlots(a)}}}function zoomImageOut(a,b){var c=a.dimensions;if(c.zoomLevel===8){hidePlots(a)}else{if(c.zoomLevel===7){zoomImage(a,b,-2)}else{if(c.zoomLevel===5){c.x=c.resetX;c.y=c.resetY;zoomImage(a,undefined,0)}}}}function zoomImageTo(a,c){var b=a.dimensions;if(c=="zoom25"){if(b.zoomLevel===8){hidePlots(a,-3)}else{if(b.zoomLevel===7){zoomImage(a,undefined,-2)}else{if(b.zoomLevel===5){b.x=b.resetX;b.y=b.resetY;zoomImage(a,undefined,0)}}}}else{if(c=="zoom75"){if(b.zoomLevel===8){hidePlots(a)}else{if(b.zoomLevel===5){zoomImage(a,undefined,2)}}}else{if(c=="zoom100"){if(b.zoomLevel===7){showPlots(a)}else{if(b.zoomLevel===5){showPlots(a,3)}}}}}}function progressIndicator(a){if(a=="show"){document.getElementById("progressIndicator").style.display="block"}else{document.getElementById("progressIndicator").style.display="none"}}function currencyConvertor(c,b){c=parseFloat(c);var a;if(b=="uk"||b==null){if(currency=="uk"){a="&pound;"+c.toFixed(2)}else{if(currency=="eu"){a=c*ukEu;a="&#8364;"+a.toFixed(2)}else{if(currency=="usa"){a=c*ukUsa;a="&#36;"+a.toFixed(2)}else{if(currency=="can"){a=c*ukCan;a="&#36;"+a.toFixed(2)}else{if(currency=="aus"){a=c*ukAus;a="&#36;"+a.toFixed(2)}else{if(currency=="nz"){a=c*ukNz;a="&#36;"+a.toFixed(2)}else{if(currency=="jap"){a=c*ukJap;a="&yen;"+a.toFixed(2)}}}}}}}}else{if(b=="eu"){if(currency=="uk"){a=c/ukEu;a="&pound;"+a.toFixed(2)}else{if(currency=="eu"){a="&#8364;"+c.toFixed(2)}else{if(currency=="usa"){a=(c/ukEu)*ukUsa;a="&#36;"+a.toFixed(2)}else{if(currency=="can"){a=(c/ukEu)*ukCan;a="&#36;"+a.toFixed(2)}else{if(currency=="aus"){a=(c/ukEu)*ukAus;a="&#36;"+a.toFixed(2)}else{if(currency=="nz"){a=(c/ukEu)*ukNz;a="&#36;"+a.toFixed(2)}else{if(currency=="jap"){a=(c/ukEu)*ukJap;a="&yen;"+a.toFixed(2)}}}}}}}}else{if(b=="usa"){if(currency=="uk"){a=(c/ukUsa);a="&pound;"+a.toFixed(2)}else{if(currency=="eu"){a=(c/ukUsa)*ukEu;a="&#8364;"+a.toFixed(2)}else{if(currency=="usa"){a="&#36;"+c.toFixed(2)}else{if(currency=="can"){a=(c/ukUsa)*ukCan;a="&#36;"+a.toFixed(2)}else{if(currency=="aus"){a=(c/ukUsa)*ukAus;a="&#36;"+a.toFixed(2)}else{if(currency=="nz"){a=(c/ukUsa)*ukNz;a="&#36;"+a.toFixed(2)}else{if(currency=="jap"){a=(c/ukUsa)*ukJap;a="&yen;"+a.toFixed(2)}}}}}}}}else{if(b=="can"){if(currency=="uk"){a=(c/ukCan);a="&pound;"+a.toFixed(2)}else{if(currency=="eu"){a=(c/ukCan)*ukEu;a="&#8364;"+a.toFixed(2)}else{if(currency=="usa"){a=(c/ukCan)*ukUsa;a="&#36;"+a.toFixed(2)}else{if(currency=="can"){a="&#36;"+c.toFixed(2)}else{if(currency=="aus"){a=(c/ukCan)*ukAus;a="&#36;"+a.toFixed(2)}else{if(currency=="nz"){a=(c/ukCan)*ukNz;a="&#36;"+a.toFixed(2)}else{if(currency=="jap"){a=(c/ukCan)*ukJap;a="&yen;"+a.toFixed(2)}}}}}}}}else{if(b=="aus"){if(currency=="uk"){a=(c/ukAus);a="&pound;"+a.toFixed(2)}else{if(currency=="eu"){a=(c/ukAus)*ukEu;a="&#8364;"+a.toFixed(2)}else{if(currency=="usa"){a=(c/ukAus)*ukUsa;a="&#36;"+a.toFixed(2)}else{if(currency=="can"){a=(c/ukAus)*ukCan;a="&#36;"+a.toFixed(2)}else{if(currency=="aus"){a="&#36;"+c.toFixed(2)}else{if(currency=="nz"){a=(c/ukAus)*ukNz;a="&#36;"+a.toFixed(2)}else{if(currency=="jap"){a=(c/ukAus)*ukJap;a="&yen;"+a.toFixed(2)}}}}}}}}else{if(b=="nz"){if(currency=="uk"){a=(c/ukNz);a="&pound;"+a.toFixed(2)}else{if(currency=="eu"){a=(c/ukNz)*ukEu;a="&#8364;"+a.toFixed(2)}else{if(currency=="usa"){a=(c/ukNz)*ukUsa;a="&#36;"+a.toFixed(2)}else{if(currency=="can"){a=(c/ukNz)*ukCan;a="&#36;"+a.toFixed(2)}else{if(currency=="aus"){a=(c/ukNz)*ukAus;a="&#36;"+a.toFixed(2)}else{if(currency=="nz"){a="&#36;"+c.toFixed(2)}else{if(currency=="jap"){a=(c/ukNz)*ukJap;a="&yen;"+a.toFixed(2)}}}}}}}}else{if(b=="jap"){if(currency=="uk"){a=(c/ukJap);a="&pound;"+a.toFixed(2)}else{if(currency=="eu"){a=(c/ukJap)*ukEu;a="&#8364;"+a.toFixed(2)}else{if(currency=="usa"){a=(c/ukJap)*ukUsa;a="&#36;"+a.toFixed(2)}else{if(currency=="can"){a=(c/ukJap)*ukCan;a="&#36;"+a.toFixed(2)}else{if(currency=="aus"){a=(c/ukJap)*ukAus;a="&#36;"+a.toFixed(2)}else{if(currency=="nz"){a=(c/ukJap)*ukNz;a="&#36;"+a.toFixed(2)}else{if(currency=="jap"){a="&yen;"+c.toFixed(2)}}}}}}}}}}}}}}return a}function saveViewerPosition(){var a=document.body.imageViewers[0];var c=a.dimensions;var b=c.x+","+c.y+","+c.zoomLevel+","+c.tileDir;setCookie("viewer_position",b,24,"/","","")}function updateViewerPosition(){if(getCookie("viewer_position")){if(document.body.imageViewers){var e=getCookie("viewer_position");alert(e);e=e.split(",");var a=document.body.imageViewers[0];var d=a.dimensions;d.tileDir=getSeason();removeListLock();var b=e[2]-5;if(b>0){zoomImage(a,undefined,b)}if(e[2]==8){d.dragActive=false}d.x=e[0];d.y=e[1];var c={x:d.width/2,y:d.height/2};a.start=c;zoomImage(a,c,0)}else{alert("imageviewer")}}else{alert("no cookie")}}function handleServerResponse(){counter=0;if(xmlHttp.responseText=="fail"){alert("unknown plot, please try again")}else{var b=xmlHttp.responseXML;if(!b||!b.documentElement){throw ("Invalid XML structure:\n"+xmlHttp.responseText)}var c=b.documentElement.nodeName;if(c=="parsererror"){throw ("Invalid XML structure 1:\n"+xmlHttp.responseText)}var f=b.documentElement;if(c!="response"||!f.firstChild){throw ("Invalid XML structure 2:\n"+xmlHttp.responseText)}var s=f.getElementsByTagName("id");var p=f.getElementsByTagName("row");var w=f.getElementsByTagName("col");var z=f.getElementsByTagName("plots")[0];var o=z.getAttribute("x");var n=z.getAttribute("y");var B=s.length;var e=getCookie("owner_id");var I=document.body.imageViewers[0];var E=I.dimensions;if(o&&n){removeListLock();var H=8-E.zoomLevel;if(H>0){zoomImage(I,undefined,H)}E.dragActive=false;E.x=o;E.y=n;var r={x:E.width/2,y:E.height/2};I.start=r;zoomImage(I,r,0)}if(E.zoomLevel==8){var C=document.getElementById("links");var k=C.cloneNode(false);var l;var q;var G;var a;var d;var h;var u;var D;var J;var j;var A=false;var m=document.getElementById("searchedPlot").innerHTML;for(var F=0;F<B;F++){G=s.item(F).firstChild.data;d=s.item(F).getAttribute("ownerId");h=s.item(F).parentNode.parentNode.parentNode;u=h.getAttribute("name");D=h.getAttribute("price");J=s.item(F).parentNode.parentNode.getAttribute("id");j=parseInt(w.item(F).firstChild.data,10);l=document.createElement("div");if(F!=0&&F!=B-1){if(j<4){if(parseInt(w.item(F+1).firstChild.data,10)-parseInt(w.item(F-1).firstChild.data,10)==24){j=parseInt(w.item(F-1).firstChild.data,10)+12}}}q="position:absolute; left:"+p.item(F).firstChild.data+"px; top:"+j+"px;";l.setAttribute("style",q);l.style.cssText=q;if(d){if(d==e){if(G==m){l.className="searchedUserPlot";A="searchedUserPlot"}else{l.className="userPlot"}}else{var g=s.item(F).getAttribute("salePrice");if(g==""||g===null||g=="0"){u=u.replace(/-/," ");if(document.getElementById("basket_"+G+"_"+u+"_"+D+"_"+J)){if(G==m){l.className="searchedSponsoredInBasket"}else{l.className="sponsoredInBasket"}}else{if(G==m){l.className="searchedSponsored";A="searchedSponsored"}else{l.className="sponsored"}}}else{D=g;u=u.replace(/-/," ");if(document.getElementById("basket_"+G+"_"+u+"_"+g+"_"+J)){if(G==m){l.className="searchedForSaleInBasket"}else{l.className="forSaleInBasket"}}else{if(G==m){l.className="searchedForSale";A="searchedForSale"}else{l.className="forSale"}}}}}else{u=u.replace(/-/," ");if(document.getElementById("basket_"+G+"_"+u+"_"+D+"_"+J)){if(G==m){l.className="searchedInBasket"}else{l.className="inBasket"}}else{if(G==m){l.className="searchedOutBasket";A="searchedOutBasket"}else{l.className="outBasket"}}}l.id="plot_"+G+"_"+u+"_"+D+"_"+J;k.appendChild(l)}C.parentNode.replaceChild(k,C)}}window.clearTimeout(t);window.clearTimeout(t1);progressIndicator("hide");if(o&&n&&m&&A){var z=document.getElementsByClassName(A,k);if(z.length>0){tabClick("return");var v=z[0].id;if(A=="searchedOutBasket"){z[0].className="searchedInBasket";getUnsponsoredplot(v);updateBasketListCookie(v,"add")}else{if(A=="searchedSponsored"){z[0].className="searchedSponsoredInBasket";selectSponsoredplot(v);updateBasketListCookie(v,"add")}else{if(A=="searchedForSale"){z[0].className="searchedForSaleInBasket";selectForSaleplot(v);updateBasketListCookie(v,"add")}else{if(A=="searchedUserPlot"){z[0].className="searchedUserPlot";showUserPlot(v)}}}}}}}function handleServerResponse1(){counter=0;var a=xmlHttp2.responseXML;if(!a||!a.documentElement){throw ("Invalid XML structure:\n"+xmlHttp2.responseText)}var b=a.documentElement.nodeName;if(b=="parsererror"){throw ("Invalid XML structure 1:\n"+xmlHttp2.responseText)}xmlRoot=a.documentElement;if(b!="response"||!xmlRoot.firstChild){throw ("Invalid XML structure 2:\n"+xmlHttp2.responseText)}var g=xmlRoot.getElementsByTagName("description");var e=xmlRoot.getElementsByTagName("status");var c=xmlRoot.getElementsByTagName("price");var i=xmlRoot.getElementsByTagName("id");var n=c.item(0).firstChild.data;var m=e.item(0).firstChild.data;var k=i.item(0).firstChild.data;var j=document.getElementById("book");var r=j.getElementsByTagName("div");while(r[9].firstChild){r[9].removeChild(r[9].firstChild)}var f=document.createElement("span");f.id="status_message";if(m=="0"){r[9].style.left="5px";r[9].style.top="5px";r[9].style.fontSize="11px";r[9].style.textAlign="left";r[9].style.lineHeight="15px";r[9].style.width="210px";var o=document.createElement("span");o.className="currency";var u=document.createElement("br");f.appendChild(document.createTextNode("Own this 1m sq (9ft sq) plot of land for "));f.appendChild(o);f.appendChild(document.createTextNode("."));f.appendChild(u);f.appendChild(document.createTextNode("You can own part of this historic and beautiful Glen in Scotland. To find out about this part of the glen and see an enlarged photo click the yellow row below or the picture to the right."));changeLeftPage()}else{r[9].style.left="220px";r[9].style.top="150px";r[9].style.fontSize="12px";r[9].style.lineHeight="20px";r[9].style.textAlign="center";r[9].style.width="230px";if(m=="1"){f.appendChild(document.createTextNode("Land is already owned."))}else{if(m=="11"){f.appendChild(document.createTextNode("This is your land"))}else{if(m=="2"){f.appendChild(document.createTextNode("Land is for sale for "));var o=document.createElement("span");o.className="currency";f.appendChild(o);f.appendChild(document.createTextNode("."));document.getElementById("ownerImage").src="/scripts/timthumb.php?src=/images/forsale.png&h=130&zc=0"}else{if(m=="21"){f.appendChild(document.createTextNode("Your land is for sale for "));m="21";var o=document.createElement("span");o.className="currency";f.appendChild(o);f.appendChild(document.createTextNode("."));document.getElementById("ownerImage").src="/scripts/timthumb.php?src=/images/forsale.png&h=130&zc=0"}else{if(m=="3"){f.appendChild(document.createTextNode("Land is under offer from a buyer."));changeLeftPage()}else{if(m=="31"){f.appendChild(document.createTextNode("You are awaiting payment from buyer"));changeLeftPage()}else{if(m=="4"){f.appendChild(document.createTextNode("Land is not currently for sale."));changeLeftPage()}}}}}}}}r[9].appendChild(f);r[9].className="status_"+m;if(o){o.innerHTML=currencyConvertor(parseFloat(n))}if(m=="1"||m=="11"||m=="2"||m=="21"){var s=xmlRoot.getElementsByTagName("type");var d=s.item(0).firstChild.data;var p=r[10].getElementsByTagName("div");if(d=="unlocked"||d=="owned"){var q=xmlRoot.getElementsByTagName("text");if(m=="2"||m=="21"){document.getElementById("makeOfferPrice").innerHTML=currencyConvertor(parseFloat(n));var h=p[1].getElementsByTagName("img");h[0].src="/scripts/timthumb.php?src=/images/plot-for-sale.png&h=130&zc=0";changeLeftPage("ops")}else{if(q.item(0).firstChild){document.getElementById("ownerMessage").innerHTML=q.item(0).firstChild.data}else{clearInnerHTML(document.getElementById("ownerMessage"))}var h=p[1].getElementsByTagName("img");h[0].src="/scripts/timthumb.php?src=/images/plots/"+k+".jpg&h=130&zc=0";changeLeftPage("op")}}else{if(d=="locked"){var l=p[0].getElementsByTagName("p");l[1].innerHTML="The owner of this land has set a password for this plot, please enter it below";p[0].firstChild.action="javascript:viewOwnerProfile('private',"+k+")";changeLeftPage("opl")}else{if(d="locked-failed"){var l=p[0].getElementsByTagName("p");l[1].innerHTML="The Password you entered was incorrect please try again";p[0].firstChild.action="javascript:viewOwnerProfile('private',"+k+")";changeLeftPage("opl")}}}}}function handleServerResponse2(){counter=0;var a=xmlHttp.responseXML;if(!a||!a.documentElement){throw ("Invalid XML structure:\n"+xmlHttp.responseText)}var b=a.documentElement.nodeName;if(b=="parsererror"){throw ("Invalid XML structure 1:\n"+xmlHttp.responseText)}xmlRoot=a.documentElement;if(b!="response"||!xmlRoot.firstChild){throw ("Invalid XML structure 2:\n"+xmlHttp.responseText)}var c=xmlRoot.getElementsByTagName("message");updateMessage(c.item(0).firstChild.data)}function handleServerResponse3(){counter=0;var a=xmlHttp3.responseText;a=a.split("_");if(a[0]=="rc"){if(a[1]=="1"){document.getElementById(a[0]+"UsernameCheckerText").innerHTML="available";document.getElementById(a[0]+"UsernameCheckerText").style.color=document.getElementById("preferred_username").style.background="lightgreen"}else{document.getElementById(a[0]+"UsernameCheckerText").innerHTML="taken";document.getElementById(a[0]+"UsernameCheckerText").style.color=document.getElementById("preferred_username").style.background="red"}document.getElementById(a[0]+"UsernameChecker").value=a[1]}else{if(a[1]=="username"){document.getElementById(a[0]+"UsernameChecker").innerHTML=a[2]}else{if(a[1]=="email"){document.getElementById(a[0]+"EmailChecker").innerHTML=a[2]}}}}function handleServerResponse4(){counter=0;var d=xmlHttp4.responseXML;if(!d||!d.documentElement){throw ("Invalid XML structure:\n"+xmlHttp4.responseText)}var b=d.documentElement.nodeName;if(b=="parsererror"){throw ("Invalid XML structure 1:\n"+xmlHttp4.responseText)}xmlRoot=d.documentElement;if(b!="response"||!xmlRoot.firstChild){throw ("Invalid XML structure 2:\n"+xmlHttp4.responseText)}var h=xmlRoot.getElementsByTagName("type");var k=xmlRoot.getElementsByTagName("id");var i=h.item(0).firstChild.data;var j=document.getElementById("ownerProfile").getElementsByTagName("div");if(i=="unlocked"||i=="owned"){var f=j[2].getElementsByTagName("p");var c=xmlRoot.getElementsByTagName("text");var g=xmlRoot.getElementsByTagName("price");if(parseFloat(g.item(0).firstChild.data)!==0){j[0].style.display="none";j[1].style.display="block";j[2].style.display="block";j[3].style.display="block";document.getElementById("makeOfferPrice").innerHTML=currencyConvertor(parseFloat(g.item(0).firstChild.data));var e=j[1].getElementsByTagName("img");e[0].src="/scripts/timthumb.php?src=/images/plot-for-sale.png&h=130&zc=0"}else{j[0].style.display="none";j[1].style.display="block";j[2].style.display="block";j[3].style.display="block";if(c.item(0).firstChild){f[1].innerHTML=c.item(0).firstChild.data}else{clearInnerHTML(f[1])}var e=j[1].getElementsByTagName("img");e[0].src="/scripts/timthumb.php?src=/images/plots/"+k.item(0).firstChild.data+".jpg&h=130&zc=0"}}else{if(i=="locked"){var a=document.getElementById("ownerProfile").getElementsByTagName("p");j[0].style.display="block";a[1].innerHTML="The owner of this land has set a password for this plot, please enter it below";j[1].style.display="none";j[2].style.display="none";j[3].style.display="none";j[0].firstChild.action="javascript:viewOwnerProfile('private',"+k.item(0).firstChild.data+")"}else{if(i="locked-failed"){var a=document.getElementById("ownerProfile").getElementsByTagName("p");j[0].style.display="block";a[1].innerHTML="The Password you entered was incorrect please try again";j[1].style.display="none";j[2].style.display="none";j[3].style.display="none";j[0].firstChild.action="javascript:viewOwnerProfile('private',"+k.item(0).firstChild.data+")"}}}}function handleServerResponse5(){counter=0;var a=document.getElementById("ownerOverId").innerHTML;if(xmlHttp4.responseText=="PRIVATE"){document.getElementById("ownerImage").src="/scripts/timthumb.php?src=/images/private.png&h=130&zc=0";document.getElementById("ownerMessage").innerHTML="The owner has set this plot to private, please click to select then highlight in the book to enter a password to view the plot"}else{if(xmlHttp4.responseText==""){document.getElementById("ownerImage").src="/scripts/timthumb.php?src=/images/plots/"+a+".jpg&h=130&zc=0";clearInnerHTML(document.getElementById("ownerMessage"))}else{document.getElementById("ownerImage").src="/scripts/timthumb.php?src=/images/plots/"+a+".jpg&h=130&zc=0";document.getElementById("ownerMessage").innerHTML=xmlHttp4.responseText}}changeLeftPage("voi",a)}function handleServerResponse6(){var a=xmlHttp3.responseText;if(a=="fail"){alert("login has expired")}else{changeLeftPage("h")}}function handleServerResponse7(){tabClick("return");var a=confirm("You are now a member, your login details have been sent to the email address provided. Update you Profile?");if(a==true){window.location="http://www.myglengarry.com/owner/owner_profile.php"}else{window.location="http://www.myglengarry.com/index.php"}}function handleServerResponse8(){return false}function handleServerResponse9(){var a=document.getElementById("tellAFriendForm");a.elements[1].value="";a.elements[2].value="";a.elements[4].value="";a.elements[5].value="";a.elements[6].value="";alert(xmlHttp3.responseText)}function handleRequestStateChange(){if(xmlHttp.readyState===4){if(xmlHttp.status===200){try{handleServerResponse()}catch(b){xmlHttp.abort();var a=document.body.imageViewers[0];if(!showAllGlen){createPlots(a)}}}else{xmlHttp.abort();var a=document.body.imageViewers[0];if(!showAllGlen){createPlots(a)}}}}function handleRequestStateChange1(){if(xmlHttp2.readyState===4){if(xmlHttp2.status===200){try{handleServerResponse1()}catch(a){alert("1: Error reading the response. "+a.toString())}}else{alert("1: There was a problem retrieving the data:\n"+xmlHttp2.status)}}}function handleRequestStateChange2(){if(xmlHttp.readyState===4){if(xmlHttp.status===200){try{handleServerResponse2()}catch(a){}}else{}}}function handleRequestStateChange3(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{handleServerResponse3()}catch(a){}}else{}}}function handleRequestStateChange4(){if(xmlHttp4.readyState===4){if(xmlHttp4.status===200){try{handleServerResponse4()}catch(a){}}else{}}}function handleRequestStateChange5(){if(xmlHttp4.readyState===4){if(xmlHttp4.status===200){try{handleServerResponse5()}catch(a){}}else{}}}function handleRequestStateChange6(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{handleServerResponse6()}catch(a){}}else{}}}function handleRequestStateChange7(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{handleServerResponse7()}catch(a){}}else{}}}function handleRequestStateChange8(){if(xmlHttp5.readyState===4){if(xmlHttp5.status===200){try{handleServerResponse8()}catch(a){}}else{}}}function handleRequestStateChange9(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{handleServerResponse9()}catch(a){}}else{}}}function readXmlFile(a,c){if(a=="create"){if(t){window.clearTimeout(t);progressIndicator("hide")}t=setTimeout("progressIndicator('show');",1000);if(xmlHttp){try{xmlHttp.open("GET","/scripts/createPlots.php?"+c,true);xmlHttp.onreadystatechange=handleRequestStateChange;xmlHttp.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="plotInfo"){if(xmlHttp2){try{xmlHttp2.open("GET","/scripts/plotinfo2.php?"+c,true);xmlHttp2.onreadystatechange=handleRequestStateChange1;xmlHttp2.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="getPrices"){if(xmlHttp2){try{xmlHttp2.open("GET","/scripts/prices.php?"+c,true);xmlHttp2.onreadystatechange=handleRequestStateChange2;xmlHttp2.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="editMessage"){if(xmlHttp){try{xmlHttp.open("GET","/scripts/editMessage.php?"+c,true);xmlHttp.onreadystatechange=handleRequestStateChange2;xmlHttp.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="inputChecker"){if(xmlHttp3){try{xmlHttp3.open("GET","/scripts/inputChecker.php?"+c,true);xmlHttp3.onreadystatechange=handleRequestStateChange3;xmlHttp3.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="viewPrivateOwnerProfile"){if(xmlHttp4){try{xmlHttp4.open("POST","/scripts/viewOwnerProfile.php",true);xmlHttp4.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp4.onreadystatechange=handleRequestStateChange4;xmlHttp4.send(c)}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="viewOwnerMessage"){if(xmlHttp4){try{xmlHttp4.open("GET","/scripts/viewOwnerMessage.php?"+c,true);xmlHttp4.onreadystatechange=handleRequestStateChange5;xmlHttp4.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="makeAnOffer"){if(xmlHttp3){try{xmlHttp3.open("GET","/scripts/makeAnOffer.php?"+c,true);xmlHttp3.onreadystatechange=handleRequestStateChange6;xmlHttp3.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="ie6hit"){if(xmlHttp5){try{xmlHttp5.open("GET","/scripts/ie6hit.php",true);xmlHttp5.onreadystatechange=handleRequestStateChange8;xmlHttp5.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="tellAFriend"){if(xmlHttp3){try{xmlHttp3.open("POST","/scripts/tell_a_friend.php",true);xmlHttp3.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp3.onreadystatechange=handleRequestStateChange9;xmlHttp3.send(c)}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}else{if(a=="joinFree"){if(xmlHttp3){try{xmlHttp3.open("POST","/scripts/free_membership.php",true);xmlHttp3.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp3.onreadystatechange=handleRequestStateChange7;xmlHttp3.send(c)}catch(b){alert("Please check you internet connection, your browser failed to make contact with myglengarry.com")}}}}}}}}}}}}}};