String.prototype.ft = function() {
    var pattern = /\{\d+\}/g;
    var args = arguments;
    return this.replace(pattern,function(capture){return args[capture.match(/\d+/)];});
}

/*$(function() {
	$('body').append(
		$('<div />').addClass('sopa')
			.css({
				'background': '#fff',
				'padding': '40px',
				'border-top': '1px solid #000',
				'border-bottom': '1px solid #000',
				'font-size': '30px',
				'line-height': '45px',
				'margin': '100px auto',
				'text-align': 'center',
				'display': 'none'})
			.append(
				$('<div />').text("We're closed until Thursday")
			)
			.append(
				$('<br />')
			)
			.append(
				$('<a />').text('?')
					.attr('href','https://www.google.com/landing/takeaction/')
			)
	);
	$('.page, .pageSeparator, .social_links, .footer').fadeOut(1000, function() {
		$('.sopa').fadeIn();
	});
});*/

$(function () { 
    $('.toggleLink').click(function () {
        if (!($(this).is('.active'))) {
            var contentToToggle = $(this).attr('linkto');
            $(this).siblings('.active').removeClass('active');
            $(this).addClass('active');
            $('.toggleContent[id="{0}"]'.ft(contentToToggle)).siblings('.active').removeClass('active');
            $('.toggleContent[id="{0}"]'.ft(contentToToggle)).addClass('active');
        }
    });
});

