"onClick": '_gaq.push(['_trackEvent', 'Connect', 'Click', 'Head'+$(this).attr('class')+'', 3]);',
"href": "#",
"html": $(this).html()
});
var $li = $('<li />');
$li.append($anchor);
$tablist.append($li);
});
$('div.heading-tab').remove();
$('.heading-tabset:gt(0)').each(function()
{
$tabset.append($(this).find('.listing'));
$(this).remove();
});
}
function slider() {
$('.slider').each(function()
{
// As we loop through the slider items we'll document the tallest one and the left position
// of each element
var maxHeight = 0, lastWidth = 0;
// grab the slider and make sure the overflow is hidden and it has a defined width
var $slider = $(this);
$slider.css('width', $slider.outerWidth());
$slider.css('position', 'relative');
$slider.css('overflow', 'hidden');
// store the index (or the currently "selected" slide)
$slider.prop('index', 0);
// loop through each of the direct children
$slider.find('> *').each(function()
{
// localize the child as a jQuery object
var $li = $(this);
// if this is the tallest child, document it
if ($li.outerHeight() > maxHeight)
{
maxHeight = $li.outerHeight();
}
// position each child to the immediate right of its preceding sibling
$li.css('position', 'absolute');
$li.css('top', 0);
$li.css('left', lastWidth);
// update our maths so we know where to place the next sibling
lastWidth+= $li.outerWidth();
});
// set the height of the slider based on the tallest child
//$slider.css('height', maxHeight);
// build the previous control button and store a reference to its related slider
var $previous = $('<a />', {"class": "prev disabled", "href": "#", "text": "Previous"});
$previous.prop('slider', $slider);
// build the next control button and store a reference to its related slider
var $next = $('<a />', {"class": "next", "href": "#", "text": "Next"});
$next.prop('slider', $slider);
// build the controls div and add it to the markup
var $controls = $('<div />', {"class": "controls"}).append($previous).append($next);
$slider.after($controls);
$slider.prop('controls', $controls);
});
// watch for clicks on the controls
$(document).delegate('.listing + .controls .prev, .listing + .controls .next', 'click', function (event)
{
// stop our clicks from affecting the browser/url
event.preventDefault();
// localize a jQuery version of the clicked link
var $anchor = $(this);
// grab the slider, that we previously stored while creating these links
var $slider = $anchor.prop('slider');










