function getAccessories(vendorId, type, itemId, spanId, categoryId, notFoundMessage, accessories, templateURI){
	var dynamicXMLHTTPRequest;
	try {
		// Firefox
		dynamicXMLHTTPRequest = new XMLHttpRequest();
	}catch(e){
		// Internet Explorer
		try{
			dynamicXMLHTTPRequest = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			// Old Internet Explorer
			try{
				dynamicXMLHTTPRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
			}
		}
	}
	dynamicXMLHTTPRequest.onreadystatechange  = function(){
		if(dynamicXMLHTTPRequest.readyState  == 4){
			if(dynamicXMLHTTPRequest.status  == 200) {
				var responseTextArray = dynamicXMLHTTPRequest.responseText.split("*,~")
				var currentItem;

				//item data in order
				var itemId;
				var shortdesc;
				var variation;
				var imagePath;
				var listprice;
				var price;
				var rowCount = 0;

				if(responseTextArray.length > 0 && responseTextArray[0].split("|")[0] != ""){
					var itemsHtml = "<tr>";
					itemsHtml += "<td>";
					itemsHtml += "<table border='0' style='width:95%;'>";
					itemsHtml += "<tr>";
					var numProducts = 0;
					for(var i = 0; i < responseTextArray.length; i++){
						numProducts++;
						rowCount++;
						currentItem = responseTextArray[i].split("|");
						itemId = currentItem[0];
						shortdesc = currentItem[1];
						variation = currentItem[2];
						imagePath = currentItem[3];
						listprice = currentItem[4];
						price = currentItem[5];
						price = price - 0.0;
						listprice = listprice - 0.0;
						if(accessories != null){
							accessories[accessories.length] = itemId;
						}
						
						if(rowCount  == 1){
							if(numProducts > 8){
								itemsHtml += "<tr style='display:none'>";
								
								$("#seeallextra" + type).show();
							} else {
								itemsHtml += "<tr>";
							}
						}
	
						if(rowCount  == 1){
							itemsHtml += "<td width='50%' align='left'>";
	                    } else{
							itemsHtml += "<td width='50%' class='leftBorder' align='left'>";
						}
	
						itemsHtml += "<table cellpadding='0' cellspacing='5' border='0' width='100%'>";
	
						itemsHtml += "<tr>";
						itemsHtml += "<td>";
						itemsHtml += "<div class='presetButBold'>";
						itemsHtml += "<p>";
						itemsHtml += "<a href='" + templateURI + "?vid=" + vendorId + "&iid=" + itemId + "&cid=" + categoryId + "' class='infoslink'>" + shortdesc + "</a>";
						itemsHtml += "</p>";
						itemsHtml += "</div>";
						if(variation != null && variation != "null"){
							itemsHtml += "<p>";
							itemsHtml += "<b>Variation:</b>  " + variation;
							itemsHtml += "</p>";
						}
						itemsHtml += "</td>";
						itemsHtml += "<td align='center' nowrap='nowrap'>";
						if(imagePath != null && imagePath != ""){
							itemsHtml += "<a class='center' href='" + templateURI + "?vid=" + vendorId + "&iid=" + itemId + "&cid=" + categoryId + "' alt='" + shortdesc + "'>";
							itemsHtml += "<img border='0' style='max-width:80px;max-height:80px;width:expression(this.width>80?80:true);height:expression(this.height>80?80:true);' src='" + imagePath + "' />";
							itemsHtml += "</a>";
						}
						itemsHtml += "</td>";
						itemsHtml += "</tr>";
						itemsHtml += "<tr>";
						itemsHtml += "<td>";
						if(listprice > price){
							itemsHtml += "List Price:  <span  class='item-list-price' id='_listPrice_" + itemId + "'>$" + listprice.toFixed(2) + "</span><br>";
							itemsHtml += "You Save:  <span  class='item-price-saved' id='_youSave_" + itemId + "'>$" + (listprice - price).toFixed(2) + " (" + (((listprice - price)/listprice)*100).toFixed(0) + "%)</span><br>";
							itemsHtml += "<span  class='productPrice' id='_price_" + itemId + "'>$" + price.toFixed(2) + "</span>";
						}
						else if(listprice == 0)	{
							itemsHtml += "<span class='productPrice'>Call for pricing<br/></span>";
						}
						else{
							itemsHtml += "<span class='productPrice'>$" + listprice.toFixed(2) + "<br/></span>";
						}
						itemsHtml += "</p></span>";
						itemsHtml += "</td>";
						itemsHtml += "<td align='center' nowrap='nowrap'>";
						
						itemsHtml += "<span>Add to Cart</span>";
						itemsHtml += "</td>";
						itemsHtml += "<td align='center' nowrap='nowrap'>";
						itemsHtml += "<input id= '" + itemId + "' class='accessories' type='checkbox' value=''/>";
						itemsHtml += "</td>";
						itemsHtml += "</tr>";
						itemsHtml += "</table>";
						itemsHtml += "</td>";
						
						
						if(rowCount  == 2){
							itemsHtml += "</tr>";
							rowCount  = 0
						}
					}
					itemsHtml += "</table>";
					itemsHtml += "</td>";
					itemsHtml += "</tr>";
					
					if(document.getElementById(spanId) != null){
						document.getElementById(spanId).innerHTML = itemsHtml;
					}
					
					document.getElementById(type).style.display = "inline";
				}else{
					if(document.getElementById(spanId) != null && document.getElementById(type) != null){
						document.getElementById(spanId).innerHTML = notFoundMessage;
						document.getElementById(type).style.display = "none";
					}
				}
			}else{
			} 
		}
	}; 

	dynamicXMLHTTPRequest.open("GET", "accessories.ajx?vendorId=" + vendorId + "&type=" + type + "&itemId=" + itemId + "&cid=" + categoryId,  true); 
	dynamicXMLHTTPRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	dynamicXMLHTTPRequest.send(null); 
}
