	jQuery().ready(function(){
		// simple accordion
		jQuery('#list1b').accordion();
		jQuery('#list1a').accordion({
			autoheight: false
		});
		
		var leftHeight=$("#left_bar").css('height');
		
		var contentHeight=$("#content").css('height');
		
		if (leftHeight>contentHeight) {
		
		$("#content").css('min-height',leftHeight);
		
		 
		
}

		// second simple accordion with special markup
		jQuery('#navigation').accordion({
			active: false,
			header: '.head',
			navigation: true,
			event: 'mouseover',
			fillSpace: true,
			animated: 'easeslide'
		});

		// highly customized accordion
		jQuery('#list2').accordion({
			event: 'mouseover',
			active: '.selected',
			selectedClass: 'active',
			animated: "bounceslide",
			header: "dt"
		}).bind("change.ui-accordion", function(event, ui) {
			jQuery('<div>' + ui.oldHeader.text() + ' hidden, ' + ui.newHeader.text() + ' shown</div>').appendTo('#log');
		});

		// first simple accordion with special markup
		jQuery('#list3').accordion({
			header: 'div.title',
			active: false,
			alwaysOpen: false,
			animated: false,
			autoheight: false
		});

		var wizard = $("#wizard").accordion({
			header: '.title',
			event: false
		});

		var wizardButtons = $([]);
		$("div.title", wizard).each(function(index) {
			wizardButtons = wizardButtons.add($(this)
			.next()
			.children(":button")
			.filter(".next, .previous")
			.click(function() {
				wizard.accordion("activate", index + ($(this).is(".next") ? 1 : -1))
			}));
		});

		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		var accordions = jQuery('#list1a, #list1b, #list2, #list3, #navigation, #wizard');

		jQuery('#switch select').change(function() {
			accordions.accordion("activate", this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			accordions.accordion("activate", -1);
		});
		jQuery('#switch2').change(function() {
			accordions.accordion("activate", this.value);
		});
		jQuery('#enable').click(function() {
			accordions.accordion("enable");
		});
		jQuery('#disable').click(function() {
			accordions.accordion("disable");
		});
		jQuery('#remove').click(function() {
			accordions.accordion("destroy");
			wizardButtons.unbind("click");
		});



 
 
 
 
 
 
 
 
 
   	lastBlock = $("#a1");
   var z=$(lastBlock,$("p"));
   $("#a1 img").show();
 $("#bulk2img").hide();
 
 z.css("visibility","visible");
 
 z.css("color","#000");
     maxWidth = 220;
 	minWidth = 100;
 
 
 
     $("#accordion ul li a").hover(
 		function(){
 			$(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
 			$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
 			currentBlock = this;
 
 var name2=   $(currentBlock).attr("id");
 
 var imgname= (name2 +"img");
 
 if(imgname=='bulk2img') {
 $("#bulk2img").show();
 } else {
 $("#bulk2img").hide();
 }
 
 			lastBlock = this;
 			var x =  $(this,$("p"));
 
 	x.css("visibility","visible");
 		x.css("color","#000");
 
 	    }
 	);
 
 
 
 
 jQuery("span.fake_link").hover(function() {
 var $this = $(this);
 		var x=$this.attr('id');
 		var location=new Array();
 		location=x.split('_');
     jQuery(this).css('background-color', 'orange');
         jQuery(this).css('cursor', 'pointer');
  $('#flag1_span').css({left:"-" + location[1] + 'px', top: "-" + location[2] + 'px'});
 
 
         $('#flag1_img').css('width',location[3] + 'px');
                 $('#flag1_img').css('height',location[4] + 'px');
                 
 }, function() {
     jQuery(this).css('background-color', 'white');
});
 
 
  jQuery("span.fake_link").click(function() {
  var $this = $(this);
  		var x=$this.attr('id');
  		var location=new Array();
  		location=x.split('_');
  		if(location[0]=='fruits' || location[0]=='vegetables' || location[0]=='organics') {
  		location[0]='produce';
  		}
  		if(location[0]=='cookies' || location[0]=='pasta') {
  		location[0]='groceries';
  		
  		
  		}
  		  		if(location[0]=='bakery' ) {
		  		location[0]='bread';
		  		
		  		
  		}
			window.location.href = 'store.php?dept='+ location[0];


});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
	});
