function makeArray(n) {
   this.length = n
   for (var i = 1; i<=n; i++) {
		this[i] = new Image()
   }
   return this
}

function onImage(imagename, num) 
{
	document.images[imagename].src = normal[num].src;
}

normal = new makeArray(17);

normal[16].src = "../images/tweezer.jpg"
normal[1].src = "../images/plier.jpg"
normal[2].src = "../images/wirestripping.jpg"
normal[3].src = "../images/single.jpg"
normal[4].src = "../images/ergoirons_menu.jpg"
normal[5].src = "../images/hobby.jpg"
normal[6].src = "../images/dandy.jpg"
normal[7].src = "../images/heavy.jpg"
normal[8].src = "../images/tips.jpg"
normal[9].src = "../images/station.jpg"
normal[10].src = "../images/vseries.jpg"
normal[11].src = "../images/mkits.jpg"
normal[12].src = "../images/powerunit.jpg"
normal[13].src = "../images/handpiece.jpg"
normal[14].src = "../images/element.jpg"
normal[15].src = "../images/accessories.jpg"
normal[17].src = "../images/group23.jpg"

function imgswap (img, swapper)
{
	document.images[img].src = normal[swapper].src;
}

function filter_irons(category)
{
	var url = "index.php?req=prod&cat="+category;
	if(document.getElementById('dia').options[document.getElementById('dia').selectedIndex].value != -1)
		 url = url+"&dia="+document.getElementById('dia').options[document.getElementById('dia').selectedIndex].value;	
	
	if(category == 'paragontips')
	{
		if(document.getElementById('mod').options[document.getElementById('mod').selectedIndex].value != -1)
			url = url+"&mod="+document.getElementById('mod').options[document.getElementById('mod').selectedIndex].value;
	}
		
	if(category == 'paragontips')
	{
		if(document.getElementById('dia').options[document.getElementById('dia').selectedIndex].value != -1 || document.getElementById('mod').options[document.getElementById('mod').selectedIndex].value != -1)
			location.href = url;
		else
			alert("Please select an iron or a diameter.");
	}
	else
	{
		if(document.getElementById('dia').options[document.getElementById('dia').selectedIndex].value != -1)
			location.href = url;
		else
			alert("Please select a diameter.");
	}
}