	// IDX Broker Slideshow version 2.0
	// Copyright ©2009 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 timeFeaturedHomeoftheDayout = 5000;
	var cFeaturedHomeoftheDaywi = 0;
	
	// iFeaturedHomeoftheDaysf1.11 :: Image swap-fade 
	// *****************************************************
	// DOM scripting by brothercake -- http://www.brothercake.com/
	//******************************************************
	//global object
	var iFeaturedHomeoftheDaysf = { 'clock' : null, 'fade' : true, 'count' : 1 }
	
	
	//swapFeaturedHomeoftheDayfade setup function
	function swapFeaturedHomeoftheDayfade()
	{
		//if the timer is not already going
		if(iFeaturedHomeoftheDaysf.clock == null)
		{
			//copy the image object 
			iFeaturedHomeoftheDaysf.obj = arguments[0];
			
			//copy the image src argument 
			iFeaturedHomeoftheDaysf.src = arguments[1];
			
			//store the supported form of opacity
			if(typeof iFeaturedHomeoftheDaysf.obj.style.opacity != 'undefined')
			{
				iFeaturedHomeoftheDaysf.type = 'w3c';
			}
			else if(typeof iFeaturedHomeoftheDaysf.obj.style.MozOpacity != 'undefined')
			{
				iFeaturedHomeoftheDaysf.type = 'moz';
			}
			else if(typeof iFeaturedHomeoftheDaysf.obj.style.KhtmlOpacity != 'undefined')
			{
				iFeaturedHomeoftheDaysf.type = 'khtml';
			}
			else if(typeof iFeaturedHomeoftheDaysf.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
				iFeaturedHomeoftheDaysf.type = (iFeaturedHomeoftheDaysf.obj.filters.length > 0 && typeof iFeaturedHomeoftheDaysf.obj.filters.alpha == 'object' && typeof iFeaturedHomeoftheDaysf.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
			}
			else
			{
				iFeaturedHomeoftheDaysf.type = 'none';
			}
			
			//change the image alt text if defined
			if(typeof arguments[3] != 'undefined' && arguments[3] != '')
			{
				iFeaturedHomeoftheDaysf.obj.alt = arguments[3];
			}
			
			//if any kind of opacity is supported
			if(iFeaturedHomeoftheDaysf.type != 'none')
			{
				//copy and convert fade duration argument 
				//the duration specifies the whole transition
				//but the swapFeaturedHomeoftheDayfade is two distinct transitions
				iFeaturedHomeoftheDaysf.length = parseInt(arguments[2], 10) * 500;
				
				//create fade resolution argument as 20 steps per transition
				//again, split for the two distrinct transitions
				iFeaturedHomeoftheDaysf.resolution = parseInt(arguments[2], 10) * 10;
				
				//start the timer
				iFeaturedHomeoftheDaysf.clock = setInterval('iFeaturedHomeoftheDaysf.swapFeaturedHomeoftheDayfade()', iFeaturedHomeoftheDaysf.length/iFeaturedHomeoftheDaysf.resolution);
			}
			
			//otherwise if opacity is not supported
			else
			{
				//just do the image swap
				iFeaturedHomeoftheDaysf.obj.src = iFeaturedHomeoftheDaysf.src;
			}
			
		}
	};
	
	
	//swapFeaturedHomeoftheDayfade timer function
	iFeaturedHomeoftheDaysf.swapFeaturedHomeoftheDayfade = function()
	{
		//increase or reduce the counter on an exponential scale
		iFeaturedHomeoftheDaysf.count = (iFeaturedHomeoftheDaysf.fade) ? iFeaturedHomeoftheDaysf.count * 0.9 : (iFeaturedHomeoftheDaysf.count * (1/0.9)); 
		
		//if the counter has reached the bottom
		if(iFeaturedHomeoftheDaysf.count < (1 / iFeaturedHomeoftheDaysf.resolution))
		{
			//clear the timer
			clearInterval(iFeaturedHomeoftheDaysf.clock);
			iFeaturedHomeoftheDaysf.clock = null;
	
			//do the image swap
			iFeaturedHomeoftheDaysf.obj.src = iFeaturedHomeoftheDaysf.src;
	
			//reverse the fade direction flag
			iFeaturedHomeoftheDaysf.fade = false;
			
			//restart the timer
			iFeaturedHomeoftheDaysf.clock = setInterval('iFeaturedHomeoftheDaysf.swapFeaturedHomeoftheDayfade()', iFeaturedHomeoftheDaysf.length/iFeaturedHomeoftheDaysf.resolution);
	
		}
		
		//if the counter has reached the top
		if(iFeaturedHomeoftheDaysf.count > (1 - (1 / iFeaturedHomeoftheDaysf.resolution)))
		{
			//clear the timer
			clearInterval(iFeaturedHomeoftheDaysf.clock);
			iFeaturedHomeoftheDaysf.clock = null;
	
			//reset the fade direction flag
			iFeaturedHomeoftheDaysf.fade = true;
			
			//reset the counter
			iFeaturedHomeoftheDaysf.count = 1;
		}
	
		//set new opacity value on element
		//using whatever method is supported
		switch(iFeaturedHomeoftheDaysf.type)
		{
			case 'ie' :
				iFeaturedHomeoftheDaysf.obj.filters.alpha.opacity = iFeaturedHomeoftheDaysf.count * 100;
				break;
				
			case 'khtml' :
				iFeaturedHomeoftheDaysf.obj.style.KhtmlOpacity = iFeaturedHomeoftheDaysf.count;
				break;
				
			case 'moz' : 
				//restrict max opacity to prevent a visual popping effect in firefox
				iFeaturedHomeoftheDaysf.obj.style.MozOpacity = (iFeaturedHomeoftheDaysf.count == 1 ? 0.9999999 : iFeaturedHomeoftheDaysf.count);
				break;
				
			default : 
				//restrict max opacity to prevent a visual popping effect in firefox
				iFeaturedHomeoftheDaysf.obj.style.opacity = (iFeaturedHomeoftheDaysf.count == 1 ? 0.9999999 : iFeaturedHomeoftheDaysf.count);
		}
	};



	
	document.writeln('<style type="text/css" media="all">');
	document.writeln('#IDX-FeaturedHomeoftheDay-slideshow { text-align: center; width: 310px;  }');
	document.writeln('.IDX-FeaturedHomeoftheDay-image { width: 310px; height: 175px;  }');
	document.writeln('#IDX-FeaturedHomeoftheDay-slideshowImage span { text-align: center; }');
	document.writeln('</style>');
	var nextFeaturedHomeoftheDay = 1;
	prevFeaturedHomeoftheDay = 1 - 1;

	document.writeln('<div id="IDX-FeaturedHomeoftheDay-slideshow">');
	document.writeln('<div id="IDX-FeaturedHomeoftheDay-slideshowImage">');
	document.writeln('<span><a href="" id="IDX-FeaturedHomeoftheDay-ssImageURL" class="IDX-FeaturedHomeoftheDay-ssLinkText"><img id="IDX-FeaturedHomeoftheDay-ssImage" name="FeaturedHomeoftheDay-ssImage" alt="Slideshow image" border="0"  class="IDX-FeaturedHomeoftheDay-image" src="http://images.mlslistings.com/Reports/GetContents.ashx?content_type=image&ResourceID=920313&ObjectID=1" ></a></span>');
	document.writeln('</div>');
	document.writeln('<div id="IDX-FeaturedHomeoftheDay-priceLine"></div>');
	document.writeln('<div id="IDX-FeaturedHomeoftheDay-addressLine"></div>');
	document.writeln('<div id="IDX-FeaturedHomeoftheDay-cszLine"></div>');
	document.writeln('<div id="IDX-FeaturedHomeoftheDay-bedLine" style="display:none;"></div>');
	document.writeln('<div id="IDX-FeaturedHomeoftheDay-bathLine" style="display:none;"></div>');
	document.writeln('<div id="IDX-FeaturedHomeoftheDay-remarkLine" style="display:none;"></div>');
	
	document.writeln('</div>');

	function playFeaturedHomeoftheDay()
	{
		
		
		urlVarFeaturedHomeoftheDay = '<a href="'+propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][6]+'" class="IDX-FeaturedHomeoftheDay-ssLinkText">';
		swapFeaturedHomeoftheDayfade(document.getElementById('IDX-FeaturedHomeoftheDay-ssImage'), preLoadFeaturedHomeoftheDay.src, '1', ' ');
		document.getElementById('IDX-FeaturedHomeoftheDay-ssImageURL').href = propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][6];
		document.getElementById('IDX-FeaturedHomeoftheDay-priceLine').innerHTML = urlVarFeaturedHomeoftheDay+'$'+propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][0]+'</a>';
		document.getElementById('IDX-FeaturedHomeoftheDay-addressLine').innerHTML =  urlVarFeaturedHomeoftheDay+propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][1]+'</a>';
		document.getElementById('IDX-FeaturedHomeoftheDay-cszLine').innerHTML = urlVarFeaturedHomeoftheDay+propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][2]+'</a>';
		document.getElementById('IDX-FeaturedHomeoftheDay-bedLine').innerHTML = urlVarFeaturedHomeoftheDay+'Beds: '+propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][7]+'</a>';
		document.getElementById('IDX-FeaturedHomeoftheDay-bathLine').innerHTML = urlVarFeaturedHomeoftheDay+'Baths: '+propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][8]+'</a>';
		document.getElementById('IDX-FeaturedHomeoftheDay-remarkLine').innerHTML = urlVarFeaturedHomeoftheDay+propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][9]+'</a>';
		
		preLoadFeaturedHomeoftheDay = new Image();
		preLoadFeaturedHomeoftheDay.src = propertiesFeaturedHomeoftheDay[nextFeaturedHomeoftheDay][3];
		
		updateFeaturedHomeoftheDay();
		
		cFeaturedHomeoftheDay = setTimeout('playFeaturedHomeoftheDay()', timeFeaturedHomeoftheDayout);	
		
		
	} // end play()
	function updateFeaturedHomeoftheDay()
	{		
		cFeaturedHomeoftheDaywi = nextFeaturedHomeoftheDay;		
		genNextFeaturedHomeoftheDay();
		genPrevFeaturedHomeoftheDay();
		
	}
	function genNextFeaturedHomeoftheDay()
	{
		nextFeaturedHomeoftheDay = cFeaturedHomeoftheDaywi + 1;
		if (nextFeaturedHomeoftheDay >= 1)
			nextFeaturedHomeoftheDay = 0;
	} // end genNext
	function genPrevFeaturedHomeoftheDay()
	{
		prevFeaturedHomeoftheDay = cFeaturedHomeoftheDaywi - 1;
		if (prevFeaturedHomeoftheDay < 0)
			prevFeaturedHomeoftheDay = 1 - 1;
	} // end genPrev

	var propertiesFeaturedHomeoftheDay = new Array(1);
	propertiesFeaturedHomeoftheDay[0] = new Array('6,880,000','14833 KARL AV','Monte Sereno, CA 95030 ','http://images.mlslistings.com/Reports/GetContents.ashx?content_type=image&ResourceID=920313&ObjectID=1','80930263','108','http://www.sanjose.idxco.com/idx/4619/details.php?listingID=80930263&idxID=108','4','0','Gorgeous 4 bd-5.5 bath Home + Annex w/Library,Game Room &amp...');
	var urlVarFeaturedHomeoftheDay;
	var preLoadFeaturedHomeoftheDay = new Image();
	preLoadFeaturedHomeoftheDay.src = propertiesFeaturedHomeoftheDay[cFeaturedHomeoftheDaywi][3];
	onLoad = playFeaturedHomeoftheDay();
