// 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"];

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 hpj =["AccuSystems HPJ",
"The AccuSystems HPJ is quickly becoming the industry standard for bore and dowel construction. Equipped with an ease-to-use touch screen interface, the machine offers time savings which quickly provide a return on investment. Able to handle material up to 1-1/8\" thick, the HPJ comes with a 49\" working surface and 2HP drill motor.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/accusystems_HPJ.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/accusystems_HPJ.jpg",
"http://www.hermance.com/featured/hpj.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 nows 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 sigma =["SCM Sigma Impact 105C",
"The Sigma Impact 105 C Series Panel Saws are the perfect solution for a mid-sized shop yearning for versatile and high production capabilities.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/SCMI_sigma_105.gif",
"http://www.hermance.com/library/images/intro_scroller/Full/SCMI_sigma_105.gif",
"http://www.hermance.com/featured-scmi-sigma-impact.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 olimpic =["SCM Olimpic K1000 Edgebander",
"The K1000 Series of Edgebanders are designed for the custom shop that needs maximum flexibility while maintaining maximum productivity. Standard with features usually reserved for machines twice the cost.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/scm_olimpic_k1000.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/scm_olimpic_k1000.jpg",
"http://www.hermance.com/featured-scmi-olympic-k-1000-edgebander.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 record132 =["Routech Record 132 CNC Router",
"The Record 132 series offer several working units, tool changers and table lengths to create a fully customized CNC Router.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/routech-record132.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/routech-record132.jpg",
"http://www.hermance.com/featured-routech-record-132-cnc-router.asp"];
var author =["Author 700 Series",
"The Author 700 Series utilizes Morbidelli's most massive base for heavy production needs.  Weight and internal structure are a result of the same, which allows for high-speed production without undue stress.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/morbidelli_Author 700.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/morbidelli_Author 700.jpg",
"http://www.hermance.com/featured-morbidelli-author-700-series.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 pratix =["SCM Pratix CNC Machining Center",
"The Pratix 48 NST brings total panel processing power to an entry-level machine without making compromises.  Featuring a 48\" x 105\" work area, 9 spindle drilling head, 10hp HSK F63 router and eight-position tool changer.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/SCMI_Pratix.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/SCMI_Pratix.jpg",
"http://www.hermance.com/featured-scmi-pratix.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 si400e =["SCM SI 400E Saw",
"For woodworkers requiring a saw with higher production capabilities, the SI 400 EZ+ 16\" saw is designed with production in mind.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/si_400e.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/si_400e.jpg",
"http://www.hermance.com/featured-scmi-si-400e-saw.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 unisand =["DMC Unisand K Wide Belt Sander",
"The multi-shift per day Unisand K offers configurations to suit and requirement ranging from solid wood planing and sanding, sanding of veneered and sealer applications.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/dmc-Unisand-K.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/dmc-Unisand-K.jpg",
"http://www.hermance.com/featured-dmc-unisand-k.asp"];
var t130n =["SCM T 130N",
"T 130N is the SCM heavy industrial spindle moulder designed for full production work loads ensuring maximum finish quality in the work piece.  This quality is made possible due to the huge 130mm quill assembly that eliminates almost all run out even with 6 inch tall tooling.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/t130nova.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/t130nova.jpg",
"http://www.hermance.com/featured-scmi-t-130n.asp"];
/* Removed as company is out of business.
var quickwood =["QUICKWOOD System Elite 1100 Sander",
"The \"ELITE Series\" Sanders are upgraded \"PRO Series\" Sanders with many new options that will help you speed up your production and quality with a better price point.",
"http://www.hermance.com/library/images/intro_scroller/Thumb/quickwood_ELITE2.jpg",
"http://www.hermance.com/library/images/intro_scroller/Full/quickwood_ELITE2.jpg",
"http://www.hermance.com/featured-quickwood-elite-1100.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 tup 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"];


//add the variable 'something' to this list.
scrollItems = shuffle([cutterhead,hpj,dantherm,doucet,mikron,omec,vecoplan,denray,sawstop,sigma,onsrud,tigerstop,olimpic,u2710,record132,author,paulsaws,pratix,northtech,nfkbagfilter,si400e,rfssl,panelpro,pfm,hp4000,striebig,unisand,t130n,panelmate]);

//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' />";
		}
	}
}