// function to adjust the minimum of 5 cartons
function checkqty()
{ 	//alert("5 minimum");
	m = document.getElementById("mcode").innerHTML;
	f = parseInt(document.getElementById("quantitytext").value);
	if ((m == "0")&&(f <= 4))
	{ 
		//alert("Your Quantity Is Below The 5 Minimum.");
		alert ("Quantity below minimum. Quantity of 5 added to basket.");
		document.getElementById("quantitytext").value = "5";
	}
}

function announce()
{
	aqty = parseInt(document.getElementById("quantitytext").value);
	if (aqty >= 5)
	{
		alert (aqty + " units have been added to your basket.");
	}
}


var goods = [	
34,47,
101,102,104,128,129,
206,
400,402,403,406,407,412,480,486,
801,802,881,882,
902,904,925,935,945,
3005,3015,3025,3105,3200,3220,3300,3550,3552,
8000,8001,8003,8020,8030,8040,8099,
9925,9935,9945 
];

		
		
if (document.getElementById("pcode") == null)
{
}
else
{

		
	pc = document.getElementById("pcode").innerHTML;
	//if (pc == null) { return false; }
	
	infotext = "hello";
	stylecode = 0;
	
	//alert("Product Code" + pc);
	
	for(g=0;g<goods.length;g++)
	{
		// scan through the 'good' list
		var a = 0;
		a = goods[g];
		if (a.toString() == pc)
		{
			stylecode = 1;
			break;
		}
		else
		{
			stylecode = 0;
		}
	}
	
	document.getElementById("makeinfo").style.fontFamily = "Arial,Helvetica,sans-serif";
	document.getElementById("makeinfo").style.fontSize = "14px";
	document.getElementById("makeinfo").style.padding = "10px";
	document.getElementById("makeinfo").style.fontWeight = "bold";
	document.getElementById("makeinfo").style.letterSpacing = "1px";
	
	if (stylecode == 1)
	{
		infotext = "This Product is considered a 'shelf' item.<br>";
		infotext += "Shelf Items normally can be shipped in quantities of ";
		infotext += "1 skid or less the same day on orders placed by 2:30pm EST.";
		document.getElementById("makeinfo").style.backgroundColor = "green";
		document.getElementById("makeinfo").style.color = "white";
		document.getElementById("makeinfo").innerHTML = infotext;
		document.getElementById("mcode").innerHTML = "1";
	}
	else
	{
		infotext = "This Product is considered a 'make' item.<br>";
		infotext += "It has a minimum order of 5 cartons. ";
		infotext += "Make items normally ship in 1-2 days.";
		document.getElementById("makeinfo").style.backgroundColor = "maroon";
		document.getElementById("makeinfo").style.color = "white";
		document.getElementById("makeinfo").innerHTML = infotext;
		document.getElementById("mcode").innerHTML = "0";
		m = document.getElementById("mcode").innerHTML;
		f = parseInt(document.getElementById("quantitytext").value);
		if ((m == "0")&&(f <= 4))
		{ 
			//alert("Make Items Have a 5 Carton Minimum.");
			document.getElementById("quantitytext").value = "5";
		}
	}
	
} // close 'else' to see if pcode exists or not
	
	
	
	
	/*
	function gup( name )
	{
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( window.location.href );
	  if( results == null )
	    return "";
	  else
	    return results[1];
	}
	*/

