uiGEOH=null; uiGEOV=null; var hotelmap_lite = { MyGreenPointers : [], msie_6_flag : 'NO', init_fs_mode: true, mouse : { interval : null, down : false, gleft : 0, gtop : 0, pointX : 0, pointY : 0 }, debug_mode : false, geos : {'h1':512037,'v1':165077,'h2':545922,'v2':188021}, geoh : 529849, geov : 180772, level : 6, tubes_enabled : false, select_drop : null, // References the select drop for hotel finder. original_width : 0, original_height : 0, fullscreen : false, zoom_control : null, zooms : [ {'x1':'0','x2':'7981','y1':'0','y2':'5406','multiplier':'0.25'}, {'x1':'0','x2':'9573','y1':'0','y2':'6484','multiplier':'0.25'}, {'x1':'0','x2':'11488','y1':'0','y2':'7781','multiplier':'0.25'}, {'x1':'0','x2':'13786','y1':'0','y2':'9337','multiplier':'0.25'}, {'x1':'0','x2':'16543','y1':'0','y2':'11205','multiplier':'0.25'}, {'x1':'0','x2':'19851','y1':'0','y2':'13445','multiplier':'0.25'}, {'x1':'0','x2':'23821','y1':'0','y2':'16134','multiplier':'0.25'} ], dimensions : { width : 0, height : 0 }, views : { 'owner' : null, 'maps' : null, 'hotels' : null, 'nav' : null, 'controls' : null }, debug : { message : function( message ) { if ( hotelmap_lite.debug_mode == true ) console.log( "debug: " + message ) ; } } }; hotelmap_lite.init = { close_source : null, generate_views : function( target_node, width, height, geoh, geov, zoom_level ) { // -- // Event Lister for fulls creen resize mode if (window.addEventListener) { window.addEventListener("resize", hotelmap_lite.events.full_screen_resize_adjust, false); //invoke function } else { if (window.attachEvent) window.attachEvent("onresize", hotelmap_lite.events.full_screen_resize_adjust); //invoke function } //--We need to control a select differently. try { document.getElementById("PTMpa").onchange = function() { hotelmap_lite.events.price_switcher(document.getElementById("PTMpa")); } document.getElementById("hotel_node_selection").onchange = function() { hotelmap_lite.events.focus_hotel( document.getElementById("hotel_node_selection") ); } hotelmap_lite.select_drop = document.getElementById("hotel_node_selection") ; } catch ( ifWeDontNeedTheseException ){} if ( geoh > 0 ) hotelmap_lite.geoh = geoh; if ( geoh > 0 ) hotelmap_lite.geov = geov; hotelmap_lite.level = zoom_level; hotelmap_lite.dimensions.width = width; hotelmap_lite.dimensions.height = height; hotelmap_lite.views.owner = document.getElementById( target_node ) ; hotelmap_lite.views.owner.innerHTML = ""; var basic = hotelmap_lite.utility.element("div",{'overflow':'hidden','position':'relative','left':'0px','top':'0px','width':hotelmap_lite.dimensions.width+'px','height':hotelmap_lite.dimensions.height+'px','border':'#0000FF'},null); hotelmap_lite.dimensions.width = parseInt( hotelmap_lite.dimensions.width ) ; hotelmap_lite.dimensions.height = parseInt( hotelmap_lite.dimensions.height ) ; hotelmap_lite.views.maps = hotelmap_lite.utility.element("div", {'MozUserSelect':'none','zIndex':'10','position':'absolute','left':'0px','top':'0px','backgroundColor':'#FF0000'}, {'id':'geocore'}); hotelmap_lite.views.hotels = hotelmap_lite.utility.element("div", {'MozUserSelect':'none','zIndex':'14','position':'absolute','left':'0px','top':'0px'}, null); hotelmap_lite.views.nav = hotelmap_lite.utility.element("div", {'backgroundColor':'#0000FF','cursor':'pointer','MozUserSelect':'none','zIndex':'12','position':'absolute','left':'0px','top':'0px','width':hotelmap_lite.dimensions.width+'px','height':hotelmap_lite.dimensions.height+'px','backgroundColor':'#000000'}, null); hotelmap_lite.views.controls = hotelmap_lite.utility.element("div", {'backgroundColor':'#0000FF','cursor':'pointer','MozUserSelect':'none','zIndex':'15','position':'absolute','left':'0px','top':'0px','backgroundColor':'#000000'}, null); hotelmap_lite.views.fscreen = hotelmap_lite.utility.element("img", {'cursor':'pointer','MozUserSelect':'none','zIndex':'15','position':'absolute','left':'10px','top':'0px'}, {'src':'/hotels/resource/images/ling_series/view_full_screen.png'}); hotelmap_lite.init.ie_transparency_nav_shift(); hotelmap_lite.utility.JumpDirect( hotelmap_lite.geoh, hotelmap_lite.geov ); hotelmap_lite.tiling.images(); basic.appendChild( hotelmap_lite.views.maps ); basic.appendChild( hotelmap_lite.views.hotels ); basic.appendChild( hotelmap_lite.views.nav ); basic.appendChild( hotelmap_lite.views.controls ); if ( hotelmap_lite.init_fs_mode && hotelmap_lite.msie_6_flag == "NO" ) basic.appendChild( hotelmap_lite.views.fscreen ); hotelmap_lite.views.owner.appendChild( basic ) ; hotelmap_lite.views.nav.onmousedown = hotelmap_lite.events.down; hotelmap_lite.views.nav.onmouseup = hotelmap_lite.events.up; hotelmap_lite.views.nav.onmousemove = hotelmap_lite.events.move; hotelmap_lite.basic = basic; hotelmap_lite.original_width = hotelmap_lite.dimensions.width; hotelmap_lite.original_height = hotelmap_lite.dimensions.height; hotelmap_lite.views.fscreen.onmousedown = hotelmap_lite.views.fscreen.activate = function() { if ( hotelmap_lite.fullscreen ) { hotelmap_lite.fullscreen=false; } else { hotelmap_lite.fullscreen=true; } hotelmap_lite.basic.fullscreen(hotelmap_lite.fullscreen); hotelmap_lite.tiling.images(); } basic.fullscreen = function( full_screen_state ) { if ( full_screen_state ) { var csource = ( hotelmap_lite.init.close_source != null ) ? '/hotels/resource/images/close_map.png' : '/hotels/resource/images/ling_series/exit_full_screen.png'; hotelmap_lite.views.fscreen.src = csource; document.body.style.overflow = 'hidden'; var d = hotelmap_lite.utility.dimensions(); hotelmap_lite.dimensions.width = d[0]; hotelmap_lite.dimensions.height= d[1]; this.style.position = 'fixed'; this.style.left = '0px'; this.style.top = '0px'; this.style.width = d[0]+"px"; this.style.height = d[1]+"px"; hotelmap_lite.views.nav.style.width = d[0]+"px"; hotelmap_lite.views.nav.style.height = d[1]+"px"; hotelmap_lite.zoom_control.style.left = ( d[0] - 40 ) + "px" ; hotelmap_lite.zoom_control.style.top = hotelmap_lite.controls.zoom.top_place + "px" ; try { document.getElementById("nav").style.display = "none"; } catch ( asdasd2 ) {} try { document.getElementById("state_overlay_back").style.display = ""; } catch ( asdasd ) {} hotelmap_lite.utility.JumpDirect( hotelmap_lite.geoh, hotelmap_lite.geov ); try { ajax.remote.get("/hotels/live/ia_ader?acp=FS_SCR_M&"); } catch ( exceptionACP ) { } } else { var csource = ( hotelmap_lite.init.close_source != null ) ? '/hotels/resource/images/close_map.png' : '/hotels/resource/images/ling_series/view_full_screen.png'; hotelmap_lite.views.fscreen.src = csource; document.body.style.overflow = 'auto'; hotelmap_lite.dimensions.width = hotelmap_lite.original_width; hotelmap_lite.dimensions.height = hotelmap_lite.original_height; hotelmap_lite.zoom_control.style.left = ( hotelmap_lite.original_width - 40 ) + "px" ; hotelmap_lite.zoom_control.style.top = hotelmap_lite.controls.zoom.top_place + "px" ; this.style.position = 'relative'; this.style.left = '0px'; this.style.top = '0px'; this.style.width = hotelmap_lite.dimensions.width+"px"; this.style.height = hotelmap_lite.dimensions.height+"px"; hotelmap_lite.views.nav.style.width = hotelmap_lite.dimensions.width+"px"; hotelmap_lite.views.nav.style.height = hotelmap_lite.dimensions.height+"px"; try { document.getElementById("nav").style.display = ""; } catch ( asdasd2 ) {} try { document.getElementById("state_overlay_back").style.display = "none"; } catch ( asdasd ) {} hotelmap_lite.utility.JumpDirect( hotelmap_lite.geoh, hotelmap_lite.geov ); } } }, ie_transparency_nav_shift : function() { if ( document.all ) { hotelmap_lite.utility.transparency(hotelmap_lite.views.nav,1); } else { hotelmap_lite.views.nav.style.backgroundColor = ''; } } }; function runoptions(){ try { hotelmap_lite.utility.pointers.node.reference.overlay=false; hotelmap_lite.utility.pointers.node.parentNode.removeChild(hotelmap_lite.utility.pointers.node); }catch(ifgn){} } /** * HotelMap Lite - Utility Object * $Id: utility.js,v 1.25 2012/10/03 08:27:26 james Exp $ */ hotelmap_lite.utility = { //hotelmap_lite.utility.scrolls scrolls : { zone_node : null, internal_contents : null, custom_scroll_element : false, field_container : null, view_node : null , /** * new_article_entry * Adds a new article section to the left side menu controller */ new_article_entry: function( data, container ) { var isLongSentence = ( data.desc.length > 150 ) ? true : false ; var a = hotelmap_lite.utility.element("img",{'position':'absolute','left':'0px','top':'0px','width':'60px','height':'100px'},{'src':data.image}); var fontSize = '15px'; //if ( data.name.length > 5 ) { // fontSize = '12px'; //} var b = hotelmap_lite.utility.element("div",{'letterSpacing':'-1px','textAlign':'left','fontFamily':'arial','fontSize':fontSize,'color':'#5C90B5','fontWeight':'bold','position':'absolute','left':'92px','top':'7px','width':'257px','height':'10px','overflow':'hidden','height':'17px'},{'id':'hjsh','title':data.name,'innerHTML':data.name + " "}); var c = hotelmap_lite.utility.element("div",{'textTransform':'uppercase','textAlign':'left','fontFamily':'arial','fontSize':'11px','color':'#998F00','letterSpacing':'0px','fontWeight':'bold','position':'absolute','left':'92px','top':'25px'},{'innerHTML':data.category}); if ( ( data.bookable == "Y" || data.offer == "Y" || data.michelin != "N") && data.michelin != null ) { var bookstring = ""; data.desc = data.desc.substring(0,47) + ((isLongSentence)?".. more info/booking":""); var d = hotelmap_lite.utility.element("div",{'lineHeight':'13px','textAlign':'left','position':'absolute','left':'92px','top':'66px','paddingRight':'4px','fontFamily':'verdana','fontSize':'11px','color':'#444444'},{'id':'desc','innerHTML':data.desc}); var asd = hotelmap_lite.utility.element("div",{'position':'absolute','left':'92px','top':'46px'},null); if ( data.michelin != 'N' ) { for ( var k = 0 ; k < data.michelin ; k++ ) { bookstring += '
'; } bookstring +='
MICHELIN STARRED
'; } if ( data.bookable == "Y") { bookstring += "
"; } if ( data.offer == "Y" ) { bookstring += "
"; } bookstring += '
'; asd.innerHTML = bookstring; } else { data.desc = data.desc.substring(0,130) + ((isLongSentence)?".. more information":""); var d = hotelmap_lite.utility.element("div",{'lineHeight':'13px','textAlign':'left','position':'absolute','left':'92px','top':'41px','paddingRight':'20px','fontFamily':'verdana','fontSize':'11px','color':'#444444'},{'innerHTML':data.desc}); } var e = hotelmap_lite.utility.element("img",{'position':'absolute','left':'65px','top':'7px','width':'22px','height':'29px'},{'src':'/hotels/hmlite/points/auto_point?p=3&id='+data.nid}); var p = hotelmap_lite.utility.element("div",{'borderTop':'2px solid #FFFFFF','position':'relative','backgroundColor':'#F5F5F5','width':'344px','height':'100px','overflow':'hidden'},{'id':'article_element','reference':data.nid}); p.contentMode = d; p.nid = data.nid ; p.appendChild(a); p.appendChild(b); p.appendChild(c); p.appendChild(d); p.appendChild(e); p.MainTitle = b; p.MainLink = data.link; p.MainTitleNode = data.name; p.data = data; if ( asd ) p.appendChild(asd); container.appendChild(p); container.style.overflowY = 'auto'; container.style.overflowX = 'hidden'; container.p=p; container.p = p.nid; if ( iDevice ) { container.ontouchstart=function(){ container.p.showLozzenge(); }; } p.onmousedown = p.showLozzenge = function() { if ( this.nid && !p.activeNode ) { try { // Kill the node overlay if one already exists. try { hotelmap_lite.utility.scrolls.view_node.parentNode.removeChild( hotelmap_lite.utility.scrolls.view_node ) ; } catch ( er ) {} // Grab the correct node by it's NID value var pObject = document.getElementById(hotelmap_lite.utility.pointers.getIdentity(this.nid)); /** * Weird firefox error. Resolved with this. */ if ( !pObject.properties.geoh && this.data.geoh ) { pObject = { properties : this.data }; } // Sort our the postioning. if ( iDevice ) hotelmap_lite.utility.JumpDirect(pObject.properties.geoh,pObject.properties.geov); // alert( "NID: "+ this.nid + " >> "+ pObject.properties.geoh + ", " + pObject.properties.geov ) ; hotelmap_lite.geoh = pObject.properties.geoh; hotelmap_lite.geov = pObject.properties.geov; var data = this.data; // Closne the left side node and make ready to plot it out into the map var node = this.cloneNode(true); var pixels = hotelmap_lite.utility.geoToPixel(pObject.properties.geoh,pObject.properties.geov); // Calculate the clash between the slide out and the main central popup - slide rigth if they // are hitting each other. var map_position = Math.abs( parseInt( (0-parseInt(pixels[0]-(hotelmap_lite.dimensions.width/2))) ) ) + 364 ; var container_node = hotelmap_lite.utility.element("div",null,null); var container_destination_left = pixels[0] - (parseInt(node.style.width)/2)-15; var gt = 0; if ( container_destination_left < map_position ) { var ds = container_destination_left; var ofs = map_position + 40; //hotelmap_lite.views.maps.style.left = hotelmap_lite.views.hotels.style.left = parseInt(hotelmap_lite.views.maps.style.left) + (ofs-ds) + "px"; gt = (ofs-ds); } //console.dir(node.MainTitle); //node.MainTitle.innerHTML = node.MainTitleNode; //p.MainTitle = b; //p.MainTitleNode = data.name;.MainTitle.innerHTML = container_node.MainTitle.innerHTML.replace("| full info",""); //contentMode container_node.style.position = 'absolute'; container_node.style.left = container_destination_left + "px"; container_node.style.top = pixels[1] - (parseInt(node.style.height)+80)+ "px"; if ( data.offer == 'N' ) { container_node.style.top = pixels[1] - (parseInt(node.style.height)+60)+ "px"; } container_node.style.top =(parseInt(container_node.style.top) + 5) + "px"; container_node.style.zIndex = '99999999'; node.style.position = 'absolute'; node.style.left = '0px'; node.style.top = '0px'; // Add the box shadow node.style.MozBoxShadow = "4px 4px 4px #666"; node.style.WebkitBoxShadow = "4px 4px 4px #666"; node.style.boxShadow ="4px 4px 4px #666"; node.style.border = '2px solid #FFFFFF'; try{ for ( var j = 0 ; j < node.childNodes.length ; j++ ) { var mynode = node.childNodes[j]; if ( mynode.id == 'hjsh') { mynode.style.textDecoration = 'underline'; mynode.style.cursor = 'pointer'; var links = this.MainLink; mynode.onmousedown = function(){ location.href = links; } } } /* node.MainTitle.style.textDecoration = 'underline'; node.MainTitle.style.cursor = 'pointer'; var links = node.MainLink; node.MainTitle.onmousedown=function(){ location.href = links; }; */ } catch ( exception ) { alert("Error: " + exception.message); } container_node.appendChild(node); var arrow = hotelmap_lite.utility.element("img", {'position':'absolute','left':((parseInt(node.style.width)/2)+2)+"px",'top':'104px'},{'src':'/images/arrow3.png'}); var close = hotelmap_lite.utility.element("img", {'position':'absolute','left':(parseInt(node.style.width)-14)+'px','top':'2px'},{'src':'/images/close_map.gif'}); close.onmousedown=function() { this.parentNode.parentNode.removeChild(this.parentNode); } container_node.appendChild(arrow); container_node.appendChild(close); hotelmap_lite.utility.scrolls.view_node = container_node; container_node.nid = this.nid; container_node.reposition = function() { this.parentNode.removeChild(this); } hotelmap_lite.views.hotels.appendChild( container_node ) ; hotelmap_lite.utility.SlideIn( (0-parseInt(pixels[0]-(hotelmap_lite.dimensions.width/2)))+gt,0-parseInt(pixels[1]-(hotelmap_lite.dimensions.height/2)),false); } catch ( noReferenceFoundException ){} } } p.onmouseover = function() { this.style.backgroundColor = '#F5F3E7'; } p.onmouseout = function() { this.style.backgroundColor = '#F5F5F5'; } hotelmap_lite.utility.scrolls.field_container = container ; }, cr_major_container : null , //hotelmap_lite.utility.scrolls.article_zone article_zone : function() { var imin = hotelmap_lite.utility.element("img", {'zIndex':'3','position':'absolute','left':'0px','top':'10px'},{'src':'/hotels/resource/images/open.png'}); hotelmap_lite.imin = imin; imin.style.MozBoxShadow = "2px 2px 2px #333"; imin.style.WebkitBoxShadow = "2px 2px 2px #333"; imin.style.boxShadow ="2px 2px 2px #333"; var n = hotelmap_lite.utility.element("div", {'zIndex':'2','position':'absolute','left':'-364px','top':'10px','overflow':'hidden','height':(parseInt(hotelmap_lite.dimensions.height)-103)+"px",'width':'364px','backgroundColor':''},null); var i = hotelmap_lite.utility.element("img", {'position':'absolute','left':'0px','top':'0px'},{'src':'/hotels/resource/images/the-best.png'}); var fontTypeSize = '20px'; var c = hotelmap_lite.utility.element("div", {'textAlign':'left','border':'0px solid #FF0000','position':'absolute','left':'10px','top':'29px','width':'364px','fontFamily':'arial','fontSize':fontTypeSize,'color':'#FFFFFF'},{'id':'centric_title','innerHTML':'Content'}); var D = hotelmap_lite.utility.element("div", {'textAlign':'left','border':'0px solid #FF0000','position':'absolute','left':'10px','top':'48px','width':'300px','fontWeight':'bold','fontFamily':'arial','fontSize':'12px','color':'#998F00'},{'id':'centric_sub','innerHTML':'LondonTown.com Map Feature'}); var internal_contents = hotelmap_lite.utility.element("div", {'backgroundColor':'','position':'absolute','top':'73px','left':'0px','height':(hotelmap_lite.dimensions.height-103)+"px",'width':'364px','overflow':'auto'},null); n.style.height = (hotelmap_lite.dimensions.height-30)+"px"; n.appendChild(internal_contents); n.appendChild(i); hotelmap_lite.views.controls.appendChild(imin); hotelmap_lite.views.controls.appendChild(n); n.appendChild(c); n.appendChild(D); // Add the box shadow n.style.MozBoxShadow = "4px 4px 4px #666"; n.style.WebkitBoxShadow = "4px 4px 4px #666"; n.style.boxShadow ="4px 4px 4px #666"; //n.style.border = '1px solid #FF0000'; hotelmap_lite.utility.scrolls.cr_major_container = n; hotelmap_lite.utility.scrolls.internal_contents=internal_contents; imin.masternode = i; i.masternode=imin; /* Movement Logic - nothign interesting here */ imin.onmousedown=function(){if ( parseInt( this.style.left ) == 0 ){ this.shut(); } else { this.masternode.show(); }} hotelmap_lite.view_tab = i; // alert("iSpeed: " + iSpeed); i.onmousedown=function(){this.shut();} i.shut=function(){ var t = this ; var increment = ( parseInt( t.parentNode.style.left ) < -330 ) ? 2 : 10; if ( iDevice ) increment = 40; setTimeout(function(){if ( parseInt( t.parentNode.style.left ) > -364 ) { t.parentNode.style.left = ( parseInt( t.parentNode.style.left ) - increment ) + "px" ; t.shut(); } else { t.parentNode.style.left = "-364px"; t.masternode.show(); } },iSpeed); } i.show=function() { var t = this ; var increment = ( parseInt( t.parentNode.style.left ) > -40 ) ? 2 : 10; if ( iDevice ) increment = 40; setTimeout(function(){if ( parseInt( t.parentNode.style.left ) < 0 ){t.parentNode.style.left = ( parseInt( t.parentNode.style.left ) + increment ) + "px" ;t.show();}else{t.parentNode.style.left = "0px"; }},iSpeed); } /* Display the mini open linker */ imin.show=function(){ var t = this ; var increment = ( parseInt( t.parentNode.style.left ) > -5 ) ? 1 : 3; if ( iDevice ) increment = 40; setTimeout(function() { if ( parseInt( t.style.left ) < 0 ) { t.style.left = ( parseInt( t.style.left ) + increment ) + "px" ; t.show(); } else { t.style.left = "0px"; } } ,iSpeed); } /* HIDE the mini open linker */ imin.shut=function(){ var t = this ; var increment = ( parseInt( t.style.left ) < -10 ) ? 3 : 3; if ( iDevice ) increment = 40; setTimeout(function(){if ( parseInt( t.style.left ) > -32 ){t.style.left = ( parseInt( t.style.left ) - increment ) + "px" ;t.shut();}else{t.style.left = "-32px"; t.masternode.show();}},iSpeed); } } }, // -- // hotelmap_lite.utility.pointers pointers : { active : null, // Active node node : null, // Reference node // -- // hotelmap_lite.utility.pointers.overlay_point_area // : Specific overlay system for a map view for articles. overlay_point_area : function( t ) { var point_location = t.locdata; // Point Location data // -- // Remove any reference to existing child try { hotelmap_lite.utility.pointers.node.parentNode.removeChild(hotelmap_lite.utility.pointers.node); hotelmap_lite.utility.pointers.node.reference.overlay=false; } catch( nullPointerNodeException ){} try { if ( t.overlay == false ) { t.overlay = true; var coordinates = hotelmap_lite.utility.geoToPixel(point_location.geoh,point_location.geov); var styles = { 'zIndex' : '9999', 'position' : 'absolute', 'left' : (coordinates[0]-7)+'px', 'top' : (coordinates[1]-45)+'px', 'height' : '15px', 'backgroundColor' :'#000000', 'padding' : '3px', 'paddingBottom' : '4px', 'paddingRight' : '9px', 'paddingLeft' : '7px', 'fontFamily' : 'arial', 'fontSize' : '11px', 'color' : '#FFFFFF', 'width' : '0px', 'overflow' : 'hidden', 'textAlign' : 'center', 'whiteSpace' : 'nowrap','MozBorderRadius' : '4px','borderRadius' : '4px'}; var pointer = hotelmap_lite.utility.element("div",styles,{'innerHTML':point_location.name+"
VENUE HIRE
"}); hotelmap_lite.utility.pointers.node=pointer; t.tthy = pointer; pointer.reference=t; var t = hotelmap_lite.utility.element("img",{'cursor':'pointer'},{'src':'/hotels/resource/images/more_info.png'}); t.point=point_location; pointer.appendChild(t); t.onmousedown = function(){ location.href = "http://"+this.point.link; } pointer.properties = {'geoh':point_location.geoh,'geov':point_location.geov,'width':30,'height':15}; pointer.reposition = function() { this.parentNode.removeChild(this); t.overlay = false; } hotelmap_lite.views.hotels.appendChild( pointer ); var pl = pointer; setTimeout(function(){ pl.style.width = (( parseInt(pl.style.width) + parseInt(pl.scrollWidth) ) - 9) + "px"; pl.style.height = parseInt(pl.scrollHeight)-4 + "px"; pl.style.left = (parseInt(pl.style.left) - (parseInt(pl.style.width)/2)) + "px"; pl.style.top = (coordinates[1]-parseInt(pl.scrollHeight)-39) + "px"; pl.properties.width = parseInt(pl.style.width); pl.properties.height = parseInt(pl.style.height); pointer.style.overflow = ''; var pointer_pb = hotelmap_lite.utility.element("div", {'position':'absolute','left':((parseInt(pl.style.width)/2)+4)+'px','top':parseInt(pl.scrollHeight)+"px",'width':'8px','height':'6px','backgroundImage':'url(/hotels/resource/images/pb2.png)'}); pl.appendChild(pointer_pb); hotelmap_lite.utility.transparency(pl,70); },20); } } catch ( blackPointerException ) { alert("BPException: " + blackPointerException.message ); } }, getIdentity : function( id ) { return "pdi" + id ; }, // -- // hotelmap_lite.utility.pointers.blue_pointer blue_pointer : function( point_location ) { //console.dir(point_location); //pointLocation = {'pointer':type,'category':cate,'image':image,'desc':desc,'id':segments[0],'geoh':segments[1],'geov':segments[2],'name':segments[3],'type':segments[4],'link':segments[5]}; var coordinates = hotelmap_lite.utility.geoToPixel(point_location.geoh,point_location.geov); var pointer = hotelmap_lite.utility.element("img",{'cursor':'pointer','zIndex':'9999','position':'absolute','left':(coordinates[0]-11)+'px','top':(coordinates[1]-29)+'px'},{'id':hotelmap_lite.utility.pointers.getIdentity(point_location.nid), 'src':'/hotels/hmlite/points/large_point?id='+point_location.nid}); pointer.overlay = false; pointer.tthy = false; pointer.properties = {'geoh':point_location.geoh,'geov':point_location.geov,'width':50,'height':67}; pointer.locdata = point_location; pointer.active = false; pointer.style.zIndex = 999999-point_location.geov; pointer.permZIndex = pointer.style.zIndex; pointer.title = point_location.name; pointer.reposition = function() { var pixel_coordinates = hotelmap_lite.utility.geoToPixel( this.properties.geoh, this.properties.geov ); this.style.left = ( pixel_coordinates[0] - (this.properties.width / 2 ) ) + "px" ; this.style.top = ( pixel_coordinates[1] - this.properties.height ) + "px" ; }; pointer.onmouseover=function(){ this.style.zIndex = 999999; }; pointer.onmouseout=function(){ this.style.zIndex = this.permZIndex ; } setTimeout(function(){ pointer.reposition(); }, 200); hotelmap_lite.views.hotels.appendChild( pointer ); pointer.onmousedown=function(){ if ( !pointer.active ){ //pointer.active=true; //hotelmap_lite.utility.pointers.overlay_point_area(this); //pointer.active=false; var divs = document.getElementsByTagName("div"); for ( var i = 0 ; i < divs.length ; i++ ) { try { if ( divs[i].reference && divs[i].reference == this.locdata.nid ) { divs[i].showLozzenge(); } } catch ( noReferenceException ) { } } } } }, /** * _custom_restaurant_pointer * Displays a specific restaurant based icon for our restaurants product */ _custom_restaurant_pointer : function( point_location ) { var coordinates = hotelmap_lite.utility.geoToPixel(point_location.geoh,point_location.geov); var pointer = null; if ( point_location.offer == 'N' ) { pointer= hotelmap_lite.utility.element("img",{'cursor':'pointer','zIndex':(600000-point_location.geov),'position':'absolute','left':(coordinates[0]-26)+'px','top':(coordinates[1]-55)+'px'},{'id':hotelmap_lite.utility.pointers.getIdentity(point_location.nid), 'src':'/LondonRestaurantDeals/res/images/rest_nodeal.png'}); } else { pointer= hotelmap_lite.utility.element("img",{'cursor':'pointer','zIndex':(600000-point_location.geov),'position':'absolute','left':(coordinates[0]-26)+'px','top':(coordinates[1]-55)+'px'},{'id':hotelmap_lite.utility.pointers.getIdentity(point_location.nid), 'src':'/LondonRestaurantDeals/res/images/restaurant_icon.png'}); } pointer.title = point_location.name + " | " + point_location.category; //console.dir(point_location); pointer.overlay = false; pointer.tthy = false; pointer.properties = {'geoh':point_location.geoh,'geov':point_location.geov,'width':51,'height':55}; pointer.locdata = point_location; pointer.active = false; pointer.reposition = function() { var pixel_coordinates = hotelmap_lite.utility.geoToPixel( this.properties.geoh, this.properties.geov ); this.style.left = ( pixel_coordinates[0] - (this.properties.width / 2 ) ) + "px" ; this.style.top = ( pixel_coordinates[1] - this.properties.height ) + "px" ; }; hotelmap_lite.views.hotels.appendChild( pointer ); pointer.onmousedown=function(){ if ( !pointer.active ){ //pointer.active=true; //hotelmap_lite.utility.pointers.overlay_point_area(this); //pointer.active=false; var divs = document.getElementsByTagName("div"); for ( var i = 0 ; i < divs.length ; i++ ) { try { if ( divs[i].reference && divs[i].reference == this.locdata.nid ) { divs[i].showLozzenge(); } } catch ( noReferenceException ) { } } } } }, // -- // hotelmap_lite.utility.pointers.small_green_pointer small_green_pointer : function(geoh,geov) { var coordinates = hotelmap_lite.utility.geoToPixel(geoh,geov); var pointer = hotelmap_lite.utility.element("img",{'zIndex':'9999','position':'absolute','left':(coordinates[0]-15)+'px','top':(coordinates[1]-43)+'px'},{'src':'/hotels/resource/images/pointer_small.png'}); pointer.properties = {'geoh':geoh,'geov':geov,'width':30,'height':43}; pointer.reposition = function() { var pixel_coordinates = hotelmap_lite.utility.geoToPixel( this.properties.geoh, this.properties.geov ); this.style.left = ( pixel_coordinates[0] - (this.properties.width / 2 ) ) + "px" ; this.style.top = ( pixel_coordinates[1] - this.properties.height ) + "px" ; }; hotelmap_lite.views.hotels.appendChild( pointer ); }, /** * Black Pointer */ black_pointer : function( geoh, geov, name ) { try { var coordinates = hotelmap_lite.utility.geoToPixel(geoh,geov); var styles = { 'zIndex' : '9999', 'position' : 'absolute', 'left' : (coordinates[0])+'px', 'top' : (coordinates[1]+10)+'px', 'height' : '12px', 'backgroundColor' :'#000000', 'padding' : '3px', 'paddingBottom' : '4px', 'paddingRight' : '9px', 'paddingLeft' : '7px', 'fontFamily' : 'arial', 'fontSize' : '11px', 'color' : '#FFFFFF', 'width' : '0px', 'overflow' : 'hidden', 'textAlign' : 'center', 'whiteSpace' : 'nowrap', 'MozBorderRadius' : '4px', 'borderRadius' : '4px' }; var pointer = hotelmap_lite.utility.element("div",styles,{'innerHTML':name}); pointer.properties = { 'geoh':geoh, 'geov':geov, 'width':30, 'height':15 }; pointer.reposition = function() { var pixel_coordinates = hotelmap_lite.utility.geoToPixel( this.properties.geoh, this.properties.geov ); this.style.left = ( pixel_coordinates[0] - (this.properties.width / 2 ) ) + "px" ; this.style.top = ( pixel_coordinates[1] + 10 ) + "px" ; } hotelmap_lite.views.hotels.appendChild( pointer ); var pl = pointer; setTimeout(function(){ // alert("Execute"); pl.style.width = (( parseInt(pl.style.width) + parseInt(pl.scrollWidth) ) - 9) + "px"; pl.style.left = (parseInt(pl.style.left) - (parseInt(pl.style.width)/2)) + "px"; pl.properties.width = parseInt(pl.style.width); pl.properties.height = parseInt(pl.style.height); pl.properties.geoh = geoh; pl.properties.geov = geov; pointer.style.overflow = ''; var pointer_pb = hotelmap_lite.utility.element("div", {'position':'absolute','left':((parseInt(pl.style.width)/2)+4)+'px','top':'-6px','width':'8px','height':'6px','backgroundImage':'url(/hotels/resource/images/pb1.png)'}); pl.appendChild(pointer_pb); hotelmap_lite.utility.transparency(pl,70); // alert("Finish"); },600); } catch ( blackPointerException ) { //alert("BPException: " + blackPointerException.message ); } } }, pixelToGeo:function(x,y) { x = Math.abs(x); y = Math.abs(y); var geoHorizontalWidth = hotelmap_lite.geos.h2 -hotelmap_lite.geos.h1; var geoVerticalWidth = hotelmap_lite.geos.v2 - hotelmap_lite.geos.v1; var mapWidth = hotelmap_lite.zooms[hotelmap_lite.level].x2; var mapHeight = hotelmap_lite.zooms[hotelmap_lite.level].y2; var widthRatio = geoHorizontalWidth / mapWidth ; var heightRatio = geoVerticalWidth / mapHeight; var panX = hotelmap_lite.geos.h1 + ((x) * widthRatio); var panY = hotelmap_lite.geos.v2 - ((y) * heightRatio); panX=Math.round(panX); panY=Math.round(panY); return new Array(panX,panY); }, geoToPixel:function(geoh,geov) { var geoHorizontalWidth = hotelmap_lite.geos.h2 - hotelmap_lite.geos.h1; var geoVerticalWidth = hotelmap_lite.geos.v2 - hotelmap_lite.geos.v1; var mapWidth = hotelmap_lite.zooms[hotelmap_lite.level].x2; var mapHeight = hotelmap_lite.zooms[hotelmap_lite.level].y2; var widthRatio = geoHorizontalWidth / mapWidth ; var heightRatio = geoVerticalWidth / mapHeight; var panX = (geoh-hotelmap_lite.geos.h1) / widthRatio; var panY = (hotelmap_lite.geos.v2-geov) / heightRatio; return new Array(panX,panY); }, JumpDirect : function(geoh,geov) { // console.log(">>"); var pix = hotelmap_lite.utility.geoToPixel(geoh,geov); hotelmap_lite.debug.message("Loading pixels: " + pix[0] + ", " + pix[1]); hotelmap_lite.views.maps.style.left = hotelmap_lite.views.hotels.style.left = 0-(pix[0]-(hotelmap_lite.dimensions.width/2)) + "px"; hotelmap_lite.views.maps.style.top = hotelmap_lite.views.hotels.style.top = 0-(pix[1]-(hotelmap_lite.dimensions.height/2)) + "px"; hotelmap_lite.tiling.images(); }, SlideActive : false, dx : 0 , dy : 0 , rtx: 25, rty : 25, ratiox : 1, ratioy : 1, SlideIn : function( x,y, ov ) { var donex=false; var doney = false; var pause = 25; if ( iDevice ) pause = 15; if ( !hotelmap_lite.utility.SlideActive || ov ) { hotelmap_lite.utility.SlideActive = true; if ( !ov ) { var current_left = parseInt( hotelmap_lite.views.maps.style.left ); var current_top = parseInt( hotelmap_lite.views.maps.style.top ); hotelmap_lite.utility.dx = current_left; hotelmap_lite.utility.dy = current_top; var dx = Math.abs(Math.abs(x)-Math.abs(parseInt(hotelmap_lite.utility.dx))); var dy = Math.abs(Math.abs(y)-Math.abs(parseInt(hotelmap_lite.utility.dy))); if ( dx > dy ) hotelmap_lite.utility.ratioy = dx/dy; if ( dy > dx ) hotelmap_lite.utility.ratiox = dy/dx; } var distance_x = Math.abs(Math.abs(x)-Math.abs(parseInt(hotelmap_lite.utility.dx))); var distance_y = Math.abs(Math.abs(y)-Math.abs(parseInt(hotelmap_lite.utility.dy))); if ( distance_x < 150 && distance_y < 150 ) { hotelmap_lite.utility.rtx = 7; hotelmap_lite.utility.ratioy=1; hotelmap_lite.utility.rty = 7; hotelmap_lite.utility.ratiox =1; } else if ( distance_x < 250 && distance_y < 250 ) { hotelmap_lite.utility.rtx = 15; hotelmap_lite.utility.rty = 15; } else { hotelmap_lite.utility.rtx = 25; hotelmap_lite.utility.rty = 25; } var xamount = hotelmap_lite.utility.rtx / hotelmap_lite.utility.ratiox; var yamount = hotelmap_lite.utility.rty / hotelmap_lite.utility.ratioy; //console.log(hotelmap_lite.utility.ratiox + " , " + hotelmap_lite.utility.ratioy); if ( parseInt(hotelmap_lite.utility.dx) != y || parseInt(hotelmap_lite.utility.dy) != x ) { if ( parseInt(hotelmap_lite.utility.dx) < x ){ donex=true; hotelmap_lite.utility.dx = hotelmap_lite.utility.dx + xamount;//hotemap_lite.utility.rtx; if ( hotelmap_lite.utility.dx > x ) {donex=false;hotelmap_lite.utility.dx = x;} hotelmap_lite.views.maps.style.left = hotelmap_lite.views.hotels.style.left = ( hotelmap_lite.utility.dx ) + "px"; } if ( parseInt(hotelmap_lite.utility.dx) > x ){ donex=true; hotelmap_lite.utility.dx = hotelmap_lite.utility.dx - xamount;//hotemap_lite.utility.rtx; if ( hotelmap_lite.utility.dx < x ) {donex=false;hotelmap_lite.utility.dx = x;} hotelmap_lite.views.maps.style.left = hotelmap_lite.views.hotels.style.left = ( hotelmap_lite.utility.dx ) + "px"; } if ( parseInt(hotelmap_lite.utility.dy) < y ){ doney=true; hotelmap_lite.utility.dy = hotelmap_lite.utility.dy + yamount;//hotelmap_lite.utility.rty; if ( hotelmap_lite.utility.dy > y ) {doney=false;hotelmap_lite.utility.dy = y;} hotelmap_lite.views.maps.style.top = hotelmap_lite.views.hotels.style.top = ( hotelmap_lite.utility.dy ) + "px"; } if ( parseInt(hotelmap_lite.utility.dy) > y ){ doney=true; hotelmap_lite.utility.dy = hotelmap_lite.utility.dy - yamount;//hotelmap_lite.utility.rty; if ( hotelmap_lite.utility.dy < y ) {doney=false;hotelmap_lite.utility.dy = y;} hotelmap_lite.views.maps.style.top = hotelmap_lite.views.hotels.style.top = ( hotelmap_lite.utility.dy ) + "px"; } if ( hotelmap_lite.utility.dy % 2) hotelmap_lite.tiling.images(); if ( donex || doney) { setTimeout( function(){ hotelmap_lite.utility.SlideIn( x, y, true ); }, pause ); } else { hotelmap_lite.views.maps.style.left = hotelmap_lite.views.hotels.style.left = x + "px"; hotelmap_lite.views.maps.style.top = hotelmap_lite.views.hotels.style.top = y +"px"; hotelmap_lite.utility.SlideActive = false; } } /* console.log("ended"); hotelmap_lite.views.maps.style.top = hotelmap_lite.views.hotels.style.top = ( x ) + "px"; hotelmap_lite.views.maps.style.left = hotelmap_lite.views.hotels.style.left = ( y ) + "px"; hotelmap_lite.utility.SlideActive = false ; */ } }, getScrollXY:function () { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; }, findPosX : function(obj){ var curleft = 0; if (obj.offsetParent){while (obj.offsetParent){curleft += obj.offsetLeft;obj = obj.offsetParent;}} else if (obj.x) curleft += obj.x; return curleft; }, findPosY : function (obj){ var curtop = 0; if (obj.offsetParent){ while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; }, // --------------------------------------------------------------------------------------------------- // element // Create a new DOM element and attach a series of styles and attributes then return the object back element : function( element_name, styles, attributes ) { var dom_element = document.createElement(element_name) ; if ( styles ) for ( style in styles ) if ( style ) try { dom_element.style[style] = styles[style];} catch ( Exception2 ) {} if ( attributes ) for ( attribute in attributes ) if ( attribute ) try { dom_element[attribute] = attributes[attribute]; } catch ( Exception1 ) {} return dom_element; }, // --------------------------------------------------------------------------------------------------- // dimensions // Obtains and sets the current view port dimensions : function() { var viewportwidth; var viewportheight; if (typeof window.innerWidth != 'undefined'){ viewportwidth = window.innerWidth; viewportheight = window.innerHeight; } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth; viewportheight = document.documentElement.clientHeight; } else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth; viewportheight = document.getElementsByTagName('body')[0].clientHeight; } return [viewportwidth,viewportheight]; }, // --------------------------------------------------------------------------------------------------- // transparency // Sets the transparency of an object... transparency : function( obj, level ) { obj.hidOpac = level; obj.style.MozOpacity = level/100 ; obj.style.opacity = level/100; obj.style.filter = "alpha(opacity="+level+")"; } }; hotelmap_lite.tiling = { tubes : false, tile_dimension : 300, stack : {}, oldstack : {}, tubestack : {}, setTubes : function(state){ mobile.tiling.tubes = state ; if ( !state ) mobile.tiling.removeTubes(); }, removeTubes : function() { for ( var i = 0 ; i < mobile.screens.geocore.childNodes.length; i++ ) { var curX = mobile.screens.geocore.childNodes[i].xer; var curY = mobile.screens.geocore.childNodes[i].yer; if ( !mobile.tiling.tubes && mobile.screens.geocore.childNodes[i].baseType == 'tube') { mobile.tiling.stack[mobile.screens.geocore.childNodes[i].id]=null; mobile.screens.geocore.removeChild(mobile.screens.geocore.childNodes[i]); --i; } } }, fade_up : function(obj) { if ( obj.hidOpac < 100 ) { hotelmap_lite.utility.transparency(obj,(obj.hidOpac+6)); setTimeout(function(){hotelmap_lite.tiling.fade_up(obj); },10); } else { hotelmap_lite.utility.transparency(obj,100); } }, images : function(zoom) { var tile_dimension = hotelmap_lite.tiling.tile_dimension; var map_left = Math.abs( parseInt( hotelmap_lite.views.maps.style.left )) ; var map_top = Math.abs( parseInt( hotelmap_lite.views.maps.style.top ) ); var startX1 = (tile_dimension * Math.floor( map_left / tile_dimension )); var startY1 = (tile_dimension * Math.floor( map_top / tile_dimension )); var startX2 = (tile_dimension * Math.floor( (map_left + hotelmap_lite.dimensions.width) / tile_dimension )); var startY2 = (tile_dimension * Math.floor( (map_top + hotelmap_lite.dimensions.height) / tile_dimension )); startX1=startX1-300; startY1=startY1-300; startX2=startX2+300; startY2=startY2+300; var defaultSetName = 'MAPS_FINAL_JUNE09'; var extension = 'jpg'; var imagePath = (hotelmap_lite.level+1)+"/Standard/"; var curlevel = hotelmap_lite.zooms[hotelmap_lite.level]; for ( var x = startX1 ; x <= startX2 ; x+=300 ) { for ( var y = startY1 ; y <= startY2 ; y+=300 ) { if ( x <= curlevel.x2 && x >= curlevel.x1 && y >= curlevel.y1 && y <= curlevel.y2 ) { var state ='trial'+x+"."+y+"."+hotelmap_lite.level; if ( !hotelmap_lite.tiling.stack[state]) { newImage = document.createElement("img"); newImage.onload = function() { this.style.display = ''; if ( !document.all ) hotelmap_lite.tiling.fade_up(this); } newImage.style.position = 'absolute'; newImage.style.display = 'none'; newImage.width = '300'; newImage.height = '300'; newImage.style.border = 'none'; /** These four allow the images to not appear befre load and also stop dragging **/ newImage.style.MozUserSelect = 'none'; newImage.style.left = x+"px"; newImage.style.top = y+"px"; newImage.xer = x; newImage.yer = y; newImage.id = state; newImage.baseType ='map'; newImage.zLevel = hotelmap_lite.level; //console.log("State Image: " + state); newImage.src = 'http:\/\/d22wy126mbexx4.cloudfront.net/'+imagePath+"set1-" + x + "-" + y + "."+extension; hotelmap_lite.views.maps.appendChild(newImage); hotelmap_lite.tiling.stack[state]=newImage; //console.log("Appending: " + newImage.style.left + ", " + newImage.style.top); if ( !document.all ) hotelmap_lite.utility.transparency(newImage,50); } var tstate = 'tube'+x+"."+y+"."+(hotelmap_lite.level-1); /* Tiling for tubes */ if ( hotelmap_lite.tubes_enabled && !hotelmap_lite.tiling.stack[tstate]) { //console.log("Tube Elements: " + x + ", " + y ) ; var tubePath = "http:\/\/m1.londonmaps.com/TUBE_FINAL_JUNE09/"+(hotelmap_lite.level+1)+"/Standard/set1-" + x + "-" + y + ".png"; var tubeImage = document.createElement("img"); tubeImage.onload = function() { this.style.display = ''; if ( !document.all ) hotelmap_lite.tiling.fade_up(this); } tubeImage.style.position = 'absolute'; tubeImage.style.display = 'none'; tubeImage.width = '300'; tubeImage.height = '300'; tubeImage.style.border = 'none'; /** These four allow the images to not appear befre load and also stop dragging **/ tubeImage.style.MozUserSelect = 'none'; tubeImage.style.left = x+"px"; tubeImage.style.top = y+"px"; tubeImage.xer = x; tubeImage.yer = y; tubeImage.id = tstate; tubeImage.style.zIndex = 999; tubeImage.src = tubePath; tubeImage.baseType ='tube'; tubeImage.zLevel = hotelmap_lite.level; hotelmap_lite.views.maps.appendChild(tubeImage); hotelmap_lite.tiling.stack[tstate]=tubeImage; if ( !document.all ) hotelmap_lite.utility.transparency(tubeImage,50); } } } } for ( var i = 0 ; i < hotelmap_lite.views.maps.childNodes.length; i++ ) { var curX = hotelmap_lite.views.maps.childNodes[i].xer; var curY = hotelmap_lite.views.maps.childNodes[i].yer; if ( (curX < startX1 || curX > startX2 || curY < startY1 || curY > startY2) && hotelmap_lite.views.maps.childNodes[i].width == 300 ) { hotelmap_lite.tiling.stack[hotelmap_lite.views.maps.childNodes[i].id]=null; hotelmap_lite.views.maps.removeChild(hotelmap_lite.views.maps.childNodes[i]); --i; } try { if ( !hotelmap_lite.tubes_enabled && hotelmap_lite.views.maps.childNodes[i].baseType == 'tube') { hotelmap_lite.tiling.stack[hotelmap_lite.views.maps.childNodes[i].id]=null; hotelmap_lite.views.maps.removeChild(hotelmap_lite.views.maps.childNodes[i]); --i; } } catch ( tubeDeletionException ) {} } if ( zoom ) { setTimeout( function() { for ( var i = 0 ; i < hotelmap_lite.views.maps.childNodes.length; i++ ) { if ( hotelmap_lite.views.maps.childNodes[i].zLevel != hotelmap_lite.level ) { hotelmap_lite.tiling.stack[hotelmap_lite.views.maps.childNodes[i].id]=null; hotelmap_lite.views.maps.removeChild(hotelmap_lite.views.maps.childNodes[i]); --i; } } }, 1000); } } }; hotelmap_lite.londontown = { adjust_fs_position : false, events : function() { var londontown_events = document.getElementsByTagName("ltevent"); var location_points = {}; for ( var i = 0 ; i < londontown_events.length ; i++ ) { try { var name = londontown_events[i].getAttribute("name"); var geoh = londontown_events[i].getAttribute("x"); var geov = londontown_events[i].getAttribute("y"); var dest = (geoh+"="+geov); while ( location_points[dest] == 1 ) { geoh = parseInt(geoh)+12; geov = parseInt(geov)+20; dest = (geoh+"="+geov); //console.log("Reassing"); } location_points[dest]=1; //console.log(geoh+" = "+geov); var pixels = hotelmap_lite.utility.geoToPixel( geoh, geov ); //console.log("Event: " + name + " at ("+geoh+","+geov+") - " + pixels[0] + " by " + pixels[1]); var test_block = hotelmap_lite.utility.element("div",{'backgroundImage':'url(/pin.png)','position':'absolute','width':'32px','height':'32px','left':pixels[0]+'px','top':pixels[1]+'px'},{'title':name}); test_block.properties = { 'geoh':geoh, 'geov':geov, 'width':32, 'height':32 }; test_block.reposition = function() { var pixel_coordinates = hotelmap_lite.utility.geoToPixel( this.properties.geoh, this.properties.geov ); this.style.left = ( pixel_coordinates[0] - (this.properties.width / 2 ) ) + "px" ; this.style.top = ( pixel_coordinates[1] - this.properties.height ) + "px" ; } hotelmap_lite.views.hotels.appendChild(test_block); } catch ( myException ) { alert("Exception: " + myException.message); } } } }; /** * Hotelmap - Lite - Event Mode */ hotelmap_lite.events = { meta_capture: function() { // hotelmap_lite.dd = hotelmap_lite.utility.element("div",{'zIndex':'999999','position':'absolute','left':'0px','top':'0px','width':'200px','height':'200px','backgroundColor':'#FFFFFF'},null); // document.body.appendChild(hotelmap_lite.dd); var metaLocation = { location : null, poi : [], points : [] }; var meta = document.getElementsByTagName("meta"); for ( var i = 0 ; i < meta.length ; i++ ) { var m=meta[i]; //id,geoh,geov,location_name,pointer_type if ( m.getAttribute("name") == "londontown-location") { var c = m.getAttribute("content"); var segments = c.split(","); metaLocation.location = {'id':segments[0],'geoh':segments[1],'geov':segments[2],'name':segments[3],'pointer':segments[4]}; if ( segments[3].length > 20 ) { document.getElementById("centric_title").style.fontSize = '15px'; document.getElementById("centric_title").style.fontWeight = 'bold'; } document.getElementById("centric_title").innerHTML = segments[3].toUpperCase(); try { var ctitle = m.getAttribute("title"); if ( ctitle ) document.getElementById("centric_sub").innerHTML = ctitle; } catch ( werwer ) {} } //id,geoh,geov,location_name,pointer_type if ( m.getAttribute("name") == "londontown-poi") { var c = m.getAttribute("content"); var segments = c.split(","); segments[3]=segments[3].replace("@@",""); metaLocation.poi.push({'id':segments[0],'geoh':segments[1],'geov':segments[2],'name':segments[3],'pointer':segments[4]}); } //id,geoh,geov,name,type,link if ( m.getAttribute("name") == "londontown-point") { //for ( var k=0;k<5;k++ ) { var c = m.getAttribute("content"); var segments = c.split(","); segments[3]=segments[3].replace("@@",""); var type = m.getAttribute("type"); var image = m.getAttribute("image"); var desc = m.getAttribute("desc"); var cate = m.getAttribute("category"); var nid = m.getAttribute("nid"); desc = desc.replace(/@@/g, ","); var isOffer = ""; var isBookable = ""; var isMichelin = ""; try { isBookable = m.getAttribute("book_online"); isMichelin = m.getAttribute("michelin_star"); isOffer = m.getAttribute("deal"); } catch ( isExceptionElement ) {} var pointLocation = {'offer':isOffer,'michelin':isMichelin,'bookable':isBookable,'nid':nid,'pointer':type,'category':cate,'image':image,'desc':desc,'id':segments[0],'geoh':segments[1],'geov':segments[2],'name':segments[3],'type':segments[4],'link':segments[5]}; //console.dir(pointLocation); metaLocation.points.push(pointLocation); hotelmap_lite.utility.scrolls.new_article_entry(pointLocation,hotelmap_lite.utility.scrolls.internal_contents); //} } } if ( metaLocation.location ){ if ( metaLocation.location.pointer=='black' ){ hotelmap_lite.utility.pointers.black_pointer(metaLocation.location.geoh,metaLocation.location.geov,metaLocation.location.name); } if ( metaLocation.location.pointer=='green' ){ hotelmap_lite.utility.pointers.small_green_pointer(metaLocation.location.geoh,metaLocation.location.geov); } hotelmap_lite.utility.JumpDirect(metaLocation.location.geoh,metaLocation.location.geov); } if ( metaLocation.poi.length > 0 ){ for ( var j = 0; j < metaLocation.poi.length ; j++ ) { if ( metaLocation.poi[j].pointer=='black' ){ hotelmap_lite.utility.pointers.black_pointer(metaLocation.poi[j].geoh,metaLocation.poi[j].geov,metaLocation.poi[j].name); } if ( metaLocation.poi[j].pointer=='green' ){ hotelmap_lite.utility.pointers.small_green_pointer(metaLocation.poi[j].geoh,metaLocation.poi[j].geov); } } } if ( metaLocation.points.length > 0 ) { for ( var i = 0 ; i < metaLocation.points.length ; i++ ) { if ( metaLocation.points[i].pointer=='black' ){ hotelmap_lite.utility.pointers.black_pointer(metaLocation.points[i].geoh,metaLocation.points[i].geov,metaLocation.points[i].name); } if ( metaLocation.points[i].pointer=='green' ){ hotelmap_lite.utility.pointers.small_green_pointer(metaLocation.points[i].geoh,metaLocation.points[i].geov); } if ( metaLocation.points[i].pointer=='bluepoint' ){ hotelmap_lite.utility.pointers.blue_pointer(metaLocation.points[i]); } if ( metaLocation.points[i].pointer=='restaurant') { hotelmap_lite.utility.pointers._custom_restaurant_pointer(metaLocation.points[i]); } } } /* Now lets assess whether we have the scroll bar or not */ try { var isTargetScrolling = ( parseInt( hotelmap_lite.utility.scrolls.field_container.style.height ) < parseInt( hotelmap_lite.utility.scrolls.field_container.scrollHeight ) ) ? true : false ; if ( !isTargetScrolling ) { var count = 0; var targets = document.getElementsByTagName("div") ; //console.log("M: Scrolling is NOT enabled within this view point"); for ( var i = 0 ; i < targets.length ; i++ ) { if ( targets[i].id == 'article_element' ) { count++; targets[i].style.width = '364px'; } } // //hotelmap_lite.utility.scrolls.cr_major_container.style.border = '1px solid #FF0000'; // console.log("M: Target Elements: " + count); // console.log("M: Element Pixels: " + ( parseInt(count) * 102 ) ); //hotelmap_lite.utility.scrolls.cr_major_container.style.height = ( parseInt(count) * 102 ) + 73 + "px"; } else { var targets = document.getElementsByTagName("div") ; for ( var i = 0 ; i < targets.length ; i++ ) { if ( targets[i].id == 'article_element' ) { count++; targets[i].style.width = '368px'; targets[i].contentMode.style.width = '240px'; } } } } catch ( scrollBarExistException ) { // Empty } }, fullscreen : function() { // Empty for the moment. }, move : function(event) { event = (event) ? event : window.event; if ( hotelmap_lite.mouse.down ) { clearInterval( hotelmap_lite.mouse.interval ); hotelmap_lite.views.maps.style.left = hotelmap_lite.views.hotels.style.left = (hotelmap_lite.mouse.gleft + (event.clientX - hotelmap_lite.mouse.pointX))+"px"; hotelmap_lite.views.maps.style.top = hotelmap_lite.views.hotels.style.top = (hotelmap_lite.mouse.gtop + (event.clientY - hotelmap_lite.mouse.pointY))+"px"; hotelmap_lite.mouse.interval = setInterval( function(){ hotelmap_lite.tiling.images(); }, 100); } return false; }, down: function(event) { event = (event) ? event : window.event; hotelmap_lite.mouse.gleft = parseInt(hotelmap_lite.views.maps.style.left); hotelmap_lite.mouse.gtop = parseInt(hotelmap_lite.views.maps.style.top); hotelmap_lite.mouse.pointX = event.clientX; hotelmap_lite.mouse.pointY = event.clientY; hotelmap_lite.mouse.down = true; try { runoptions(); } catch ( eo ){} return false; }, up : function(event) { event = (event) ? event : window.event; clearInterval( hotelmap_lite.mouse.interval ); hotelmap_lite.mouse.down = false; hotelmap_lite.tiling.images(); var sl = Math.abs(parseInt(hotelmap_lite.views.hotels.style.left)) + (hotelmap_lite.dimensions.width/2); var st = Math.abs(parseInt(hotelmap_lite.views.hotels.style.top)) + (hotelmap_lite.dimensions.height/2); var gh = hotelmap_lite.utility.pixelToGeo(sl,st); hotelmap_lite.geoh = gh[0]; hotelmap_lite.geov = gh[1]; return false; }, // -- // Tubes // Shows or hides the tubes // -- tubes : function( object_checkbox_reference ) { var tube_state = (object_checkbox_reference.checked ) ? true : false; hotelmap_lite.tubes_enabled = tube_state; hotelmap_lite.tiling.images(); }, // -- // Fully Booked // Shows or hides the fully booked hotels // -- fully_booked : function( object_checkbox_reference ) { var state = (!object_checkbox_reference.checked ) ? true : false; // Reversed since the option is checked for hiding and unchecked for display for ( var i = 0 ; i < hotelmap_lite.views.hotels.childNodes.length ; i++ ) { if ( hotelmap_lite.views.hotels.childNodes[i].properties.isFullyBooked == "0" ) { hotelmap_lite.views.hotels.childNodes[i].style.display = (state) ? "" : "none" ; } } }, // -- // Price Switcher // Switches from the various types of price views we offer // -- price_switcher : function( price_selection ) { var cycle_hotel_count = 0 ; var price_types = ['PricePerNightExTax','PricePerNightIncTax','TotalCostExTax','TotalCostIncTax','AvgCostPerNightExTax','AvgCostPerNightIncTax']; for ( var i = 0 ; i < price_types.length ; i++ ) if ( price_selection.value == price_types[i] ) pt = price_types[i] ; for ( var j = 0 ; j < hotelmap_lite.views.hotels.childNodes.length ; j++ ) { cycle_hotel_count++; var hotel_obj = hotelmap_lite.views.hotels.childNodes[j]; if ( hotel_obj && hotel_obj.hotel_identity==1 && hotel_obj.properties.isFullyBooked == "1") { hotel_obj.price_node.innerHTML = hotel_obj.properties.rates[pt].rate; hotel_obj.properties.vis_rate_type = hotel_obj.properties.rates[pt].vrt; hotel_obj.properties.vis_tax_type = hotel_obj.properties.rates[pt].vtt; } } }, focus_hotel : function( hotel_selection ) { var hotel_object = document.getElementById(hotel_selection.value); hotelmap_lite.utility.JumpDirect( hotel_object.properties.geoh, hotel_object.properties.geov ) ; hotelmap_lite.tiling.images(); hotelmap_lite.listings.launch_rate_view(hotel_object); }, full_screen_resize_adjust : function() { if ( hotelmap_lite.fullscreen ) { // document.body.style.overflow = 'hidden'; var d = hotelmap_lite.utility.dimensions(); hotelmap_lite.dimensions.width = d[0]; hotelmap_lite.dimensions.height= d[1]; hotelmap_lite.basic.style.position = 'fixed'; hotelmap_lite.basic.style.left = '0px'; hotelmap_lite.basic.style.top = '0px'; hotelmap_lite.basic.style.width = d[0]+"px"; hotelmap_lite.basic.style.height = d[1]+"px"; hotelmap_lite.views.nav.style.width = d[0]+"px"; hotelmap_lite.views.nav.style.height = d[1]+"px"; hotelmap_lite.zoom_control.style.left = ( d[0] - 40 ) + "px" ; hotelmap_lite.zoom_control.style.top = hotelmap_lite.controls.zoom.top_place + "px" ; hotelmap_lite.tiling.images(); if ( hotelmap_lite.londontown.adjust_fs_position ) { hotelmap_lite.views.fscreen.style.left = hotelmap_lite.zoom_control.style.left; } } } }; hotelmap_lite.controls = {}; hotelmap_lite.controls.zoom = { top_place : 20, number_of_zoom_levels : hotelmap_lite.zooms.length, // How many zooms do we have to deal with! slide_distance : 67, // -- // initialise_control_view // Create the zoom control and add functionality // -- initialise_control_view : function() { var left_place = hotelmap_lite.dimensions.width - 40; var top_place = hotelmap_lite.controls.zoom.top_place; var image_reference = { 'ins' : '/hotels/resource/images/zoom/zoomin.png', 'out' : '/hotels/resource/images/zoom/zoomout.png', 'slide' : '/hotels/resource/images/zoom/slide.png', 'point' : '/hotels/resource/images/zoom/point.png' }; var zoom_control = hotelmap_lite.utility.element("div", {'zIndex':'99999','position':'absolute','left':left_place+'px', 'top':top_place+'px', 'width':'60','height':'121'},null); var zoom_in_subcontrol = hotelmap_lite.utility.element("img", {'position':'absolute','left':'0px', 'top':'0px'},{'src':image_reference.ins}); var zoom_out_subcontrol = hotelmap_lite.utility.element("img", {'position':'absolute','left':'0px', 'top':'94px'},{'src':image_reference.out}); var zoom_slide_subcontrol = hotelmap_lite.utility.element("div", {'position':'absolute','left':'0px', 'top':'27px','width':'24px','height':'67px','backgroundImage':'url('+image_reference.slide+')'},null); var zoom_point = hotelmap_lite.utility.element("img", {'position':'absolute','left':'2px', 'top':'27px','width':'19px','height':'17px'},{'src':image_reference.point}); zoom_control.appendChild( zoom_in_subcontrol ) ; zoom_control.appendChild( zoom_out_subcontrol ) ; zoom_control.appendChild( zoom_slide_subcontrol ) ; zoom_control.appendChild( zoom_point ) ; hotelmap_lite.zoom_control = zoom_control; hotelmap_lite.views.controls.appendChild( zoom_control ) ; // -- // Postioning - Determine the correct position of the point given our current zoom level hotelmap_lite.controls.zoom.determine_correct_top_zoom_position(zoom_point); zoom_in_subcontrol.point = zoom_point; zoom_out_subcontrol.point = zoom_point; // -- // Controller mechanism for zoom buttons zoom_in_subcontrol.onmousedown = function() { hotelmap_lite.zoomevent.old_level = hotelmap_lite.level; hotelmap_lite.level++; if ( hotelmap_lite.level > 6 ) hotelmap_lite.level = 6; hotelmap_lite.controls.zoom.determine_correct_top_zoom_position(this.point); hotelmap_lite.zoomevent.zoom_level_changed(); } zoom_out_subcontrol.onmousedown = function() { hotelmap_lite.zoomevent.old_level = hotelmap_lite.level; hotelmap_lite.level--; if ( hotelmap_lite.level < 0 ) hotelmap_lite.level = 0; hotelmap_lite.controls.zoom.determine_correct_top_zoom_position(this.point); hotelmap_lite.zoomevent.zoom_level_changed(); } }, // -- // Method to correctly position the slider within the zoom controller. // [all-level - current-level determine_correct_top_zoom_position : function( control ) { var distance_per_move = hotelmap_lite.controls.zoom.slide_distance / hotelmap_lite.controls.zoom.number_of_zoom_levels; var point_location = 6 - hotelmap_lite.level ; var top_point = point_location * distance_per_move; control.style.top = (27 + top_point) + "px"; } }; // -- // Manage the tiles & elements when the zoom action is called. hotelmap_lite.zoomevent = { old_level : 0, tof : null, zoom_level_changed : function() { clearTimeout(hotelmap_lite.zoomevent.tof); var hRatio = hotelmap_lite.zooms[hotelmap_lite.level].x2 / hotelmap_lite.zooms[hotelmap_lite.zoomevent.old_level].x2; var vRatio = hotelmap_lite.zooms[hotelmap_lite.level].y2 / hotelmap_lite.zooms[hotelmap_lite.zoomevent.old_level].y2; if ( hotelmap_lite.zoomevent.old_level != hotelmap_lite.level ) { for ( var i = 0 ; i < hotelmap_lite.views.maps.childNodes.length; i++ ) { var w = parseInt( hotelmap_lite.views.maps.childNodes[i].width ) * hRatio; var h = parseInt( hotelmap_lite.views.maps.childNodes[i].height ) * vRatio; var l = Math.round(parseInt( hotelmap_lite.views.maps.childNodes[i].style.left ) * hRatio); var t = Math.round(parseInt( hotelmap_lite.views.maps.childNodes[i].style.top ) * vRatio); hotelmap_lite.views.maps.childNodes[i].width = (w+2); hotelmap_lite.views.maps.childNodes[i].height = (h+2); //+ ( parseInt( mapCollection[i].height ) * 0.25 ); hotelmap_lite.views.maps.childNodes[i].style.left = (l-1)+"px"; //+ ( parseInt( mapCollection[i].style.left ) * 0.25 ); hotelmap_lite.views.maps.childNodes[i].style.top = (t-1)+"px"; } } for ( var i = 0 ; i < hotelmap_lite.views.hotels.childNodes.length; i++ ) { try { var ho = hotelmap_lite.views.hotels.childNodes[i]; ho.reposition(); // console.log(i+": "+ho); } catch ( e ) { } } hotelmap_lite.utility.JumpDirect( hotelmap_lite.geoh, hotelmap_lite.geov ); hotelmap_lite.zoomevent.tof = setTimeout(function(){ hotelmap_lite.tiling.images(true); }, 150 ); } }; hotelmap_lite.listings = { rate_list : [], set_rate_list : function( RL ) { hotelmap_lite.listings.rate_list = RL; hotelmap_lite.listings.build_basic_icon_set(); }, build_basic_icon_set : function() { var list = hotelmap_lite.listings.rate_list ; if ( list.length > 0 ) { for ( var i = 0 ; i < list.length ; i++ ) { var hotel_object = hotelmap_lite.utility.element("div",{'zIndex':'100','border':'0px solid #FF0000','position':'absolute', 'width':'55px','height':'81px'},null); hotel_object.properties = {}; //console.log("base identity: " + list[i].base ) ; hotel_object.id = "BSE_" + list[i].base; hotel_object.properties.book_uri = list[i].direct_uri; hotel_object.properties.rack_rate = list[i].rackrate; hotel_object.properties.station = list[i].station; hotel_object.properties.geoh = list[i].x; hotel_object.properties.geov = list[i].y; hotel_object.properties.rates = list[i].rates; hotel_object.properties.formatted_uri = list[i].uri; hotel_object.properties.view_type = list[i].pt; hotel_object.properties.discount = list[i].discount; hotel_object.properties.vis_tax_type = list[i].vtt; hotel_object.properties.vis_rate_type = list[i].vrt; hotel_object.properties.survey = list[i].survey; hotel_object.properties.short_desc = list[i].shorts; hotel_object.properties.icon_pic = list[i].icon; hotel_object.properties.description = list[i].desc; hotel_object.properties.hotel_base = list[i].base; hotel_object.properties.stars = list[i].stars; hotel_object.properties.hotel_name = list[i].hotel; hotel_object.properties.isFullyBooked = list[i].price; hotel_object.properties.basic_icon = "/hotels/resource/images/newmap/basic_map_icon.png"; hotel_object.properties.width = 55; hotel_object.properties.height = 81; hotel_object.title = list[i].hotel; hotel_object.style.cursor = 'pointer'; hotel_object.hotel_identity = 1; hotel_object.onmousedown = function() { if ( this.properties.isFullyBooked === "1" ) hotelmap_lite.listings.launch_rate_view(this); } var pixel_coordinates = hotelmap_lite.utility.geoToPixel( hotel_object.properties.geoh, hotel_object.properties.geov ); hotel_object.style.left = ( pixel_coordinates[0] - (hotel_object.properties.width / 2 ) ) + "px" ; hotel_object.style.top = ( pixel_coordinates[1] - hotel_object.properties.height ) + "px" ; hotel_object.reposition = function() { var pixel_coordinates = hotelmap_lite.utility.geoToPixel( this.properties.geoh, this.properties.geov ); this.style.left = ( pixel_coordinates[0] - (this.properties.width / 2 ) ) + "px" ; this.style.top = ( pixel_coordinates[1] - this.properties.height ) + "px" ; } var icon_base = hotelmap_lite.utility.element("img", {'zIndex':'90','position':'absolute','left':'0px','top':'0px'},{'src':'/hotels/resource/images/newmap/basic_map_icon.png'}); hotel_object.appendChild( icon_base ) ;; // -- // We will not show any star rating for a fully booked property if ( hotel_object.properties.isFullyBooked === "1" ) { var ico_image = hotelmap_lite.utility.element("div", {'zIndex':'99','position':'absolute','width':'55px','height':'10px','textAlign':'center','left':'0px','top':'17px'} ); ico_image.innerHTML = ""; hotel_object.appendChild( ico_image ) ; } var price_node = hotelmap_lite.utility.element("div", {'border':'0px solid #00FF00','fontFamily':'Arial','textDecoration':'bold','fontSize':'12px','color':'#FFFFFF','zIndex':'91','position':'absolute','width':'55px','height':'13px','textAlign':'center','left':'0px','top':'2px'} ); price_node.innerHTML = hotel_object.properties.rates[pt].rate; if ( hotel_object.properties.isFullyBooked === "0" ) { price_node.style.top = '4px'; price_node.style.fontSize = '10px'; price_node.style.lineHeight = '11px'; price_node.style.fontWeight = 'bold'; price_node.innerHTML = "Fully
Booked"; hotel_object.style.display = 'none'; // By Default everything is hidden if fully booked. } hotel_object.appendChild( price_node ); hotelmap_lite.views.hotels.appendChild( hotel_object ) ; hotel_object.price_node = price_node; // -- // Add new option to the drop for hotel. if ( hotel_object.properties.isFullyBooked === "1" ) { var select_option = hotelmap_lite.utility.element("option", null, {'value':hotel_object.id,'innerHTML':hotel_object.properties.hotel_name} ); select_option.text = hotel_object.properties.hotel_name; hotelmap_lite.select_drop.appendChild( select_option ) ; } //console.log("Complete run"); } } }, ert_reference : null, launch_rate_view: function( hotel_object ){ try { if ( hotelmap_lite.listings.ert_reference ) hotelmap_lite.listings.ert_reference.parentNode.removeChild(hotelmap_lite.listings.ert_reference ); } catch (noRemovalException ) { //console.log("Error Removing Enclosure Object: " + noRemovalException.message); } hotelmap_lite.geoh = hotel_object.properties.geoh; hotelmap_lite.geov = hotel_object.properties.geov; var curleft = (parseInt(hotel_object.style.left)+28) - (743/2); var curtop = parseInt(hotel_object.style.top) - 118; hotelmap_lite.utility.JumpDirect( hotel_object.properties.geoh, hotel_object.properties.geov ) ; // Create the housing enclosure and append to the hotel view object var enclosure = hotelmap_lite.utility.element("div", {'backgroundColor':'#F5F5F5','zIndex':'99999','border':'2px solid #546E80','width':'743px','height':'146px','position':'absolute','left':curleft+"px",'top':curtop+"px"},null); hotelmap_lite.views.hotels.appendChild(enclosure); if ( !hotel_object.properties.icon_pic.match("http")) { var hotelimage = hotelmap_lite.utility.element("img",{'position':'absolute','left':'2px','top':'2px','width':'142px','height':'142px'},{'src':'http://photocdn.ltstatic.com'+hotel_object.properties.icon_pic+'_340x284.jpg'}); enclosure.appendChild(hotelimage); } else { var hotelimage = hotelmap_lite.utility.element("img",{'position':'absolute','left':'2px','top':'2px','width':'142px','height':'142px'},{'src':hotel_object.properties.icon_pic}); enclosure.appendChild(hotelimage); } var hotelname = hotelmap_lite.utility.element("div",{'position':'absolute','left':'155px','top':'12px','width':'440px','height':'21px'},{'innerHTML':hotel_object.properties.hotel_name,'className':'result-title blue-text'}); enclosure.appendChild(hotelname); var stars = hotelmap_lite.utility.element("div",{'position':'absolute','left':'155px','top':'36px','width':'440px','height':'14px'},{'innerHTML':'','className':'black-text bold'}); enclosure.appendChild(stars); enclosure.hotel_object = hotel_object; enclosure.reposition = function() { var pixel_coordinates = hotelmap_lite.utility.geoToPixel( this.hotel_object.properties.geoh, this.hotel_object.properties.geov ); this.style.left = ( pixel_coordinates[0] - (743/2) ) + "px" ; this.style.top = ( pixel_coordinates[1] - this.hotel_object.properties.height - 118 ) + "px" ; } for ( var i = 0 ; i < hotel_object.properties.stars ; i++ ) stars.appendChild(hotelmap_lite.utility.element("img", null, {'src':'/images/gold-hotelsearch/star.gif'})); var lfg = (i*11)+159; var typeHotel = hotelmap_lite.utility.element("div",{'position':'absolute','left':lfg+'px','top':'34px','width':'440px','height':'14px'},{'innerHTML':hotel_object.properties.view_type,'className':'gold-title bold'}); enclosure.appendChild(typeHotel); var close = hotelmap_lite.utility.element("img",{'cursor':'pointer','zIndex':'99999','position':'absolute','left':'732px','top':'-10px'},{'src':'/hotels/resource/images/maphead/close_item.png'}); enclosure.appendChild(close); close.referenceObject = enclosure ; hotelmap_lite.listings.ert_reference = enclosure; close.onmousedown=function(){ this.referenceObject.parentNode.removeChild( this.referenceObject ); } var nearby = hotelmap_lite.utility.element("div",{'position':'absolute','left':'155px','top':'50px','width':'440px','height':'14px'},{'innerHTML':hotel_object.properties.short_desc.replace("Near","Near"),'className':'black-text '}); enclosure.appendChild(nearby); if ( hotel_object.properties.station ) { nearby.innerHTML += " | "+string_view.vStation+": " + hotel_object.properties.station; } var survey = hotelmap_lite.utility.element("div",{'position':'absolute','left':'155px','top':'67px','width':'440px','height':'14px'},{'innerHTML':''+string_view.vCusRating+': '+hotel_object.properties.survey+'% '+string_view.vPercOfCustomers,'className':'black-text'}); enclosure.appendChild(survey); var desc = hotelmap_lite.utility.element("div",{'position':'absolute','left':'155px','top':'84px','width':'405px','height':'14px','font-size':'11px'},{'innerHTML':hotel_object.properties.description.substr(0,200)+'.. more','className':'grey-text'}); enclosure.appendChild(desc); var block = hotelmap_lite.utility.element("div",{'paddingLeft':'1px solid #FFFFFF','backgroundColor':'#f0f0f0','position':'absolute','left':'591px','top':'2px','width':'148px','height':'142px'},null); enclosure.appendChild(block); if ( hotel_object.properties.rack_rate && hotel_object.properties.survey > 5 && hotel_object.properties.discount < 96 ) { if ( hotel_object.properties.vis_tax_type.match("including") ) hotel_object.properties.rack_rate = Math.round(parseInt(hotel_object.properties.rack_rate) + ((parseInt(hotel_object.properties.rack_rate)/100)*20)); var priceblock = hotelmap_lite.utility.element("div",{'textDecoration':'line-through','position':'absolute','left':'610px','top':'12px', 'width':'115px', 'fontSize':'15px'},{'innerHTML':'was £'+hotel_object.properties.rack_rate,'className':'price-text-hotel blue-text bold'}); enclosure.appendChild(priceblock); } var priceblock = hotelmap_lite.utility.element("div",{'textAlign':'right','position':'absolute','left':'615px','top':'12px', 'width':'115px'},{'innerHTML':''+hotel_object.properties.rates[pt].rate,'className':'price-text-hotel blue-text bold'}); enclosure.appendChild(priceblock); var vrt = hotelmap_lite.utility.element("div",{'textAlign':'right','position':'absolute','left':'615px','top':'34px', 'width':'115px'},{'innerHTML':string_view[hotel_object.properties.vis_rate_type],'className':'grey-text'}); enclosure.appendChild(vrt); var vtt = hotelmap_lite.utility.element("div",{'textAlign':'right','position':'absolute','left':'615px','top':'49px', 'width':'115px'},{'innerHTML':string_view[hotel_object.properties.vis_tax_type],'className':'grey-text'}); enclosure.appendChild(vtt); hotel_object.vrt = vrt; hotel_object.vtt = vtt; if ( hotel_object.properties.discount < 96 ) { var discount = hotelmap_lite.utility.element("div",{'textAlign':'right','position':'absolute','left':'585px','top':'75px', 'width':'145px','textAlign':'right'},{'innerHTML':string_view.SAVE+' '+hotel_object.properties.discount+'%','className':'gold-title-price bold'}); enclosure.appendChild(discount); } var moreinfo = hotelmap_lite.utility.element("div",{'cursor':'pointer','textAlign':'right','position':'absolute','left':'615px','top':'104px', 'width':'115px'},{'innerHTML':''}); enclosure.appendChild(moreinfo); moreinfo.uri = hotel_object.properties.formatted_uri; moreinfo.onmousedown=function() { location.href = this.uri; }; try { ajax.remote.get("/hotels/live/ia_ader?acp=HT_SEL&"); } catch ( exceptionACP ) { } } }