var $nextImage = $(nextSlide($carousel, index).element).find('.main-image').clone();
// remove the class
$nextImage.removeClass('main-image');
// create a link for the previous image
var $nextAnchor = $('<a />', {
"href": "#",
"class": "next-image",
"html": $nextImage
});
$nextAnchor.css('opacity', 0.2);
// add in the next image/anchor
$(this).after($nextAnchor);
});
// start the carousel by default
start($carousel);
});
}
function emergencyClose() {
//$('.emergency .wrap').append('<a href="#" class="close">Close</a>');
$(document).delegate('.emergency .close', 'click', function(event)
{
event.preventDefault();
$(this).parents('.emergency').remove();
});
}
function replyLinks() {
//$close = $('<a />', {"class": "close", "href": "#", "text": "Close"});
$twitterWrap = $('<div />', {"id": "twitter-wrap"});
//$twitterWrap.append($close);
$twitter = $('<div />', {"id": "twitter"});
$twitterWrap.append($twitter);
$(document.body).append($twitterWrap);
/*twttr.anywhere(function (T) {
T("#twitter").tweetBox({
"width": 515,
"height": 133,
"defaultContent": "",
"onTweet": function()
{
$("#twitter-wrap").fadeOut('fast');
$('#overlay').fadeOut();
$('#overlay').remove();
_gaq.push(['trackEvent', 'Home', 'SubmitReply', 'TwitterReply', 5]);
//$twitter.remove();
}
});
});*/
$(document).delegate('.link-reply', 'click', function(event)
{
event.preventDefault();
//if ( !$('#overlay') ) {
$(document.body).prepend($('<div />', {"id": "overlay"}));
//}
$('#overlay').fadeIn();
$("#twitter-wrap").css({
"position": "fixed",
"top": 200,
"left": ($(document.body).width()-515)/2
});
if ($.browser == 'msie')
{
$("#twitter-wrap").css({
"position": "absolute",
"top": $(document.body).scrollTop() + 200
});
}
$("#twitter-wrap").fadeIn('fast');
});
$(document).delegate('#overlay, #twitter-wrap .close', 'click', function(event)
{
event.preventDefault();
$('#twitter-wrap').fadeOut('fast');
$('#overlay').fadeOut('fast', function()
{
$(this).remove();
})
});
}
function adjournLinks()
{
$('.adjoin-options').each(function()
{
var headings = [];
$(this).find('*[data-heading]').each(function()
{
headings[$(this).attr('data-heading')] = $(this).attr('data-heading');
});
var $headings = $('<ul />', {
"class": "adjoin-header"










