// Displayed Savings Pop-Up v.5if (expDS === undefined) {	var expDS = {		dsCopy: '<div class="ds-title">Save with Flight + Hotel!</div><div class="ds-copy">As the world\'s largest online travel agency, we\'re able to get special Flight + Hotel discounts from our partners...and pass them on to you. In fact, <strong>Expedia customers saved $410 million by booking Flight + Hotel together last year.</strong></div>',		dsCTALink: null,		dsCTACopy: null,				coords:{popupX:0, popupY:0, arrowX:0, arrowY:0, clickX:0, clickY:0},        		triggerElement:null,		popupDiv:null,		popupDivPaddingVert: 50,		popupDivPaddingHoriz: 5,        popupIFrame:null,		arrowDiv:null,        isIE:(/\w*MSIE\w*/).test(navigator.appVersion),		previousDivHeight:0,		isInited:false,		init:function()		{								            this.createDiv();            this.createIF();							this.createArrow();			this.isInited = true;		},		        showDS:function(el,event)        {			(typeof el == 'string')?el = document.getElementById(el):el = el;			this.coords.clickX = (window.Event) ? event.pageX : event.clientX;			this.coords.clickY = (window.Event) ? event.pageY : (event.clientY + this.getScrollHeight());			if (!this.isInited)			{				this.init();			}            this.triggerElement = el;                        this.show();        },	        hideDS:function()        {               if (this.popupDiv != null)this.popupDiv.style.display = 'none';            if (this.popupIFrame != null && this.isIE ) this.popupIFrame.style.display = 'none';			this.hideArrow();        },        show:function()        {                   this.setCoords();      						this.showArrow();            var _top = this.coords.popupY + 'px';            var _left = this.coords.popupX + 'px';						                        this.popupDiv.style.top = _top;            this.popupDiv.style.left = _left;					this.popupDiv.style.visibility ='hidden';	            this.popupDiv.style.display = 'block';			                                    if (this.isIE)            {                this.popupIFrame.style.width = this.popupDiv.offsetWidth+'px';                this.popupIFrame.style.height = this.popupDiv.offsetHeight+'px';                this.popupIFrame.style.top = _top;                            this.popupIFrame.style.left = _left;                this.popupIFrame.style.display = 'block';            }                        this.check();						this.popupDiv.style.visibility ='visible';        },					        createDiv:function()        {                        if(this.popupDiv == null)            {                this.popupDiv = document.createElement('div');                this.popupDiv.id = 'ds-div';            	this.popupDiv.innerHTML = this.createContent();				                this.popupDiv.style.zIndex = '9999';                this.popupDiv.style.display = 'none';                this.popupDiv.style.position= 'absolute';                                document.body.appendChild(this.popupDiv);            }        },        createIF:function()        {            if(this.isIE && this.popupIFrame == null)            {                this.popupIFrame = document.createElement('iframe');                this.popupIFrame.id='ds-if';                this.popupIFrame.src='';                this.popupIFrame.style.zIndex='9998';                this.popupIFrame.style.display='none';                this.popupIFrame.style.position='absolute';                this.popupIFrame.style.top = 0;                this.popupIFrame.style.left = 0;                this.popupIFrame.frameBorder=0;                this.popupIFrame.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=0)';                document.body.appendChild(this.popupIFrame);			            }        },		createArrow:function()		{			            if(this.arrowDiv == null)            {                this.arrowDiv = document.createElement('div');                this.arrowDiv.id = 'ds-arw';				this.arrowDiv.className = 'ds-arwL';				this.arrowDiv.innerHTML = '&nbsp;';                this.arrowDiv.style.position= 'absolute'; 								                this.arrowDiv.style.zIndex = '10000';                this.arrowDiv.style.display = 'none';                              document.body.appendChild(this.arrowDiv);            }								},        		createContent:function()        {             return [				'<div id="ds-js-all">',					'<div id="ds-top">',						'<div id="ds-top-left">&nbsp;</div>',						'<div id="ds-top-center">&nbsp;</div>',						'<div id="ds-top-right">&nbsp;</div>',					'</div>',					'<div style="clear:both;"></div>',					'<div id="ds-body-wrapper">',						'<div id="ds-body-left">&nbsp;</div>',						'<div id="ds-body-content">',							'<div id="ds-body-close">',								'<div id="ds-close-button" onclick="expDS.hideDS();return false;">&nbsp;</div>',							'</div>',							'<div id="ds-body-copy">',								this.dsCopy,							'</div>',							'<div id="ds-body-link">',								'<a href="',								this.dsCTALink,								'">',								this.dsCTACopy,								'</a>',							'</div>',						'</div>',						'<div id="ds-body-right">&nbsp;</div>',					'</div>',					'<div style="clear:both;"></div>',					'<div id="ds-bottom">',						'<div id="ds-bottom-left">&nbsp;</div>',						'<div id="ds-bottom-center">&nbsp;</div>',						'<div id="ds-bottom-right">&nbsp;</div>',					'</div>',				'</div>'                 ].join('');        },					showArrow:function()		{			this.hideArrow();            var _top = this.coords.arrowY + 'px';            var _left = this.coords.arrowX + 'px';            this.arrowDiv.style.top = _top;            this.arrowDiv.style.left = _left;						this.arrowDiv.style.display = 'block';		},		hideArrow:function()		{						if (this.arrowDiv != null)this.arrowDiv.style.display = 'none';		},			setCoords:function()		{			var el = this.triggerElement;			var elOffsetTop = 0;			var elOffsetLeft = 0;            while (el != null)            {                elOffsetTop += el.offsetTop;                elOffsetLeft += el.offsetLeft;                el = el.offsetParent;             }			var elWidth = this.triggerElement.offsetWidth;			var elHeight = this.triggerElement.offsetHeight;			var popupWidth = this.popupDiv.offsetWidth;						var popupHeight = this.popupDiv.offsetHeight;						var arrowWidth = this.arrowDiv.offsetWidth;			var arrowHeight = this.arrowDiv.offsetHeight;			var arrowDirection = null;			var screenWidth = this.getScreenWidth();			var screenHeight = this.getScreenHeight();						//Position the arrow vertically						this.coords.arrowY = this.coords.clickY - arrowHeight/2; 						//Position the arrow horizontally			if((elOffsetLeft + elWidth + arrowWidth + popupWidth + this.popupDivPaddingHoriz) < screenWidth)			{				this.arrowDiv.className = 'ds-arwL';				arrowDirection = 'left';				this.coords.arrowX = elOffsetLeft + elWidth + this.popupDivPaddingHoriz;			}			else			{				this.arrowDiv.className = 'ds-arwR';				arrowDirection = 'right';				this.coords.arrowX = elOffsetLeft - arrowWidth - this.popupDivPaddingHoriz;			}			//Position the popup vertically			var exceedsTop = (this.getScrollHeight() >= (this.coords.clickY - this.popupDivPaddingVert));			var exceedsBottom = ((this.getScreenHeight() + this.getScrollHeight()) <= (this.coords.clickY + (popupHeight - this.popupDivPaddingVert)));			var maxTopY = this.coords.clickY - (this.de('ds-top').offsetHeight + arrowHeight/2);			var maxBottomY = (this.coords.clickY - popupHeight) + (this.de('ds-top').offsetHeight + arrowHeight/2);						if (this.getScreenHeight() < popupHeight)			{				this.coords.popupY = this.getScrollHeight();			}			else if (exceedsTop)			{				this.coords.popupY = (maxTopY < this.getScrollHeight()) ? maxTopY : this.getScrollHeight();			}			else if (exceedsBottom)			{				this.coords.popupY = (maxBottomY > ((this.getScreenHeight() + this.getScrollHeight()) - popupHeight)) ? maxBottomY : (this.getScreenHeight() + this.getScrollHeight()) - popupHeight;			}			else			{				this.coords.popupY = this.coords.clickY - this.popupDivPaddingVert;			}			// Position popup horizontal						if (arrowDirection == 'left')			{				this.coords.popupX = elOffsetLeft + elWidth + arrowWidth + this.popupDivPaddingHoriz;			}			else			{				this.coords.popupX = elOffsetLeft - arrowWidth - popupWidth - this.popupDivPaddingHoriz;			}						if (this.getScrollLeft() > this.coords.popupX)			{				this.setClickCoords();			}						this.previousDivHeight = this.popupDiv.offsetHeight;        					},		setClickCoords:function()		{				this.arrowDiv.className = 'ds-arwL';					//Position the arrow						this.coords.arrowX = ((isIE)?(this.coords.clickX + this.getScrollLeft()):this.coords.clickX) + this.popupDivPaddingHoriz;			this.coords.arrowY = (this.coords.clickY - this.arrowDiv.offsetHeight/2);						//Position the popup						this.coords.popupX = ((isIE)?(this.coords.clickX + this.getScrollLeft()):this.coords.clickX) + this.popupDivPaddingHoriz + this.arrowDiv.offsetWidth;							this.coords.popupY = (this.coords.clickY - this.popupDivPaddingVert);		},													getScrollHeight:function()        {            if(document.documentElement.scrollTop)            {                return document.documentElement.scrollTop;            }                        if(document.body.scrollTop)            {                return document.body.scrollTop;            }                        if(window.pageYOffset)            {                return window.pageYOffset;            }                        return 0;        },	  	              getScreenHeight:function()        {			            if(window.innerHeight)            {				                return window.innerHeight;            }						            if(document.documentElement.clientHeight)            {				                return document.documentElement.clientHeight;            }			            if(document.body.clientHeight)            {				                return document.body.clientHeight;            }                        return 0;        },        getScrollLeft:function()        {            if(document.documentElement.scrollLeft)            {                return document.documentElement.scrollLeft;            }                        if(document.body.scrollLeft)            {                return document.body.scrollLeft;            }                        if(window.pageXOffset)            {			                return window.pageXOffset;				            }                        return 0;        },		        getScrollWidth:function()        {            if(document.documentElement.scrollWidth)            {                return document.documentElement.scrollWidth;            }                        if(document.body.scrollWidth)            {                return document.body.scrollWidth;            }                        if(window.pageXOffset)            {				                return window.pageXOffset;				            }                        return 0;        },		  	              getScreenWidth:function()        {            if(window.innerWidth)            {				var windowInnerWidth = window.innerWidth;				var scrollWidth = this.getScrollWidth();                return (scrollWidth < windowInnerWidth)?scrollWidth:windowInnerWidth;            }                        if(document.documentElement.clientWidth)            {                return document.documentElement.clientWidth;            }                        if(document.body.clientWidth)            {                return document.body.clientWidth;            }                        return 0;        }, 	           		check:function()        {            var newOFHeight = this.popupDiv.offsetHeight;            if (this.previousDivHeight != newOFHeight)            {                this.show();            }                     },				 	    		de:function(id){return document.getElementById(id);}         };    }function doDS_SA(rfrr){    g_s_gsDelay=10;    s_linkTrackVars='prop16,eVar28';    s_linkType='o';    s_linkName='RFRR Action Link';    s_prop16=rfrr;    s_eVar28=rfrr;    s_lnk=s_co(this);    s_gs(s_account);    g_s_gsDelay=500;}
