/** Initial Set **/ var lt_theatre_promotion = { advert_chosen : '/TheatrePromotions/Images/Deliveries/theatredinner1.jpg', advert_header : '/TheatrePromotions/Images/SpecialOffers-Header.gif', advert_primary : '/TheatrePromotions/Images/Deliveries/discountedtheatre.gif', advert_cycle : 1, advert_hotel : '/TheatrePromotions/Images/Deliveries/hoteloffers.gif', enclosure : null, runner : function() { var dimensions = lt_theatre_promotion.dimensions(); enclosure = document.createElement("div") ; enclosure.id = "lt_theatre_promotion"; enclosure.style.position = 'absolute'; enclosure.style.left = (dimensions[0]/2) + (594/2) + 10; enclosure.style.top = 105; enclosure.style.width = 112; var specialOffer = document.createElement("img"); specialOffer.src = lt_theatre_promotion.advert_header; var advert_1 = document.createElement("img"); advert_1.src = lt_theatre_promotion.advert_primary; advert_1.style.cursor = 'pointer'; advert_1.onmousedown = function(){ location.href = '/halfpricetickets/'; } var advert_2 = document.createElement("img"); advert_2.src = lt_theatre_promotion.advert_chosen; advert_2.style.cursor = 'pointer'; advert_2.onmousedown = function(){ location.href = '/TheatreAndDinner/Home'; } var advert_3 = document.createElement("img"); advert_3.src = lt_theatre_promotion.advert_hotel; advert_3.style.cursor = 'pointer'; advert_3.onmousedown = function(){ location.href = 'http://www.londontown.com/mymaps/Today.php'; } enclosure.appendChild(specialOffer); enclosure.appendChild(lt_theatre_promotion.sep(4)); enclosure.appendChild(advert_2); enclosure.appendChild(lt_theatre_promotion.sep(21)); enclosure.appendChild(advert_1); enclosure.appendChild(lt_theatre_promotion.sep(21)); enclosure.appendChild(advert_3); document.body.appendChild(enclosure); }, sep : function(height) { var d = document.createElement("div"); d.style.paddingBottom = height; return d; }, 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 new Array(viewportwidth,viewportheight); }, test : function() { try { if( document.body ) { lt_theatre_promotion.runner(); } else { setTimeout( function() { lt_theatre_promotion.test(); } , 1500 ); } } catch ( exceptionElement ) { } }, scroll : function () { var dimensions = lt_theatre_promotion.dimensions(); enclosure.style.left = (dimensions[0]/2) + (594/2) + 10; } }; setTimeout( function() { lt_theatre_promotion.test(); } , 700 ); window.onresize = lt_theatre_promotion.scroll;