jQuery().ready(function(){
	// simple Accordion
	jQuery('#portfolio').Accordion();

	// first simple Accordion with special markup
	jQuery('#portfolio').Accordion({
		header: 'div.title',
		alwaysOpen: false
	});
	
	// bind to change event of select to control first and seconds accordion
	// similar to tab's plugin triggerTab(), without an extra method
	jQuery('#switch select').change(function() {
		jQuery('#portfolio').activate( this.selectedIndex-1 );
	});
	jQuery('#close').click(function() {
		jQuery('#portfolio').activate(-1);
	});
	jQuery('#switch2').change(function() {
		jQuery('#portfolio').activate(this.value);
	});
	
	// calculate height
	var height 	= jQuery('#container').height()
	var body 	= jQuery('body').height();
	var margin	= 70;

	height = height-margin;
	
	if (body > height){
		jQuery('#container').height(body-margin);
	}
});