function MM_findObj(n, d) { //v4.01
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all)
		x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById)
		x=d.getElementById(n);
	return x;
}
function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null) {
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document;
	if(d.images){
		if(!d.MM_p)
			d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
	}
}

// ==============================================================================
// ==============================================================================
//									SLIDE SHOW
// ==============================================================================
// ==============================================================================

// =======================================
// set the slide show variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 7000

// Duration of crossfade (seconds)
//var crossFadeDuration = 5000	// this var doesn't matter

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[3] = 'graphics/mainswap/120.jpg'
Pic[6] = 'graphics/mainswap/155.jpg'
Pic[9] = 'graphics/mainswap/205.jpg'
Pic[14] = 'graphics/mainswap/257.jpg'
Pic[2] = 'graphics/mainswap/345.jpg'
Pic[5] = 'graphics/mainswap/415.jpg'
// Added on 3/3/10
Pic[16] = 'graphics/mainswap/133.jpg'
Pic[4] = 'graphics/mainswap/150.jpg'
Pic[17] = 'graphics/mainswap/190.jpg'
Pic[10] = 'graphics/mainswap/255.jpg'
Pic[11] = 'graphics/mainswap/260.jpg'
Pic[15] = 'graphics/mainswap/265.jpg'
Pic[1] = 'graphics/mainswap/270.jpg'
Pic[7] = 'graphics/mainswap/310.jpg'
Pic[0] = 'graphics/mainswap/335.jpg'
Pic[13] = 'graphics/mainswap/370.jpg'
Pic[12] = 'graphics/mainswap/380.jpg'
Pic[8] = 'graphics/mainswap/388.jpg'
Pic[18] = 'graphics/mainswap/395.jpg'

var Txt = new Array()

Txt[3] = "<b><a href='/properties/120'>SWC El Camino Real & Curbaril Avenue</a></b><br /><b>Atascadero, CA</b><p>This neighborhood shopping center is conveniently located in the city of Atascadero on the southwest corner of El Camino Real and Curbaril Avenue. It is adjacent to the 101. The center consists of approximately 73,913 square feet of retail space and is anchored by Albertsons supermarket.</p>"
Txt[6] = "<b><a href='/properties/155'>NWC Carson Street & Bloomfield Avenue</a></b><br /><b>Hawaiian Gardens, CA</b><p>This neighborhood shopping center is conveniently located in the city of Hawaiian Gardens on the northwest corner of Carson Street and Bloomfield Avenue. It is minutes from the 605 freeway. The center consists of approximately 104,960 square feet of retail space encompassing 27 stores and is anchored by Zion Supermarket and Burger King.</p>"
Txt[9] = "<b><a href='/properties/205'>NWC Knott Avenue & Lincoln Boulevard</a></b><br /><b>Buena Park, CA</b><p>This neighborhood shopping center is conveniently located in the city of Buena Park on the northwest corner of Lincoln Boulevard and Knott Avenue. It is minutes from the 22 and 91 freeways. The center consists of approximately 67,700 square feet of retail space encompassing 24 stores and is anchored by Northgate-Gonzales supermarket and Carl's Jr.</p>"
Txt[14] = "<b><a href='/properties/257'>NWC Tefft Street & Highway 101</a></b><br /><b>Nipomo, CA</b><p>This neighborhood shopping center is conveniently located in the city of Nipomo on the northwest corner of West Tefft Street and Mary Avenue. It is adjacent to the 101. The center consists of approximately 10,320 square feet of retail space encompassing 7 stores and is anchored by Von\'s supermarket.</p>"
Txt[2] = "<b><a href='/properties/345'>SWC N Capitol Avenue & Hostetter Road</a></b><br /><b>San Jose, CA</b><p>This neighborhood shopping center is conveniently located in the city of San Jose on the southwest corner of Capitol Avenue and Hostetter Road. It is directly off the 680 freeway. The center consists of approximately 55,865 square feet of retail space encompassing 15 stores and is anchored by Save Mart supermarket.</p>"
Txt[5] = "<b><a href='/properties/415'>NWC White Lane & Hughes Lane</a></b><br /><b>Bakersfield, CA</b><p>This neighborhood shopping center is conveniently located in the city of Bakersfield on the northwest corner of White Lane and Hughes Lane. It is minutes from the 99 freeway. The center spans approximately 25,460 square feet of retails space encompassing 14 stores and is anchored by Von\'s Market.</p>"
// Added on 3/3/10
Txt[16] = "<b><a href='/properties/133'>Sunnyside Plaza</a></b><br /><b>Fresno, CA</b><p>This neighborhood shopping center is conveniently located in the city of Fresno on the southeast corner of Clovis Avenue and Kings Canyon Road. It is minutes from Highway 99. The center consists of approximately 16,562 square feet of retail space encompassing 10 stores and is anchored by Vons, Dollar Tree, Autozone, Wendy's, Wells Fargo and Blockbuster Video.</p>"
Txt[4] = "<b><a href='/properties/150'>Fontana Village</a></b><br /><b>Fontana, CA</b><p>This strip is conveniently located in the city of Fontana on the southeast corner of Foothill Boulevard and Sierra Highway. It is minutes from the 10 and 15 freeways. The center consists of approximately 23,989 square feet of retail space encompassing 17 stores and is anchored by Weinerschnitzel, Subway, Kentucky Fried Chicken, and Wells Fargo Mortgage.</p>"
Txt[17] = "<b><a href='/properties/190'>Santa Clara Village</a></b><br /><b>Santa Clara, CA</b><p>This neighborhood shopping center is conveniently located in the city of Santa Clara on the northwest corner of El Camino Real and Halford Avenue. It is directly off the Lawrence Expressway. The center consists of approximately 27,481 square feet of retail space encompassing 16 stores and is anchored by The Fish Market restaurant.</p>"
Txt[10] = "<b><a href='/properties/255'>Newark Marketplace</a></b><br /><b>Newark, CA</b><p>This neighborhood shopping center is conveniently located in the city of Newark on the northwest corner of Newark Boulevard and Jarvis Avenue. It is adjacent to the 84 freeway. The center consists of approximately 169,789 square feet of retail space encompassing 40 stores and is anchored by Safeway supermarket, Drug Emporium, and Orchard Supply Hardware.</p>"
Txt[11] = "<b><a href='/properties/260'>Fulton-Hurley Plaza</a></b><br /><b>Sacramento, CA</b><p>This neighborhood shopping center is conveniently located in the city of Sacramento on the northeast corner of Fulton Avenue and Hurley Way. It is minutes from the 80 freeway. The center consists of approximately 107,476 square feet of retail space encompassing 16 stores and is anchored by Vic's Market , 24-Hour Fitness, and the Goodwill Store.</p>"
Txt[15] = "<b><a href='/properties/265'>Orangewood Center</a></b><br /><b>Pasadena, CA</b><p>This neighborhood shopping center is conveniently located in the city of Pasadena on the northeast corner of California Boulevard and Pasadena Avenue. It is minutes from the 110 and 134 freeways. The center consists of approximately 68,715 square feet of retail space encompassing 24 stores and is anchored by Von's Market.</p>"
Txt[1] = "<b><a href='/properties/270'>Paddison Square</a></b><br /><b>Norwalk, CA</b><p>This neighborhood shopping center is conveniently located in the city of Norwalk on the northwest corner of Norwalk Boulevard and Imperial Highway. It is minutes from the 605 and 5 freeway freeways. The center consists of approximately 217,159 square feet of retail space encompassing 22 stores and is anchored by Target, Rite-Aid, Payless Food, Kragen Auto, Applebee's, and Union Bank.</p>"
Txt[7] = "<b><a href='/properties/310'>Newbury Park Center</a></b><br /><b>Newbury Park, CA</b><p>This neighborhood shopping center is conveniently located in the city of Newbury Park on the northwest corner of Reino Road and Borchard Road. It is minutes from the 101 freeway. The center consists of approximately 95,006 square feet of retail space encompassing 14 stores and is anchored by CVS drugstore and a local gym.</p>"
Txt[0] = "<b><a href='/properties/335'>Riverside Plaza</a></b><br /><b>Sacramento, CA</b><p>This neighborhood shopping center is conveniently located in the city of Sacramento on the southeast corner of Riverside Boulevard and Florin Road. It is minutes from the 5 freeway. The center consists of approximately 18,075 square feet of retail space encompassing 15 stores and is anchored by a former Nugget Market.</p>"
Txt[13] = "<b><a href='/properties/370'>San Mateo Fish Market</a></b><br /><b>San Mateo, CA</b><p>This center is conveniently located in the city of San Mateo on the northwest corner of Norfolk Street and Susan Court. It is minutes from the 101 and the 92 freeway. It consists of approximately 17,233 square feet of buildings that house the Fish Market restaurant and one retail shop.</p>"
Txt[12] = "<b><a href='/properties/380'>Alvarado Plaza</a></b><br /><b>Union City, CA</b><p>This recently-remodeled neighborhood shopping center is conveniently located in the city of Union City on the northwest corner of Alvarado Blvd. and Dyer Street. It is minutes from the 880 freeway. The center consists of approximately 178,724 square feet of retail space encompassing 34 stores and is anchored by Rite-Aid and Seafood City supermarket.</p>"
Txt[8] = "<b><a href='/properties/388'>Alvarado Plaza</a></b><br /><b>Union City, CA</b><p>This recently-remodeled neighborhood shopping center is conveniently located in the city of Union City on the northeast corner of Alvarado Blvd and Dyer St. It is minutes from the 880 freeway. The center consists of approximately 53,530 square feet of retail space encompassing 28 stores and is anchored by Kentucky Fried Chicken, Autozone, Taco Bell, and Starbucks.</p>"
Txt[18] = "<b><a href='/properties/395'>Vineyard Ontario</a></b><br /><b>Ontario, CA</b><p>This neighborhood shopping center is conveniently located in the city of Ontario on the northeast corner of Fourth Street and Vineyard Avenue. It is minutes from the 10 freeway. The center consists of approximately 25,072 square feet of retail space encompassing 19 stores and is anchored by Stater Bros. Market.</p>"


// =======================================
// do not edit anything below this line
// =======================================

var t;
var p = Pic.length;
//var imgIndex = 2;
var j = Math.floor(p*Math.random());
//var j = 2;

var preLoad = new Array();
for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i];
}

function runSlideShowIfHome(){
	if(document.title.indexOf("Home") == 0)
		runSlideShow();
}

function runSlideShow(){
//   imgIndex = imgIndex + 1;
//   if (imgIndex > 3) imgIndex=1;
   
/*   		switch  (imgIndex) {
			case 1:
				blendimage('blenddiv1','blendimage1', preLoad[j].src,1000);
				break; 
				
			case 2:
				blendimage('blenddiv2','blendimage2', preLoad[j].src,1000);
				break;
				
			case 3: 
				blendimage('blenddiv3','blendimage3', preLoad[j].src,1000);
				break;

		}
  */ 
blendimage('blenddiv1','blendimage1', preLoad[j].src, 10000, Txt[j], 'sidebar-text-container');
   
   j = j + 1;
   if (j > (p-1)) j=0;
   
   t = setTimeout('runSlideShow()', slideShowSpeed);
  
}


function blendimage(divid, imageid, imagefile, millisec, text, textdiv) { 
	//var speed = Math.round(millisec / 100); 
	//var speed = Math.round(millisec / 95); 
	var speed = 25; 
	var timer = 0; 

	//set the current image as background 
	//document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
	// this caused a weird pixel-shift in IE--the top 4 rows of pixels from the previous image would appear at the bottom of the next
	//changeOpac(0, imageid);
	// no idea what this was supposed to do. changeOpac is called in the for loop, so whatever
	//document.getElementById(imageid).width=0;
	document.getElementById(imageid).src = imagefile;
	//document.getElementById(imageid).style.opacity=0; 
	description = document.getElementById(textdiv).innerHTML = text;
	for(i = 20; i <= 100; i=i+2) { 
		//if (i==20) alert("i=0");
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
		//setTimeout("changeOpac(" + i + ",'" + imageid + "')",speed); 
		timer++; 
	} 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 	
    var object = document.getElementById(id).style; 
	//if (opacity==0) 
	//	object.visibility='hidden'
	//else
	//    object.visibility='visible';
    object.filter = "alpha(opacity=" + opacity + ")";     
    object.opacity = (opacity / 100); 
    //object.MozOpacity = (opacity / 100); 
    //object.KhtmlOpacity = (opacity / 100); 
} 

// ==============================================================================
// ==============================================================================
//								END OF SLIDE SHOW
// ==============================================================================
// ==============================================================================
//-->