
		function checkcookies()
			{
			setCookie("cookietest", "cookies work!")
			var cookievalue = getCookie("cookietest");
			if (cookievalue)
				{
				deleteCookie("cookietest")
				return true;
				}
			else
				{
				 alert("You need to enable cookies to add an item to you cart.");
				 return false;
				}
			}
		function setCookie(name, value, expires, path, domain, secure)
			{
			    document.cookie= name + "=" + escape(value) +
			        ((expires) ? "; expires=" + expires.toGMTString() : "") +
			        ((path) ? "; path=" + path : "") +
			        ((domain) ? "; domain=" + domain : "") +
			        ((secure) ? "; secure" : "");
			}

		function getCookie(name)
			{
			    var dc = document.cookie;
			    var prefix = name + "=";
			    var begin = dc.indexOf("; " + prefix);
			    if (begin == -1)
			    {
			        begin = dc.indexOf(prefix);
			        if (begin != 0) return null;
			    }
			    else
			    {
			        begin += 2;
			    }
			    var end = document.cookie.indexOf(";", begin);
			    if (end == -1)
			    {
			        end = dc.length;
			    }
			    return unescape(dc.substring(begin + prefix.length, end));
			}

		function deleteCookie(name, path, domain)
			{
			    if (getCookie(name))
			    {
			        document.cookie = name + "=" +
			            ((path) ? "; path=" + path : "") +
			            ((domain) ? "; domain=" + domain : "") +
			            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
			    }
			}
		function ShippingNotice(Inventory,ETA,AvailableQuantity)
			{
				objForm = document.forms['FormAddcart'];
				var requestedQuantity = objForm.elements['Quantity'].value;
				var PartNumber = objForm.elements['PartNumber'].value;
				var strValidChars = "0123456789";
				var strChar;
				var blnResult = true;

				if (requestedQuantity.length == 0)
				{
					requestedQuantity = 1;
				}

				for (i = 0; i < requestedQuantity.length && blnResult == true; i++)
				{
					strChar = requestedQuantity.charAt(i);
					if (strValidChars.indexOf(strChar) == -1)
					{
						blnResult = false;
					}
				}
				
				if (blnResult == false)
				{
					requestedQuantity = 1;
				}
				
				requestedQuantity=parseInt(requestedQuantity);
				AvailableQuantity=parseInt(AvailableQuantity);
				
				if(AvailableQuantity < requestedQuantity && Inventory=='NA')
				{
					alert('The part ' + PartNumber +' is being discontinued and only has ' + AvailableQuantity + ' available for purchase.  The quantity you requested for ' + PartNumber +' has been adjusted accordingly.');
				}
				if(AvailableQuantity < requestedQuantity && Inventory=='IS')
				{
					alert('The entire quantity you requested is not currently available. Tentative ship date: ' + ETA + ' if order is placed today');
				}
				if(AvailableQuantity < requestedQuantity && Inventory=='SO')
				{
					alert('This part is a special order item.  Tentative ship date: ' + ETA + ' if order is placed today');
				}
			}
			function ShippingNotice2(Inventory,ETA,AvailableQuantity,FormNumber)
			{
				objForm = document.forms['FormAddcart'+FormNumber];
				var requestedQuantity = objForm.elements['Quantity'].value;
				var PartNumber = objForm.elements['PartNumber'].value;
				var strValidChars = "0123456789";
				var strChar;
				var blnResult = true;

				if (requestedQuantity.length == 0)
				{
					requestedQuantity = 1;
				}

				for (i = 0; i < requestedQuantity.length && blnResult == true; i++)
				{
					strChar = requestedQuantity.charAt(i);
					if (strValidChars.indexOf(strChar) == -1)
					{
						blnResult = false;
					}
				}
				
				if (blnResult == false)
				{
					requestedQuantity = 1;
				}
				
				requestedQuantity=parseInt(requestedQuantity);
				AvailableQuantity=parseInt(AvailableQuantity);
				
				if(AvailableQuantity < requestedQuantity && Inventory=='NA')
				{
					alert('The part ' + PartNumber +' is being discontinued and only has ' + AvailableQuantity + ' available for purchase.  The quantity you requested for ' + PartNumber +' has been adjusted accordingly.');
				}
				if(AvailableQuantity < requestedQuantity && Inventory=='IS')
				{
					alert('The entire quantity you requested is not currently available. Tentative ship date: ' + ETA + ' if order is placed today');
				}
				if(AvailableQuantity < requestedQuantity && Inventory=='SO')
				{
					alert('This part is a special order item.  Tentative ship date: ' + ETA + ' if order is placed today');
				}
			}