
// taken 'day' out below --- var dsProducts = new Fizz.Data.HTMLDataSet(null, "productListing", {firstRowAsHeaders:false, rowSelector:".product", dataSelector:".boximage, .category,.location,.code,.day, .price,h2, .productdescription, .featureslist", columnNames:["boximage","category","location","code","day","price","name","description","features"]});
//var dsProducts = new Fizz.Data.HTMLDataSet(null, "productListing", {firstRowAsHeaders:false, rowSelector:".product", dataSelector:".boximage, .category,.location,.code,.price,h2, .productdescription, .featureslist", columnNames:["boximage","category","location","code","price","name","description","features"]});

//var dsProducts = new Fizz.Data.HTMLDataSet(null, "productListing", {firstRowAsHeaders:false, rowSelector:".product", dataSelector:".boximage, .category,.location,h2, .productdescription, .featureslist", columnNames:["boximage","category","location","name","description","features"]});

var dsProducts = new Fizz.Data.HTMLDataSet(null, "productListing", {firstRowAsHeaders:false, rowSelector:".product", dataSelector:".boximage, .category,.enquirybtn,h2, .productdescription, .featureslist", columnNames:["boximage","category","enquiry","name","description","features"]});
//var dsProducts = new Fizz.Data.HTMLDataSet(null, "productListing", {firstRowAsHeaders:false, rowSelector:".product", dataSelector:".boximage, .category,h2, .productdescription, .featureslist", columnNames:["boximage","category","name","description","features"]});


//dsProducts.setColumnType("date", "date");
//dsProducts.setColumnType("price", "number");

// Add an observer to the dsProducts data set so we know when it is done
// loading its data. Once it is done loading, we want to *replace* the content
// inside the "productListing" container with an HTML fragment, which contains
// several region templates, that we will load dynamically.

	dsProducts.addObserver({onPostLoad: function(notificationType, notifier, data)
	{
		// Load the HTML fragment that contains our region templates.
		var ds=dsProducts.getData();
		Fizz.Utils.updateContent("productListing", "products_template.html", function()
		{
		// Tell Spry to process the regions.

		Fizz.Data.initRegions();

		// If an HTML data set loads its data from markup embedded in the page,
		// it automatically hides the data source with display:none. Since we
		// are re-using the same container as the data source, we need to make
		// sure that it shows, so set its display to "block".
		// We also need to ensure that the menu item for the current category 
		// is set to it's "on" state (handling ampersands [already entity-referenced]).
		var ident=ds[0]['category'].replace(/\s/g,"").replace(/\&amp;/g,"_").toLowerCase().replace(/,/g,"");
		//alert(ident);
		 Fizz.$('productListing').style.display = "block";
		 Fizz.$(ident).style.backgroundPosition = "100% -85px";
		 Fizz.$(ident).style.color = "yellow";
		 Fizz.$(ident).style.fontWeight = "bold";

		// The HTML fragment we loaded contains markup for an Accordion. Create
		// an Accordion widget to attach the appropriate behaviors to that markup.
		Acc1 = new Fizz.Widget.Accordion("acc1", {defaultPanel:1,useFixedPanelHeights:false,enableAnimation: false});
		});
	}});


// Turn off the automatic region processing that occurs when a page includes
// FizzData.js. We will manually trigger the processing *after* the HTML fragment
// is loaded and inserted into the document.

Fizz.Data.initRegionsOnLoad = false;

// Tell the HTML data set to load its data source as soon as the onload
// event fires. This kicks off the whole transformation of the document.

Fizz.Utils.addLoadListener(function(){ dsProducts.loadData(); });
