/*
ss.js

Software design and development by:
	Terence M. Bandoian
	P.O. Box 4074
	Austin, TX 78765
	http://www.tmbsw.com
	terence@tmbsw.com

Copyright (c) 2001-2010 Terence M. Bandoian. All rights reserved.
*/

if ( typeof listingagent == 'undefined' ) { listingagent = {}; } function SlideShow() {} listingagent.SlideShow = function( properties ) { this.fbipw = properties.imagePaneWidth; this.fbiph = properties.imagePaneHeight; this.fbipol = properties.imagePaneOffsetLeft; this.fbipot = properties.imagePaneOffsetTop; this.fbcpw = properties.captionPaneWidth; this.fbcpol = properties.captionPaneOffsetLeft; this.fbcpot = properties.captionPaneOffsetTop; this.fbcplp = properties.controlPanelPosition; this.fbcplho = properties.controlPanelHorzOffset; this.fboa = null; this.fboal = 0; this.fboai = -1; this.fbil = false; this.fbid = null; this.fbam = false; this.fbamc = 0; this.fbamcm = 8; this.fbamci = this.fbamcm - 3; this.fbipl = 0; this.fbipt = 0; this.fbcpl = 0; this.fbcpt = 0; this.fbm = null; this.fbss = null; this.fbsscp = null; this.fbsscpp1 = null; this.fbsscpp2 = null; this.fbsscpm1 = null; this.fbsscpm2 = null; this.fbte = false; this.fbtid = null; this.fbti1 = null; this.fbti2 = null; this.fbti = 200; this.fbtd = 200; this.fbts = 0; this.fbtoos = 60; this.fbtooe = 0; this.fbtozi = 2; this.fbtios = 100; this.fbtioe = 100; this.fbtizi = 1; }; listingagent.SlideShow.prototype.i = function () { if ( this.fboa != null ) { var slideShow = this; if ( window.addEventListener ) { window.addEventListener( 'load', function() { slideShow.s(); }, true ); } else if ( window.attachEvent ) { window.attachEvent( 'onload', function() { slideShow.s(); } ); } } }; listingagent.SlideShow.prototype.s = function () { if ( this.fboa != null ) { this.im(); this.icpl(); this.sipp(); this.scpp(); for ( var n = 0; n < this.fboal; n++ ) { this.sip( this.fboa[ n ].gi() ); this.sicp( this.fboa[ n ].gc() ); } if ( this.fbid == null ) { var slideShow = this; this.a1(); this.fbid = window.setInterval( function () { slideShow.ih(); }, 500 ); } } }; listingagent.SlideShow.prototype.ih = function () { if ( this.hmm() ) { this.s(); return; } if ( this.fbam ) { if ( ++this.fbamc >= this.fbamcm ) { if ( this.ri( 1 ) ) { this.fbamc = 0; } else { this.fbamc = 100; } } else { if ( !this.fbil && !this.fboa[ this.fboai ].il() ) { this.fbamc--; } } } if ( !this.fbil ) { this.fbil = this.pli( this.fboai ); } }; listingagent.SlideShow.prototype.a1 = function () { if ( this.fboai < 0 ) { this.fboai = 0; this.fbamc = this.fbamci; this.ri( 0 ); } else { this.fbamc = 100; } this.fbam = true; }; listingagent.SlideShow.prototype.a2 = function () { this.fbam = false; }; listingagent.SlideShow.prototype.m = function ( d ) { this.a2(); this.ri( d ); }; listingagent.SlideShow.prototype.im = function () { this.fbm = document.getElementById( "ssi" ); this.sm(); }; listingagent.SlideShow.prototype.sm = function () { if ( this.fbm != null ) { var e = this.fbm; this.fbm.al = 0; this.fbm.at = 0; while ( e != null ) { this.fbm.al += e.offsetLeft; this.fbm.at += e.offsetTop; e = e.offsetParent; } } }; listingagent.SlideShow.prototype.hmm = function () { if ( this.fbm != null ) { var al = this.fbm.al; var at = this.fbm.at; this.sm(); if (( al == this.fbm.al ) && ( at == this.fbm.at )) { return false; } } return true; }; listingagent.SlideShow.prototype.icpl = function () { var slideShow = this; var s; var p; var e; var l; var t; s = document.getElementById( 'ss' ); p = document.getElementById( 'sscp' ); if ( !s || !p ) { return; } l = 0; t = 0; e = s; while ( e != null ) { l += e.offsetLeft; t += e.offsetTop; e = e.offsetParent; } s.fbl = l; s.fbr = l + s.offsetWidth - 1; s.fbt = t; s.fbb = t + s.offsetHeight - 1; p.style.display = 'block'; l = ( this.fbcplp == 'left' ? l + this.fbcplho : l + this.fbcplho + s.offsetWidth - p.offsetWidth ); t = t; p.style.left = l + 'px'; p.style.top = t + 'px'; p.fbl = l; p.fbr = l + p.offsetWidth - 1; p.fbt = t; p.fbb = t + p.offsetHeight - 1; this.fbss = s; this.fbsscp = p; this.fbsscpp1 = document.getElementById( 'sscpp1' ); this.fbsscpp2 = document.getElementById( 'sscpp2' ); this.fbsscpm1 = document.getElementById( 'sscpm1' ); this.fbsscpm2 = document.getElementById( 'sscpm2' ); if ( this.fboai < 0 ) { if ( document.body.addEventListener ) { document.body.addEventListener( 'mousemove', function ( event ) { slideShow.ecpl( event ); }, true ); this.fbsscpp1.addEventListener( 'click', function ( event ) { slideShow.ep1( event ); }, true ); this.fbsscpp2.addEventListener( 'click', function ( event ) { slideShow.ep2( event ); }, true ); this.fbsscpm1.addEventListener( 'click', function ( event ) { slideShow.em1( event ); }, true ); this.fbsscpm2.addEventListener( 'click', function ( event ) { slideShow.em2( event ); }, true ); } else if ( document.body.attachEvent ) { document.body.attachEvent( 'onmousemove', function ( event ) { slideShow.ecpl( event ); } ); this.fbsscpp1.attachEvent( 'onclick', function ( event ) { slideShow.ep1( event ); } ); this.fbsscpp2.attachEvent( 'onclick', function ( event ) { slideShow.ep2( event ); } ); this.fbsscpm1.attachEvent( 'onclick', function ( event ) { slideShow.em1( event ); } ); this.fbsscpm2.attachEvent( 'onclick', function ( event ) { slideShow.em2( event ); } ); } } }; listingagent.SlideShow.prototype.ecpl = function ( event ) { if ( this.fbss && this.fbsscp ) { var x; var y; if ( window.event ) { if ( document.compatMode && ( document.compatMode != 'BackCompat' )) { x = event.clientX - document.documentElement.clientLeft + document.documentElement.scrollLeft; y = event.clientY - document.documentElement.clientTop + document.documentElement.scrollTop; } else { x = event.x - document.body.clientLeft + document.body.scrollLeft; y = event.y - document.body.clientTop + document.body.scrollTop; } } else { x = event.clientX + window.pageXOffset; y = event.clientY + window.pageYOffset; } if ((( this.fbss.fbl > x ) || ( this.fbss.fbr < x ) || ( this.fbss.fbt > y ) || ( this.fbss.fbb < y )) && (( this.fbsscp.fbl > x ) || ( this.fbsscp.fbr < x ) || ( this.fbsscp.fbt > y ) || ( this.fbsscp.fbb < y ))) { if ( this.fbsscp.style.visibility != 'hidden' ) { this.fbsscp.style.visibility = 'hidden'; } } else { if ( this.fbsscp.style.visibility != 'visible' ) { this.fbsscp.style.visibility = 'visible'; } } } }; listingagent.SlideShow.prototype.ep1 = function ( event ) { this.a2(); this.fbsscpp1.blur(); return this.ec( event ); }; listingagent.SlideShow.prototype.ep2 = function ( event ) { this.a1(); this.fbsscpp2.blur(); return this.ec( event ); }; listingagent.SlideShow.prototype.em1 = function ( event ) { this.m( -1 ); this.fbsscpm1.blur(); return this.ec( event ); }; listingagent.SlideShow.prototype.em2 = function ( event ) { this.m( 1 ); this.fbsscpm2.blur(); return this.ec( event ); }; listingagent.SlideShow.prototype.ec = function ( event ) { if ( event ) { if ( event.preventDefault ) { event.preventDefault(); event.stopPropagation(); } event.cancelBubble = true; event.returnValue = false; } return false; }; listingagent.SlideShow.prototype.ai = function( ssi ) { if ( this.fboal == 0 ) { ssi.li(); } if ( this.fboa == null ) { this.fboa = new Array( ssi ); } else { this.fboa[ this.fboal ] = ssi; } this.fboal = this.fboa.length; }; listingagent.SlideShow.prototype.sipp = function () { var e; if ( e = document.getElementById( 'ssi' ) ) { this.fbipl = this.fbipol; this.fbipt = this.fbipot; while ( e != null ) { this.fbipl += e.offsetLeft; this.fbipt += e.offsetTop; e = e.offsetParent; } } }; listingagent.SlideShow.prototype.scpp = function () { var e; if ( e = document.getElementById( 'ssc' ) ) { this.fbcpl = this.fbcpol; this.fbcpt = this.fbcpot; while ( e != null ) { this.fbcpl += e.offsetLeft; this.fbcpt += e.offsetTop; e = e.offsetParent; } } }; listingagent.SlideShow.prototype.sip = function ( e ) { if ( this.fbipl > 0 ) { var l; var t; e.style.display = 'block'; if (( e.offsetWidth > this.fbipw ) || ( e.offsetHeight > this.fbiph )) { l = this.fbipl; t = this.fbipt; e.style.clip = 'rect(0px ' + this.fbipw + 'px ' + this.fbiph + 'px 0px)'; } else { l = this.fbipl + Math.floor(( this.fbipw - e.offsetWidth ) / 2 ); t = this.fbipt + Math.floor(( this.fbiph - e.offsetHeight ) / 2 ); } e.style.left = l + 'px'; e.style.top = t + 'px'; } }; listingagent.SlideShow.prototype.sicp = function ( e ) { if ( this.fbcpl > 0 ) { var l; e.style.display = 'block'; if ( e.offsetWidth > this.fbcpw ) { l = this.fbcpl; e.style.clip = 'rect(0px ' + this.fbcpw + 'px ' + e.offsetHeight + 'px 0px)'; } else { l = this.fbcpl + Math.floor(( this.fbcpw - e.offsetWidth ) / 2 ); } e.style.left = l + 'px'; e.style.top = this.fbcpt + 'px'; } }; listingagent.SlideShow.prototype.si = function ( ssi ) { if (( this.fbipl > 0 ) && ( this.fbcpl > 0 )) { if ( ssi.il() ) { ssi.si(); } ssi.sc(); } }; listingagent.SlideShow.prototype.hi = function ( ssi ) { ssi.hi(); ssi.hc(); }; listingagent.SlideShow.prototype.hic = function ( ssi ) { ssi.hc(); }; listingagent.SlideShow.prototype.ri = function ( d ) { var oi = this.fboai; if ( this.fboai < 0 ) { return false; } this.fboai += d; if ( this.fboai < 0 ) { this.fboai = this.fboal - 1; } else if ( this.fboai >= this.fboal ) { this.fboai = 0; } if ( this.fbam ) { if ( !this.fboa[ this.fboai ].il() ) { this.fboai = oi; return false; } if ( this.fbte ) { this.ti( oi == this.fboai ? null : this.fboa[ oi ], this.fboa[ this.fboai ] ); return true; } } else { if ( this.fbte ) { this.tia(); } } this.si( this.fboa[ this.fboai ] ); if ( oi != this.fboai ) { this.hi( this.fboa[ oi ] ); } return true; }; listingagent.SlideShow.prototype.ti = function ( i1, i2 ) { if ( this.fbtid != null ) { window.clearInterval( this.fbtid ); this.fbtid = null; } if (( this.fbti1 != null ) && ( this.fbti1 != i1 ) && ( this.fbti1 != i2 )) { this.hi( this.fbti1 ); this.fbti1.sio(); this.fbti1.sizi(); } if (( this.fbti2 != null ) && ( this.fbti2 != i1 ) && ( this.fbti2 != i2 )) { this.hi( this.fbti2 ); this.fbti2.sio(); this.fbti2.sizi(); } if ( i1 != null ) { var slideShow = this; i1.sio( this.fbtoos ); i1.sizi( this.fbtozi ); if ( i2 != null ) { i2.sio( this.fbtios ); i2.sizi( this.fbtizi ); this.si( i2 ); } this.hic( i1 ); this.fbti1 = i1; this.fbti2 = i2; this.fbts = (new Date()).getTime(); this.fbtid = window.setInterval( function() { slideShow.tih(); }, this.fbti ); } else { this.fbti1 = null; this.fbti2 = null; if ( i2 != null ) { i2.sio(); i2.sizi(); this.si( i2 ); } } }; listingagent.SlideShow.prototype.tih = function () { var o; var t; if ( this.fbtid == null ) { return; } t = (new Date()).getTime(); if ( this.fbti1 != null ) { o = this.fbtoos + ( this.fbtooe - this.fbtoos ) * ( t - this.fbts ) / this.fbtd; if ( o > this.fbtooe ) { this.fbti1.sio( o ); } else { this.hi( this.fbti1 ); this.fbti1.sio(); this.fbti1.sizi(); this.fbti1 = null; } } if ( this.fbti2 != null ) { o = this.fbtios + ( this.fbtioe - this.fbtios ) * ( t - this.fbts ) / this.fbtd; if ( o < this.fbtioe ) { this.fbti2.sio( o ); } else { this.fbti2.sio(); this.fbti2.sizi(); this.fbti2 = null; } } if (( this.fbti1 == null ) && ( this.fbti2 == null )) { window.clearInterval( this.fbtid ); this.fbtid = null; } }; listingagent.SlideShow.prototype.tia = function () { if ( this.fbtid != null ) { window.clearInterval( this.fbtid ); this.fbtid = null; if ( this.fbti1 != null ) { this.hi( this.fbti1 ); this.fbti1.sio(); this.fbti1.sizi(); this.fbti1 = null; } if ( this.fbti2 != null ) { this.fbti2.sio(); this.fbti2.sizi(); this.fbti2 = null; } } }; listingagent.SlideShow.prototype.pli = function ( s ) { if (( s >= 0 ) && ( s < this.fboal )) { this.fboa[ s ].li(); } for ( var i = 0; i < this.fboal; i++ ) { if ( !this.fboa[ i ].il() ) { this.fboa[ i ].li(); return false; } } return true; }; listingagent.SlideShowImage = function( properties ) { this.i = properties.image; this.s = properties.imageSrc; this.c = properties.caption; this.ls = 0; }; listingagent.SlideShowImage.prototype.gi = function() { return this.i; }; listingagent.SlideShowImage.prototype.gc = function() { return this.c; }; listingagent.SlideShowImage.prototype.sio = function( o ) { if ( typeof o == 'undefined' ) { this.i.style.opacity = ''; this.i.style.MozOpacity = ''; this.i.style.filter = ''; } else if ( o <= 0 ) { this.i.style.opacity = '0'; this.i.style.MozOpacity = '0'; this.i.style.filter = 'alpha(opacity=0)'; } else if ( o < 100 ) { this.i.style.opacity = '' + ( o / 100.0 ); this.i.style.MozOpacity = '' + ( o / 100.0 ); this.i.style.filter = 'alpha(opacity=' + o + ')'; } else { this.i.style.opacity = '1'; this.i.style.MozOpacity = '1'; this.i.style.filter = 'alpha(opacity=100)'; } }; listingagent.SlideShowImage.prototype.sizi = function( zi ) { if ( typeof zi == 'undefined' ) { this.i.style.zIndex = ''; } else { this.i.style.zIndex = '' + zi; } }; listingagent.SlideShowImage.prototype.il = function() { return (( this.ls == 2 ) && ( this.i.complete == true )); }; listingagent.SlideShowImage.prototype.li = function () { if ( this.ls == 0 ) { if ( this.i.attachEvent ) { var image = this; this.i.attachEvent( 'onload', function ( event ) { image.eil( event ); } ); this.ls = 1; this.i.src = this.s; } else { this.ls = 2; this.i.src = this.s; } } }; listingagent.SlideShowImage.prototype.eil = function ( event ) { this.ls = 2; }; listingagent.SlideShowImage.prototype.si = function () { this.i.style.visibility = "visible"; }; listingagent.SlideShowImage.prototype.hi = function () { this.i.style.visibility = "hidden"; }; listingagent.SlideShowImage.prototype.sc = function () { this.c.style.visibility = "visible"; }; listingagent.SlideShowImage.prototype.hc = function () { this.c.style.visibility = "hidden"; };

/* Copyright (c) 2001-2010 Terence M. Bandoian. All rights reserved. */