function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 function winopen (nm, fx, fy) {
 sw=screen.width-8; sh=screen.height-55;
 s='no';
 if (fx>sw) { x=0; s='yes'; fx=sw; } else x=Math.round((sw-fx)/2);
 if (fy>sh) { y=0; s='yes'; fy=sh; } else y=Math.round((sh-fy)/2);
 abc=window.open('/popup.php?nm='+nm,'ViewPic','top='+y+',left='+x+',width='+fx+',height='+fy+',scrollbars='+s);
}
function winopen3 (nm, fx, fy) {
 sw=screen.width-8; sh=screen.height-55;
 s='no';
 if (fx>sw) { x=0; s='yes'; fx=sw; } else x=Math.round((sw-fx)/2);
 if (fy>sh) { y=0; s='yes'; fy=sh; } else y=Math.round((sh-fy)/2);
abc=window.open(nm,'ViewPic','top='+y+',left='+x+',width='+fx+',height='+fy+',scrollbars='+s);
}
	jQuery().ready(function(){
		// simple accordion
		jQuery('#list1a').accordion();
		jQuery('#list2a').accordion();
		jQuery('#list3a').accordion();
		jQuery('#list4a').accordion();
		
		// 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, #list2,#list3a, #list4a, #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");
		});
	});