var domain="canarysquares.co.uk";var website_url="http://www."+domain;var xmlHttp=false;var xmlHttp2=false;var xmlHttp3=false;var xmlHttp4=false;var hlRow=null;var searchedPlot=null;var plotInfoLock=false;var editingPlotLock=false;var overSponsoredPlot=false;var overCorpPlotLocal=false;var showSeatNumbers=false;var timer=null;var timer1=null;var timer2=null;var timer3=null;var timer4=null;var timer5=null;var timer6=null;var mouseViewCounter=0;var largeWidth=670;var largeHeight=510;var smallWidth=520;var smallHeight=430;var app_startX=-280;var app_startY=-230;var app_minZoom=3;var maxZoom=7;var minZoom=2;var startX=34;var startY=-13;var pitchNumberOfPlots=9163;var seatCodeLookupTable=new Array("pitch","seat1","seat2","seat3","seat4","seat5","seat6","seat7","seat8","seat9","seat10","seat11","seat12","seat13","seat14","seat15","seat16","seat17","seat18","seat19","seat20");var seatCodeLookupTable2=new Array("pitch_2","seat1_2","seat2_2","seat3_2","seat4_2","seat5_2","seat6_2","seat7_2","seat8_2","seat9_2","seat10_2","seat11_2","seat12_2","seat13_2","seat14_2","seat15_2","seat16_2","seat17_2","seat18_2","seat19_2","seat20_2");var seatCodeLookupTable3=new Array("pitch_3","seat1_3","seat2_3","seat3_3","seat4_3","seat5_3","seat6_3","seat7_3","seat8_3","seat9_3","seat10_3","seat11_3","seat12_3","seat13_3","seat14_3","seat15_3","seat16_3","seat17_3","seat18_3","seat19_3","seat20_3");var numberDefaultIcons=12;var current_celeb=null;var current_famous_square=null;var treasure_hunt_finished_notification=false;function appendZeroes(d){var c=4-d.length;var b;var e;for(var a=c;a>0;a--){if(!b){b="0"}else{b+="0"}}if(b){e=b+d}else{e=d}return e}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b,c){var a=this.length;var c=Number(arguments[1])||0;c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a}for(;c<a;c++){if(c in this&&this[c]===b){return c}}return -1}}Array.prototype.search=function(d,b){var a=this.length;for(var c=0;c<a;c++){if(this[c].constructor==Array){if(this[c][0]==d&&this[c][1]==b){return c;break}}}return false};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 clearInnerHTML(b){var a=b.cloneNode(false);b.parentNode.insertBefore(a,b);b.parentNode.removeChild(b)}function getEvent(a){if(a==undefined){return window.event}return a}function isInteger(a){return(a.toString().search(/^-?[0-9]+$/)==0)}function moneyFormat(a){return"&pound;"+parseFloat(a).toFixed(2)}function limitText(b,a){if(b.value.length>a){b.value=b.value.substring(0,a)}}function getViewportDimensions(a){if(a=="width"){if(window.innerWidth){return window.innerWidth}else{if(document.body.clientWidth){return document.body.clientWidth}else{if(document.body&&document.body.offsetWidth){return document.body.offsetWidth}else{if(document.documentElement.clientWidth){return document.documentElement.clientWidth}else{if(window.innerWidth){return window.innerWidth}else{return 0}}}}}}else{if(window.innerHeight){return window.innerHeight}else{if(document.body&&document.body.clientHeight){return document.body.clientHeight}else{if(document.body&&document.body.offsetHeight){return document.body.offsetHeight}else{if(document.documentElement.clientHeight){return document.documentElement.clientHeight}else{if(window.innerHeight){return window.innerHeight}else{return 0}}}}}}}function getAllSheets(){if(!window.ScriptEngine&&navigator.__ice_version){return document.styleSheets}if(document.getElementsByTagName){var c=document.getElementsByTagName("link"),d=document.getElementsByTagName("style")}else{if(document.styleSheets&&document.all){var c=document.all.tags("LINK"),d=document.all.tags("STYLE")}else{return[]}}for(var b=0,e=[];c[b];b++){var a=c[b].rel?c[b].rel:c[b].getAttribute?c[b].getAttribute("rel"):"";if(typeof(a)=="string"&&a.toLowerCase().indexOf("style")+1){e[e.length]=c[b]}}for(var b=0;d[b];b++){e[e.length]=d[b]}return e}function changeStyle(){window.userHasChosen=window.MWJss;for(var a=0,b=getAllSheets();b[a];a++){if(b[a].title){b[a].disabled=true}for(var c=0;c<arguments.length;c++){if(b[a].title==arguments[c]){b[a].disabled=false}}}}function rememberStyle(g,d){for(var b=false,e=getAllSheets(),a=0;window.MWJss&&MWJss[a]&&e[a];a++){if(e[a].disabled!=MWJss[a]){b=true;break}}if(!window.userHasChosen&&!b){return}for(var a=0,c="",f=[];e[a];a++){if(e[a].title&&e[a].disabled==false&&!f[e[a].title]){f[e[a].title]=true;c+=(c?" MWJ ":"")+escape(e[a].title)}}if(e.length){document.cookie=escape(g)+"="+escape(c)+(d?";expires="+new Date((new Date()).getTime()+(d*86400000)).toGMTString():"")+";path=/"}}function useStyleAgain(cookieName){for(var x=0;x<document.cookie.split("; ").length;x++){var oneCookie=document.cookie.split("; ")[x].split("=");if(oneCookie[0]==escape(cookieName)){var styleStrings=unescape(oneCookie[1]).split(" MWJ ");for(var y=0,funcStr="";styleStrings[y];y++){funcStr+=(y?",":"")+"unescape( styleStrings["+y+"] )"}eval("changeStyle("+funcStr+");");break}}window.MWJss=[];for(var ss=getAllSheets(),x=0;ss[x];x++){MWJss[x]=ss[x].disabled}}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}}function findXmlRoot(b){var a=b.responseXML;if(!a||!a.documentElement){throw ("Invalid XML structure:\n"+b.responseText)}var c=a.documentElement.nodeName;if(c=="parsererror"){throw ("Invalid XML structure 1:\n"+b.responseText)}var d=a.documentElement;if(c!="response"||!d.firstChild){throw ("Invalid XML structure 2:\n"+b.responseText)}return d}function readXmlFile(a,c){if(a=="createPlots"){if(xmlHttp){try{xmlHttp.open("GET","/scripts/php/createPlots.php?"+c,true);xmlHttp.onreadystatechange=handleRequestStateChange;xmlHttp.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="plotInfo"){if(xmlHttp2){try{xmlHttp2.open("GET","/scripts/php/plotInfo.php?"+c,true);xmlHttp2.onreadystatechange=handleRequestStateChange2;xmlHttp2.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="inputChecker"){if(xmlHttp3){try{xmlHttp3.open("GET","/scripts/php/inputChecker.php?"+c,true);xmlHttp3.onreadystatechange=handleRequestStateChange3;xmlHttp3.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="joinFree"){if(xmlHttp3){try{xmlHttp3.open("POST","/scripts/php/joinFree.php",true);xmlHttp3.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp3.onreadystatechange=handleRequestStateChange4;xmlHttp3.send(c)}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="tellAFriend"){if(xmlHttp3){try{xmlHttp3.open("POST","/scripts/php/tellAFriend.php",true);xmlHttp3.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp3.onreadystatechange=handleRequestStateChange5;xmlHttp3.send(c)}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="nextPanels"){if(xmlHttp3){try{xmlHttp3.open("GET","/scripts/php/nextPanels.php?"+c,true);xmlHttp3.onreadystatechange=handleRequestStateChange6;xmlHttp3.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="moreInfo"){if(xmlHttp2){try{xmlHttp2.open("GET","/scripts/php/moreInfo.php?"+c,true);xmlHttp2.onreadystatechange=handleRequestStateChange7;xmlHttp2.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="plotInfoHlRow"){if(xmlHttp2){try{xmlHttp2.open("GET","/scripts/php/plotInfo.php?"+c,true);xmlHttp2.onreadystatechange=handleRequestStateChange8;xmlHttp2.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="linkCount"){if(xmlHttp4){try{xmlHttp4.open("GET","/scripts/php/linkCount.php?"+c,true);xmlHttp4.onreadystatechange=handleRequestStateChange9;xmlHttp4.send("")}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}else{if(a=="visitSquare"){if(xmlHttp3){try{xmlHttp3.open("POST","/scripts/php/visitSquare.php",true);xmlHttp3.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp3.onreadystatechange=handleRequestStateChange10;xmlHttp3.send(c)}catch(b){alert("Please check you internet connection, your browser failed to make contact with "+domain)}}}}}}}}}}}}}function handleRequestStateChange(){if(xmlHttp.readyState===4){if(xmlHttp.status===200){try{createPlotsResponse()}catch(a){}}else{}}}function handleRequestStateChange2(){if(xmlHttp2.readyState===4){if(xmlHttp2.status===200){try{plotInfoResponse()}catch(a){}}else{}}}function handleRequestStateChange3(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{inputCheckerResponse()}catch(a){}}else{}}}function handleRequestStateChange4(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{joinFreeResponse()}catch(a){}}else{}}}function handleRequestStateChange5(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{tellAFriendResponse()}catch(a){}}else{}}}function handleRequestStateChange6(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{nextPanelsResponse()}catch(a){}}else{}}}function handleRequestStateChange7(){if(xmlHttp2.readyState===4){if(xmlHttp2.status===200){try{moreInfoResponse()}catch(a){}}else{}}}function handleRequestStateChange8(){if(xmlHttp2.readyState===4){if(xmlHttp2.status===200){try{plotInfoHlRowResponse()}catch(a){}}else{}}}function handleRequestStateChange9(){if(xmlHttp4.readyState===4){if(xmlHttp4.status===200){try{}catch(a){}}else{}}}function handleRequestStateChange10(){if(xmlHttp3.readyState===4){if(xmlHttp3.status===200){try{visitSquareResponse()}catch(a){}}else{}}}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 getElementFromEvent(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}return a}function plotOver(d){if(timer1){window.clearTimeout(timer1)}if(timer2){window.clearTimeout(timer2)}if(!plotInfoLock&&!editingPlotLock){var b=getElementFromEvent(d);var a=b.className;a=a.split(" ");if(seatCodeLookupTable.indexOf(a[0])!=-1||seatCodeLookupTable2.indexOf(a[0])!=-1||seatCodeLookupTable3.indexOf(a[0])!=-1){var c=b.id;c=c.split("_");if(c[0]=="plotview"){setPEVImage(c.join("_"),true)}else{setPEVImage(c.join("_"))}if(a[0]=="pitch"||a[0]=="pitch_2"){setRowHighlight(hlRow);if(a[1]=="onList"||a[1]=="searchedOnList"){timer=window.setTimeout("setRowHighlight('"+b.id+"', true); updateSearchedPlot(true, '"+b.id+"');",500)}else{if(a[1]=="sponsoredOnList"||a[1]=="searchedSponsoredOnList"||a[1]=="userPlot"||a[1]=="searchedUserPlot"){timer=window.setTimeout("setRowHighlight('"+b.id+"', true); plotInfo('"+b.id+"',false,true,true); updateSearchedPlot(true, '"+b.id+"');",500)}else{if(a[1]=="famousSquareOnList"||a[1]=="searchedFamousSquareOnList"||a[1]=="famousSquareCorpOnList"||a[1]=="searchedFamousSquareCorpOnList"){timer=window.setTimeout("setRowHighlight('"+b.id+"', true); plotInfo('"+b.id+"'); updateSearchedPlot(true, '"+b.id+"');",500)}else{if(a[1]=="famousSquareOffList"||a[1]=="famousSquareCorpOffList"){timer=window.setTimeout("plotInfo('"+b.id+"',false,true);",500)}else{if(a[1]=="sponsoredOffList"){timer=window.setTimeout("plotInfo('"+b.id+"',false,true,true);",500)}}}}}}}}}function plotOut(d){if(!plotInfoLock&&!editingPlotLock){if(timer){window.clearTimeout(timer)}timer1=window.setTimeout("setPEVImage(false);",300);var c=getElementFromEvent(d);var b=c.className;b=b.split(" ");if(seatCodeLookupTable.indexOf(b[0])!=-1||seatCodeLookupTable2.indexOf(b[0])!=-1||seatCodeLookupTable3.indexOf(b[0])!=-1){if(b[0]=="pitch"||b[0]=="pitch_2"){if(document.getElementById(hlRow)){var a=document.getElementById(hlRow).getElementsByTagName("td")[1].className;a=a.split(" ");if(a[1]=="unsponsored"){window.clearTimeout(timer1);timer1=window.setTimeout("setPEVImage('"+hlRow+"');",300);clearPlotInfo()}else{if(a[1]=="sponsored"){plotInfo(hlRow,false,false,true,false,true)}else{if(a[1]=="famousSquare"||a[1]=="famousSquareCorp"||a[1]=="corp"){plotInfo(hlRow,false,false,false,false,true)}}}}else{hlRow=null;clearPlotInfo()}}}}}function plotClick(c){var b=getElementFromEvent(c);var a=b.className;a=a.split(" ");if(a[1]=="offList"||a[1]=="sponsoredOffList"||a[1]=="corpOffList"||a[1]=="famousSquareOffList"||a[1]=="famousSquareCorpOffList"){selectPlot(b)}else{if(a[1]=="onList"||a[1]=="searchedOnList"||a[1]=="sponsoredOnList"||a[1]=="searchedSponsoredOnList"||a[1]=="corpOnList"||a[1]=="searchedCorpOnList"||a[1]=="famousSquareOnList"||a[1]=="searchedFamousSquareOnList"||a[1]=="famousSquareCorpOnList"||a[1]=="searchedFamousSquareCorpOnList"){if(timer){window.clearTimeout(timer)}unselectPlot(b.id);if(!plotInfoLock){clearPlotInfo()}}else{if(a[1]=="userPlot"||a[1]=="searchedUserPlot"){b.className=a[0]+" searchedUserPlot";setRowHighlight(b.id,true);plotInfo(b.id,false,false,true)}}}}function listOver(f){if(timer3){window.clearTimeout(timer3)}if(!plotInfoLock&&!editingPlotLock){var d=getElementFromEvent(f);if(d.className=="moreInfo"){d=d.parentNode}else{if(d.className=="jump"){d=d.parentNode.parentNode}else{if(d.className=="invite"){d=d.parentNode.nextSibling}}}var c=d.className;c=c.split(" ");var b=d.parentNode.id;var a=b.split("_");a.splice(0,1,"plot");if(c[0]=="columnHL"||c[1]=="columnHL"){if(hlRow){setRowHighlight(hlRow,false,true)}setRowHighlight(b,true);updateSearchedPlot(true,a.join("_"));if(c[c.length-1]=="unsponsored"||c[c.length-1]=="corp"){setPEVImage(b);if(xmlHttp2){xmlHttp2.abort()}}else{if(c[c.length-1]=="famousSquareCorp"||c[c.length-1]=="famousSquare"){setPEVImage(false);plotInfo(b)}else{setPEVImage(false);plotInfo(b,false,false,true)}}}else{if(c[0]=="lockedColumnHL"||c[1]=="lockedColumnHL"){if(c[c.length-1]=="unsponsored"||c[c.length-1]=="corp"){setPEVImage(b)}}}}}function tabClick(d,f){var h=document.getElementById("infoPane");var b=h.getElementsByTagName("div");var e=document.getElementById("loggedInMessage");for(var c=1;c<=15;c++){b[c].style.display="none"}b[18].style.display="none";if((d=="joinfree")||(d=="tellafriend")||(d=="squawk")||(d=="why")||(d=="getstarted")){clearMoreInfo(true,true);h.style.background="url(/images/v2/enlarged-green-slab.png) no-repeat";b[1].style.display="block";if(d=="why"){b[2].style.display="block"}else{if(d=="joinfree"){b[3].style.display="block"}else{if(d=="tellafriend"){b[4].style.display="block"}else{if(d=="squawk"){b[5].style.display="block"}else{if(d=="getstarted"){b[6].style.display="block"}}}}}plotInfoLockSwitch(true)}else{if((d=="home")||(d=="myprofile")||(d=="visitsquare")){if(b[20].getElementsByTagName("td").length>0||f){h.style.background="url(/images/v3/two-panels.png) no-repeat";if(d=="home"){b[13].style.display="block";if(f||editingPlotLock){for(var c=15;c<=17;c++){b[c].style.display="block"}}else{b[16].style.visibility="hidden";b[9].style.display="block"}plotInfoLockSwitch(false)}else{if(d=="myprofile"){b[1].style.display="block";b[7].style.display="block";plotInfoLockSwitch(true)}else{if(d=="visitsquare"){b[1].style.display="block";b[8].style.display="block";b[13].style.display="block";for(var c=15;c<=17;c++){b[c].style.display="block"}plotInfoLockSwitch(true)}}}if(b[20].getElementsByTagName("td").length>0&&d!="visitsquare"){b[18].style.display="block"}}else{if(d=="home"){var a=document.getElementById("imageViewer");var g=a.dimensions.zoomLevel;if(g<=(maxZoom-2)){if(g==(maxZoom-2)){h.style.background="url(/images/v4/top-white-slab.png) no-repeat"}else{h.style.background="url(/images/v2/top-green-slab.png) no-repeat"}b[11].style.display="block";b[12].style.display="block"}else{h.style.background="url(/images/v3/two-panels.png) no-repeat"}plotInfoLockSwitch(false)}else{if(d=="myprofile"){h.style.background="url(/images/v3/two-panels.png) no-repeat";b[1].style.display="block";b[7].style.display="block";plotInfoLockSwitch(true)}}}}}}function toggleGrid(b){if(!b){b=document.getElementById("toggleGrid")}var a=document.getElementById("imageViewer");if(a.dimensions.zoomLevel>=(a.dimensions.maxZoom-1)){if(b.parentNode.className=="hideGrid"){b.parentNode.className="showGrid";b.parentNode.title="show grid";if(document.getElementById("toggleSponsorsContainer").className=="hideSponsors"){changeStyle("justIcons")}else{changeStyle("hideAll")}a.switches.showGrid="false"}else{b.parentNode.className="hideGrid";b.parentNode.title="hide grid";if(document.getElementById("toggleSponsorsContainer").className=="hideSponsors"){changeStyle("showAll")}else{changeStyle("justGrid")}a.switches.showGrid="true"}saveViewerPosition()}else{alert("To use show/hide owner icons or show/hide grid you need to zoom in more.")}}function toggleSponsors(b){if(!b){b=document.getElementById("toggleSponsors")}var a=document.getElementById("imageViewer");if(a.dimensions.zoomLevel>=(a.dimensions.maxZoom-1)){if(b.parentNode.className=="hideSponsors"){b.parentNode.className="showSponsors";b.parentNode.title="show owners";if(document.getElementById("toggleGridContainer").className=="hideGrid"){changeStyle("justGrid")}else{changeStyle("hideAll")}a.switches.showSponsors="false"}else{b.parentNode.className="hideSponsors";b.parentNode.title="hide owners";if(document.getElementById("toggleGridContainer").className=="hideGrid"){changeStyle("showAll")}else{changeStyle("justIcons")}a.switches.showSponsors="true"}saveViewerPosition()}else{alert("To use show/hide owner icons or show/hide grid you need to zoom in more.")}}function toggleSeats(b){if(!b){b=document.getElementById("toggleSeats")}var a=document.getElementById("imageViewer");if(b.parentNode.className=="hideSeats"){b.parentNode.className="showSeats";b.parentNode.title="show seats";a.dimensions.tileDir="/images/canopy_on";a.switches.showSeats="false"}else{b.parentNode.className="hideSeats";b.parentNode.title="hide seats";a.dimensions.tileDir="/images/canopy_off";a.switches.showSeats="true"}saveViewerPosition();resetTiles(a);createPlots(a)}function toggleSize(a){if(!a){a=document.getElementById("resize")}if(a.parentNode.className=="enlarge"){a.parentNode.className="reduce";a.parentNode.title="reduce view";resizeViewer(document.getElementById("imageViewer"))}else{a.parentNode.className="enlarge";a.parentNode.title="enlarge view";resizeViewer(document.getElementById("imageViewer"))}saveViewerPosition()}function openWindow(a){if(a=="corporate"){window.open(website_url+"/corporate.php")}else{if(a=="whatownersget"){window.open(website_url+"/what_you_get.php")}else{if(a=="videotutorial"){window.open(website_url+"/video-tutorial.php","_blank","scrollbars=no,directories=no,location=no,menubar=no,resizeable=no,status=no,titlebar=no,toolbar=no,width=660,height=525")}else{if(a=="goldencanary"){window.open(website_url+"/goldencanary.php")}}}}}function pageLevelRefresh(b){if(plotInfoLock){tabClick("home")}var a=false;if(document.getElementById("listTableContainer").getElementsByTagName("td").length>0){a=true}if(b>=(maxZoom-2)){if(a){document.getElementById("playerEyeViewContainer").style.display="none"}else{document.getElementById("playerEyeViewContainer").style.display="block"}if(b==maxZoom){document.getElementById("zoomIndicator").className="zoom_6";document.getElementById("infoPane").style.background="url(/images/v3/two-panels.png) no-repeat";document.getElementById("introImageContainer").style.display="none";document.getElementById("introTextContainer").style.display="none"}else{if(b==(maxZoom-1)){document.getElementById("zoomIndicator").className="zoom_5";document.getElementById("infoPane").style.background="url(/images/v3/two-panels.png) no-repeat";document.getElementById("introImageContainer").style.display="none";document.getElementById("introTextContainer").style.display="none"}else{if(b==(maxZoom-2)){document.getElementById("zoomIndicator").className="zoom_4";if(a){document.getElementById("introImageContainer").style.display="none";document.getElementById("introTextContainer").style.display="none";document.getElementById("infoPane").style.background="url(/images/v3/two-panels.png) no-repeat"}else{document.getElementById("introImageContainer").style.display="block";document.getElementById("introTextContainer").style.display="block";document.getElementById("introTextContainer").style.visibility="hidden";document.getElementById("infoPane").style.background="url(/images/v4/top-white-slab.png) no-repeat"}}}}}else{document.getElementById("playerEyeViewContainer").style.display="none";if(a){document.getElementById("infoPane").style.background="url(/images/v3/two-panels.png) no-repeat";document.getElementById("introTextContainer").style.display="none";document.getElementById("introImageContainer").style.display="none"}else{document.getElementById("infoPane").style.background="url(/images/v2/top-green-slab.png) no-repeat";document.getElementById("introTextContainer").style.display="block";document.getElementById("introImageContainer").style.display="block";document.getElementById("introTextContainer").style.visibility="visible"}if(b==(maxZoom-4)){document.getElementById("zoomIndicator").className="zoom_2"}else{if(b==(maxZoom-5)){document.getElementById("zoomIndicator").className="zoom_1"}}}}function saveViewerPosition(){var a=document.getElementById("imageViewer");var d=a.dimensions;var b=a.switches;var c=d.bi.x+","+d.bi.y+","+d.zoomLevel+","+d.iv.size+","+b.showGrid+","+b.showSponsors+","+b.showSeats;setCookie("viewer_position",c,24,"/","","")}function reloadViewerPosition(){if(getCookie("viewer_position")){if(document.getElementById("imageViewer")){var e=getCookie("viewer_position");e=e.split(",");var a=document.getElementById("imageViewer");var d=a.dimensions;var b=e[2]-d.zoomLevel;if(b>0){zoomImage(a,undefined,b,true)}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("no imageviewer")}}else{alert("no cookie")}}function updateBasketListCookie(f,e){var d=getCookie("basket_list");if(e=="add"){if(f!=null&&f!=""){if(d===null||d==""){d=f}else{d=d+","+f}setCookie("basket_list",d,24,"/","","")}}else{if(e=="del"){if(d!=null&&d!=""){var a=d.split(",");d="";var b=0;for(var c=0;c<a.length;c++){if(a[c]!=f||a[c]==""){if(b!==0){d=d+","+a[c]}else{d=a[c]}b++}}setCookie("basket_list",d,24,"/","","")}}}}function continueInIE6(){document.getElementById("ie6-container").style.display="none";document.getElementById("pageContainer").style.display="block"}function homePrompt(){deleteCookie("viewer_position","/","");deleteCookie("basket_list","/","");var b=confirm("Would you also like to logout?");if(b==true){window.location="/index.php?task=logout"}else{window.location="/index.php"}}function linkCount(b){xmlHttp4=createXmlHttpRequest();var a="id="+b+"&d="+new Date().getTime();readXmlFile("linkCount",a)}function toggleAutoZoom(b,a){var c=document.getElementById("autoZoomContainer");if(b=="show"){if(a=="sl"){c.style.backgroundImage="url(/images/v5/overlay_sl.png)"}else{if(a=="fs"){c.style.backgroundImage="url(/images/v5/overlay_fs.png)"}else{c.style.backgroundImage="url(/images/v5/overlay.png)";c.style.cursor="progress"}}c.style.display="block"}else{c.style.backgroundImage="";c.style.display="none";c.style.cursor="default"}}function beginAutoZoom(a,b){b.onclick=null;timer6=window.setTimeout("autoZoom(1,'"+a+"'); toggleAutoZoom('show')",500)}function autoZoom(a,b){var c=2000;if(a==1){zoomImageIn(document.getElementById("imageViewer"),undefined);timer6=window.setTimeout("autoZoom(2,'"+b+"');",c)}else{if(a==2){zoomImageIn(document.getElementById("imageViewer"),undefined);timer6=window.setTimeout("autoZoom(3,'"+b+"');",c)}else{if(a==3){zoomImageIn(document.getElementById("imageViewer"),undefined);timer6=window.setTimeout("autoZoom(4,'"+b+"');",c)}else{if(a==4){findPlot(b,true);timer6=window.setTimeout("autoZoom(5);",c)}else{if(a==5){toggleGrid();timer6=window.setTimeout("autoZoom(6);",c)}else{if(a==6){toggleSize();timer6=window.setTimeout("autoZoom(7);",c)}else{if(a==7){toggleSponsors();toggleAutoZoom()}}}}}}}}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 checkList(){var c=false;if(document.listForm.elements){var b=document.listForm.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.listForm.action="/ss_checkout.php";document.listForm.method="POST";document.listForm.target="_self";document.listForm.submit()}}}}if(!c){alert('Identify the squares you want to purchase by ticking the "Buy" box.  Seats can\'t be purchased.')}}function clearList(){var a=document.getElementById("list").getElementsByTagName("tr");if(plotInfoLock){clearMoreInfo()}for(var b=a.length-1;b>=0;b--){tds=a[b].getElementsByTagName("td");if(tds.length>0){if(tds[0].innerHTML!="Mine"&&tds[0].innerHTML!="Unpaid"){unselectPlot(a[b].id)}}}}function joinFree(b){if(b.elements[1].style.backgroundColor=="lightgreen"&&b.elements[1].value!=""){if(b.elements[3].value!=""){if(b.elements[3].value==b.elements[4].value){var a="new_e="+b.elements[1].value+"&new_p="+b.elements[3].value+"&new_p_2="+b.elements[4].value;xmlHttp3=createXmlHttpRequest();readXmlFile("joinFree",a)}else{alert("The passwords you have entered do not match.")}}else{alert("Please enter a password.")}}else{alert("Please enter a valid email address.")}}function tellAFriend(a){var b="yn="+a.elements[1].value;b=b+"&ye="+a.elements[2].value;b=b+"&fn="+a.elements[4].value;b=b+"&fe="+a.elements[5].value;b=b+"&m="+a.elements[6].value;xmlHttp3=createXmlHttpRequest();readXmlFile("tellAFriend",b)}function submitEditOwnerDetails(){if((document.form_plot.plot_picture.value)&&((document.form_plot.plot_picture.value.toLowerCase().indexOf(".jpg")==-1)&&(document.form_plot.plot_picture.value.toLowerCase().indexOf(".jpeg")==-1)&&(document.form_plot.plot_picture.value.toLowerCase().indexOf(".gif")==-1)&&(document.form_plot.plot_picture.value.toLowerCase().indexOf(".png")==-1))){alert("bbb");alert("Please upload only GIF, JPG, JPEG and PNG files.");return false}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.icon_image.value=document.getElementById("iconImage").className;document.form_plot.submit()}function checkInput(b,a,c){if(a=="email"){if(b.search(/^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)<=-1){document.getElementById(c).style.backgroundColor="yellow"}else{xmlHttp3=createXmlHttpRequest();readXmlFile("inputChecker","v="+b+"&t="+a+"&id="+c)}}else{xmlHttp3=createXmlHttpRequest();readXmlFile("inputChecker","v="+b+"&t="+a+"&id="+c)}}function joinFreeResponse(){if(xmlHttp3.responseText=="password"){alert("The passwords you entered do not match.")}else{if(xmlHttp3.responseText=="email"){alert("The email you entered is already taken.")}else{var a=confirm("You are now a member, your login details have been sent to the email address provided. Update your Profile?");if(a==true){window.location=website_url+"/index.php?task=showMyProfile"}else{window.location=website_url+"/index.php"}}}}function tellAFriendResponse(){alert(xmlHttp3.responseText)}function inputCheckerResponse(){var a=xmlHttp3.responseText;a=a.split("-");if(a[1]=="1"){document.getElementById(a[0]).style.backgroundColor="lightgreen"}else{document.getElementById(a[0]).style.backgroundColor="yellow"}}function checkMyProfileForm(b,a){if(b.email.value.search(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)<=-1){alert("Please fill in your e-mail address.");b.email.focus();return false}if((!b.name.value)||(b.name.value.match(/^\s+$/))){alert("Please fill in your name.");b.name.focus();return false}if(a){if((!b.password.value)||(b.password.value.match(/^\s+$/))){alert("Please fill in your preferred password.");b.password.focus();return false}}}function toUpper(d){var c=d.value.split(/\s+/g);for(i=0;i<c.length;i++){var e=c[i].substring(0,1).toUpperCase();var b=c[i].substring(1,c[i].length).toLowerCase();c[i]=e+b}d.value=c.join(" ")}function updateVisitSquareForm(b,a){if(b){document.getElementById("visitSquareId").value=b;if(a){document.getElementById("visitSquareUserEmail").value=a}}else{document.getElementById("visitSquareUserEmail").value="";document.getElementById("visitSquareEmails").value="";document.getElementById("visitSquareUserMessage").value="";document.getElementById("visitSquareId").value=""}}function visitSquareAddNewEmail(){var h=document.getElementById("visitSquareAddEmail");var e=h.value;e=e.replace(", ",",");e=e.replace(" ",",");var f=e.split(",");for(var c=0;c<f.length;c++){if(f[c].search(/^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)<=-1){h.style.backgroundColor="yellow";h.focus();alert("Please ensure all email addresses are valid")}else{var k=false;var a=document.getElementById("visitSquareEmails");var d=a.value;if(d!=""){var g=d.split(",");for(var b=0;b<g.length;b++){if(g[c]==f[c]){k=true}}if(!k){h.style.backgroundColor="";h.value="";g.push(f[c]);d=g.join(",");a.value=d}}else{h.style.backgroundColor="";h.value="";a.value=f[c]}}}}function visitSquareSubmit(){var b=document.getElementById("visitSquareUserEmail");var c=b.value;var f=document.getElementById("visitSquareEmails");var h=f.value;var d=true;if(c.search(/^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)<=-1){b.style.backgroundColor="yellow";b.focus();alert("Please enter a valid email address for yourself");d=false}else{b.style.backgroundColor=""}if(d){if(h==""){f.style.backgroundColor="yellow";f.focus();alert("Please enter at least one recipient email address");d=false}else{f.style.backgroundColor=""}if(d){var a=document.getElementById("visitSquareUserMessage").value;var g=document.getElementById("visitSquareId").value;var e="ye="+c;e=e+"&re="+h;e=e+"&id="+g;if(a!=""){e=e+"&ym="+a}xmlHttp3=createXmlHttpRequest();readXmlFile("visitSquare",e)}}}function visitSquareClose(){updateVisitSquareForm(false);tabClick("home")}function visitSquareResponse(){visitSquareClose();alert("Email(s) sent, thanks for spreading the word!")}function buyBoxClicked(a){}function clearPlotInfo(b){var a=document.getElementById("plotInfo").getElementsByTagName("div");for(var c=0;c<a.length;c++){a[c].style.display="none"}tabClick("home")}function plotInfo(e,l,f,h,c,g){var b=e.split("_");var j="plot";var k="list";if(!plotInfoLock){overSponsoredPlot=h;if(overSponsoredPlot){if(g){xmlHttp2=createXmlHttpRequest();var a="id="+b[1]+"&type=sponsored&d="+new Date().getTime();readXmlFile("plotInfoHlRow",a)}else{xmlHttp2=createXmlHttpRequest();var a="id="+b[1]+"&type=sponsored&d="+new Date().getTime();readXmlFile("plotInfo",a)}}else{if(b[3]=="Stands"){displayInfo("seat");document.getElementById("grabThisSquareText").innerHTML="<b>You have clicked on a seat.</b><br /><br />Please note that seats are not for sale, but by visiting different seats you can compare the view from different parts of the stadium."}else{if(g){xmlHttp2=createXmlHttpRequest();var a="id="+b[1]+"&type=famous&d="+new Date().getTime();readXmlFile("plotInfoHlRow",a)}else{xmlHttp2=createXmlHttpRequest();var a="id="+b[1]+"&type=famous&d="+new Date().getTime();readXmlFile("plotInfo",a)}}}if(l){listSearch(e)}else{if(!f){updateSearchedPlot(true,e);for(var d=1;d<b.length;d++){j=j+"_"+b[d];k=k+"_"+b[d]}searchedPlot=j;hlRow=k}}}else{updateSearchedPlot(true,e);for(var d=1;d<b.length;d++){j=j+"_"+b[d]}searchedPlot=j}}function setPlotHighlight(e,a){var c=e.split("_");var d=document.getElementById("plot_"+c[1]+"_"+c[2]+"_"+c[3]+"_"+c[4]);if(d){var b=d.className.split(" ");if(a){if(b[1]=="onList"){d.className=b[0]+" searchedOnList"}else{if(b[1]=="sponsoredOnList"){d.className=b[0]+" searchedSponsoredOnList"}else{if(b[1]=="userPlot"){d.className=b[0]+" searchedUserPlot"}else{if(b[1]=="corpOnList"){d.className=b[0]+" searchedCorpOnList"}else{if(b[1]=="famousSquareOnList"){d.className=b[0]+" searchedFamousSquareOnList"}else{if(b[1]=="famousSquareCorpOnList"){d.className=b[0]+" searchedFamousSquareCorpOnList"}}}}}}return true}else{if(b[1]=="searchedOnList"){d.className=b[0]+" onList"}else{if(b[1]=="searchedSponsoredOnList"){d.className=b[0]+" sponsoredOnList"}else{if(b[1]=="searchedUserPlot"){d.className=b[0]+" userPlot"}else{if(b[1]=="searchedCorpOnList"){d.className=b[0]+" corpOnList"}else{if(b[1]==" searchedFamousSquareOnList"){d.className=b[0]+" famousSquareOnList"}else{if(b[1]==" searchedFamousSquareCorpOnList"){d.className=b[0]+" famousSquareCorpOnList"}}}}}}return true}}else{return false}}function setRowHighlight(a,c,b){if(a&&!plotInfoLock){var f=false;var l=a.split("_");if(l[0]=="plot"){f=true}l.splice(0,1,"list");a=l.join("_");if(document.getElementById(a)){var m=document.getElementById(a);var k=m.getElementsByTagName("td");var h;if(c){if(f){if(hlRow&&(hlRow!=a)){setRowHighlight(hlRow,false)}for(var e=1;e<=4;e++){h=k[e].className;h=h.split(" ");for(var d=0;d<h.length;d++){if(h[d]=="columnHL"){h.splice(d,1,"lockedColumnHL");k[e].className=h.join(" ");break}}}m.parentNode.insertBefore(m,m.parentNode.getElementsByTagName("tr")[0]);document.getElementById("listTableContainer").scrollTop=0;hlRow=a}else{if(hlRow&&(hlRow!=a)){setRowHighlight(hlRow,false)}for(var e=1;e<=4;e++){h=k[e].className;h=h.split(" ");for(var d=0;d<h.length;d++){if(h[d]=="columnHL"){h.splice(d,1,"lockedColumnHL");k[e].className=h.join(" ");break}}}hlRow=a}}else{for(var e=1;e<=4;e++){h=k[e].className;h=h.split(" ");for(var d=0;d<h.length;d++){if(h[d]=="lockedColumnHL"){h.splice(d,1,"columnHL");k[e].className=h.join(" ");break}}}var g=k[2].getElementsByTagName("a")[0];if(g.className=="return"){g.className="moreInfo";g.innerHTML="see more";if(document.getElementById("imageViewerContainer").style.display=="none"){clearMoreInfo(true)}}if(searchedPlot){setPlotHighlight(searchedPlot,false)}else{setPlotHighlight(hlRow,false)}if(!b){clearPlotInfo()}hlRow=null;searchedPlot=null}}}}function setTopRowHighlight(b){var a=document.getElementById("list").getElementsByTagName("tr")[0];if(a.className=="listHeader"){a=document.getElementById("list").getElementsByTagName("tr")[1]}var f=a.id;var e=f.split("_");var c=a.getElementsByTagName("td")[1];var d=c.className;d=d.split(" ");setRowHighlight(f,true);updateSearchedPlot(true,f);if(d[d.length-1]=="unsponsored"||d[d.length-1]=="corp"){setPEVImage(f)}else{if(d[d.length-1]=="famousSquareCorp"||d[d.length-1]=="famousSquare"){setPEVImage(false);plotInfo(f)}else{setPEVImage(false);plotInfo(f,false,false,true)}}}function setPEVImage(f,e){var c=document.getElementById("playerEyeViewContainer");var h=c.getElementsByTagName("img");var g=c.getElementsByTagName("p");if(f){f=f.split("_");var d=null;var b=null;if(!e){d=f[2];if(f[5]!="url"&&f[5]){b=f[5]}else{if(f[5]=="url"&&f[6]){b=f[6]}}}else{d=f[1]}if(d&&!b){g[0].style.display="none";if(!document.getElementById("pev_thumb_"+d)){var a=h[0];a.id="pev_thumb_"+d;if(treasure_hunt_finished_notification){a.src="/images/treasure_hunt/finished.jpg"}else{a.src="/images/sub_regions/pev/"+d+".jpg"}}c.style.display="block";if(document.getElementById("imageViewer").dimensions.zoomLevel>=(maxZoom-1)){if(document.getElementById("listTableContainer").getElementsByTagName("td").length==0){document.getElementById("listHelpContainer").style.display="block"}else{document.getElementById("listHelpContainer").style.display="none"}}}else{if(d&&b){if(!document.getElementById("pev_thumb_"+d)){var a=h[0];a.id="pev_thumb_"+d;if(treasure_hunt_finished_notification){a.src="/images/treasure_hunt/finished.jpg";g[0].style.display="none"}else{a.src="/images/treasure_hunt/"+d+".jpg";g[0].style.display="block"}}c.style.display="block";if(document.getElementById("imageViewer").dimensions.zoomLevel>=(maxZoom-1)){if(document.getElementById("listTableContainer").getElementsByTagName("td").length==0){document.getElementById("listHelpContainer").style.display="block"}else{document.getElementById("listHelpContainer").style.display="none"}}}}}else{g[0].style.display="none";h[0].id="";h[0].setAttribute("src","/images/transparentpixel.gif");c.style.display="none";document.getElementById("listHelpContainer").style.display="none"}}function listSearch(f){if(!editingPlotLock){setRowHighlight(f,true);var c=f.split("_");var j="plot";for(var e=1;e<c.length;e++){j=j+"_"+c[e]}if(!updateSearchedPlot(true,j)){toggleAutoZoom();var d=document.getElementById("imageViewer");xmlHttp=createXmlHttpRequest();var b="q="+c[1]+"&l="+d.dimensions.zoomLevel+"&s="+d.dimensions.iv.size+"&c="+d.switches.showSeats+"&d="+ +new Date().getTime();readXmlFile("createPlots",b)}else{var a=document.getElementById(f).getElementsByTagName("td")[1];var g=a.className;var h=g.split(" ");if(h[1]=="unsponsored"||h[1]=="corp"){setPEVImage(f)}else{if(h[1]=="sponsored"){plotInfo(f,false,false,true)}else{if(h[1]=="famousSquareCorp"||h[1]=="famousSquare"){plotInfo(f)}}}}}else{alert("You are in edit mode. Please cancel or save to use this function")}}function editMyPlot(a,b){saveViewerPosition();if(!b){a=a.split("_");a=a[1]}window.location="/index.php?edit_plot="+a}function sponsorURL(a){window.open("/sponsor_site_redirect.php?id="+a)}function moreInfo(a){if(!editingPlotLock){if(a.className=="moreInfo"){listId=a.parentNode.parentNode.id;plotInfoLockSwitch(false);if(hlRow){setRowHighlight(hlRow,false)}setRowHighlight(listId,true);a.className="return";a.innerHTML="return";listId=listId.split("_");xmlHttp2=createXmlHttpRequest();var b="id="+listId[1];readXmlFile("moreInfo",b)}else{clearMoreInfo()}}else{alert("You are in edit mode. Please cancel or save to use this function")}}function clearMoreInfo(b,a){if(!b){plotInfoLockSwitch(false);if(hlRow){setRowHighlight(hlRow,false)}}document.getElementById("moreInfoText").style.display="none";document.getElementById("imageViewer").style.display="inline";document.getElementById("moreInfoImageContainer").style.display="none"}function updateSearchedPlot(a,b){if(searchedPlot){setPlotHighlight(searchedPlot,false)}if(a){if(setPlotHighlight(b,true)){searchedPlot=b;return true}else{return false}}}function changeIcon(e,f,b){var c=document.getElementById("iconImage");var a=c.className;var d=a.split("_");if(e=="next"){if(parseInt(d[1],10)==numberDefaultIcons){if(b==1){d[1]="0"}else{d[1]="1"}}else{d[1]=parseInt(d[1],10)+1}}else{if(parseInt(d[1],10)==0){d[1]=numberDefaultIcons}else{if(b!=1&&parseInt(d[1],10)==1){d[1]=numberDefaultIcons}else{d[1]=parseInt(d[1],10)-1}}}a=d.join("_");c.className=a;if(d[1]==0){if(b==1){c.src="/images/user/user_icons/"+f+".jpg"}}else{c.src="/images/user/default_icons/"+d[1]+".png"}}function displayInfo(d,e){var a=document.getElementById("plotInfo").getElementsByTagName("div");if(d=="owner-edit"){if(!e){tabClick("home")}plotInfoLockSwitch(true);editingPlotSwitch(true);a[0].style.display="none";for(var c=1;c<a.length;c++){a[c].style.display="block"}a[2].style.visibility="visible"}else{if(d=="unsponsored"){if(!e){tabClick("home")}for(var c=0;c<a.length;c++){a[c].style.display="none"}a[3].style.visibility="hidden"}else{if(d=="seat"){if(!e){tabClick("home")}for(var c=0;c<a.length;c++){a[c].style.display="none"}a[3].style.visibility="hidden"}else{if(d=="corp"){if(!e){tabClick("home")}for(var c=0;c<a.length;c++){a[c].style.display="none"}a[3].style.visibility="hidden"}else{if(d=="moreinfo"){if(!e){tabClick("home")}document.getElementById("plotInfo").style.display="block";setPEVImage(false);plotInfoLockSwitch(true);for(var c=1;c<a.length;c++){a[c].style.display="none"}a[3].style.visibility="hidden";a[0].style.display="block";var b=a[0].getElementsByTagName("span");b[0].style.display="none";b[1].style.display="none";b[2].style.display="block"}else{if(d=="famous-square"){if(!e){tabClick("home",true)}a[0].style.display="none";for(var c=1;c<a.length;c++){a[c].style.display="block"}a[3].style.visibility="visible"}else{if(!e){tabClick("home",true)}a[0].style.display="none";for(var c=1;c<a.length;c++){a[c].style.display="block"}a[3].style.visibility="visible"}}}}}}}function plotInfoResponse(){var c=findXmlRoot(xmlHttp2);var l=c.getElementsByTagName("icon");var h=c.getElementsByTagName("text");var k=c.getElementsByTagName("type");var a=c.getElementsByTagName("id");var g;var j;var e;if(h.item(0).firstChild){g=h.item(0).firstChild.data}if(a.item(0).firstChild){id=a.item(0).firstChild.data}if(k.item(0).firstChild){e=k.item(0).firstChild.data}if(e){if(e=="unsponsored"){if(g){g=g.replace(/\n/g,"<br />");document.getElementById("grabThisSquareText").innerHTML=g}displayInfo("unsponsored")}else{if(e=="famous"){var d=c.getElementsByTagName("defaultImage");defaultImage=d.item(0).firstChild.data;var f=document.getElementById("ownerMessageContainer");if(parseInt(defaultImage)==0){f.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/famous_squares/pictures/"+id+".png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};f.insertBefore(b,f.firstChild)}else{if(parseInt(defaultImage)==1){f.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/famous_squares/pictures/default/goal.png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};f.insertBefore(b,f.firstChild)}else{f.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/famous_squares/pictures/default/question-mark.png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};f.insertBefore(b,f.firstChild)}}if(g){g=g.replace(/\n/g,"<br />");document.getElementById("ownerMessage").innerHTML=g}displayInfo("famous-square")}else{if(e=="sponsored"){var f=document.getElementById("ownerMessageContainer");if(l.item(0).firstChild){j=l.item(0).firstChild.data;if(j==0){f.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/scripts/php/timthumb.php?src=/images/user/pictures/"+id+".jpg&w=99&zc=0";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};f.insertBefore(b,f.firstChild)}else{f.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/user/default_icons/"+j+".png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};f.insertBefore(b,f.firstChild)}}else{f.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/scripts/php/timthumb.php?src=/images/user/pictures/"+id+".jpg&w=99&zc=0";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};f.insertBefore(b,f.firstChild)}if(g){g=g.replace(/\n/g,"<br />");document.getElementById("ownerMessage").innerHTML=g}else{document.getElementById("ownerMessage").innerHTML="Owner has not yet uploaded any text."}displayInfo("sponsored")}}}}}function plotInfoHlRowResponse(){var c=findXmlRoot(xmlHttp2);var k=c.getElementsByTagName("icon");var h=c.getElementsByTagName("text");var j=c.getElementsByTagName("type");var a=c.getElementsByTagName("id");var g;var e;if(h.item(0).firstChild){g=h.item(0).firstChild.data}if(a.item(0).firstChild){id=a.item(0).firstChild.data}if(j.item(0).firstChild){e=j.item(0).firstChild.data}if(e){if(e=="unsponsored"){if(g){g=g.replace(/\n/g,"<br />");document.getElementById("grabThisSquareText").innerHTML=g}displayInfo("unsponsored",true)}else{if(e=="famous"){var d=c.getElementsByTagName("defaultImage");defaultImage=d.item(0).firstChild.data;if(parseInt(defaultImage)==0){parent.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/famous_squares/pictures/"+id+".png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};parent.insertBefore(b,parent.firstChild)}else{if(parseInt(defaultImage)==1){parent.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/famous_squares/pictures/default/goal.png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};parent.insertBefore(b,parent.firstChild)}else{parent.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/famous_squares/pictures/default/question-mark.png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};parent.insertBefore(b,parent.firstChild)}}if(g){g=g.replace(/\n/g,"<br />");document.getElementById("ownerMessage").innerHTML=g}displayInfo("famous-square",true)}else{if(e=="sponsored"){if(k.item(0).firstChild){var f=k.item(0).firstChild.data;if(f==0){parent.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/scripts/php/timthumb.php?src=/images/user/pictures/"+id+".jpg&w=99&zc=0";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};parent.insertBefore(b,parent.firstChild)}else{parent.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/images/user/default_icons/"+f+".png";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};parent.insertBefore(b,parent.firstChild)}}else{parent.removeChild(document.getElementById("ownerImage"));var b=document.createElement("img");b.className="thumb";b.id="ownerImage";b.alt="Sponsorer Picture";b.src="/scripts/php/timthumb.php?src=/images/user/pictures/"+id+".jpg&w=99&zc=0";b.onError=function(){this.src="/scripts/php/timthumb.php?src=/images/no-image.jpg&w=99&zc=0"};parent.insertBefore(b,parent.firstChild)}if(g){g=g.replace(/\n/g,"<br />");document.getElementById("ownerMessage").innerHTML=g}else{document.getElementById("ownerMessage").innerHTML="Owner has not yet uploaded any text."}displayInfo("sponsored",true)}}}}}function moreInfoResponse(){var e=findXmlRoot(xmlHttp2);var a=e.getElementsByTagName("id");var b=e.getElementsByTagName("name");var c=e.getElementsByTagName("text");if(a.item(0).firstChild){document.getElementById("imageViewer").style.display="none";document.getElementById("moreInfoImageContainer").style.display="block";document.getElementById("moreInfoImage").src="/images/sub_regions/lowres/"+a.item(0).firstChild.data+".jpg"}if(b.item(0).firstChild){var d=b.item(0).firstChild.data;if(c.item(0).firstChild){d="<b>"+d+"</b><br /><br />"+c.item(0).firstChild.data}d=d+'<br /><br /><a href="#" onclick="clearMoreInfo(); return false;"><img src="/images/v2/return.png" /></a>';document.getElementById("moreInfoText").innerHTML=d;displayInfo("moreinfo")}}function plotInfoLockSwitch(a){plotInfoLock=a}function editingPlotSwitch(a){editingPlotLock=a}function initPanels(a,b){current_celeb=a;current_famous_square=b}function nextPanels(){xmlHttp3=createXmlHttpRequest();var a="c_id="+current_celeb+"&fs_id="+current_famous_square+"&d="+new Date().getTime();readXmlFile("nextPanels",a)}function nextPanelsResponse(){var d=findXmlRoot(xmlHttp3);var f=d.getElementsByTagName("c_id");var g=d.getElementsByTagName("c_name");var j=d.getElementsByTagName("fs_id");var l=d.getElementsByTagName("fs_title");var k=d.getElementsByTagName("fs_di");var e=f.item(0).firstChild.data;var b=g.item(0).firstChild.data;var a=j.item(0).firstChild.data;var h=l.item(0).firstChild.data;var c=k.item(0).firstChild.data;document.getElementById("celeb").onclick=function(){findPlot(e);return false};document.getElementById("celebName").innerHTML=b;document.getElementById("celebPic").src="/scripts/php/timthumb.php?src=/images/user/pictures/"+e+".jpg&h=85&zc=0;";document.getElementById("celebPic").title=b;document.getElementById("famousSquare").onclick=function(){findPlot(a);return false};document.getElementById("famousSquareTitle").innerHTML=h;if(c==0){document.getElementById("famousSquarePic").src="/images/famous_squares/panels/"+a+".png"}else{if(c==1){document.getElementById("famousSquarePic").src="/images/famous_squares/panels/default/goal.png"}else{if(c==2){document.getElementById("famousSquarePic").src="/images/famous_squares/panels/default/question-mark.png"}}}document.getElementById("famousSquarePic").title=h;current_celeb=e;current_famous_square=a}function selectPlot(f,s){if(!editingPlotLock){var l=true;var t=f.id;var p=t.split("_");p.splice(0,1,"list");var b=p.join("_");if(document.getElementById(hlRow)){if(hlRow==b){l=false}else{plotInfoLockSwitch(false);setRowHighlight(hlRow,false)}}else{hlRow=null}if(l){var j=f.className;var n;j=j.split(" ");var z=false;var r=false;var w=false;var q=false;var v=false;if(seatCodeLookupTable.indexOf(j[0],1)!=-1||seatCodeLookupTable2.indexOf(j[0],1)!=-1){if((j[0]=="seat18")||(j[0]=="seat18_2")){v=true}else{q=true}}if(j[1]=="offList"){if(s){f.className=j[0]+" searchedOnList";searchedPlot=t}else{f.className=j[0]+" onList"}listClassName=" unsponsored"}else{if(j[1]=="famousSquareOffList"){if(s){f.className=j[0]+" searchedFamousSquareOnList";searchedPlot=t}else{f.className=j[0]+" famousSquareOnList"}listClassName=" famousSquare";w=true}else{if(j[1]=="famousSquareCorpOffList"){if(s){f.className=j[0]+" searchedFamousSquareCorpOnList";searchedPlot=t}else{f.className=j[0]+" famousSquareCorpOnList"}listClassName=" famousSquareCorp";w=true;r=true}else{if(j[1]=="corpOffList"){if(s){f.className=j[0]+" searchedCorpOnList";searchedPlot=t}else{f.className=j[0]+" corpOnList"}listClassName=" corp";r=true}else{if(j[1]=="sponsoredOffList"){if(s){f.className=j[0]+" searchedSponsoredOnList";searchedPlot=t}else{f.className=j[0]+" sponsoredOnList"}listClassName=" sponsored";z=true}}}}}var y=document.getElementById("list");var x=y.parentNode.parentNode.parentNode.parentNode;var H=p[1];var d=p[3];var u=p[4];var c=document.createElement("tr");var o=document.createElement("td");var m=document.createElement("td");var k=document.createElement("td");var h=document.createElement("td");var g=document.createElement("td");var e=document.createElement("td");var E=document.createElement("a");var I=document.createElement("a");var G=document.createElement("a");var D=document.createElement("a");var B=document.createElement("a");var J=document.createElement("img");var F=document.createElement("img");var C=document.createElement("img");if(z){B.href="#";B.onclick=function(){tabClick("visitsquare");updateVisitSquareForm(H);return false};B.className="invite";B.appendChild(document.createTextNode("Invite"));o.appendChild(B);h.appendChild(document.createTextNode("Owned"))}else{if(r){o.appendChild(document.createTextNode("Reserved"))}else{if(q||v){}else{var A=document.createElement("input");A.setAttribute("type","checkbox");A.setAttribute("name","plot_id[]");A.setAttribute("value",H);A.onclick=function(){buyBoxClicked(this)};o.appendChild(A)}}}E.className="jump";E.href="#";E.onclick=function(){listSearch(this.parentNode.parentNode.id);return false};J.className="jump";J.src="/images/v1/go-to.png";E.appendChild(J);I.className="remove";I.href="#";I.onclick=function(){unselectPlot(this.parentNode.parentNode.id);return false};F.src="/images/v1/cross.png";F.title="remove";I.appendChild(F);G.className="moreInfo";G.href="#";G.onclick=function(){moreInfo(this);return false};G.appendChild(document.createTextNode("see more"));if(p[5]=="url"){D.className="url";D.href="#";D.onclick=function(){sponsorURL(this.parentNode.parentNode.id);return false};C.src="/images/v2/internet.gif";C.title="visit sponsor website";D.appendChild(C)}tabClick("home");m.className="lockedColumnHL"+listClassName;k.className="lockedColumnHL"+listClassName;h.className="currency lockedColumnHL"+listClassName;g.className="lockedColumnHL"+listClassName;c.id=hlRow=b;if(q){m.appendChild(document.createTextNode("Seat"))}else{if(v){m.appendChild(document.createTextNode("Tunnel"))}else{m.appendChild(document.createTextNode(appendZeroes(H)))}}k.appendChild(G);g.appendChild(E);if(p[5]=="url"){e.appendChild(D)}e.appendChild(I);c.appendChild(o);c.appendChild(m);c.appendChild(k);c.appendChild(h);c.appendChild(g);c.appendChild(e);y.insertBefore(c,y.getElementsByTagName("tr")[0]);if(!q&&!v&&!z){h.innerHTML="&pound;"+parseFloat(u).toFixed(2)}updateBasketListCookie(H,"add");if(z){linkCount(H);plotInfo(b,false,false,true)}else{if(w){plotInfo(b)}else{clearPlotInfo();setPEVImage(b)}}document.getElementById("listTableContainer").scrollTop=0}}else{alert("You are in edit mode. Please cancel or save to use this function")}}function unselectPlot(f){var d=f.split("_");var c;var e;if(d[0]=="plot"){d.splice(0,1,"list");c=d.join("_");e=f}else{d.splice(0,1,"plot");var e=d.join("_");c=f}if(document.getElementById(e)){var a=document.getElementById(e);if(a){var b=a.className.split(" ");if(b[1]=="onList"||b[1]=="searchedOnList"){a.className=b[0]+" offList"}else{if(b[1]=="corpOnList"||b[1]=="searchedCorpOnList"){a.className=b[0]+" corpOffList"}else{if(b[1]=="famousSquareOnList"||b[1]=="searchedFamousSquareOnList"){a.className=b[0]+" famousSquareOffList"}else{if(b[1]=="famousSquareCorpOnList"||b[1]=="searchedFamousSquareCorpOnList"){a.className=b[0]+" famousSquareCorpOffList"}else{a.className=b[0]+" sponsoredOffList"}}}}}}document.getElementById("list").removeChild(document.getElementById(c));if(c==hlRow){hlRow=null}updateBasketListCookie(d[1],"del");if(!plotInfoLock){tabClick("home")}}function findPlot(c,b){if(!isNaN(c)&&c!=""){while(c.indexOf("0")===0){c=c.substr(1)}c=Number(c);if(c>=1){if(!b){toggleAutoZoom()}var a=document.getElementById("imageViewer");xmlHttp=createXmlHttpRequest();var d="q="+c+"&l="+a.dimensions.zoomLevel+"&s="+a.dimensions.iv.size+"&c="+a.switches.showSeats+"&d="+new Date().getTime();if(b){d=d+"&m="+1}readXmlFile("createPlots",d)}else{alert("Please enter a square number between 1 and 9163")}}else{alert("Please enter a square number that you want to go to (between 1 and 9163)")}}function createPlots(a,b){if(!a){a=document.getElementById("imageViewer")}var c=a.switches;if((c.plotLevel||c.plotLevel2||c.plotViewLevel)&&!b){var d=a.dimensions;xmlHttp=createXmlHttpRequest();var e="x="+d.bi.x+"&y="+d.bi.y+"&l="+d.zoomLevel+"&s="+d.iv.size+"&c="+a.switches.showSeats+"&d="+new Date().getTime();readXmlFile("createPlots",e)}else{clearInnerHTML(document.getElementById("plots"))}}function createPlotsResponse(){if(xmlHttp.responseText=="not found"){alert("Looks like this square doesn't exist, please try again")}else{if(xmlHttp.responseText=="fail"){clearInnerHTML(document.getElementById("plots"))}else{var p=findXmlRoot(xmlHttp);var N=p.getElementsByTagName("plots")[0];var K=N.getAttribute("x");var J=N.getAttribute("y");var k=N.getAttribute("userId");var L=N.getAttribute("id");var P=N.getAttribute("mzl1");treasure_hunt_finished_notification=N.getAttribute("thfn");var v=p.getElementsByTagName("row");var F=p.getElementsByTagName("col");var b=v.length;var U=false;var l=document.getElementById("imageViewer");var a=l.dimensions;var f=l.switches;if(L){if(P){var w=a.maxZoom-a.zoomLevel-1;if(w>0){zoomImage(l,undefined,w,true)}}else{if(a.zoomLevel<a.maxZoom){var w=a.maxZoom-a.zoomLevel;if(w>0){zoomImage(l,undefined,w,true)}}}a.bi.x=parseInt(K);a.bi.y=parseInt(J);var C={x:a.iv.width/2,y:a.iv.height/2};l.start=C;zoomImage(l,undefined,0,true)}if(f.plotLevel||f.plotLevel2){var M=p.getElementsByTagName("id");var z=document.getElementById("plots");var n=z.cloneNode(false);var D;var t;var u;var B;var X;var Q;var d;var j;var e;var W;var V;var o;var E;var q;var m;var s;var g;var S;var r;var O;var H;var A=false;var c=null;var G=false;var h=null;var I=false;var T=false;for(var R=0;R<b;R++){u=M.item(R).firstChild.data;X=M.item(R).getAttribute("ownerId");Q=M.item(R).getAttribute("celeb");d=M.item(R).getAttribute("url");s=M.item(R).getAttribute("sc");j=M.item(R).getAttribute("icon");e=M.item(R).getAttribute("fs");W=M.item(R).getAttribute("th");V=M.item(R).parentNode.parentNode.parentNode;o=V.getAttribute("name");E=V.getAttribute("price");q=V.getAttribute("corp");m=M.item(R).parentNode.parentNode.getAttribute("id");g=parseInt(F.item(R).firstChild.data,10);D=document.createElement("div");t="position:absolute; left:"+v.item(R).firstChild.data+"px; top:"+g+"px; font-size:14px;";S="list_"+u+"_"+m+"_"+o+"_"+E;if(d){S=S+"_url"}if(document.getElementById(S)){r=true}else{r=false}if(L==u){H=true}else{H=false;A=false;G=false}if(f.pressed){R=b;break;U=true}if(X){o=o.replace(/-/," ");if(X!=k){if(r){if(H){D.className="searchedSponsoredOnList";G=true}else{D.className="sponsoredOnList"}}else{D.className="sponsoredOffList";if(H){A=true}}}else{if(H){D.className="searchedUserPlot";G=true}else{D.className="userPlot"}}if(j){if(j==0){if(f.plotLevel){if(Q){t+=" background-image:url(/images/user/user_icons/"+u+".png);"}else{t+=" background-image:url(/images/user/user_icons/"+u+".jpg);"}}else{if(f.plotLevel2){if(Q){t+=" background-image:url(/scripts/php/timthumb.php?src=/images/user/user_icons/"+u+".png&w=24&zc=0);"}else{t+=" background-image:url(/scripts/php/timthumb.php?src=/images/user/user_icons/"+u+".jpg&w=24&zc=0);"}}}}else{if(f.plotLevel){t+=" background-image:url(/images/user/default_icons/"+j+".png);"}else{if(f.plotLevel2){t+=" background-image:url(/scripts/php/timthumb.php?src=/images/user/default_icons/"+j+".png&w=24&zc=0);"}}}}}else{o=o.replace(/-/," ");if(e){if(e==0){if(f.plotLevel){t+=" background-image:url(/images/famous_squares/icons/"+u+".png);"}else{if(f.plotLevel2){t+=" background-image:url(/scripts/php/timthumb.php?src=/images/famous_squares/icons/"+u+".png&w=24&zc=0);"}}}else{if(e==1){if(f.plotLevel){t+=" background-image:url(/images/famous_squares/icons/default/goal.png);"}else{if(f.plotLevel2){t+=" background-image:url(/scripts/php/timthumb.php?src=/images/famous_squares/icons/default/goal.png&w=24&zc=0);"}}}else{if(e==2){if(f.plotLevel){t+=" background-image:url(/images/famous_squares/icons/default/question-mark.png);"}else{if(f.plotLevel2){t+=" background-image:url(/scripts/php/timthumb.php?src=/images/famous_squares/icons/default/question-mark.png&w=24&zc=0);"}}}}}}if(q==0){if(e){if(r){if(H){D.className="searchedFamousSquareOnList";G=true}else{D.className="famousSquareOnList"}}else{D.className="famousSquareOffList";if(H){A=true}}}else{if(r){if(H){D.className="searchedOnList";G=true}else{D.className="onList"}}else{D.className="offList";if(H){A=true}}}}else{if(e){if(r){if(H){D.className="searchedFamousSquareCorpOnList";G=true}else{D.className="famousSquareCorpOnList"}}else{D.className="famousSquareCorpOffList";if(H){A=true}}}else{if(r){if(H){D.className="searchedCorpOnList";G=true}else{D.className="corpOnList"}}else{D.className="corpOffList";if(H){A=true}}}}}if(f.pressed){R=b;break;U=true}if(f.plotLevel){if(s==0){D.className=seatCodeLookupTable[s]+" "+D.className}else{if(s>0){D.className=seatCodeLookupTable[s]+" "+D.className;if(showSeatNumbers){if((u>100000)&&(u<200000)){D.innerHTML=u.substr(2)}else{if((u>200000)&&(u<300000)){D.innerHTML=u.substr(2,2)+"<br>"+u.substr(4,2)}else{if((u>300000)&&(u<400000)){D.innerHTML=u.substr(2)}else{if((u>400000)&&(u<500000)){D.innerHTML=u.substr(2,2)+"<br>"+u.substr(4,2)}else{D.innerHTML=u}}}}}}}}else{if(f.plotLevel2){if(s==0){D.className=seatCodeLookupTable2[s]+" "+D.className}else{if(s>0){D.className=seatCodeLookupTable2[s]+" "+D.className;if(showSeatNumbers){if((u>100000)&&(u<200000)){D.innerHTML=u.substr(2)}else{if((u>200000)&&(u<300000)){D.innerHTML=u.substr(2,2)+"<br>"+u.substr(4,2)}else{if((u>300000)&&(u<400000)){D.innerHTML=u.substr(2)}else{if((u>400000)&&(u<500000)){D.innerHTML=u.substr(2,2)+"<br>"+u.substr(4,2)}else{D.innerHTML=u}}}}}}}}}D.id="plot_"+u+"_"+m+"_"+o+"_"+E;if(d){D.id=D.id+"_url"}if(W){D.id=D.id+"_"+W}if(A){c=D.id}else{if(G){h=D.id;if(X){I=true}else{if(e){T=true}}}}D.style.cssText=t;D.setAttribute("style",t);n.appendChild(D);if(f.pressed){R=b;break;U=true;alert("cancelled")}}if(!U){if((K==a.bi.x&&J==a.bi.y)||L){z.parentNode.replaceChild(n,z)}else{createPlots(l)}if(c){selectPlot(document.getElementById(c),true)}else{if(h){setRowHighlight(h,true);if(I){plotInfo(h,false,true,true)}else{if(T){plotInfo(h,false,false,false,false,true)}else{setPEVImage(h)}}}else{}}}}else{if(f.plotViewLevel){var z=document.getElementById("plots");var n=z.cloneNode(false);var D;var t;var m;var s;var g;for(var R=0;R<b;R++){m=v.item(R).parentNode.getAttribute("id");s=v.item(R).parentNode.getAttribute("sc");g=parseInt(F.item(R).firstChild.data,10);D=document.createElement("div");t="position:absolute; left:"+v.item(R).firstChild.data+"px; top:"+g+"px; font-size:10px;";if(s==0){D.className=seatCodeLookupTable3[s]}else{if(s>0){D.className=seatCodeLookupTable3[s];if(showSeatNumbers){if((u>100000)&&(u<200000)){D.innerHTML=u.substr(2)}else{if((u>200000)&&(u<300000)){D.innerHTML=u.substr(2,2)+"<br>"+u.substr(4,2)}else{if((u>300000)&&(u<400000)){D.innerHTML=u.substr(2)}else{if((u>400000)&&(u<500000)){D.innerHTML=u.substr(2,2)+"<br>"+u.substr(4,2)}else{D.innerHTML=u}}}}}}}D.id="plotview_"+m;D.style.cssText=t;D.setAttribute("style",t);n.appendChild(D);if(f.pressed){R=b;break;U=true;alert("cancelled")}}if(!U){if(K==a.bi.x&&J==a.bi.y){z.parentNode.replaceChild(n,z)}else{createPlots(l)}}}}}}}function removeSearchedPlot(){var b=document.getElementById("plots");var a=document.getElementsByClassName("searchedOnList",b);if(a.length>0){a[0].className="onList"}else{a=document.getElementsByClassName("searchedOutBasket",links);if(a.length>0){a[0].className="outBasket"}else{a=document.getElementsByClassName("searchedSponsoredInBasket",links);if(a.length>0){a[0].className="sponsoredInBasket"}else{a=document.getElementsByClassName("searchedSponsored",links);if(a.length>0){a[0].className="sponsored"}else{a=document.getElementsByClassName("searchedUserPlot",links);if(a.length>0){a[0].className="userPlot"}else{a=document.getElementsByClassName("searchedForSale",links);if(a.length>0){a[0].className="forSale"}else{a=document.getElementsByClassName("searchedForSaleInBasket",links);if(a.length>0){a[0].className="forSaleInBasket"}}}}}}}}function gridToggle(b){var a=document.getElementById("imageViewer");if(a.dimensions.zoomLevel>=(maxZoom-1)){var c=document.getElementById("iconToggle");if(c.name=="showIcons"){if(b.name=="hideGrid"){changeStyle("hideAll");b.name="showGrid";b.src="/images/v1/show-grid-on.png";b.onmouseover=function(){this.src="/images/v1/show-grid-on.png"};b.onmouseout=function(){this.src="/images/v1/show-grid-off.png"}}else{changeStyle("justGrid");b.name="hideGrid";b.src="/images/v1/hide-grid-on.png";b.onmouseover=function(){this.src="/images/v1/hide-grid-on.png"};b.onmouseout=function(){this.src="/images/v1/hide-grid-off.png"}}}else{if(b.name=="hideGrid"){changeStyle("justIcons");b.name="showGrid";b.src="/images/v1/show-grid-on.png";b.onmouseover=function(){this.src="/images/v1/show-grid-on.png"};b.onmouseout=function(){this.src="/images/v1/show-grid-off.png"}}else{changeStyle("showAll");b.name="hideGrid";b.src="/images/v1/hide-grid-on.png";b.onmouseover=function(){this.src="/images/v1/hide-grid-on.png"};b.onmouseout=function(){this.src="/images/v1/hide-grid-off.png"}}}}else{alert("you need to be at 100% zoom for the grid to appear")}}function iconToggle(c){var a=document.getElementById("imageViewer");if(a.dimensions.zoomLevel>=(maxZoom-1)){var b=document.getElementById("gridToggle");if(b.name=="showGrid"){if(c.name=="hideIcons"){changeStyle("hideAll");c.name="showIcons";c.src="/images/v1/show-icons-on.png";c.onmouseover=function(){this.src="/images/v1/show-icons-on.png"};c.onmouseout=function(){this.src="/images/v1/show-icons-off.png"}}else{changeStyle("justIcons");c.name="hideIcons";c.src="/images/v1/hide-icons-on.png";c.onmouseover=function(){this.src="/images/v1/hide-icons-on.png"};c.onmouseout=function(){this.src="/images/v1/hide-icons-off.png"}}}else{if(c.name=="hideIcons"){changeStyle("justGrid");c.name="showIcons";c.src="/images/v1/show-icons-on.png";c.onmouseover=function(){this.src="/images/v1/show-icons-on.png"};c.onmouseout=function(){this.src="/images/v1/show-icons-off.png"}}else{changeStyle("showAll");c.name="hideIcons";c.src="/images/v1/hide-icons-on.png";c.onmouseover=function(){this.src="/images/v1/hide-icons-on.png"};c.onmouseout=function(){this.src="/images/v1/hide-icons-off.png"}}}}else{alert("you need to be at 100% zoom for the owner plots to appear")}}function prepareViewer(u,w,f,e){for(var d=u.firstChild;d;d=d.nextSibling){if(d.className=="surface"){u.activeSurface=d;d.imageViewer=u}else{if(d.className=="tileContainer"){u.tileContainer=d;d.imageViewer=u}}}var l;var s;var q;var j;var a;var b;var p;var m;var k;var o=false;var t=false;var v=false;if(e){s=(getViewportDimensions("width")/2)+app_startX;q=(getViewportDimensions("height")/2)+app_startY;l=app_minZoom-1;j="app";a="true";b="true";p="false";m=getViewportDimensions("width");k=getViewportDimensions("height")}else{if(getCookie("viewer_position")){var r=getCookie("viewer_position");r=r.split(",");s=parseInt(r[0],10);q=parseInt(r[1],10);l=parseInt(r[2],10);j=r[3];a=r[4];b=r[5];p=r[6];if(l==maxZoom){o=true}else{if(l==(maxZoom-1)){t=true}else{if(l==(maxZoom-2)){v=true}}}if(j=="small"){m=smallWidth;k=smallHeight}else{document.getElementById("resizeContainer").className="reduce";document.getElementById("resizeContainer").title="reduce view";m=largeWidth;k=largeHeight;document.getElementById("rightColumn").style.display="none";document.getElementById("leftFooter").style.marginTop="-66px";u.style.width=m+"px";u.style.height=k+"px";u.style.minWidth=m+"px";u.style.minHeight=k+"px";u.style.maxWidth=m+"px";u.style.maxHeight=k+"px";u.parentNode.style.width=m+"px";u.parentNode.style.height=k+"px"}if(a&&b){if(a=="true"){if(b=="false"){document.getElementById("toggleSponsorsContainer").className="showSponsors";document.getElementById("toggleSponsorsContainer").title="show owners";changeStyle("justGrid")}}else{document.getElementById("toggleGridContainer").className="showGrid";document.getElementById("toggleGridContainer").title="show grid";if(b=="true"){changeStyle("justIcons")}else{document.getElementById("toggleSponsorsContainer").className="showSponsors";document.getElementById("toggleSponsorsContainer").title="show owners";changeStyle("hideAll")}}}if(p){if(p=="true"){document.getElementById("toggleSeatsContainer").className="hideSeats";document.getElementById("toggleSeatsContainer").title="hide seats";w="/images/canopy_off"}}pageLevelRefresh(l)}else{s=startX;q=startY;l=minZoom;j="small";a="true";b="true";p="true";m=smallWidth;k=smallHeight}}var h=f*Math.pow(2,l);var g=0;var c=0;for(var n=u;n;n=n.offsetParent){g+=n.offsetTop;c+=n.offsetLeft}u.dimensions={iv:{width:m,height:k,size:j},bi:{x:s,y:q,cx:m/2/h,cy:k/2/h,fullSize:h},tileDir:w,tileSize:f,zoomLevel:l,maxZoom:maxZoom,minZoom:minZoom,startX:startX,startY:startY};u.start={x:0,y:0};u.previous={x:0,y:0};u.switches={pressed:false,plotLevel:o,plotLevel2:t,plotViewLevel:v,showGrid:a,showSponsors:b,showSeats:p};if(document.body.imageViewers==undefined){document.body.imageViewers=[u];document.body.onmouseup=releaseViewer;document.body.onmousemove=moveViewer}else{document.body.imageViewers.push(u)}prepareTiles(u)}function prepareTiles(a){resetTiles(a);a.activeSurface.onmousedown=pressViewer;a.activeSurface.ondblclick=doubleClickZoom;positionTileContainer(a,{x:0,y:0},true);createPlots(a)}function positionTileContainer(C,k,a,h,q){var B=C.tiles;var u=C.dimensions;var b=C.previous;var t=C.getElementsByTagName("div");var f=parseInt(t[0].style.left);var o=parseInt(t[0].style.top);var d=f;var m=o;var w=B[0].length;var y=B.length;var x=0;var v=0;var e;if(!a){if(h||q){if(h){o+=h;C.previous.y+=h}else{f+=q;C.previous.x+=q}k=C.previous}else{f+=(k.x-b.x);o+=(k.y-b.y);C.previous=k}t[0].style.left=f+"px";t[0].style.top=o+"px"}else{C.previous=k}var l=Math.floor(f/u.tileSize);var p=Math.floor(o/u.tileSize);var s=Math.floor(d/u.tileSize);var g=Math.floor(m/u.tileSize);if(l!=s){if(l>s){e=l-s;for(v=0;v<e;v++){for(var n=0;n<w;n+=1){var D=B[B.length-1][n];D.x_tc-=u.tileSize*y;D.c_bi-=y;setTileImage(D,false);D.img.style.left=D.x_tc+"px"}var z=B.pop();B.unshift(z)}}else{if(l<s){e=s-l;for(v=0;v<e;v++){for(var n=0;n<w;n+=1){var D=B[0][n];D.x_tc+=u.tileSize*y;D.c_bi+=y;setTileImage(D,false);D.img.style.left=D.x_tc+"px"}var z=B.shift();B.push(z)}}else{}}}if(p!=g){if(p>g){e=p-g;for(v=0;v<e;v++){for(var A=0;A<y;A+=1){var D=B[A][w-1];D.y_tc-=u.tileSize*w;D.r_bi-=w;setTileImage(D,false);D.img.style.top=D.y_tc+"px";var z=B[A].pop();B[A].unshift(z)}}}else{if(p<g){e=g-p;for(v=0;v<e;v++){for(var A=0;A<y;A+=1){var D=B[A][0];D.y_tc+=u.tileSize*w;D.r_bi+=w;setTileImage(D,false);D.img.style.top=D.y_tc+"px";var z=B[A].shift();B[A].push(z)}}}else{}}}}function setTileImage(b,a){var c=b.imageViewer.dimensions;var d=c.tileDir+"/"+c.zoomLevel+"-"+b.c_bi+"-"+b.r_bi+".jpg";if(a){d="/images/none.png"}b.img.src=d;b.img.onerror=function(){tileRetry(this)}}function tileRetry(a){a.onerror=function(){a.src="/images/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 pressViewer(d){if(timer){window.clearTimeout(timer)}var a=this.imageViewer;var c=getEvent(d);if(a.switches.pressed==false){var b=localizeCoordinates(a,{x:c.clientX,y:c.clientY});a.switches.pressed=true;a.tileContainer.style.cursor=a.activeSurface.style.cursor="pointer";a.previous=b;a.start=b}}function moveViewer(g){var b=document.getElementById("imageViewer");var e=b.switches;if(e.pressed==true){var f=getEvent(g);var d=localizeCoordinates(b,{x:f.clientX,y:f.clientY});if(e.plotLevel||e.plotLevel2||e.plotViewLevel){var c=Math.abs(b.start.x-d.x);var a=Math.abs(b.start.y-d.y);if(c>9||a>9){if(timer){window.clearTimeout(timer)}if(document.getElementById("plots").firstChild){clearInnerHTML(document.getElementById("plots"))}positionTileContainer(b,d)}}else{positionTileContainer(b,d)}}}function releaseViewer(g){var f=getEvent(g);var b=document.getElementById("imageViewer");var d=localizeCoordinates(b,{x:f.clientX,y:f.clientY});var h=b.dimensions;var e=b.switches;if(e.pressed){b.activeSurface.onmousemove=null;b.tileContainer.style.cursor=b.activeSurface.style.cursor="pointer";e.pressed=false;if(e.plotLevel||e.plotLevel2||e.plotViewLevel){var c=Math.abs(b.start.x-d.x);var a=Math.abs(b.start.y-d.y);if(c>9||a>9){h.bi.x+=(d.x-b.start.x);h.bi.y+=(d.y-b.start.y);timer=window.setTimeout("createPlots();",750)}else{if(!document.getElementById("plots").firstChild){timer=window.setTimeout("createPlots();",750)}}}else{if(h.zoomLevel<=h.minZoom+1){var c=Math.abs(b.start.x-d.x);var a=Math.abs(b.start.y-d.y);if(c<1||a<1){if(timer5){window.clearTimeout(timer5);timer5=null}else{timer5=window.setTimeout("clickHelp()",350)}}}h.bi.x+=(d.x-b.start.x);h.bi.y+=(d.y-b.start.y)}}}function slideViewer(a,d){if(a.switches.plotLevel||a.switches.plotLevel2||a.switches.plotViewLevel){createPlots(a,true)}var b=192;var c=a.dimensions.bi;switch(d){case"up":positionTileContainer(a,undefined,false,b);c.y+=b;break;case"down":positionTileContainer(a,undefined,false,-b);c.y-=b;break;case"left":positionTileContainer(a,undefined,false,false,b);c.x+=b;break;case"right":positionTileContainer(a,undefined,false,false,-b);c.x-=b;break}if(a.switches.plotLevel||a.switches.plotLevel2||a.switches.plotViewLevel){createPlots(a)}}function resizeViewer(a){var b=a.dimensions;if(b.iv.size=="small"){document.getElementById("rightColumn").style.display="none";document.getElementById("leftFooter").style.marginTop="-66px";a.style.width=largeWidth+"px";a.style.height=largeHeight+"px";a.style.minWidth=largeWidth+"px";a.style.minHeight=largeHeight+"px";a.style.maxWidth=largeWidth+"px";a.style.maxHeight=largeHeight+"px";a.parentNode.style.width=largeWidth+"px";a.parentNode.style.height=largeHeight+"px";b.iv.width=largeWidth;b.iv.height=largeHeight;b.iv.size="large"}else{document.getElementById("rightColumn").style.display="block";document.getElementById("leftFooter").style.marginTop="0px";a.style.width=smallWidth+"px";a.style.height=smallHeight+"px";a.style.minWidth=smallWidth+"px";a.style.minHeight=smallHeight+"px";a.style.maxWidth=smallWidth+"px";a.style.maxHeight=smallHeight+"px";a.parentNode.style.width=smallWidth+"px";a.parentNode.style.height=smallHeight+"px";b.iv.width=smallWidth;b.iv.height=smallHeight;b.iv.size="small"}saveViewerPosition();createPlots(a)}function clickHelp(){alert("Please click on the green + above to zoom into the pitch. Move the pitch by clicking and dragging, zoom in to see the squares.");timer5=null}function doubleClickZoom(c){var a=this.imageViewer;var b=getEvent(c);zoomImageIn(a,localizeCoordinates(a,{x:b.clientX,y:b.clientY}))}function zoomImageIn(a,b){var c=a.dimensions;if(c.zoomLevel<c.maxZoom){if(c.zoomLevel==(minZoom+1)){zoomImage(a,b,2)}else{zoomImage(a,b,1)}}}function zoomImageOut(a,b){var c=a.dimensions;if(c.zoomLevel>=c.minZoom){if(c.zoomLevel==minZoom+3){zoomImage(a,b,-2)}else{zoomImage(a,b,-1)}}}function debugInfo(){document.getElementById("debug").innerHTML=""}function zoomImage(b,c,f,a){var e=b.dimensions;var d=b.switches;e.bi.cx=((e.iv.width/2)-e.bi.x)/e.bi.fullSize;e.bi.cy=((e.iv.height/2)-e.bi.y)/e.bi.fullSize;e.zoomLevel+=f;e.bi.fullSize=e.bi.fullSize*Math.pow(2,f);e.bi.x=-((e.bi.cx*e.bi.fullSize)-(e.iv.width/2));e.bi.y=-((e.bi.cy*e.bi.fullSize)-(e.iv.height/2));resetTiles(b);if(e.zoomLevel==e.maxZoom){d.plotLevel=true;d.plotLevel2=false;d.plotViewLevel=false}else{d.plotLevel=false;if(e.zoomLevel==(e.maxZoom-1)){d.plotLevel2=true;d.plotViewLevel=false}else{d.plotLevel2=false;if(e.zoomLevel==(e.maxZoom-2)){d.plotViewLevel=true}else{d.plotViewLevel=false}}}if(!a){createPlots(b)}pageLevelRefresh(e.zoomLevel)}function resetTiles(b){var j=b.tileContainer;var d=b.dimensions;var k=2;b.tiles=[];j.innerHTML="";if(d.bi.x>0){j.style.left=((d.bi.x%d.tileSize)-d.tileSize)+"px"}else{j.style.left=(d.bi.x%d.tileSize)+"px"}if(d.bi.y>0){j.style.top=((d.bi.y%d.tileSize)-d.tileSize)+"px"}else{j.style.top=(d.bi.y%d.tileSize)+"px"}var l=Math.ceil(d.iv.height/d.tileSize)+(2*k);var h=Math.ceil(d.iv.width/d.tileSize)+(2*k);for(var f=-k;f<h-k;f+=1){var g=[];for(var a=-k;a<l-k;a+=1){var e={c_bi:0,r_bi:0,x_tc:0,y_tc:0,img:document.createElement("img"),imageViewer:b};e.img.className="tile";e.x_tc=(f*d.tileSize);e.c_bi=Math.floor((e.x_tc-d.bi.x)/d.tileSize);e.y_tc=a*d.tileSize;e.r_bi=Math.floor((e.y_tc-d.bi.y)/d.tileSize);e.img.style.top=e.y_tc+"px";e.img.style.left=e.x_tc+"px";setTileImage(e,false);j.appendChild(e.img);g.push(e)}b.tiles.push(g)}};