	// IDX Broker Slideshow version 2.0
	// Copyright ©2010 All rights reserved.
	// This script exists soley for the purposes of allowing real estate professionals to display
	// their property information easily on their own web site. All other use prohibited.
	
	var c;
		
	var timeRichmondNewHomesout = 5000;
	var cRichmondNewHomeswi = 0;
	
	// iRichmondNewHomessf1.11 :: Image swap-fade 
	// *****************************************************
	// DOM scripting by brothercake -- http://www.brothercake.com/
	//******************************************************
	//global object
	var iRichmondNewHomessf = { 'clock' : null, 'fade' : true, 'count' : 1 }
	
	
	//swapRichmondNewHomesfade setup function
	function swapRichmondNewHomesfade()
	{
		//if the timer is not already going
		if(iRichmondNewHomessf.clock == null)
		{
			//copy the image object 
			iRichmondNewHomessf.obj = arguments[0];
			
			//copy the image src argument 
			iRichmondNewHomessf.src = arguments[1];
			
			//store the supported form of opacity
			if(typeof iRichmondNewHomessf.obj.style.opacity != 'undefined')
			{
				iRichmondNewHomessf.type = 'w3c';
			}
			else if(typeof iRichmondNewHomessf.obj.style.MozOpacity != 'undefined')
			{
				iRichmondNewHomessf.type = 'moz';
			}
			else if(typeof iRichmondNewHomessf.obj.style.KhtmlOpacity != 'undefined')
			{
				iRichmondNewHomessf.type = 'khtml';
			}
			else if(typeof iRichmondNewHomessf.obj.filters == 'object')
			{
				//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
				//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
				//then the returned value type, which should be a number, but in mac/ie5 is an empty string
				iRichmondNewHomessf.type = (iRichmondNewHomessf.obj.filters.length > 0 && typeof iRichmondNewHomessf.obj.filters.alpha == 'object' && typeof iRichmondNewHomessf.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
			}
			else
			{
				iRichmondNewHomessf.type = 'none';
			}
			
			//change the image alt text if defined
			if(typeof arguments[3] != 'undefined' && arguments[3] != '')
			{
				iRichmondNewHomessf.obj.alt = arguments[3];
			}
			
			//if any kind of opacity is supported
			if(iRichmondNewHomessf.type != 'none')
			{
				//copy and convert fade duration argument 
				//the duration specifies the whole transition
				//but the swapRichmondNewHomesfade is two distinct transitions
				iRichmondNewHomessf.length = parseInt(arguments[2], 10) * 500;
				
				//create fade resolution argument as 20 steps per transition
				//again, split for the two distrinct transitions
				iRichmondNewHomessf.resolution = parseInt(arguments[2], 10) * 10;
				
				//start the timer
				iRichmondNewHomessf.clock = setInterval('iRichmondNewHomessf.swapRichmondNewHomesfade()', iRichmondNewHomessf.length/iRichmondNewHomessf.resolution);
			}
			
			//otherwise if opacity is not supported
			else
			{
				//just do the image swap
				iRichmondNewHomessf.obj.src = iRichmondNewHomessf.src;
			}
			
		}
	};
	
	
	//swapRichmondNewHomesfade timer function
	iRichmondNewHomessf.swapRichmondNewHomesfade = function()
	{
		//increase or reduce the counter on an exponential scale
		iRichmondNewHomessf.count = (iRichmondNewHomessf.fade) ? iRichmondNewHomessf.count * 0.9 : (iRichmondNewHomessf.count * (1/0.9)); 
		
		//if the counter has reached the bottom
		if(iRichmondNewHomessf.count < (1 / iRichmondNewHomessf.resolution))
		{
			//clear the timer
			clearInterval(iRichmondNewHomessf.clock);
			iRichmondNewHomessf.clock = null;
	
			//do the image swap
			iRichmondNewHomessf.obj.src = iRichmondNewHomessf.src;
	
			//reverse the fade direction flag
			iRichmondNewHomessf.fade = false;
			
			//restart the timer
			iRichmondNewHomessf.clock = setInterval('iRichmondNewHomessf.swapRichmondNewHomesfade()', iRichmondNewHomessf.length/iRichmondNewHomessf.resolution);
	
		}
		
		//if the counter has reached the top
		if(iRichmondNewHomessf.count > (1 - (1 / iRichmondNewHomessf.resolution)))
		{
			//clear the timer
			clearInterval(iRichmondNewHomessf.clock);
			iRichmondNewHomessf.clock = null;
	
			//reset the fade direction flag
			iRichmondNewHomessf.fade = true;
			
			//reset the counter
			iRichmondNewHomessf.count = 1;
		}
	
		//set new opacity value on element
		//using whatever method is supported
		switch(iRichmondNewHomessf.type)
		{
			case 'ie' :
				iRichmondNewHomessf.obj.filters.alpha.opacity = iRichmondNewHomessf.count * 100;
				break;
				
			case 'khtml' :
				iRichmondNewHomessf.obj.style.KhtmlOpacity = iRichmondNewHomessf.count;
				break;
				
			case 'moz' : 
				//restrict max opacity to prevent a visual popping effect in firefox
				iRichmondNewHomessf.obj.style.MozOpacity = (iRichmondNewHomessf.count == 1 ? 0.9999999 : iRichmondNewHomessf.count);
				break;
				
			default : 
				//restrict max opacity to prevent a visual popping effect in firefox
				iRichmondNewHomessf.obj.style.opacity = (iRichmondNewHomessf.count == 1 ? 0.9999999 : iRichmondNewHomessf.count);
		}
	};



	
	document.writeln('<style type="text/css" media="all">');
	document.writeln('#IDX-RichmondNewHomes-slideshow { text-align: center; width: 600px;  }');
	document.writeln('.IDX-RichmondNewHomes-image { width: 600px; height: 450px;  }');
	document.writeln('#IDX-RichmondNewHomes-slideshowImage span { text-align: center; }');
	document.writeln('</style>');
	var nextRichmondNewHomes = 1;
	prevRichmondNewHomes = 9 - 1;

	document.writeln('<div id="IDX-RichmondNewHomes-slideshow">');
	document.writeln('<div id="IDX-RichmondNewHomes-slideshowImage">');
	document.writeln('<span><a href="" id="IDX-RichmondNewHomes-ssImageURL" class="IDX-RichmondNewHomes-ssLinkText"><img id="IDX-RichmondNewHomes-ssImage" name="RichmondNewHomes-ssImage" alt="Slideshow image" border="0"  class="IDX-RichmondNewHomes-image" src="http://photos-12.idxco.com/237a8a1758575d6b8e2abdf6285d5924bcd1000179" ></a></span>');
	document.writeln('</div>');
	document.writeln('<div id="IDX-RichmondNewHomes-priceLine"></div>');
	document.writeln('<div id="IDX-RichmondNewHomes-addressLine"></div>');
	document.writeln('<div id="IDX-RichmondNewHomes-cszLine"></div>');
	document.writeln('<div id="IDX-RichmondNewHomes-bedLine" style="display:none;"></div>');
	document.writeln('<div id="IDX-RichmondNewHomes-bathLine" style="display:none;"></div>');
	document.writeln('<div id="IDX-RichmondNewHomes-remarkLine" style="display:none;"></div>');
	
	document.writeln('</div>');

	function playRichmondNewHomes()
	{
		
		
		urlVarRichmondNewHomes = '<a href="'+propertiesRichmondNewHomes[cRichmondNewHomeswi][6]+'" class="IDX-RichmondNewHomes-ssLinkText">';
		swapRichmondNewHomesfade(document.getElementById('IDX-RichmondNewHomes-ssImage'), preLoadRichmondNewHomes.src, '1', ' ');
		document.getElementById('IDX-RichmondNewHomes-ssImageURL').href = propertiesRichmondNewHomes[cRichmondNewHomeswi][6];
		document.getElementById('IDX-RichmondNewHomes-priceLine').innerHTML = urlVarRichmondNewHomes+'$'+propertiesRichmondNewHomes[cRichmondNewHomeswi][0]+'</a>';
		document.getElementById('IDX-RichmondNewHomes-addressLine').innerHTML =  urlVarRichmondNewHomes+propertiesRichmondNewHomes[cRichmondNewHomeswi][1]+'</a>';
		document.getElementById('IDX-RichmondNewHomes-cszLine').innerHTML = urlVarRichmondNewHomes+propertiesRichmondNewHomes[cRichmondNewHomeswi][2]+'</a>';
		document.getElementById('IDX-RichmondNewHomes-bedLine').innerHTML = urlVarRichmondNewHomes+'Beds: '+propertiesRichmondNewHomes[cRichmondNewHomeswi][7]+'</a>';
		document.getElementById('IDX-RichmondNewHomes-bathLine').innerHTML = urlVarRichmondNewHomes+'Baths: '+propertiesRichmondNewHomes[cRichmondNewHomeswi][8]+'</a>';
		document.getElementById('IDX-RichmondNewHomes-remarkLine').innerHTML = urlVarRichmondNewHomes+propertiesRichmondNewHomes[cRichmondNewHomeswi][9]+'</a>';
		
		preLoadRichmondNewHomes = new Image();
		preLoadRichmondNewHomes.src = propertiesRichmondNewHomes[nextRichmondNewHomes][3];
		
		updateRichmondNewHomes();
		
		cRichmondNewHomes = setTimeout('playRichmondNewHomes()', timeRichmondNewHomesout);	
		
		
	} // end play()
	function updateRichmondNewHomes()
	{		
		cRichmondNewHomeswi = nextRichmondNewHomes;		
		genNextRichmondNewHomes();
		genPrevRichmondNewHomes();
		
	}
	function genNextRichmondNewHomes()
	{
		nextRichmondNewHomes = cRichmondNewHomeswi + 1;
		if (nextRichmondNewHomes >= 9)
			nextRichmondNewHomes = 0;
	} // end genNext
	function genPrevRichmondNewHomes()
	{
		prevRichmondNewHomes = cRichmondNewHomeswi - 1;
		if (prevRichmondNewHomes < 0)
			prevRichmondNewHomes = 9 - 1;
	} // end genPrev

	var propertiesRichmondNewHomes = new Array(9);
	propertiesRichmondNewHomes[0] = new Array('1,149,950','4028 Huntsteed Way','Henrico, VA 23233 ','http://photos-12.idxco.com/237a8a1758575d6b8e2abdf6285d5924bcd1000179','1000179','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=1000179&idxID=237','7','5','BEST VIEW IN ALL OF RICHMOND of WETLANDS COMPLETE W/GORGEOUS...');
	propertiesRichmondNewHomes[1] = new Array('995,000','2719 Stonegate Court','Chesterfield, VA 23113 ','http://photos-12.idxco.com/23719bfb81ee7b1a26240ecb95e37b7cd4e2931044','2931044','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=2931044&idxID=237','4','4','Build this all brick home for this price or have your plan b...');
	propertiesRichmondNewHomes[2] = new Array('980,000','11 SONNY MEADOWS LN.','Hanover, VA 23116 ','http://photos-12.idxco.com/237452a187e64c9079e1cf0f93995cd58cf2907727','2907727','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=2907727&idxID=237','5','3','YOU WILL BE SWEPT AWAY BY THE BEAUTY OF LINDSAY MEADOWS II. ...');
	propertiesRichmondNewHomes[3] = new Array('759,000','9514 Arrowdel Court','Henrico, VA 23229 ','http://photos-12.idxco.com/237852857adb4647300a01680967c8d1c5a2932961','2932961','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=2932961&idxID=237','4','4','Beautiful single-family home to-be-built on a cul-de-sac in ...');
	propertiesRichmondNewHomes[4] = new Array('749,900','5631 Regal Court','New Kent, VA 23140 ','http://photos-12.idxco.com/23774681c3240b1faad76c4f96e05a8756d1000384','1000384','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=1000384&idxID=237','4','3','Golf Course Lot on the 18th Tee of Brickshire, New Kent Coun...');
	propertiesRichmondNewHomes[5] = new Array('674,000','0 Wyngate Lane','Hanover, VA 23116 ','http://photos-12.idxco.com/237c05baa97aac81d10aff5e4ee1888bf0c2923754','2923754','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=2923754&idxID=237','5','4','Charming 2 story Craftsman home by Krickovic and Ziegler. Be...');
	propertiesRichmondNewHomes[6] = new Array('334,900','12207 Penny Bridge Drive','Chesterfield, VA 23112 ','http://photos-12.idxco.com/2377e31a66da04c061a02362bc0dfebaa322802414','2802414','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=2802414&idxID=237','4','2','Unbelievable price on The \\\\\\\'REVISED LOMBARDI\\\\\\\' W/A DIFFE...');
	propertiesRichmondNewHomes[7] = new Array('298,363','6100 Bing Court','Henrico, VA 23150 ','http://photos-12.idxco.com/23723b163de232069ff6243dd574a39b43c1000441','1000441','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=1000441&idxID=237','3','2','THE LINSEY PLAN BY RCI BUILDERS.  OPEN RANCHER FLOOR PLAN WI...');
	propertiesRichmondNewHomes[8] = new Array('269,450','1716 Palm Grove Terrace','Henrico, VA 23228 ','http://photos-12.idxco.com/2373bb6c439e6bfbf9fbb6e2cc0a6d4fa852838083','2838083','237','http://idx.richmondvamlssearch.net/idx/5633/details.php?listingID=2838083&idxID=237','3','2','\\\\\\&quot;GORGEOUS, NEW RANCH...READY NOW! Custom Built by En...');
	var urlVarRichmondNewHomes;
	var preLoadRichmondNewHomes = new Image();
	preLoadRichmondNewHomes.src = propertiesRichmondNewHomes[cRichmondNewHomeswi][3];
	onLoad = playRichmondNewHomes();
