// JavaScript Document

setTimeout("rotate()", 3000 );

var product = new Array();
product[0] = "overhead";
product[1] = "gate";
product[2] = "metal";
product[3] = "service";
product[4] = "inlet";

overhead = new Image;
gate = new Image;
metal = new Image;
service = new Image;
inlet = new Image;

overhead.src = "images/tmb_overhead_screen_door.jpg";
gate.src = "images/tmb_overhead_security_gate.jpg";
metal.src = "images/tmb_expanded_metal.jpg";
service.src = "images/tmb_service_door_screen_insert.jpg";
inlet.src = "images/tmb_air_inlet_screen_panel.jpg";

var productText = new Array();
productText['overheadTxt'] = "<strong>Overhead Screen Door System<br /></strong>Switch Track Model (Dual track model is also available).";
productText['gateTxt'] = "<strong>Chain-Link Security Door<br /></strong>Prevent unauthorized entry with 2&Prime; diamond galvanized steel.";
productText['metalTxt'] = "<strong>Expanded Metal Security Door<br /></strong>20 gauge Stainless Steel, 30 mesh can be added for insect control.";
productText['serviceTxt'] = "<strong>Service Door Screen Insert<br /></strong>(Shown With Solid Panel in Storage Rack)";
productText['inletTxt'] = "<strong>Air Inlet Screen Panel<br /></strong>Easy to remove and clean, panels mount outside building to prevent pest infestation at air inlets and louvers.";

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 );	
}
