jQuery().ready( function() {
	 var drawer;
	 var audioSection = jQuery.cookie('audioSection');
	 if(audioSection != null) {
		 drawer = jQuery.cookie('accDrawer.'+audioSection);
	 }else{
		 drawer = jQuery.cookie('accDrawer');
	 }
		
	 if(drawer === undefined) {
		 drawer = "0";
	 }
	 
	jQuery('#navigation').flexAccordion({
		speed: 'slow',	// see jQuery slideDown function for available options
		activeitem: parseInt(drawer), 	// 'none' to close all sliders or specify the index of the slider you want to open (0,1,2...)
		showheaders: true, 	// Specify if you want to show a slide header (span)
		headerEl: 'a', 	// Specify the element to be the header of each slide
		contentEl: 'ul',		// Specify the element to be the container of each slide
		targetdelimiter: ' ' 	// Specify the digit to separate the target slide index in custom buttons
	});
	
	jQuery("a.accHeader").click(function() {   
		var index = jQuery("a.accHeader").index(this);
		if (index > -1 && audioSection != null) {
			jQuery.cookie("accDrawer."+audioSection, index, {path: "/"});
		}else if (index > -1) {
			jQuery.cookie("accDrawer", index, {path: "/"});
		}
	});

	// photo gallery
	jQuery("a.fancybox").fancybox();
	 
	jQuery("a.inlineContentGroup").fancybox({
		'hideOnContentClick': false,
		'frameWidth': 800,
		'frameHeight': 600
	});
	 
	jQuery("a#priceNegotiate").fancybox({
		'hideOnContentClick': false,
		'frameWidth': 465,
		'frameHeight': 290
	});
});

