// JavaScript Document

setTimeout("rotate()", 3000 );

var product = new Array();
product[0] = "overhead";
product[1] = "gate";
product[2] = "rolling";
product[3] = "service";
product[4] = "inlet";

overhead = new Image;
rolling = new Image;
gate = new Image;
service = new Image;
inlet = new Image;

overhead.src = "img/tmb_overhead_screen_door.jpg";
rolling.src = "img/tmb_rolling_steel_door.jpg";
gate.src = "img/tmb_overhead_security_gate.jpg";
service.src = "img/tmb_service_door_screen_insert.jpg";
inlet.src = "img/tmb_air_inlet_screen_panel.jpg";

var productText = new Array();
productText['inletTxt'] = "<span class='bold'>Air Inlet Screen Panel<br /></span>Easy to remove and clean, panels mount outside building to prevent pest infestation at air inlets and louvers.";
productText['overheadTxt'] = "<span class='bold'>Overhead Screen Door System<br /></span>Switch Track Model (Dual track model is also available).";
productText['gateTxt'] = "<span class='bold'>Chain-Link Security Door<br /></span>Prevent unauthorized entry with a 2&Prime; diamond fence door.";
productText['rollingTxt'] = "<span class='bold'>Rolling Steel Door Model<br /></span>Behind rolling door model with a deep reverse angle.";
productText['serviceTxt'] = "<span class='bold'>Service Door Screen Insert<br /></span>(Shown With Solid Panel in Storage Rack)";

function swapInfo(product) {
	if (document.getElementById){
		var productTextArr = product + "Txt";
		document.getElementById('productphoto').src = eval(product + ".src");
		document.getElementById('indextextarea').innerHTML = eval("productText[" + 'productTextArr' + "]");
	}
}

i=0;
function rotate(){
	if(i==0){
		document.getElementById(product[i]+'_link').style.textDecoration = "underline";
		swapInfo(product[i]);
		i++;
	} else if (i>4){
		i=0;
		document.getElementById(product[i]+'_link').style.textDecoration = "underline";
		document.getElementById(product[4]+'_link').style.textDecoration = "none";
		swapInfo(product[i]);
		i++;
	} else {
		document.getElementById(product[i]+'_link').style.textDecoration = "underline";
		document.getElementById(product[i - 1]+'_link').style.textDecoration = "none";
		swapInfo(product[i]);
		i++;
	}
	setTimeout ( "rotate()", 3000 );	
}
