var Home = {
	Init: function() {
		this.Click($('#b1'), 'content1');
	},

	Click: function(button, elementid) {
		if(button) {
			var buttons = $('.buttons').children();
			$('#contents').children().hide();		
			$.each(buttons, function(index, item) {					
				if($(button).attr('id') == $(item).attr('id')) {
					$(item).addClass('active');
					$('#' + elementid).show();
				}
				else {
					$(item).removeClass('active');	
				}
			});
		}		
	},

	Open: function(dialogid, button) {
		$('#' + dialogid).dialog({
			modal: true,
			width: '780px',
			resizable: false,
			title: $(button).text()
		});
	}
};

$('.home').ready(function() {
	Home.Init();
	$( ".JQAccordion" ).accordion({
			autoHeight: false,
			active: false,
			collapsible: true 
		});
		
});
