//---------------------------------------------------------------------------------
// Top rotating styles

var rotateStyle = new Array (
"/images/rotating/home-luxury3.gif","luxury-house-plans.asp","luxury","home plans",
"/images/rotating/home-ranch4.gif","ranch-house-plans.asp","ranch","home design plans",
"/images/rotating/home-small7.jpg","small-house-plans.asp","small","house plans",
"/images/rotating/home-craftsman1.jpg","craftsman-house-plans.asp","craftsman","house plans",
"/images/rotating/home-beach1.gif","beach-house-plans.asp","beach","house plans",
"/images/rotating/home-country6.jpg","country-house-plans.asp","country","house design plans",
"/images/rotating/home-narrow3.gif","narrow-lot-house-plans.asp","narrow lot","house plans",
"/images/rotating/home-mediterranean5.gif","mediterranean-house-plans.asp","mediterranean","house design",
"/images/rotating/home-sloping-lot4.gif","sloping-lot-house-plans.asp","sloping lot","design plans",
"/images/rotating/home-country-french3.gif","country-french-house-plans.asp","french country","house plans",
"/images/rotating/home-farm6.gif","farm-house-plans.asp","farm","house plans",
"/images/rotating/home-victorian3.gif","victorian-house-plans.asp","victorian","home plans",
"/images/rotating/home-european5.gif","european-house-plans.asp","european","house schematic",
"/images/rotating/home-southern3.gif","southern-house-plans.asp","southern","design plans",
"/images/rotating/home-two-story10.gif","two-story-house-plans.asp","two story","house plans",
"/images/rotating/home-contemporary4.gif","contemporary-house-plans.asp","contemporary","house plans"
);

// temp two story "/images/rotating/home-southern3.gif","southern-house-plans.asp","Southern","House Plans",
var numCells = 4;  // Change the number of images to rotate here.
var curCell = 1;
var numItems = rotateStyle.length/4;
var curStyle = 4;  // Change selected first rotate style here

function rotate(rotateCell,style)
{
//	alert("curStyle=" + curStyle);
	var styleNum = (parseInt(style) * 4) + 1;
	//rotateCell.innerHTML = fillRotate(styleNum);
	var div = document.getElementById("rotate" + curCell);
	div.innerHTML = "";
	var inner = document.createElement("inner");
	inner.innerHTML = fillRotate(styleNum);
	div.appendChild(inner);

	curCell ++;
	curStyle ++;
	if(curCell > numCells)curCell=1;
	if(curStyle >= numItems)curStyle=0;	
	setTimeout("rotate(rotate" + curCell + "," + curStyle + ")",5000);
}
function fillRotate(passItem)
{
	var rotateItem = parseInt(passItem);
	return "<a href=\"" + rotateStyle[rotateItem] + "\" class=\"rotate\" title=\"" + rotateStyle[rotateItem+1] + " " + rotateStyle[rotateItem+2] + "\"><img src=\"" + rotateStyle[rotateItem-1] + "\" width=\"167\" height=\"100\" alt=\"" + rotateStyle[rotateItem+1] + " " + rotateStyle[rotateItem+2] + "\"  title=\"" + rotateStyle[rotateItem+1] + " " + rotateStyle[rotateItem+2] + "\"border=\"0\"><br>"
		+ "" + rotateStyle[rotateItem+1] + "</a>";// + "<br>"
		//+ "" + rotateStyle[rotateItem+2] + "</a>";
}

//---------------------------------------------------------------------------------
// Our Architects’ Top Product Picks

var rotateStyle02 = new Array (
"/images/callout1-1.jpg","product-ideas/garage.asp","Wayne-Dalton Garage Doors","",
"/images/callout1-2.jpg","product-ideas/homesafety.asp","Tyco Home Fire Sprinkler Systems","",
"/images/callout1-3.jpg","product-ideas/lighting.asp","Lamps Plus Lighting Experts",""
);
var numCells02 = 3;  // Change the number of images to rotate here.
var curCell02 = 1;
var numItems02 = rotateStyle02.length/4;
var curStyle02 = 1;  // Change selected first rotate style here
//setTimeout("rotate02(" + curStyle02 + ")",6000);
function rotate02(style)
{
	var styleNum = (parseInt(style) * 4) + 1;
	//rotatecall02.innerHTML = fillRotate02(styleNum);
	var div = document.getElementById("rotatecall02");
	div.innerHTML = "";
	var inner = document.createElement("inner");
	inner.innerHTML = fillRotate02(styleNum);
	div.appendChild(inner);

	curCell02 ++;
	curStyle02 ++;
	if(curCell02 > numCells02)curCell02=1;
	if(curStyle02 >= numItems02)curStyle02=0;		
	setTimeout("rotate02(" + curStyle02 + ")",6000);
}
function fillRotate02(passItem)
{
	var rotateItem = parseInt(passItem);
	return "<a href=\"" + rotateStyle02[rotateItem] + "\" rel=\"nofollow\"><img src=\"" + rotateStyle02[rotateItem-1] + "\" width=\"86\" height=\"86\" alt=\"" + rotateStyle02[rotateItem+1] + " " + rotateStyle02[rotateItem+2] + "\" border=\"0\"></a>";
}

//---------------------------------------------------------------------------------
// 3D spinning house

function rotateSpin()
{
	//alert("begin.");
	//rotateSpin1.innerHTML = "<a href=\"plan_3d_list.asp\"><img src=\"images/home-3d-collection3.gif\" width=\"154\" height=\"90\" border=\"0\"><img src=\"images/spinning-house.gif\" width=\"150\" height=\"90\" border=\"0\"></a>";
	var div = document.getElementById("rotateSpin1");
	div.innerHTML = "";
	var inner = document.createElement("inner");
	inner.innerHTML = "<a href=\"plan_3d_list.asp\" title=\"3D house plans and home plans\"><img src=\"images/home-3d-collection3.gif\" width=\"154\" height=\"90\" border=\"0\"><img src=\"images/spinning-house.gif\" width=\"150\" height=\"90\" border=\"0\"></a>";
	div.appendChild(inner);
	//alert("done.");
}

//---------------------------------------------------------------------------------
// Free House Plan Magazine and Exclusive House Plans
var curShow = "rotatecallRed";
//document.getElementById("rotatecallShow").innerHTML = document.getElementById("rotatecallRed").innerHTML;
//setTimeout("Swap('" + curShow + "')",8000);
function Swap(passCurrent)
{
	if(passCurrent == "rotatecallBrown")
	{
		document.getElementById("rotatecallShow").innerHTML = document.getElementById(passCurrent).innerHTML;
		curShow = "rotatecallRed";
	}
	if(passCurrent == "rotatecallRed")
	{
		document.getElementById("rotatecallShow").innerHTML = document.getElementById(passCurrent).innerHTML;
		curShow = "rotatecallBrown";
	}
	setTimeout("Swap('" + curShow + "')",8000);
}

