(function() { var widgetID = 47078; var agentHeaderID = null; if (!widgetID) { alert('Invalid widget ID given.'); return false; } function widgetMainOut() { var widgetElement = idx('#idxwidgetsrc-47078'); // if it doesn't exist try getting it the old have via the src if (!widgetElement.size()) { var src = (!isNaN(widgetID)) ? 'carousel.php?widgetid=47078' : 'carousel.php'; widgetElement = idx('script[src*="'+src+'"]'); } !function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&ka(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==na?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=qa(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=pa(j.x)>pa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Da&&f.eventType!==Fa||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ga&&(i>Ca||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=pa(l.x)>pa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:oa(c/b),y:oa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ha:pa(a)>=pa(b)?0>a?Ia:Ja:0>b?Ka:La}function H(a,b,c){c||(c=Pa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Pa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Qa)+I(a[1],a[0],Qa)}function K(a,b){return H(b[0],b[1],Qa)/H(a[0],a[1],Qa)}function L(){this.evEl=Sa,this.evWin=Ta,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Wa,this.evWin=Xa,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=Za,this.evWin=$a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Fa|Ga)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=ab,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Da|Ea)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Da)for(e=0;e-1&&d.splice(a,1)};setTimeout(e,bb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d=f&&cb>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,ib))return ib;var b=p(a,jb),c=p(a,kb);return b&&c?ib:b||c?b?jb:kb:p(a,hb)?hb:gb}function X(a){this.options=ka({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=lb,this.simultaneous={},this.requireFail=[]}function Y(a){return a&qb?"cancel":a&ob?"end":a&nb?"move":a&mb?"start":""}function Z(a){return a==La?"down":a==Ka?"up":a==Ia?"left":a==Ja?"right":""}function $(a,b){var c=b.manager;return c?c.get(a):a}function _(){X.apply(this,arguments)}function aa(){_.apply(this,arguments),this.pX=null,this.pY=null}function ba(){_.apply(this,arguments)}function ca(){X.apply(this,arguments),this._timer=null,this._input=null}function da(){_.apply(this,arguments)}function ea(){_.apply(this,arguments)}function fa(){X.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ga(a,b){return b=b||{},b.recognizers=l(b.recognizers,ga.defaults.preset),new ha(a,b)}function ha(a,b){this.options=ka({},ga.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ia(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ia(a,b){var c=a.element;c.style&&g(a.options.cssProps,function(a,d){c.style[u(c.style,d)]=b?a:""})}function ja(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var ka,la=["","webkit","Moz","MS","ms","o"],ma=b.createElement("div"),na="function",oa=Math.round,pa=Math.abs,qa=Date.now;ka="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;ch&&(b.push(a),h=b.length-1):e&(Fa|Ga)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Ya={touchstart:Da,touchmove:Ea,touchend:Fa,touchcancel:Ga},Za="touchstart",$a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Ya[a.type];if(b===Da&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Fa|Ga)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:ya,srcEvent:a})}}});var _a={touchstart:Da,touchmove:Ea,touchend:Fa,touchcancel:Ga},ab="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=_a[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:ya,srcEvent:a})}});var bb=2500,cb=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==ya,e=c.pointerType==Aa;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var db=u(ma.style,"touchAction"),eb=db!==d,fb="compute",gb="auto",hb="manipulation",ib="none",jb="pan-x",kb="pan-y";V.prototype={set:function(a){a==fb&&(a=this.compute()),eb&&this.manager.element.style&&(this.manager.element.style[db]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){if(!eb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,ib),f=p(d,kb),g=p(d,jb);if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}if(!g||!f)return e||f&&c&Ma||g&&c&Na?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var lb=1,mb=2,nb=4,ob=8,pb=ob,qb=16,rb=32;X.prototype={defaults:{},set:function(a){return ka(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=$(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=$(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=$(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=$(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;ob>d&&b(c.options.event+Y(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=ob&&b(c.options.event+Y(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=rb)},canEmit:function(){for(var a=0;af?Ia:Ja,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ha:0>g?Ka:La,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return _.prototype.attrTest.call(this,a)&&(this.state&mb||!(this.state&mb)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=Z(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ba,_,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ib]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&mb)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(ca,X,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[gb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Fa|Ga)&&!f)this.reset();else if(a.eventType&Da)this.reset(),this._timer=e(function(){this.state=pb,this.tryEmit()},b.time,this);else if(a.eventType&Fa)return pb;return rb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===pb&&(a&&a.eventType&Fa?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=qa(),this.manager.emit(this.options.event,this._input)))}}),i(da,_,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ib]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&mb)}}),i(ea,_,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ma|Na,pointers:1},getTouchAction:function(){return aa.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Ma|Na)?b=a.overallVelocity:c&Ma?b=a.overallVelocityX:c&Na&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&pa(b)>this.options.velocity&&a.eventType&Fa},emit:function(a){var b=Z(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(fa,X,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance').attr({'id': maincID}); var outerCarouselWrapper = idx('
').attr('class', 'IDX-outerCarouselWrapper'); var innerCarouselWrapper = idx('
').attr('class', 'IDX-innerCarouselWrapper').css('left', '0'); widgetElement.after(mainc); idx('#'+maincID).before(''); var propertyElements = ''; propertyElements += '
DCDC2129376
3508 Prospect Street NW
Washington, District Of Columbia DC 20007
$15,995,000
8 Bedrooms
7 Total Baths
6 Full Baths
1 Partial Baths
Thought to be designed by William Thornton, the ar ...
ACTIVE
'; propertyElements += '
DCDC2123682
3210 R Street NW
Washington, District Of Columbia DC 20007
$15,000,000
5 Bedrooms
8 Total Baths
6 Full Baths
2 Partial Baths
Experience Unparalleled Luxury in the Heart of His ...
ACTIVE
'; propertyElements += '
DCDC2131240
1534 28th Street NW
Washington, District Of Columbia DC 20007
$13,500,000
8 Bedrooms
9 Total Baths
7 Full Baths
2 Partial Baths
In Georgetown’s coveted East Village, amongst a la ...
ACTIVE
'; propertyElements += '
DCDC2114220
3150 South Street NW PH2A
Washington, District Of Columbia DC 20007
$10,500,000
4 Bedrooms
7 Total Baths
5 Full Baths
2 Partial Baths
Few brands are as synonymous with service and luxu ...
ACTIVE
'; propertyElements += '
DCDC2138146
2727 Q Street NW
Washington, District Of Columbia DC 20007
$9,990,000
8 Bedrooms
9 Total Baths
7 Full Baths
2 Partial Baths
Ideally located in the heart of Georgetown’s prest ...
ACTIVE
'; propertyElements += '
DCDC2134964
3032 N Street NW
Washington, District Of Columbia DC 20007
$9,990,000
8 Bedrooms
8 Total Baths
7 Full Baths
1 Partial Baths
The property on which the current 3032 N Stands to ...
PENDING
'; propertyElements += '
DCDC2130126
3313 O Street NW
Washington, District Of Columbia DC 20007
$7,995,000
6 Bedrooms
7 Total Baths
6 Full Baths
1 Partial Baths
On a quiet, cobblestone block in historic Georgeto ...
ACTIVE
'; propertyElements += '
DCDC2094712
3255 Prospect Street NW PH-5
Washington, District Of Columbia DC 20007
$7,750,000
3 Bedrooms
4 Total Baths
3 Full Baths
1 Partial Baths
Open House on Tuesday, April 16th from 12:00 to 2: ...
ACTIVE
'; propertyElements += '
DCDC2122914
3051 N Street NW
Washington, District Of Columbia DC 20007
$7,500,000
7 Bedrooms
7 Total Baths
6 Full Baths
1 Partial Baths
11,000 SF prominent, stately home on the corner of ...
PENDING
'; propertyElements += '
DCDC2131236
1644 Avon Place NW
Washington, District Of Columbia DC 20007
$7,450,000
6 Bedrooms
8 Total Baths
6 Full Baths
2 Partial Baths
“It may come as a surprise particularly to Georget ...
ACTIVE UNDER CONTRACT
'; propertyElements += '
DCDC2094586
3255 Prospect Street NW 3
Washington, District Of Columbia DC 20007
$6,900,000
3 Bedrooms
4 Total Baths
3 Full Baths
1 Partial Baths
Open House Tuesday , April 16th from 12:00 to 2:00 ...
ACTIVE
'; propertyElements += '
DCDC2119334
1633 31st Street NW
Washington, District Of Columbia DC 20007
$6,350,000
3 Bedrooms
4 Total Baths
3 Full Baths
1 Partial Baths
Impeccably renovated by Georgetown\'s esteemed Arch ...
ACTIVE
'; propertyElements += '
DCDC2121608
1352 28th Street NW
Washington, District Of Columbia DC 20007
$5,880,000
4 Bedrooms
5 Total Baths
4 Full Baths
1 Partial Baths
Welcome to 1352 28th - an extremely unique three-s ...
ACTIVE
'; propertyElements += '
DCDC2122514
2900 K Street NW 607
Washington, District Of Columbia DC 20007
$5,500,000
5 Bedrooms
6 Total Baths
5 Full Baths
1 Partial Baths
Welcome to 2900 K Street NW at HARBOURSIDE, a spec ...
ACTIVE
'; propertyElements += '
DCDC2136620
3150 South Street NW PH1B
Washington, District Of Columbia DC 20007
$5,495,000
3 Bedrooms
3 Total Baths
2 Full Baths
1 Partial Baths
This splendid custom penthouse offers the best vie ...
ACTIVE UNDER CONTRACT
'; propertyElements += '
DCDC2136706
3126 O Street NW
Washington, District Of Columbia DC 20007
$5,200,000
6 Bedrooms
5 Total Baths
4 Full Baths
1 Partial Baths
Perfectly located in the East Village this histori ...
ACTIVE
'; propertyElements += '
DCDC2084108
3150 South Street NW PH1F
Washington, District Of Columbia DC 20007
$4,995,000
4 Bedrooms
4 Total Baths
3 Full Baths
1 Partial Baths
This extraordinary Penthouse with three exposures, ...
ACTIVE
'; propertyElements += '
DCDC2126886
2906 N Street NW
Washington, District Of Columbia DC 20007
$4,995,000
5 Bedrooms
4 Total Baths
3 Full Baths
1 Partial Baths
Rarely will you find a home with more to offer tha ...
ACTIVE
'; propertyElements += '
DCDC2044418
3303 Water Street NW 5G
Washington, District Of Columbia DC 20007
$4,495,000
2 Bedrooms
3 Total Baths
2 Full Baths
1 Partial Baths
RIVER VIEWS with RARE privacy - one of the only ap ...
ACTIVE
'; propertyElements += '
DCDC2101298
1406 34th Street NW
Washington, District Of Columbia DC 20007
$4,400,000
6 Bedrooms
6 Total Baths
5 Full Baths
1 Partial Baths
HUGE PRICE IMPROVEMENT! Listed on the National Reg ...
ACTIVE
'; propertyElements += '
DCDC2122038
3150 South Street NW 2A
Washington, District Of Columbia DC 20007
$4,200,000
4 Bedrooms
5 Total Baths
4 Full Baths
1 Partial Baths
Elegance | Location l Amenities - The Georgetown ...
ACTIVE
'; propertyElements += '
DCDC2133306
3039 W Lane Keys NW
Washington, District Of Columbia DC 20007
$3,895,000
4 Bedrooms
5 Total Baths
4 Full Baths
1 Partial Baths
NEW LISTING!! RARELY AVAILABLE 3900+sqft WEST LANE ...
PENDING
'; propertyElements += '
DCDC2125884
3303 Water Street NW 6H
Washington, District Of Columbia DC 20007
$3,500,000
2 Bedrooms
3 Total Baths
2 Full Baths
1 Partial Baths
Sophisticated elegance exudes in this two bedroom ...
ACTIVE
'; propertyElements += '
DCDC2134508
1416 34th Street NW
Washington, District Of Columbia DC 20007
$3,495,000
4 Bedrooms
4 Total Baths
3 Full Baths
1 Partial Baths
Quintessentially Georgetown, this detached home, b ...
ACTIVE
'; propertyElements += '
DCDC2139114
1669 Avon Place NW
Washington, District Of Columbia DC 20007
$3,495,000
5 Bedrooms
6 Total Baths
4 Full Baths
2 Partial Baths
ACTIVE UNDER CONTRACT
'; innerCarouselWrapper.append(propertyElements); innerCarouselWrapper.css('visibility', 'hidden'); outerCarouselWrapper.append(innerCarouselWrapper); outerCarouselWrapper.css('margin', '0 auto'); mainc.append(outerCarouselWrapper); mainc.append(' <'); mainc.append(' >'); var containterWidth = idx('#'+maincID).outerWidth(true); var arrowWidth = idx('#'+maincID+' .IDX-carouselArrow').outerWidth(true); var columns = 3; var responsive = true; var noPhotoUrl = "https://s3.amazonaws.com/mlsphotos.idxbroker.com/defaultNoPhoto/noPhotoThumb.png"; var cells = idx('#'+maincID+' .IDX-carouselCell'); var links = idx('#'+maincID+' .IDX-carouselLink'); var cellSize = cells.length; var isAnimating = false; var cellOuterWidth = (containterWidth - arrowWidth * 2) / columns; if (cells.length) { cells.css('box-sizing', 'content-box'); var images = cells.find('img'); function loadImage(originalImage) { var deferred = idx.Deferred(); var image = new Image(); idx(image).on('load', function() { delete(image); deferred.resolve(); }); idx(image).on('error', function() { if (originalImage instanceof Element) { idx(originalImage).unbind('error').attr('src', noPhotoUrl); } deferred.resolve(); }); image.src = originalImage.src; return deferred.promise(); } var imagePromise = [ loadImage({ src: noPhotoUrl }) ]; for (var i = 0, l = images.length; i < l; i++) { var image = images[i]; imagePromise.push(loadImage(image)); } var circleCells, offset, boundary, forwardOffset, outerCarouselWrapperWidth, arrowPrevPosition, arrowNextPosition, paddingLeft, paddingRight, paddingTop, paddingBottom, borderLeft, borderRight, borderTop, borderBottom; idx.when.apply(null, imagePromise).then(function() { cells.css('display', 'inline-block'); var carouselLinkHeightInfo = links.map(function () { return {height: idx(this).height(), outerHeight: idx(this).outerHeight()}; }); paddingLeft = parseFloat(cells.css('padding-left').replace('px', '')); paddingRight = parseFloat(cells.css('padding-right').replace('px', '')); paddingTop = parseFloat(cells.css('padding-top').replace('px', '')); paddingBottom = parseFloat(cells.css('padding-bottom').replace('px', '')); borderLeft = parseFloat(cells.css('border-left-width').replace('px', '')); borderRight = parseFloat(cells.css('border-left-width').replace('px', '')); borderTop = parseFloat(cells.css('border-top-width').replace('px', '')); borderBottom = parseFloat(cells.css('border-bottom-width').replace('px', '')); var cellWidth = cellOuterWidth; if (responsive) { var linkWidth = links.outerWidth(true); cellWidth = (linkWidth > cellOuterWidth) ? cellOuterWidth : linkWidth; } cellWidth -= (paddingLeft + paddingRight + borderLeft + borderRight); cellWidth = Math.floor(cellWidth); cells.width(cellWidth); cellOuterWidth = cells.outerWidth(true); offset = 0; if (cellSize > columns) { offset = columns * cellOuterWidth; } forwardOffset = cells.length * cellOuterWidth; var containerHeight = cells.outerHeight(true); if (cellSize > columns) { boundary = (cells.length + columns) * cellOuterWidth; circleCells = cells.slice(0, columns); for (var i = 0; i < circleCells.length; i++) { innerCarouselWrapper.append(idx(circleCells[i]).clone().addClass('IDX-carouselCloneCell')); } circleCells = cells.slice(cells.length - columns, cells.length); for (var i = circleCells.length; i >= 0; i--) { innerCarouselWrapper.prepend(idx(circleCells[i]).clone().addClass('IDX-carouselCloneCell')); } } else { boundary = cells.length * cellOuterWidth * 2; circleCells = cells.slice(); for (var i = 0; i < circleCells.length; i++) { innerCarouselWrapper.append(idx(circleCells[i]).clone().addClass('IDX-carouselCloneCell')); } for (var i = circleCells.length; i >= 0; i--) { innerCarouselWrapper.prepend(idx(circleCells[i]).clone().addClass('IDX-carouselCloneCell')); } } var totalCells = idx('#'+maincID+' .IDX-carouselCell'); innerCarouselWrapper.css({visibility: 'visible', left: '-' + offset + 'px'}); innerCarouselWrapper.width(totalCells.length * cellOuterWidth); innerCarouselWrapper.height(containerHeight); outerCarouselWrapper.height(containerHeight); var maxHeight = containerHeight - (paddingTop + paddingBottom + borderTop + borderBottom); innerCarouselWrapper.find('.IDX-carouselCell').css('max-height', maxHeight); outerCarouselWrapperWidth = cellOuterWidth * cellSize; if (cellSize > columns) { outerCarouselWrapperWidth = cellOuterWidth * columns; } var maxCellHeight = Math.max.apply( null, totalCells.map(function () { return idx(this).outerHeight(true); }) ); totalCells.outerHeight(maxCellHeight); innerCarouselWrapper.height(maxCellHeight); outerCarouselWrapper.height(maxCellHeight); outerCarouselWrapper.width(outerCarouselWrapperWidth); var galleryWidth = idx('#'+maincID).outerWidth(); var outerWidth = outerCarouselWrapper.outerWidth(); var availableSpace = (galleryWidth - outerWidth - arrowWidth * 2); var arrowOffset = availableSpace / 2; idx('#'+maincID+' .IDX-carouselPrevArrow').css('left', arrowOffset); idx('#'+maincID+' .IDX-carouselNextArrow').css('right', arrowOffset); idx(window).trigger('resize'); }); var carouselMove = function carouselMove(direction) { if (!isAnimating) { var position = parseFloat(innerCarouselWrapper.css('left').replace('px', '')); if (direction === 'prev') { if ((position + offset) > 0){ position -= (cellSize * cellOuterWidth); innerCarouselWrapper.css('left', position); } innerCarouselWrapper.animate({left: '+=' + offset}, "swing", function() {isAnimating = false;}); isAnimating = true; } else { if ((-(position - offset)) > boundary) { position = position + forwardOffset; innerCarouselWrapper.css('left', position); } innerCarouselWrapper.animate({left: '-=' + offset}, "swing", function() {isAnimating = false;}); isAnimating = true; } } }; idx('#'+maincID+' .IDX-carouselPrevArrow').click(function(e) { e.preventDefault(); carouselMove('prev'); }); idx('#'+maincID+' .IDX-carouselNextArrow').click(function(e) { e.preventDefault(); carouselMove('next'); }); var hammertime = new idxHammer(document.getElementById(maincID)); hammertime.get('swipe').set({direction: idxHammer.DIRECTION_HORIZONTAL, velocity: 0.1}); hammertime.on('swipeleft swiperight', function(e) { if (e.type === 'swipeleft') { carouselMove('next'); } else { carouselMove('prev'); } }); idx(window).resize(function(){ idx('#'+maincID).css('width','100%'); var galleryWidth = idx('#'+maincID).outerWidth(true); var availableColumns = Math.floor((galleryWidth- arrowWidth * 2)/cellOuterWidth) || 1; if (availableColumns > columns) { availableColumns = columns; } var visibleCells = idx('#'+maincID+' .IDX-carouselCell:visible'); var prevVisibleSize = visibleCells.length; var outerWidth = cellOuterWidth*availableColumns; if (cellSize > availableColumns) { idx('#'+maincID+' .IDX-carouselArrow').show(); } else { availableColumns = cellSize; idx('#'+maincID+' .IDX-carouselArrow').hide(); } outerCarouselWrapper.width(cellOuterWidth*availableColumns); offset = availableColumns * cellOuterWidth; var availableSpace = (galleryWidth - outerWidth - arrowWidth * 2); var arrowOffset = availableSpace / 2; idx('#'+maincID+' .IDX-carouselPrevArrow').css('left', arrowOffset); idx('#'+maincID+' .IDX-carouselNextArrow').css('right', arrowOffset); }); } if (agentHeaderID) { idx(function() { var widetSrc = widgetElement.attr('src'); if (widetSrc.match(/.+quicksearchjs\.php/)) { var quicksearchForm = idx('#IDX-quicksearchForm-47078'); quicksearchForm.append(idx('').attr({ type: 'hidden', name: 'agentHeaderID', value: agentHeaderID })); } else if (widetSrc.match(/.+leadloginwidget\.php/)) { var leadLoginForm = idx('#IDX-widgetLeadLoginForm'); leadLoginForm.append(idx('').attr({ type: 'hidden', name: 'agentHeaderID', value: agentHeaderID })); } else if (widetSrc.match(/.+mapwidgetjs\.php/)) { idx('#IDX-map-' + widgetID).on('click', 'a[href^="http"]', function (e) { e.preventDefault(); var href = idx(e.target).attr('href'); if (href.match(/.+\?.+/)) { href = href + '&agentHeaderID=' + agentHeaderID; } else { href = href + '?agentHeaderID=' + agentHeaderID; } window.location.href = href; }); } else { // carousel, showcase, and slideshow var detailsLinks = idx('div[id*='+widgetID+']').find('a[href*=widgetReferer]'); detailsLinks.each(function(index, element) { var originalLink = idx(element).attr('href'); idx(element).attr('href', originalLink + '&agentHeaderID=' + agentHeaderID ); }); } }); } } // build a script tag with our version of jquery provided if it doesn't already exist if (typeof idx == 'undefined') { /** * fake idx object to let other widgets know the first widget has inserted jqidx.js * wait to jqwidx.js loaded, idx will be the jquery object. */ window.idx = {}; var jqsrc = '//d1qfrurkpai25r.cloudfront.net/graphical/javascript/jqwidx.js?auid=Zi3QF4m8@s1ap4hIrdP37QAAAAA'; var idxjs = document.createElement('script'); idxjs.setAttribute('type','text/javascript'); idxjs.setAttribute('id','idx_jquery_include_tag'); idxjs.setAttribute('src',jqsrc); // lets let IE in or he'll just sit outside and drink and cry if (idxjs.readyState) { idxjs.onreadystatechange = function () { if (this.readyState == 'complete' || this.readyState == 'loaded') { widgetMainOut(); } }; } // For gooder browsers else { idxjs.onload = widgetMainOut; } // for loading speed our best bet is to insert our jquery before the first script tag on their site since, at minimum, // this widget is being loaded in a script tag, we know there's at least 1 in the document and we know for sure this // will load before any version of jquery on their site so that we can sequester our version behind noConflict var s1 = document.getElementsByTagName('script')[0]; s1.parentNode.insertBefore(idxjs, s1); } // if the idx jquert is loaded then we need to wait until the idx val is defined else { // wait to the first widget's idx jquery object loaded var callWidgetOut = function () { if (window.idx && window.idx.fn) { widgetMainOut(); } else { setTimeout(function() { callWidgetOut(); }, 500); } }; callWidgetOut(); } })();