var RLS2000 = Class.create({ initialize: function(displayDiv) { this.parentDiv = displayDiv; this.displayDiv = 'code'; this.listings = {list: [{property: [ { listing_id: '71094275' ,listing_location: 'Easthampton MA' ,listing_price: '$2,100,000' ,link: "detail.asp?listingid=71094275&agentid=M8000515" } , { listing_id: '71047253' ,listing_location: 'Hadley MA' ,listing_price: '$1,195,000' ,link: "detail.asp?listingid=71047253&agentid=E0000CAM" } , { listing_id: '71095555' ,listing_location: 'Conway MA' ,listing_price: '$975,000' ,link: "detail.asp?listingid=71095555&agentid=E000CMBO" } , { listing_id: '71095561' ,listing_location: 'Conway MA' ,listing_price: '$975,000' ,link: "detail.asp?listingid=71095561&agentid=E000CMBO" } , { listing_id: '70670758' ,listing_location: 'Westhampton MA' ,listing_price: '$895,000' ,link: "detail.asp?listingid=70670758&agentid=E0000WHM" } , { listing_id: '70670760' ,listing_location: 'Westhampton MA' ,listing_price: '$895,000' ,link: "detail.asp?listingid=70670760&agentid=E0000WHM" } , { listing_id: '70771147' ,listing_location: 'Conway MA' ,listing_price: '$749,000' ,link: "detail.asp?listingid=70771147&agentid=E0000WHM" } , { listing_id: '71115010' ,listing_location: 'Plainfield MA' ,listing_price: '$740,000' ,link: "detail.asp?listingid=71115010&agentid=E00PHPLE" } , { listing_id: '70850789' ,listing_location: 'Conway MA' ,listing_price: '$689,000' ,link: "detail.asp?listingid=70850789&agentid=E0000WHM" } , { listing_id: '70985576' ,listing_location: 'Williamsburg MA' ,listing_price: '$674,000' ,link: "detail.asp?listingid=70985576&agentid=M8000893" } , { listing_id: '71103427' ,listing_location: 'Charlemont MA' ,listing_price: '$635,000' ,link: "detail.asp?listingid=71103427&agentid=E00PHPLE" } , { listing_id: '71085304' ,listing_location: 'Rowe MA' ,listing_price: '$595,000' ,link: "detail.asp?listingid=71085304&agentid=E0000WHM" } , { listing_id: '71059889' ,listing_location: 'Conway MA' ,listing_price: '$590,000' ,link: "detail.asp?listingid=71059889&agentid=E0000WHM" } , { listing_id: '71059886' ,listing_location: 'Conway MA' ,listing_price: '$565,000' ,link: "detail.asp?listingid=71059886&agentid=E0000WHM" } , { listing_id: '71093736' ,listing_location: 'Plainfield MA' ,listing_price: '$525,000' ,link: "detail.asp?listingid=71093736&agentid=E9500016" } , { listing_id: '70958268' ,listing_location: 'Hatfield MA' ,listing_price: '$525,000' ,link: "detail.asp?listingid=70958268&agentid=TEAM0237" } , { listing_id: '71121923' ,listing_location: 'Erving MA' ,listing_price: '$499,900' ,link: "detail.asp?listingid=71121923&agentid=E00000DM" } , { listing_id: '71100892' ,listing_location: 'Plainfield MA' ,listing_price: '$499,000' ,link: "detail.asp?listingid=71100892&agentid=E9500016" } , { listing_id: '71080162' ,listing_location: 'Ashfield MA' ,listing_price: '$495,000' ,link: "detail.asp?listingid=71080162&agentid=E0000WHM" } , { listing_id: '71080176' ,listing_location: 'Ashfield MA' ,listing_price: '$495,000' ,link: "detail.asp?listingid=71080176&agentid=E0000WHM" } , { listing_id: '70943427' ,listing_location: 'Ashfield MA' ,listing_price: '$469,000' ,link: "detail.asp?listingid=70943427&agentid=E0000WHM" } , { listing_id: '70987294' ,listing_location: 'Conway MA' ,listing_price: '$449,999' ,link: "detail.asp?listingid=70987294&agentid=E9500228" } , { listing_id: '70904218' ,listing_location: 'Warwick MA' ,listing_price: '$449,900' ,link: "detail.asp?listingid=70904218&agentid=E9500228" } , { listing_id: '71102191' ,listing_location: 'Amherst MA' ,listing_price: '$449,900' ,link: "detail.asp?listingid=71102191&agentid=M8000893" } , { listing_id: '71071843' ,listing_location: 'Ashfield MA' ,listing_price: '$425,000' ,link: "detail.asp?listingid=71071843&agentid=E9500228" } , { listing_id: '71054301' ,listing_location: 'Bernardston MA' ,listing_price: '$399,900' ,link: "detail.asp?listingid=71054301&agentid=E9500228" } , { listing_id: '71115999' ,listing_location: 'Whately MA' ,listing_price: '$399,900' ,link: "detail.asp?listingid=71115999&agentid=E000CMBO" } , { listing_id: '71052088' ,listing_location: 'Northfield MA' ,listing_price: '$399,000' ,link: "detail.asp?listingid=71052088&agentid=E0000WHM" } , { listing_id: '70185148' ,listing_location: 'Greenfield MA' ,listing_price: '$394,900' ,link: "detail.asp?listingid=70185148&agentid=E00000DM" } , { listing_id: '71077193' ,listing_location: 'Greenfield MA' ,listing_price: '$394,900' ,link: "detail.asp?listingid=71077193&agentid=E00000DM" } , { listing_id: '71087007' ,listing_location: 'Leyden MA' ,listing_price: '$393,000' ,link: "detail.asp?listingid=71087007&agentid=E0000WHM" } , { listing_id: '71091789' ,listing_location: 'Deerfield MA' ,listing_price: '$389,900' ,link: "detail.asp?listingid=71091789&agentid=E00000DM" } , { listing_id: '71065336' ,listing_location: 'Charlemont MA' ,listing_price: '$379,000' ,link: "detail.asp?listingid=71065336&agentid=E0000WHM" } , { listing_id: '71118412' ,listing_location: 'Westhampton MA' ,listing_price: '$379,000' ,link: "detail.asp?listingid=71118412&agentid=M8000244" } , { listing_id: '71126289' ,listing_location: 'Whately MA' ,listing_price: '$375,000' ,link: "detail.asp?listingid=71126289&agentid=E0000JRB" } , { listing_id: '71088459' ,listing_location: 'Cummington MA' ,listing_price: '$369,000' ,link: "detail.asp?listingid=71088459&agentid=E00PHPLE" } , { listing_id: '71055634' ,listing_location: 'Holyoke MA' ,listing_price: '$365,000' ,link: "detail.asp?listingid=71055634&agentid=M8000893" } , { listing_id: '70989776' ,listing_location: 'Shelburne MA' ,listing_price: '$365,000' ,link: "detail.asp?listingid=70989776&agentid=E00PHPLE" } , { listing_id: '71055746' ,listing_location: 'Holyoke MA' ,listing_price: '$365,000' ,link: "detail.asp?listingid=71055746&agentid=M8000893" } , { listing_id: '71098647' ,listing_location: 'Shelburne MA' ,listing_price: '$360,000' ,link: "detail.asp?listingid=71098647&agentid=E0000WHM" } , { listing_id: '71006860' ,listing_location: 'Whately MA' ,listing_price: '$359,900' ,link: "detail.asp?listingid=71006860&agentid=E00000DM" } , { listing_id: '71087259' ,listing_location: 'Charlemont MA' ,listing_price: '$359,000' ,link: "detail.asp?listingid=71087259&agentid=E0000WHM" } , { listing_id: '71119640' ,listing_location: 'Greenfield MA' ,listing_price: '$349,900' ,link: "detail.asp?listingid=71119640&agentid=E00000DM" } , { listing_id: '71077117' ,listing_location: 'Chester MA' ,listing_price: '$349,000' ,link: "detail.asp?listingid=71077117&agentid=M8000244" } , { listing_id: '71123143' ,listing_location: 'Ashfield MA' ,listing_price: '$348,000' ,link: "detail.asp?listingid=71123143&agentid=E00PHPLE" } , { listing_id: '70185160' ,listing_location: 'Greenfield MA' ,listing_price: '$345,900' ,link: "detail.asp?listingid=70185160&agentid=E00000DM" } , { listing_id: '71077190' ,listing_location: 'Greenfield MA' ,listing_price: '$345,900' ,link: "detail.asp?listingid=71077190&agentid=E00000DM" } , { listing_id: '71086542' ,listing_location: 'Northfield MA' ,listing_price: '$334,900' ,link: "detail.asp?listingid=71086542&agentid=M8000554" } , { listing_id: '71077188' ,listing_location: 'Greenfield MA' ,listing_price: '$334,900' ,link: "detail.asp?listingid=71077188&agentid=E00000DM" } , { listing_id: '70185095' ,listing_location: 'Greenfield MA' ,listing_price: '$334,900' ,link: "detail.asp?listingid=70185095&agentid=E00000DM" } ] }]}; this.width = 300; this.style = 'option3'; this.title = ''; this.browsername = ''; this.webaddress = ''; $(this.parentDiv).insert(Builder.node('span',{id:this.displayDiv})); this.display(); }, display: function() { try { var list = this.listings; mn=0; shownumber=1; mx=shownumber; total=list.list[0].property.length-1; for (var i=mn; itotal) { u = mn-shownumber; } else { u = i; } listing = list.list[0].property[u]; $(this.displayDiv).insert(this.buildTable(listing, u, this.width, this.style)); } mn=mn+shownumber; mx=mx+shownumber; if (mn>=total) { mn=0; mx=shownumber; } var ins = this; this.interval = setInterval(function() { if (!(ins.browsername=='sf')) { new Effect.Opacity($(ins.displayDiv),{duration: 3.0, from: 1, to: 0}); } firstRun = true; for (var i=mn; itotal) { u = mn-shownumber; } else { u = i; } listing = list.list[0].property[u]; if (firstRun) { firstRun = false; ins.show.delay(3, ins.displayDiv, ins.buildTable(listing, u, ins.width, ins.style), true); } else { ins.show.delay(3, ins.displayDiv, ins.buildTable(listing, u, ins.width, ins.style), false); } } mn=mn+shownumber; mx=mx+shownumber; if (mn>=total) { mn=0; mx=shownumber; } },10000); } catch (e) { //alert(e.name + '\n' + e.message); } }, run: function() { }, show: function(d, t, first) { if (first) { $(d).update(t).appear({duration: 3.0}); } else { $(d).insert(t).appear({duration: 3.0}); } }, buildTable: function(l, i, w, s) { var table = Builder.node('table', { width: w + 10 ,cellpadding: '0' ,cellspacing: '0' ,border: '0' ,id:'SlideTable' }); if (s!='option2' && s!='option3') { s='option2'; } var tbody = Builder.node('tbody'); if (s=='option3') { tr = Builder.node('tr'); td = Builder.node('td', {align:'center', id:'SlideTitle'}, l.listing_location); td.style.backgroundColor='#666666'; td.style.color='#ffffff'; td.style.fontWeight='bold'; tr.appendChild(td); tbody.appendChild(tr); } tr = Builder.node('tr'); td = Builder.node('td', [ Builder.node('div',{style:' border:solid 1px #CCCCCC;', align:'center'},[ Builder.node('div',{style:'margin:5px;',align:'center'}, Builder.node('img',{src:'http://img.mlspropertyfinder.com/images.asp?type=listings&id=' + l.listing_id + '&width=' + w, border:0}) ) ]) ]); tr.appendChild(td); tbody.appendChild(tr); tr = Builder.node('tr'); if (s=='option2') { div = Builder.node('div',[ Builder.node('span',{style:'font-weight:bold'},l.listing_location) ,Builder.node('br') ,Builder.node('span',l.listing_price) ] ); } else { div = Builder.node('div', Builder.node('span',l.listing_price) ); } td = Builder.node('td', [ Builder.node('div',{ align:'center'},div) ]); tr.appendChild(td); tbody.appendChild(tr); tr = Builder.node('tr'); td = Builder.node('td', [ Builder.node('div',{ align:'center'},[ Builder.node('div',{aign:'center'},[ Builder.node('span',[ Builder.node('a',{href:l.link},[ Builder.node('span','More Info') ]) ]) ] ) ]) ]); tr.appendChild(td); tbody.appendChild(tr); table.appendChild(tbody); return table; }, verify: function() { return this.webaddress; } }); document.observe('dom:loaded', function() {var r = new RLS2000('CodeFeatureProperties')});