function changeimg(imgnum,tnum)
{


	document.img01.src = '/images/icons/icons_01.jpg';
	document.img03.src = '/images/icons/icons_03.jpg';
	document.img05.src = '/images/icons/icons_05.jpg';
	document.img07.src = '/images/icons/icons_07.jpg';
	document.img09.src = '/images/icons/icons_09.jpg';
	document.img11.src = '/images/icons/icons_11.jpg';
	document.img13.src = '/images/icons/icons_13.jpg';
	document.img15.src = '/images/icons/icons_15.jpg';						
	document.img17.src = '/images/icons/icons_17.jpg';
	document.img19.src = '/images/icons/icons_19.jpg';
	document.img21.src = '/images/icons/icons_21.jpg';	

	imag='img'+imgnum
	document[imag].src = '/images/icons/icons2_'+imgnum+'.jpg';
	document.getElementById('detailcopy').innerHTML = tags[tnum];
	document.panel.src = '/images/panels/'+imgnum+'.jpg';	
}

function resetimg(imgnum)
{

	imag='img'+imgnum

	//document[imag].src = '/images/icons/icons_'+imgnum+'.jpg';

}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}


spot=500;// global state memory for position
spot2=620;// global state memory for position

function premove() {

    athome=getCookie('homexcookie1');

    if (athome=="homeran")
    {
    automove();
    }

    else
    {
    document.cookie =  'homexcookie1=homeran';
    move()
    }

}

function move() {

styleObj=document.getElementById('logo').style;
styleObj2=document.getElementById('photobar').style;


if (spot > 5) {    // check if at right stop point
    spot-=2;               // no - so move over a bit
    styleObj.left=spot+"px"; // redisplay at new site
    styleObj2.left=spot+"px"; // redisplay at new site
    setTimeout(move,2); // but first wait 50 milliseconds
    }
    
if (spot <= 5) {    // check if at right stop point
styleObj2=document.getElementById('contentheader').style.display="inline"; 
	document.homexlogo.src = '/images/homex_logo.png';	  
    }    
}

function automove() {

styleObj=document.getElementById('logo').style;
styleObj2=document.getElementById('photobar').style;

styleObj.left="4px"; // redisplay at new site
styleObj2.left="5px"; // redisplay at new site
styleObj2=document.getElementById('contentheader').style.display="inline"; 
document.homexlogo.src = '/images/homex_logo.png';	  

}


function changeprod(tnum)
{

var homprods=new Array();
homprods[0]="Arlington";
homprods[1]="Four Seasons";
homprods[2]="Northwood Cedars"; 
homprods[3]="Rustic Ridge";
homprods[4]="Lexington";
homprods[5]="Alpine Ridge"; 
homprods[6]="Bristol Bay";
homprods[7]="Addison Heights";
homprods[8]="WedgeWood Square"; 
homprods[9]="ProSpan Premium";
homprods[10]="ProSpan Soffits"; 

var homprodimgs=new Array();
homprodimgs[0]="arlington";
homprodimgs[1]="fourseasons";
homprodimgs[2]="northwood"; 
homprodimgs[3]="rusticridge";
homprodimgs[4]="lexington";
homprodimgs[5]="alpineridge"; 
homprodimgs[6]="bristolbay";
homprodimgs[7]="addison";
homprodimgs[8]="wedgewood"; 
homprodimgs[9]="prospanpro";
homprodimgs[10]="prospan"; 

var homprodtags=new Array();
homprodtags[0]="Splendor. Substance. Surpassing Time. ";
homprodtags[1]="For Every Reason. A Season For You. ";
homprodtags[2]="Times Remembered In A Cultured Keepsake."; 
homprodtags[3]="Nature Has A Way Of Bringing Out Its Beauty. ";
homprodtags[4]="Strength. Style. Sophistication.";
homprodtags[5]="For The Look That Others Look Up To. "; 
homprodtags[6]="Where The Living Is Always Easy. ";
homprodtags[7]="Living To A Higher Standard";
homprodtags[8]="Enduring Beauty"; 
homprodtags[9]="The Details Make All The Difference.";
homprodtags[10]="Details That Make A Difference"; 

	document.productinfo.src = '/images/'+homprodimgs[tnum]+'_sell_sheet.jpg';
	document.productlogo.src = '/images/products/'+homprodimgs[tnum]+'.png';
	document.getElementById('producttag').innerHTML = homprodtags[tnum];
	document.getElementById('producttitle').innerHTML = homprods[tnum];
	document.getElementById('productfarrightcolumn').style.display="inline"; 
	
}

function unchangeprod()
{
	document.productinfo.src = '/images/0.jpg';
	document.productlogo.src = '/images/products/0.png';
	document.getElementById('producttag').innerHTML = '';
	document.getElementById('producttitle').innerHTML = '';
	document.getElementById('productfarrightcolumn').style.display="none"; 

}
