/* v1.0-min-prog-scroll-gen */ var progwaitinterval = null; var progress = { hotels : ["St Martins Lane A Morgans Original","The Connaught","The Berkeley","Rosewood London","The Ritz London","One Aldwych","Le Meridien Piccadilly","Ascott Mayfair London","Four Seasons London Park Lane","22 Jermyn St","London Marriott Hotel County Hall","Swissotel The Howard","InterContinental London Westminster","Sanderson A Morgans Hotel","Claridge's","Rocco Forte Brown's Hotel","The Egerton House Hotel","The Montcalm At Brewery London City","Andaz Liverpool Street","The Metropolitan","Athenaeum Hotel","Wyndham Grand London Chelsea Harbour","ME London","No. 11 Cadogan Gardens London","St. Pancras Renaissance London Hotel","W London Leicester Square","The Soho Hotel","The Lanesborough, a St. Regis Hotel","The Savoy London","Taj 51 Buckingham Gate, Suites & Residences","Royal Garden Hotel","Sanctum Soho Hotel","Sofitel London St James","The Stafford Hotel","The Hempel","The Halkin","The Milestone Hotel","The Bentley Hotel","The Courthouse Hotel","Hyatt Regency London The Churchill","Plaza on the River","Baglioni Hotel","Blakes Hotel","St.James's Hotel & Club","Landmark London Hotel"], rotate : function() { var increment = 0; progwaitinterval = setInterval(function(){ try{ var hotel_item = progress.hotels[increment]; if ( hotel_item && hotel_item != 'undefined') document.getElementById("prog_listing_scroll").innerHTML = hotel_item; increment++; if ( increment >= progress.hotels.length ) increment = 0; } catch ( ee ) {} },50); }, getDimensions : 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 new Array(viewportwidth,viewportheight); }, scroll : function() { try{ var width = 341; var lengthOfTime = 10; if ( rate_check ) { lengthOfTime = 5; width = 291; } var perHalfSecondIncrement = width / (lengthOfTime); var increment = 0; setInterval(function() { increment = increment + 0.5; var prog_width = increment * perHalfSecondIncrement; prog_width = ( prog_width < width ) ? prog_width : width; document.getElementById("prog_scoller").style.width = prog_width + "px"; if ( prog_width > width ) { setTimeout( function() { document.getElementById("prog_scoller").style.width=0 +"px"; increment = 0; } , 1000 ); } },500); } catch ( eee2 ) { console.log(eee2.message); } }, position: function() { var dim = progress.getDimensions(); var node = document.getElementById("zone"); if ( rate_check ) { node.style.left = (dim[0]/2) - (372/2) + "px"; node.style.top = (((dim[1]/2) - (166/2))-90) + "px"; node.style.display = ''; } else { node.style.left = (dim[0]/2) - (614/2) + "px"; node.style.top = (((dim[1]/2) - (293/2))-90) + "px"; node.style.display = ''; } } }; if (window.addEventListener) window.addEventListener("load", loadprogress, false) //invoke function if (window.attachEvent) window.attachEvent("onload", loadprogress) //invoke function function loadprogress() { progress.position(); progress.rotate(); progress.scroll(); }; window.onresize = function() { progress.position(); };