// declaring variables
var scrollItems = [];
var offset=0;
var display = 5;// number of scrollItems to display at a time.

//var something = ["Name","Description","Image Location"];
//var bridge5 = ["SCM Bridge 5","SCM's Bridge 5 CNC Router offers industrial strength engineering at an affordable price. Don't waste time and money on an entry level router that is not built to last like this one.","http://www.hermance.com/images/StaticPageImages/SCMI/SCMI_Bridge5midsize.jpg"];
//Full size images: 200px
//Thumbnail size images: 100px

var cutterhead =["Hermance Helical Cutterhead",
"Hermance's Helical Cutterhead offers a unique design to reduce blade chipping and cracking, run more quietly than other cutterheads, and provide superior quality in all its applications.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/cutterhead.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/cutterhead.jpg",
"http://www.hermance.com/cutterhead.asp"];
var dantherm =["Dantherm S-Series",
"The Dantherm S-Series dust collector range is a simplified version of the long established and respected Dantherm NF wood waste filter family. Quick to install and easy to operate, it is the ideal solution for the smaller wood shop. It is designed for indoor locations and can be readily re-located as required. Available in 5 HP, 7.5 HP, and 10 HP models.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/dantherm_s_series.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/dantherm_s_series.jpg",
"http://www.hermance.com/featured/dantherm.asp"];
var doucet =["Doucet Rotary Clamp - SRH",
"The Doucet SRH model clamp carrier is recognized for its superior performance in edge and face gluing applications. The SRH is entirely modular allowing for easy add-ons with increased workloads. All systems are available with a hydraulic power unit for quick rotation and perfectly calibrated tightening. Available in standard or rapid change models, the SRH is one of the most heavy and sturdy machines of its kind.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/doucet_srh.gif",
"http://www.hermance.com/library/images/intro_scroller/Full/doucet_srh.gif",
"http://www.hermance.com/featured/doucet.asp"];
var mikron =["Mikron Moulder 652R",
"The Mikron M652R multi-moulder and router was designed from the powerful features of the Mikron M645 moulder with the addition of routing capabilities. With just a few simple steps, you can replace the moulder spindle with a router mount providing you the capability to easily router insets and channels on both straight and curved mouldings. The above features combined with the power, precision, and speed this machine offers makes it an extremely versatile and powerful piece of machinery.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/mikron_652r.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/mikron_652r.jpg",
"http://www.hermance.com/featured/mikron.asp"];
var omec =["Omec 750LN Dovetailer",
"The OMEC 750 Automatic Dovetailer is utilized to indent dovetailers for drawers and various furniture elements. The 750 model can machine single male or female work pieces, or both simultaneously.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/750.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/750.jpg",
"http://www.hermance.com/featured/omec.asp"];
var vecoplan =["Vecoplan K Series Waste Grinder",
"The Vecoplan K Series of single-shaft grinders are, quite simply, the finest rotary grinders available today. Designed processing plastic waste for reclamation and recycling, large extruded purgings, large reject parts, trim scraps, baled or loose film, and much more, the Vecoplan K Series of grinders are the ideal choice for your wood or plastic grinding needs.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/vecoplan_shredder_kseries.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/vecoplan_shredder_kseries.jpg",
"http://www.hermance.com/featured/vecoplan.asp"];
var denray =["Denray Downdraft Table 2800",
"Popular among both small and large sized shops, the Denray Model 2800 downdraft table cleans with a 99% capture rate a 1 micron, creating a much superior filtration system than the previously used pleated filters. Standard features are 115 volt and casters.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/denray_downdraft_2800.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/denray_downdraft_2800.jpg",
"http://www.hermance.com/featured/denray.asp"];
var sawstop =["SawStop Table Saw",
"The company that brought the world the revolutionary SawStop Cabinet Table Saw now offers the SawStop Contractor Saw. Just released in the Spring of 2008, the SawStop Contractor Saw offers the same quality and performance you've come to expect from SawStop along with their revolutionary contact detection and brake system.  There's no longer a need to live with the risk of injury; own a SawStop today!",
"http://www.hermance.com/library/images/intro_scroller/Thumb/sawstop_contractor_saw.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/sawstop_contractor_saw.jpg",
"http://www.hermance.com/sawstop-contractors.asp"];
var onsrud =["C.R. Onsrud 5-Axis CNC Router",
"The Super Heavy Duty - yet super fast - 5 Axis Series CNC Routers carry the 'No Compromises' design of our Extreme Duty machines to the next logical, power-production level.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/CROnsrud-5-axisCNCRouter.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/CROnsrud-5-axisCNCRouter.jpg",
"http://www.hermance.com/featured-cronsrud-5-axis-cnc-router.asp"];
var tigerstop =["TigerStop",
"The TigerStop positioning system is a replacement for manual style stops. TigerStop allows for simple positioning which is automated with the touch of a button.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/tigerstop.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/tigerstop.jpg",
"http://www.hermance.com/featured-tigerstop.asp"];
var u2710 =["Unique 2710 CNC Door Machine",
"The Unique Model 2710 is a single end machine designed for high quality production of cabinet and passage doors as well as furniture and window parts.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/2710.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/2710.jpg",
"http://www.hermance.com/featured-unique-2710-cnc-door-machine.asp"];
var paulsaws =["Paul Saws C/GL Rip Saw",
"Compact climb-cutting rip saw with movable saws for highest cutting quality.  Suitable for selective ripping and edging of solid wood and production for first-class cutting edges.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/paul-modelcgl.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/paul-modelcgl.jpg",
"http://www.hermance.com/featured-paul-saws-cgl.asp"];
var northtech =["Northtech NT-610HCHD",
"Heavy duty jack shaft and lifting column system.  Increased thickness of plate steel fabrication for support of HD horsepower motors.  Production series cutterheads, and increased feed speeds.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/610HCHD.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/610HCHD.jpg",
"http://www.hermance.com/featured-northtech-nt-610hchd.asp"];
var nfkbagfilter =["Dantherm NFK Bag Filter",
"Suitable for collection of many types of dust including wood, paper, and plastic.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/dantherm-nfk-bag-filter.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/dantherm-nfk-bag-filter.jpg",
"http://www.hermance.com/featured-dantherm-nfk-bag-filter.asp"];
var rfssl  =["RFS Model SL Slant Gluers",
"The SL3660 can be equipped with up to a 100KW generator capable of curing 1,000 square inches of glue line a minute.  Larger sizes, such as 36\" x 72\", are available.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/sl3660.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/sl3660.jpg",
"http://www.hermance.com/featured-rfs-model-l-slant-gluer.asp"];
var panelpro =["C.R. Onsrud \"Panel Pro\"",
"The Panel Pro series can easily break down full sheets of 1-1/2\" thick plywood, laminates, or veneers at super fast feed rates, under continuous duty conditions and handle solid wood applications on a limited basis.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/cronsrud_G-Series-Panel-Pro.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/cronsrud_G-Series-Panel-Pro.jpg",
"http://www.hermance.com/featured-cronsrud_pro-panel.asp"];
var pfm =["Doucet PFM",
"Equipped with high precision ductile iron drive chains, Doucet's PFM End-Matcher is designed to meet the squareness requirements of premium quality wide board flooring makers.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/pfm.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/pfm.jpg",
"http://www.hermance.com/featured-doucet-pfm.asp"];
var hp4000 =["Uhling HP4000 Case Clamp",
"The HP 4000's unprecedented counterweight balanced horizontal carriage and roller bearing mounter vertical carriage design make it the fastest operating two (2) axis clamp on the market.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/uhling-hp4000.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/uhling-hp4000.jpg",
"http://www.hermance.com/featured-hp-4000-case-clamp.asp"];
var striebig =["STRIEBIG Compact Plus",
"Full-size panel saw at a compact price.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/striebig-COMPACT-PLUS.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/striebig-COMPACT-PLUS.jpg",
"http://www.hermance.com/featured-striebig-compact-plus.asp"];
var panelmate =["CR CNC PanelMate CNC Router",
"The CR CNC Panel Mate offers a simple, affordable solution to those in the market for a CNC router. Available in 8 and 10 HP models with up to 5' x 10' table sizes. Each Panel Mate comes standard with Artcam CAD/CAM software. Click below for more information and videos of the machine in action.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/panelmate.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/panelmate.jpg",
"http://www.hermance.com/StaticPages/CRCNC/panel-mate.asp"];
var omal =["Omal HBD 1300 Bore and Dowel Machine", 
"The Omal HBD 1300 has a 4' work table and CNC bores, glues, and inserts dowels. The machine has a cycle time of approx. 1 second for each bore, glue, and dowel insertion when holes are on 32mm intervals. The Omal also features the 'Sure Shot' revolver system that guarantees a dowel is inserted every time, eliminating misfeeds.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Omal_HBD_1300-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Omal_HBD_1300.jpg", 
"http://www.hermance.com/staticpages/delmac/OMAL-HBD-1300.asp"];
var busellato =["Busellato JET Optima P Series CNC Routers", 
"The Busellato P Series of CNC routers offer working zones of up to 5' in width and increased part thickness capacity. The P Series features the TL rail and pod system for quick 'pick and place' pod positioning. Rotary tool changers increase the tool carrying capacity and are 'aggregate-ready'.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Busellato_P_Series-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Busellato_P_Series.jpg", 
"http://www.hermance.com/staticpages/delmac/Busellato-Jet-Optima-P20.asp"];
var mayer =["Mayer PS 8 Z Front Load Panel Saw", 
"The Mayer PS8 Z panel saw is engineered for flexible, small footprint production. The saw features Windows PC controller and superior cut quality through a unique saw carriage guidance system. Mayer panel saws are designed to cut a wide variety of materials - particleboard, MDF, plywood, wood veneer, melamine, and HPL panels.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Mayer_PS_8_Z_Panel_Saw-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Mayer_PS_8_Z_Panel_Saw.jpg", 
"http://www.hermance.com/staticpages/delmac/Mayer-PS-8-Z-Front-Load-Panel-Saw.asp"];
var ala_edgebander =["Casadei ALA 23R Edgebander", 
"The Casadei ALA 23R is the best all around edgebander developed for high quality edging for shops processing a variety of edging: 3mm, thin tape, HPL, and solid wood. This machine features line control, programmable operator interface, corner rounding, scraping and buffing. This workhorse is designed for shops with limited floor space, yet requiring high quality output at an affordable price.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Casadei_ALA_23R_Edgebander-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Casadei_ALA_23R_Edgebander.jpg", 
"http://www.hermance.com/staticpages/delmac/Casadei-ALA-23R-Edgebander.asp"];
var casadei_planer =["Casadei PS630 Planer", 
"Casadei's PS630 planer is a heavy duty machine with stepless feed speed control by inverter, powered raise and fall on 4 columns, and 300mm max working height.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Casadei_PS630_Planer-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Casadei_PS630_Planer.jpg", 
"http://www.hermance.com/staticpages/delmac/Casadei-PS-630-Planer.asp"];
var casadei_jointer =["Casadei PF410 Jointer", 
"Casadei's PF410 jointer is a heavy-duty machine with polished cast iron tables (2600x410mm). The jointer has infeed table height adjustment through a quick action lever, and all electric controls are centralized and conveniently located in the main control cabinet.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Casadei_PF410_Jointer-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Casadei_PF410_Jointer.jpg", 
"http://www.hermance.com/staticpages/delmac/Casadei-PF-410-Jointer.asp"];
var casadei_sliding_tablesaw =["Casadei SC 40 Sliding Table Saw", 
"The Casadei SC40 sliding table saw features an anodized aluminum carriage sliding on hardened steel guides, front readout of saw blade tilt, independently powered scoring unit, and table extension on exit side.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Casadei_SC_40_Sliding_Table_Saw-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Casadei_SC_40_Sliding_Table_Saw.jpg", 
"http://shopping.hermance.com/Brands/Casadei-Sliding-Table-Saws/Casadei-SC40-Sliding-Table-Saw"];
var casadei_shaper =["Casadei F230 Fixed Spindle Shaper", 
"Casadei's F230 fixed spindle shaper is a heavy-duty, high performance machine. Spindle speeds: 3000/4500/6000/7000/10000 RPM. A wide range of standard and optional equipment makes this machine the ideal solution for the most demanding customers.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/Casadei_F230_Shaper-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Casadei_F230_Shaper.jpg", 
"http://www.hermance.com/staticpages/delmac/Casadei-F-230-Shaper.asp"];
var casadei_panel_saw =["Casadei AXO 65 3800 Panel Saw",
"The Casadei AXO 65/3800 panel saw is designed for ease of use, great value, and great flexibility. The AXO 65/3800 is a 12' machine equipped with a 12HP main saw motor and 2.5 inch blade projection. The machine base is designed with precision guides and linear motion systems for exceptional cut quality.", 
"http://www.hermance.com/library/images/intro_scroller/Thumb/Casadei_AXO_65_3800_Panel_Saw-T.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/Casadei_AXO_65_3800_Panel_Saw.jpg", 
"http://www.hermance.com/staticpages/delmac/Casadei-AXO-65-3800-Panel-Saw.asp"];



//add the variable 'something' to this list.
scrollItems = shuffle([cutterhead,dantherm,doucet,mikron,omec,vecoplan,denray,sawstop,onsrud,tigerstop,u2710,paulsaws,northtech,nfkbagfilter,rfssl,panelpro,pfm,hp4000,striebig,panelmate,omal,busellato,mayer,ala_edgebander,casadei_planer,casadei_jointer,casadei_sliding_tablesaw,casadei_shaper,casadei_panel_saw]);

//no need to edit anything further, hopefully.
var max = Math.floor(scrollItems.length/display);
if((scrollItems.length % display) == 0){max--;}

function scrollLoad(index){// selected items are placed in a box above or below the bar
	if(index != document.getElementById("scrollHolder").name){
		var html = "";//"<table cellpadding=0 cellspacing=0><tr>";
		//html += "<td class='subScrollItem'><img class='scrollItem' src="+scrollItems[index][3]+" /></td>"//onclick='overlay(\""+scrollItems[index][3]+"\")'
		html += "<h3 class='scrollItem'>"+scrollItems[index][0]+"</h3>"; // name //<td class='scrollItem'>
		html += "<p class='scrollItem'>"+scrollItems[index][1]
		if(scrollItems[index][4] != null && scrollItems[index][4] != ""){
			document.getElementById("scrollHref").href= scrollItems[index][4];
			html+="<br/><a href=\""+scrollItems[index][4]+"\">&raquo;More information</a>"
		}else{
			document.getElementById("scrollHref").href=null;
		}
		html += "</p>"//</td>"; // description
		// html += "<p class='scrollItem'>Buy Now! Quantity: <input type='text' width='5px' style='border:1px solid black;' /><img align='top' src='http://www.hermance.com/library/images/buttons/addtocart.gif' /></p>";//add to cart
		//html += "</tr></table>";
		document.getElementById("scrollHolder").innerHTML = html//Bigger pic, name, description.
		document.getElementById("scrollMainImage").src = scrollItems[index][3];
		
	}//this part after this controlls dynamic stuff
	/*else if(index == document.getElementById("scrollHolder").name){
		document.getElementById("scrollHolder").innerHTML = '';
		document.getElementById("scrollHolder").name = 'empty';
	}*/
}
function shuffle(o){ //v1.0
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
 	return o;
};
function scrollInit(){//initialize the scroll bar if it exists
	if(document.getElementById("scrollHolder") != null && document.getElementById("scrollHolder") != ""){
		scroll(0);
		scrollLoad('0');
	}
}
function scroll(dir){//changes the items when an arrow is pressed
	if(dir=='scrollLeft' && offset > 0){
		offset--;
	}else if(dir=='scrollRight' && offset < max ){
		offset++;
	}else if(dir==0){
		offset=0;
	}else{return;}
	var html="";
	for(var i=(offset*display);i<(offset*display+display) ;i++){//&& i < items.length
		var cell = document.getElementById('item'+(i-(offset*display)));
		if(i < scrollItems.length){
			cell.innerHTML = "<img onclick='scrollLoad("+i+")' src='"+ scrollItems[i][2] +"' />";
		}else{
			cell.innerHTML = "<img src='http://www.hermance.com/images/none.gif' />";
		}
	}
}
