


var map=new GMap2(document.getElementById("map"));var zoomControll=new GLargeMapControl();var pos=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(5,5));map.addControl(zoomControll,pos);map.addControl(new GMapTypeControl());map.addControl(new GScaleControl());map.setCenter(new GLatLng(cd,cc),ck);var copyright=new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,"© 2008 Hotel Map Search, LLC. Patent Pending");var copyCollection=new GCopyrightCollection('HotelPrices');copyCollection.addCopyright(copyright);var stack=[];var roadsEnabled=false;var roadsVisble=false;var roadsMinZoom=2;var roadsMaxZoom=8;var ev=new GTileLayer(copyCollection,0,25);ev=G_HYBRID_MAP.getTileLayers()[1];var myRoads=new GTileLayerOverlay(ev);function enableRoads(){if(roadsEnabled==false){roadsEnabled==true;var zoomLevel=map.getZoom();if(roadsEnabled==true&&roadsVisble==false&&zoomLevel>=roadsMinZoom&&zoomLevel<=roadsMaxZoom){map.addOverlay(myRoads);roadsVisble=true;}}};function disableRoads(){if(roadsEnabled==false){if(roadsEnabled==true&&roadsVisble==true){if(zoomLevel<roadsMinZoom||zoomLevel>roadsMaxZoom){map.removeOverlay(myRoads);roadsVisble=false;}}roadsEnabled==false;}};GEvent.addListener(map,'zoomend',function(){m();});GEvent.addListener(map,'moveend',function(){bl();});var cb=false;var bw=[];var bn=[];GEvent.addListener(map,'click',ae);var ct=false;var af="";var dO="";var dB="";var cB="";var dp;var StickyNoteText="Enter Text Here";var ba="";GEvent.addListener(map,'infowindowopen',function(){ct=true;});GEvent.addListener(map,'infowindowbeforeclose',function(){ct=false;});function k(num,dec){var result=Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);return result;};function cN(num,dec){var result=Math.floor(num*Math.pow(10,dec))/Math.pow(10,dec);return result;};function cY(num,dec){var result=Math.ceil(num*Math.pow(10,dec))/Math.pow(10,dec);return result;};function bi(point){var marker=new GMarker(point);marker.et=point.x+"_"+point.y;GEvent.addListener(marker,'click',function(){var mPoint=marker.getPoint();var MarkerID=mPoint.x+"_"+mPoint.y;var dO=MarkerID;dB=af;af=MarkerID;var markerIndex=aE(mPoint.x+"_"+mPoint.y,bw);cB=markerIndex;dp=marker;if(markerIndex> -1){var markerHTML='<div id="myBalloon"><a href="javascript:cA(dp);" style="color: red"> <span style="font-size: 12px;"> <strong>Delete</strong> </span> </a><br/><textarea id="infoInput" rows="5" cols="36" wrap=soft onkeyup="cv();" style="width: 200px; height: 100px;">'+bn[markerIndex]+'</textarea></div>';marker.openInfoWindowHtml(markerHTML);}});if(cb){cw();}return marker;};function cA(marker){var mPoint=marker.getPoint();var markerIndex=aE(mPoint.x+"_"+mPoint.y,bw);bw.splice(markerIndex,1);bn.splice(markerIndex,1);map.removeOverlay(marker);};var IE=document.all?true:false;if(!IE)document.captureEvents(Event.MOUSEMOVE);var tempX=0;var tempY=0;function getMouseXY(e){if(IE){tempX=event.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);tempY=event.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);}else{tempX=e.pageX;tempY=e.pageY;}if(tempX<0){tempX=0}if(tempY<0){tempY=0}return true};function cn(){blocking('MarkerInstructions');};function cw(){blocking('MarkerInstructions')};function m(){for(var testi=0;testi<stack.length;testi++){stack[testi].m();}var zoomLevel=map.getZoom();if(roadsEnabled==true&&roadsVisble==false&&zoomLevel>=roadsMinZoom&&zoomLevel<=roadsMaxZoom){map.addOverlay(myRoads);roadsVisble=true;}if(roadsEnabled==true&&roadsVisble==true){if(zoomLevel<roadsMinZoom||zoomLevel>roadsMaxZoom){map.removeOverlay(myRoads);roadsVisble=false;}}};function bl(){for(i=0;i<stack.length;i++){stack[i].aT();}};function ae(overlay,point){if(cb==true){bw.push(point.x+"_"+point.y);bn.push('Enter Text Here');var marker=bi(point);map.addOverlay(marker);cb=false;}else{if(typeof point!="undefined"){for(i=0;i<stack.length;i++){if(stack[i].ae(overlay,point)==true){return;}}}}};function cv(){if(cB> -1){bn[cB]=document.getElementById('infoInput').value;}};function cE(){StickyNoteText=document.getElementById('StickyNote').value;};function aR(str){return str.replace(/\w+/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase();});};var ppLon=[];ppLon.push(0.71111111111111114);ppLon.push(1.4222222222222223);ppLon.push(2.8444444444444446);ppLon.push(5.6888888888888891);ppLon.push(11.377777777777778);ppLon.push(22.755555555555556);ppLon.push(45.511111111111113);ppLon.push(91.022222222222226);ppLon.push(182.04444444444445);ppLon.push(364.0888888888889);ppLon.push(728.17777777777781);ppLon.push(1456.3555555555556);ppLon.push(2912.7111111111112);ppLon.push(5825.4222222222224);ppLon.push(11650.844444444445);ppLon.push(23301.68888888889);ppLon.push(46603.37777777778);ppLon.push(93206.755555555559);ppLon.push(186413.5111111);ppLon.push(372827.0222222);ppLon.push(745654.0444444);function aE(SearchString,cF){var itemCount=cF.length;if(itemCount>0){for(i=0;i<itemCount;i++){if(cF[i]==SearchString){return i;}}}return-1;};function bP(text){text=text.replaceAll("n1n","\n");return text;};function aG(text){text=text.replaceAll(",","");text=text.replaceAll("--","");text=text.replaceAll("|","");text=text.replaceAll("=","");text=text.replaceAll("&","");text=text.replaceAll("/","");text=text.replaceAll("<","");text=text.replaceAll(">","");return text;};function aK(){var center=map.getCenter();var ed=center.lat();var eg=center.lng();var popZ=map.getZoom();var ee="llz="+ed+","+eg+","+popZ;var ea="";if(stack[Hotel].cr.length>0){ea="&f="+stack[Hotel].cr.join(",");}var cI="";if(ct==true&&af==Hotel){ba=ba.replace("|",",");ba=ba.replace("|",",");ba=ba.replace("|",",");cI="&b="+ba;}var ec="&m="+map.getCurrentMapType().getUrlArg();var layersURL="";var activeLayers=[];if(stack[Wiki].Show){activeLayers.push("w");}if(stack[Starbucks].Show){activeLayers.push("s");}if(stack[Airport].Show){activeLayers.push("a");}if(stack[Yelp].Show){activeLayers.push("y");}if(activeLayers.length>0){layersURL="&l="+activeLayers.join(",");}var NoteInfo="";if(document.getElementById('myNote').style.display!=='none'){NoteInfo="&n="+parseInt(document.getElementById("boxHandle").style.left)+","+parseInt(document.getElementById("boxHandle").style.top);var txt=document.getElementById('StickyNote').value;txt=txt.replaceAll("\n","n1n");txt=txt.replaceAll("\r","n1n");txt=txt.replaceAll(" ","_");txt=aG(txt);NoteInfo+=","+txt;}var cj="";var cQ=bn.length;if(cQ>0){cj="&u=";var NoCommaAtStart="";for(i=0;i<cQ;i++){var aF=bn[i];aF=aF.replaceAll("\n","n1n");aF=aF.replaceAll(" ","_");aF=aG(aF);var er=bw[i];cj+=NoCommaAtStart+er+"--"+aF;NoCommaAtStart=",";}}var filterList=[];if(stack[Hotel].filterPriceMin!=""){filterList.push("hpl_"+stack[Hotel].filterPriceMin);}if(stack[Hotel].filterPriceMax!=""){filterList.push("hph_"+stack[Hotel].filterPriceMax);}if(stack[Hotel].filterStarsMin!=""){filterList.push("hsl_"+stack[Hotel].filterStarsMin);}if(stack[Hotel].filterStarsMax!=""){filterList.push("hsh_"+stack[Hotel].filterStarsMax);}if(stack[Hotel].filterName!=""){filterList.push("hn_"+stack[Hotel].filterName);}if(stack[Hotel].filterChain!=""){filterList.push("hc_"+stack[Hotel].filterChain);}if(stack[Hotel].filterPetFriendly!=""){filterList.push("hpf_"+stack[Hotel].filterPetFriendly);}var filterURL="";if(filterList.length>0){filterURL="&q="+filterList.join(",");}var sortList=[];if(stack[Hotel].sortPrimaryName!=""){sortList.push(stack[Hotel].sortPrimaryName);}if(stack[Hotel].sortSecondaryName!=""){sortList.push(stack[Hotel].sortSecondaryName);}var sortURL="";if(sortList.length>0){sortURL="&s="+sortList.join(",");}var cJ="http://www.HotelMapSearch.com/"+MyVersion+"?"+ee+ec+ea+cI+layersURL+NoteInfo+cj+filterURL+sortURL;cJ=cJ.replaceAll("&&","&");cJ=cJ.replaceAll("\\|","%7C");if(cJ.charAt(cJ.length-1)=="&"){cJ=cJ.substring(0,cJ.length-1);}if(cJ.length>2080){alert("Warning too many user added items. Try shortenting your comments or removing markers. The link provided may not work in all browsers.");}return cJ;};String.prototype.replaceAll=function(s1,s2){return this.replace(new RegExp(s1,"g"),s2);};var dU=function(){if(vars.length> -1){var hIndexArray=[];for(var i=0;i<vars.length;i++){vars[i]=vars[i].replaceAll("<","");vars[i]=vars[i].replaceAll(">","");var pair=vars[i].split("=");if(pair[0]=="f"){var bH=pair[1];bH=bH.replaceAll("%7C","|");if(bH!=""){var dy=bH.split(",");stack[Hotel].dP(dy);}}if(pair[0]=="n"){var bH=pair[1];var tl=pair[1].split(",");var bs=parseInt(tl[0]);var bt=parseInt(tl[1]);var txt=tl[2];txt=aG(txt);txt=txt.replaceAll("_"," ");txt=bP(txt);if(document.getElementById('myNote').style.display=='none'){blocking('myNote')};document.getElementById('StickyNote').value=txt;ak('boxHandle',bs,bt);}if(pair[0]=="b"){var bH=pair[1];bH=bH.replaceAll("%7C","|");var tmpidll=pair[1].split(",");var tmpi=tmpidll[0];var tmplon=parseFloat(tmpidll[1]);var tmplat=parseFloat(tmpidll[2]);stack[Hotel].bz(tmpi,tmplon,tmplat);}if(pair[0]=="m"){var cmaptype=pair[1];if(cmaptype=="m"){map.setMapType(G_NORMAL_MAP);}if(cmaptype=="k"){map.setMapType(G_SATELLITE_MAP);}if(cmaptype=="h"){map.setMapType(G_HYBRID_MAP);}}if(pair[0]=="l"){var layers=pair[1].split(",");for(var ii=0;ii<layers.length;ii++){var layer=layers[ii];if(layer=="w"){stack[Wiki].Show=false;stack[Wiki].bm(document.getElementById('WikiWrapper'));}if(layer=="s"){stack[Starbucks].Show=false;stack[Starbucks].bm(document.getElementById('StarbucksWrapper'));}if(layer=="a"){stack[Airport].Show=false;stack[Airport].bm(document.getElementById('AirportWrapper'));}if(layer=="y"){stack[Yelp].Show=false;stack[Yelp].bm(document.getElementById('YelpWrapper'));}}}if(pair[0]=="q"){var filters=pair[1].split(",");for(var ii=0;ii<filters.length;ii++){var tempString=filters[ii];var filter=tempString.split("_");if(filter[0]=="hpl"){stack[Hotel].filterPriceMin=filter[1];document.getElementById('filterPriceMin').value=filter[1];}if(filter[0]=="hph"){stack[Hotel].filterPriceMax=filter[1];document.getElementById('filterPriceMax').value=filter[1];}if(filter[0]=="hn"){stack[Hotel].filterName=filter[1];document.getElementById('filterName').value=filter[1];}if(filter[0]=="hc"){stack[Hotel].filterChain=filter[1];document.getElementById('filterBrand').value=filter[1];}if(filter[0]=="hpf"){stack[Hotel].filterPetFriendly=filter[1];document.getElementById('filterPetFriendly').checked=true;}if(filter[0]=="hsl"){stack[Hotel].filterStarsMin=filter[1];document.getElementById('filterStarsMin').value=filter[1];}if(filter[0]=="hsh"){stack[Hotel].filterStarsMax=filter[1];document.getElementById('filterStarsMax').value=filter[1];}}stack[Hotel].queFilter();}if(pair[0]=="s"){var filters=pair[1].split(",");document.getElementById("sortPrimary").value=filters[0];stack[Hotel].sortChangePrimary(filters[0]);if(filters.length>1){document.getElementById("sortSecondary").value=filters[1];stack[Hotel].sortChangeSecondary(filters[1]);}}if(pair[0]=="u"){var bU=pair[1];bU=bU.split(",");var ii=0;for(ii=0;ii<bU.length;ii++){var ca=bU[ii];ca=ca.split("--");var ll=ca[0];myll=ll.split("_");var lat=parseFloat(myll[1]);var lon=parseFloat(myll[0]);var aF=ca[1];aF=aG(aF);aF=aF.replaceAll("_"," ");aF=bP(aF);var point=new GPoint(lon,lat);bw.push(point.x+"_"+point.y);bn.push(aF);var eq=bi(point);map.addOverlay(eq);}}}}};function blocking(nr){if(document.layers){current=(document.layers[nr].display=='none')?'block':'none';document.layers[nr].display=current;}else if(document.all){current=(document.all[nr].style.display=='none')?'block':'none';document.all[nr].style.display=current;}else if(document.getElementById){vista=(document.getElementById(nr).style.display=='none')?'block':'none';document.getElementById(nr).style.display=vista;}};var el=300;var d=200;function ak(ElementName,bs,bt){document.getElementById(ElementName).style['top']=bt+"px";document.getElementById(ElementName).style['left']=bs+"px";};function insertAfter(parent,newElement,referenceElement){parent.insertBefore(newElement,referenceElement.nextSibling);}//-->
; var dW = '<div style="border: 1px solid black; position: absolute; background-color: rgb(13, 68, 127); display: block; " id="emailcontainer">	   	<div style="margin: 0px 8px 8px; background-color: white; height: 332px; width: 400px;">	   		<div style="">				<form id="emailform">		   			<div style="font-size: medium; font-family: Arial,Helvetica,sans-serif; font-weight: bold; text-decoration: underline; height: 30px;">					Email Map					</div>					<div style="height: 75px;">						<div style="width: 200px; float: left;">							To: <br/>							<input type="text" id="to_email"/><br/>							separate emails with ,						</div>						<div>							From (required): <br/>							<input type="text" id="from_email"/> <br/>							<input type="checkbox" checked="checked" onclick="" id="copyemail"/> Send a copy to my email												</div>					</div>					<!--Subject: <input type=\'text\' id=\'subject\'/><br />-->					<div style="width: 392px; height: 123px; margin-left: auto; margin-right: auto;">						Message: <br/>						<textarea style="width: 378px; height: 88px;" id="body">Hi, I\'d like to show you a map of hotel prices I made!</textarea><br/>					</div>					Link:<br/>					<textarea style="width: 338px;" id="link" readonly="readonly">XXXInsertURL</textarea><br/> 					<br/>					<input type="button" onclick="javascript:EmailFormSubmit();" value="Submit" id="emailbutton"/> 				</form>			</div>	   	</div>    </div>'; var bq = new aa(200, 500, null, null, true, null); bq.SetMainWidth(415); bq.bv(345); bq.SetHandleWidth(410); bq.bo("Email This Map View"); function cq() { var URL = aK(); bq.bp(dW.replace("XXXInsertURL", URL)); bq.SetMainWidth(415); bq.SetHandleWidth(410); bq.bv(350); bq.Show(); }; function EmailSent() { bq.body.innerHTML = "Email Sent Successfully"; }; function EmailFailed() { bq.body.innerHTML = "Email Failed"; }; function EmailFormSubmit() { var to = document.getElementById("to_email").value; var from = document.getElementById("from_email").value; var body = document.getElementById("body").value; var link = document.getElementById("link").value; var copy = document.getElementById("copyemail").checked; link = link.replaceAll("&", "n1n"); j('http://www.hotelmapsearch.com/mmm.php?to=' + to + '&from=' + from + '&link=' + link + '&body=' + body + '&copy=' + copy); }; var dV = '<div style="border: 1px solid black; position: absolute; background-color: rgb(13, 68, 127); z-index: 100;" id="linkcontainer">	   	<div style="margin: 0px 8px 8px; background-color: white; height: 91px; width: 361px;">	   		<div style="width: 340px; margin-left: auto; margin-right: auto;">		   			Copy Link Text and Paste into Email or Document:		   			<textarea style="width: 338px; overflow: hidden;" wrap="soft" id="linkbox" name="linkbox" >XXXInsertURL</textarea><br/> 					<br/>			</div>	   	</div>    </div>'; var by = new aa(300, 400, null, null, true, null); by.SetMainWidth(380); by.SetHandleWidth(368); by.bv(120); by.bo("Copy Link:"); function ShowCopyLinkForm() { var URL = aK(); by.bp(dV.replace("XXXInsertURL", URL)); by.Show(); document.getElementById('linkbox').select(); document.getElementById('linkbox').focus(); }; function SetLegendHeight() { var myWidth = document.body.clientWidth; if (myWidth > 710) { document.getElementById('mytoplegend').style['height'] = 65 + "px"; } else { document.getElementById('mytoplegend').style['height'] = 130 + "px"; } }; function isNumeric(sText, failureValue) { if (sText.length == 0) { return failureValue; } var vVal = parseFloat(sText); if (isNaN(vVal)) { return failureValue; } else { return vVal; } }; function enterPressed(e) { var code; if (!e) { var e = window.event; } if (e.keyCode) { code = e.keyCode; } else if (e.which) { code = e.which; } if (code == 13) { return true; } else { return false; }; }; function setOpacity(id, level) { var element = document.getElementById(id); element.style.display = 'block'; element.style.zoom = 1; element.style.opacity = level; element.style.MozOpacity = level; element.style.KhtmlOpacity = level; element.style.filter = "alpha(opacity=" + (level * 100) + ");"; }; function fadeIn(id, steps, duration, interval, fadeOutSteps, fadeOutDuration) { var fadeInComplete; for (var t = 0; t <= 1; t += (1 / steps)) { setTimeout("setOpacity('" + id + "', " + t + ")", t * duration); fadeInComplete = t * duration; } setTimeout("fadeOut('" + id + "', " + fadeOutSteps + ", " + fadeOutDuration + ")", fadeInComplete + interval); }; function fadeOut(id, steps, duration) { var fadeOutComplete; for (var t = 0; t <= 1; t += (1 / steps)) { setTimeout("setOpacity('" + id + "', " + (1 - t) + ")", t * duration); fadeOutComplete = t * duration; } setTimeout("hide('" + id + "')", fadeOutComplete); }; function hide(id) { document.getElementById(id).style.display = 'none'; }; function increaseWidth(id, amount) { var currentX = document.getElementById(id).style.width; currentX = parseInt(currentX); currentX += amount; document.getElementById(id).style.width = currentX + 'px'; }; function loadGA() { var gaHost = ("https:" == document.location.protocol) ? "https://ssl." : "http://www."; var s = document.createElement('script'); s.src = gaHost + "google-analytics.com/ga.js"; document.getElementsByTagName("head")[0].appendChild(s); setTimeout("checkGA()", 1000); }; function checkGA() { if (typeof (_gat) == 'undefined') { setTimeout("checkGA()", 1000); } else { finalGA(); } }; function finalGA() { var pageTracker = _gat._getTracker("UA-3763936-13"); pageTracker._initData(); pageTracker._trackPageview(); }; function showDiv(id, x, y) { var myDiv = document.getElementById(id); myDiv.style.display = 'block'; if (x && y) { x = parseInt(x); y = parseInt(y); myDiv.style.left = x + "px"; myDiv.style.top = y + "px"; } }; function hideDiv(id) { var myDiv = document.getElementById(id); myDiv.style.display = 'none'; }