var siteID = 'rxmaxpharma.com';

///////DONT CHANGE ////////
document.write('<script language="javascript" src="http://www.northusapharmacy.com/scripts/prices.js"></script>');

function dwProductTypeTable(PTID)
{
	var sDocumentWrite = '';
	var i;
	var arrProductInfo = new Array();
	var arrProductTypeInfo = new Array();
		
	sDocumentWrite += '<table align="center" width="98%" cellpadding="3" cellspacing="1" class="ProductTable">'

	sDocumentWrite += '<tr class="ProductHeader" align=center>'
	sDocumentWrite += '<th>Product</th>'
	sDocumentWrite += '<th>Dosage</th>'
	sDocumentWrite += '<th>Quantity</th>'
	sDocumentWrite += '<th>Price</th>'
	sDocumentWrite += '<th width="60">Buy</th>'
	sDocumentWrite += '</tr>'

	for (i = 0; i < arrProduct.length;i++)
	{
		arrProductInfo = arrProduct[i].toString().split(',');
		arrProductTypeInfo = GetProductTypeInfo(arrProductInfo[cProductProductTypeID]);
		//alert(arrProductInfo[cProductProductTypeID].toString());
		if (arrProductInfo[cProductProductTypeID].toString() == PTID)
		{
			sDocumentWrite += '<tr bgColor=#ffffff align="center">'
			sDocumentWrite += '<td>'
			sDocumentWrite += '<div class="ProductNameTable"> ' + arrProductInfo[cProductProductName].toString().toUpperCase() + '<br><span Class="ProductIsGeneric">(' + arrProductInfo[cProductProductGeneric] +  ')</span></div>'
			sDocumentWrite += '<div class="ProductGenericName">' + arrProductInfo[cProductProductGenericName] + '</div>'
			sDocumentWrite += '</td>'
			
			sDocumentWrite += '<td class="ProductDosageQuantity">' + arrProductInfo[cProductProductDosage] + '</td>'
			sDocumentWrite += '<td class="ProductDosageQuantity">' + arrProductInfo[cProductProductQuantity] + '</td>'
			sDocumentWrite += '<td class="ProductPrice">' + GetProductPrice(arrProductInfo) + '</td>'
			sDocumentWrite += '<td><a onMouseMove="stMsg(&#34;' + arrProductInfo[cProductProductName] + ' ' + arrProductInfo[cProductProductDosage] + '&#34;)" href="'  + buyurl(arrProductInfo[cProductProductCode].toString()) +  '"><img src="images/buy.gif" border="0"></a></td>'
			//http://www.safetrustprocessing.com/nonav_aff_add_cart.cfm?inventory_id=' + arrProductInfo[cProductProductCode].toString() + '&affiliateID=2004103204&website=' + siteID + '&CID=&CID=' + siteID + '
			sDocumentWrite += '</tr>'
		}
	}
	sDocumentWrite += '</table>'
	document.write(sDocumentWrite);
}

function stMsg(str)
{	
	window.status = 'CLICK TO BUY - ' + str;
	return true;
}

function dwPriceList(CAT)
{
	var sDocumentWrite = ''
	var i
	var arrProductTypeInfo = new Array()
	for (i = 0; i < arrProductType.length;i++)
	{
		arrProductTypeInfo = arrProductType[i].toString().split(',');
		if (arrProductTypeInfo[cProductTypeCatID].toString() == CAT)
		{
		document.write('<p class="NormalSmallTitle">' + arrProductTypeInfo[cProductTypeProductName].toString().toUpperCase() + '</p>');
		dwProductTypeTable(arrProductTypeInfo[cProductTypeProductTypeID], true);
		}
	}	
	
}

function dwCatWisePriceList()
{
	var sDocumentWrite = ''
	var arrCatTypeInfo = new Array()
	var i
	for (i = 0; i < arrCatList.length;i++)
	{
			arrCatTypeInfo = arrCatList[i].toString().split(',');
			document.write('<br><table align="center" width="98%" cellpadding="3" cellspacing="1" class="ProductTable"><tr><td class=ProductTable><span class=navigation>' + arrCatTypeInfo[cCatName].toString().toUpperCase() + ' PRODUCTS</span></td></tr></table>');
			dwPriceList(arrCatTypeInfo[cCatID].toString());
	}	
}