	// IDX Broker Slideshow version 2.0
	// Copyright ©2012 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 timeWeichertHomeout = 8000;
	var cWeichertHomewi = 0;
	
	// iWeichertHomesf1.11 :: Image swap-fade 
	// *****************************************************
	// DOM scripting by brothercake -- http://www.brothercake.com/
	//******************************************************
	//global object
	var iWeichertHomesf = { 'clock' : null, 'fade' : true, 'count' : 1 }
	
	
	//swapWeichertHomefade setup function
	function swapWeichertHomefade()
	{
		//if the timer is not already going
		if(iWeichertHomesf.clock == null)
		{
			//copy the image object 
			iWeichertHomesf.obj = arguments[0];
			
			//copy the image src argument 
			iWeichertHomesf.src = arguments[1];
			
			//store the supported form of opacity
			if(typeof iWeichertHomesf.obj.style.opacity != 'undefined')
			{
				iWeichertHomesf.type = 'w3c';
			}
			else if(typeof iWeichertHomesf.obj.style.MozOpacity != 'undefined')
			{
				iWeichertHomesf.type = 'moz';
			}
			else if(typeof iWeichertHomesf.obj.style.KhtmlOpacity != 'undefined')
			{
				iWeichertHomesf.type = 'khtml';
			}
			else if(typeof iWeichertHomesf.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
				iWeichertHomesf.type = (iWeichertHomesf.obj.filters.length > 0 && typeof iWeichertHomesf.obj.filters.alpha == 'object' && typeof iWeichertHomesf.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
			}
			else
			{
				iWeichertHomesf.type = 'none';
			}
			
			//change the image alt text if defined
			if(typeof arguments[3] != 'undefined' && arguments[3] != '')
			{
				iWeichertHomesf.obj.alt = arguments[3];
			}
			
			//if any kind of opacity is supported
			if(iWeichertHomesf.type != 'none')
			{
				//copy and convert fade duration argument 
				//the duration specifies the whole transition
				//but the swapWeichertHomefade is two distinct transitions
				iWeichertHomesf.length = parseInt(arguments[2], 10) * 500;
				
				//create fade resolution argument as 20 steps per transition
				//again, split for the two distrinct transitions
				iWeichertHomesf.resolution = parseInt(arguments[2], 10) * 10;
				
				//start the timer
				iWeichertHomesf.clock = setInterval('iWeichertHomesf.swapWeichertHomefade()', iWeichertHomesf.length/iWeichertHomesf.resolution);
			}
			
			//otherwise if opacity is not supported
			else
			{
				//just do the image swap
				iWeichertHomesf.obj.src = iWeichertHomesf.src;
			}
			
		}
	};
	
	
	//swapWeichertHomefade timer function
	iWeichertHomesf.swapWeichertHomefade = function()
	{
		//increase or reduce the counter on an exponential scale
		iWeichertHomesf.count = (iWeichertHomesf.fade) ? iWeichertHomesf.count * 0.9 : (iWeichertHomesf.count * (1/0.9)); 
		
		//if the counter has reached the bottom
		if(iWeichertHomesf.count < (1 / iWeichertHomesf.resolution))
		{
			//clear the timer
			clearInterval(iWeichertHomesf.clock);
			iWeichertHomesf.clock = null;
	
			//do the image swap
			iWeichertHomesf.obj.src = iWeichertHomesf.src;
	
			//reverse the fade direction flag
			iWeichertHomesf.fade = false;
			
			//restart the timer
			iWeichertHomesf.clock = setInterval('iWeichertHomesf.swapWeichertHomefade()', iWeichertHomesf.length/iWeichertHomesf.resolution);
	
		}
		
		//if the counter has reached the top
		if(iWeichertHomesf.count > (1 - (1 / iWeichertHomesf.resolution)))
		{
			//clear the timer
			clearInterval(iWeichertHomesf.clock);
			iWeichertHomesf.clock = null;
	
			//reset the fade direction flag
			iWeichertHomesf.fade = true;
			
			//reset the counter
			iWeichertHomesf.count = 1;
		}
	
		//set new opacity value on element
		//using whatever method is supported
		switch(iWeichertHomesf.type)
		{
			case 'ie' :
				iWeichertHomesf.obj.filters.alpha.opacity = iWeichertHomesf.count * 100;
				break;
				
			case 'khtml' :
				iWeichertHomesf.obj.style.KhtmlOpacity = iWeichertHomesf.count;
				break;
				
			case 'moz' : 
				//restrict max opacity to prevent a visual popping effect in firefox
				iWeichertHomesf.obj.style.MozOpacity = (iWeichertHomesf.count == 1 ? 0.9999999 : iWeichertHomesf.count);
				break;
				
			default : 
				//restrict max opacity to prevent a visual popping effect in firefox
				iWeichertHomesf.obj.style.opacity = (iWeichertHomesf.count == 1 ? 0.9999999 : iWeichertHomesf.count);
		}
	};



	
	document.writeln('<style type="text/css" media="all">');
	document.writeln('#IDX-WeichertHome-slideshow { text-align: center; width: 290px;  }');
	document.writeln('.IDX-WeichertHome-image { width: 290px;  }');
	document.writeln('#IDX-WeichertHome-slideshowImage span { text-align: center; }');
	document.writeln('</style>');
	var nextWeichertHome = 1;
	prevWeichertHome = 2 - 1;

	document.writeln('<div id="IDX-WeichertHome-slideshow">');
	document.writeln('<div id="IDX-WeichertHome-slideshowImage">');
	document.writeln('<span><a href="" id="IDX-WeichertHome-ssImageURL" class="IDX-WeichertHome-ssLinkText"><img id="IDX-WeichertHome-ssImage" name="WeichertHome-ssImage" alt="Slideshow image" border="0"  class="IDX-WeichertHome-image" src="http://www.carolinaphotos.com/photos/948316.jpg" ></a></span>');
	document.writeln('</div>');
	document.writeln('<div id="IDX-WeichertHome-priceLine"></div>');
	document.writeln('<div id="IDX-WeichertHome-addressLine"></div>');
	document.writeln('<div id="IDX-WeichertHome-cszLine"></div>');
	document.writeln('<div id="IDX-WeichertHome-bedLine" style="display:none;"></div>');
	document.writeln('<div id="IDX-WeichertHome-bathLine" style="display:none;"></div>');
	document.writeln('<div id="IDX-WeichertHome-remarkLine" style="display:none;"></div>');
	
	document.writeln('</div>');

	function playWeichertHome()
	{
		
		
		urlVarWeichertHome = '<a href="'+propertiesWeichertHome[cWeichertHomewi][6]+'" class="IDX-WeichertHome-ssLinkText">';
		swapWeichertHomefade(document.getElementById('IDX-WeichertHome-ssImage'), preLoadWeichertHome.src, '1', ' ');
		document.getElementById('IDX-WeichertHome-ssImageURL').href = propertiesWeichertHome[cWeichertHomewi][6];
		document.getElementById('IDX-WeichertHome-priceLine').innerHTML = urlVarWeichertHome+'$'+propertiesWeichertHome[cWeichertHomewi][0]+'</a>';
		document.getElementById('IDX-WeichertHome-addressLine').innerHTML =  urlVarWeichertHome+propertiesWeichertHome[cWeichertHomewi][1]+'</a>';
		document.getElementById('IDX-WeichertHome-cszLine').innerHTML = urlVarWeichertHome+propertiesWeichertHome[cWeichertHomewi][2]+'</a>';
		document.getElementById('IDX-WeichertHome-bedLine').innerHTML = urlVarWeichertHome+'Beds: '+propertiesWeichertHome[cWeichertHomewi][7]+'</a>';
		document.getElementById('IDX-WeichertHome-bathLine').innerHTML = urlVarWeichertHome+'Baths: '+propertiesWeichertHome[cWeichertHomewi][8]+'</a>';
		document.getElementById('IDX-WeichertHome-remarkLine').innerHTML = urlVarWeichertHome+propertiesWeichertHome[cWeichertHomewi][9]+'</a>';
		
		preLoadWeichertHome = new Image();
		preLoadWeichertHome.src = propertiesWeichertHome[nextWeichertHome][3];
		
		updateWeichertHome();
		
		cWeichertHome = setTimeout('playWeichertHome()', timeWeichertHomeout);	
		
		
	} // end play()
	function updateWeichertHome()
	{		
		cWeichertHomewi = nextWeichertHome;		
		genNextWeichertHome();
		genPrevWeichertHome();
		
	}
	function genNextWeichertHome()
	{
		nextWeichertHome = cWeichertHomewi + 1;
		if (nextWeichertHome >= 2)
			nextWeichertHome = 0;
	} // end genNext
	function genPrevWeichertHome()
	{
		prevWeichertHome = cWeichertHomewi - 1;
		if (prevWeichertHome < 0)
			prevWeichertHome = 2 - 1;
	} // end genPrev

	var propertiesWeichertHome = new Array(2);
	propertiesWeichertHome[0] = new Array('649,900','4676 Dove Field Lane','Kannapolis, NC 28081 ','http://www.carolinaphotos.com/photos/948316.jpg','948316','032','http://www.weichertcraven.idxco.com/idx/3956/details.php?listingID=948316&idxID=032','6','5','Driveway just repaved &amp; ew stand alone ice maker.Souther...');
	propertiesWeichertHome[1] = new Array('395,000','5932 NW Londonderry Court','Concord, NC 28027 ','http://www.carolinaphotos.com/photos/951908.jpg','951908','032','http://www.weichertcraven.idxco.com/idx/3956/details.php?listingID=951908&idxID=032','5','3','Remarkable home, well maintained with 16X16 sunroom, 16x13 d...');
	var urlVarWeichertHome;
	var preLoadWeichertHome = new Image();
	preLoadWeichertHome.src = propertiesWeichertHome[cWeichertHomewi][3];
	onLoad = playWeichertHome();

