$(function(){
	$('#CityLinks div').hide();
	
	$('#Cities a').click(function(){
		$('#Cities a').removeClass('on');
		$('#CityLinks div').hide();
		var id = '#' + $(this).attr('class') + 'Links';
		$(id).show();
		$(this).addClass('on');
		});
});


function ExpandoBoxes(jqObj, topClass, bottomClass) {
    $(jqObj).find('.' + topClass).each(function () {
        if ($(this).find('+ .' + bottomClass).length > 0) {
            $(this).css('cursor', 'pointer');
        }
        $(this).find('+ .' + bottomClass).css('overflow', 'hidden').css('padding', '0').height('1px').addClass('hidden');
        $(this).click(function () {
            var bottom = $(this).find('+ .' + bottomClass);
            if (bottom.hasClass('hidden')) {
                bottom.css('padding', '10px').height('auto');
            }
            else {
                bottom.css('padding', '0').height('1px');
            }
            bottom.toggleClass('hidden');
            $(this).toggleClass('open');
        });
    });
}

$(function(){ ExpandoBoxes($('body'), 'Question', 'Answer'); });
