
theimage = new Array();

// The dimensions of ALL the images should be the same or some of them may look stretched or reduced in Netscape 4.
// Format: theimage[...]=[image URL, link URL, title, description]
theimage[0]=["images/new/AFCI.png", "http://www.powerdynamics.com/powercords/index.html", "AFCI Power Cord", "The AFCI power cord protects against arcing conditions to the power supply cord preventing fires.  Its unique sensing circuitry is able to determine normal and hazardous arcing conditions."]
theimage[1]=["images/new/GFCI.png", "http://www.powerdynamics.com/powercords/index.html", "GFCI Power Cord", "The GFCI power cord protects against ground faults preventing electric shock. When a ground fault is detected the circuit stops the flow of current. The GFCI can be reset by pushing the reset button."]
theimage[2]=["images/new/NEMA20.png", "http://www.powerdynamics.com/nema/index.html", "20 Amp NEMA","The Power Dynamics PD-20-2 NEMA receptacle can be used in a variety of power input applications ranging from 15 to 20 Amps. The T slot design on the face of the connector accepts NEMA 15 Amp or 20 Amp plugs."]
theimage[3]=["images/new/InLineGFCI.png", "http://www.powerdynamics.com/powercords/index.html", "In-Line GFCI Power Cord", "The GFCI power cord protects against ground faults preventing electric shock. When a ground fault is detected the circuit stops the flow of current. The GFCI can be reset by pushing the reset button."]
theimage[4]=["images/new/PIN-SLEEVE_MILITARY.png", "http://www.powerdynamics.com/pinandsleeve/index.html", "Pin and Sleeve - Military", "Power Dynamics, Inc IEC 60309 and Pin & Sleeve connectors are designed for heavy duty industrial use. Watertight IP67 and splash proof IP 44 versions are available."]
theimage[5]=["images/new/PIN-SLEEVE_HEAVY-DUTY-WIRING.png", "http://www.powerdynamics.com/pinandsleeve/index.html", "Pin and Sleeve - Heavy Duty Wiring", "Power Dynamics, Inc IEC 60309 and Pin & Sleeve connectors are designed for heavy duty industrial use. Watertight IP67 and splash proof IP 44 versions are available."]
theimage[6]=["images/new/PIN-SLEEVE_SURFACE-MOUNT.png", "http://www.powerdynamics.com/pinandsleeve/index.html", "Pin and Sleeve - Surface Mount", "Power Dynamics, Inc IEC 60309 and Pin & Sleeve connectors are designed for heavy duty industrial use. Watertight IP67 and splash proof IP 44 versions are available."]
theimage[7]=["images/new/PIN-SLEEVE_PHASE-INVERTERS.png", "http://www.powerdynamics.com/pinandsleeve/index.html", "Pin and Sleeve - Phase Inverters", "Power Dynamics, Inc IEC 60309 and Pin & Sleeve connectors are designed for heavy duty industrial use. Watertight IP67 and splash proof IP 44 versions are available."]
theimage[8]=["images/new/NEMA_LOCKING_RECEPTACLE.png", "http://www.powerdynamics.com/nema/nema_locking_receptacles.html", "NEMA - Locking Receptacles", "Power Dynamics, Inc. NEMA receptacles and re-wireable cord plugs are rated from 15 to 30 amps and are manufactured for use in North America."]
theimage[9]=["images/new/NEMA_REWIREABLE_CORD_CONNECTOR.png", "http://www.powerdynamics.com/nema/nema_rewireable_cord_connectors.html", "NEMA - Rewireable Cord Connectors", "Power Dynamics, Inc. NEMA receptacles and re-wireable cord plugs are rated from 15 to 30 amps and are manufactured for use in North America."]
theimage[10]=["images/new/NEMA_REWIREABLE_PLUG.png", "http://www.powerdynamics.com/nema/nema_rewireable_plugs.html", "NEMA - Rewireable Plugs", "Power Dynamics, Inc. NEMA receptacles and re-wireable cord plugs are rated from 15 to 30 amps and are manufactured for use in North America."]


thenumber = theimage.length;
theincrement = Math.floor(Math.random() * thenumber);
///// Plugin variables

playspeed=3000;// The playspeed determines the delay for the "Play" button in ms
//#####
//key that holds where in the array currently are
i=0;


//###########################################
window.onload=function(){

	//preload images into browser
	preloadSlide();

	//set the first slide
	//SetSlide(0);
	SetSlide(theincrement);

}

//###########################################
function SetSlide(num) {
	//too big
	i=num%theimage.length;
	//too small
	if(i<0)i=theimage.length-1;

	//switch the image
	document.images.imgslide.src=theimage[i][0];
	document.getElementById('txtslide').innerHTML=theimage[i][3];
	document.getElementById('slidelink').href=theimage[i][1];

	//if they want name of current slide
	document.getElementById('slidebox').innerHTML=theimage[i][2];

	//if they want current slide number and total
	//document.getElementById('slidecount').innerHTML= "Product "+(i+1)+" of "+theimage.length;

}


//###########################################
function PlaySlide() {
	if (!window.playing) {
		PlayingSlide(i+1);
		if(document.slideshow.play){
			document.slideshow.play.value="   Stop   ";
		}
	}
	else {
		playing=clearTimeout(playing);
		if(document.slideshow.play){
			document.slideshow.play.value="   Play   ";
		}
	}
	// if you have to change the image for the "playing" slide
	if(document.images.imgPlay){
		setTimeout('document.images.imgPlay.src="'+imgStop+'"',1);
		imgStop=document.images.imgPlay.src
	}
}


//###########################################
function PlayingSlide(num) {
	playing=setTimeout('PlayingSlide(i+1);SetSlide(i+1);', playspeed);
}


//###########################################
function preloadSlide() {
	for(k=0;k<theimage.length;k++) {
		theimage[k][0]=new Image().src=theimage[k][0];
	}
}

