/**
 * Converts tab display from JavaScript off default
 * 
 * @author A Fearon (07/12/09)
 */

if (!console) var console = {};
if (!console.log) console.log = {};


if (!argos) var argos = {};
if (!argos.tabsdraw) argos.tabsdraw = {};

argos.tabsdraw.tabs = {	

	init : function(catName) {
	
		var tabsdraw = argos.tabsdraw.tabs;
		
		var ultabs = $('ul.tabrow');
		var newlist = "";
		//Grab the individual tab rows and concatenate them in newlist
		for (var i = 0; i < ultabs.length; i++) {
			ultabs[i] = $(ultabs[i]).html();
			ultabs[i] = jQuery.trim(ultabs[i]);
			newlist += ultabs[i];			
		}
		//Create a new list object out of the individual tab rows	
		var newul = ('<ul class="tabrow">' + newlist + '</ul>');

		//Remove existing tab rows and prepend new list object at top of tab section
		$('ul.tabrow').remove();
		$('#heroproducts').prepend(newul);
		
		//Call the tab switch view script
		argos.tabviewer.tabswitchview.init(catName);
		
		
	}
	
}
