
	// fix for flashing treeview and gallery ... 
	document.write('<style type="text/css">');
	document.write('#navTree,#mini_gallery { display:none; }');
	document.write('.h1text { text-indent: -9999px; }');
	document.write('.no_js { display: none; }');
	document.write('</style>');

	// used for mailinglist entry
	function doClear(theText) {
		if (theText.value == theText.defaultValue) {
			theText.value = ""
		}
	}
	
	
	//
	// jQuery ... load when DOM ready
	//
	
	$(function(){
		
		// initialize hover of all .fader images
		fader_init('.fader img');
		
		// enable buttons when page fully loaded (to avoid premature clicks)
		enable_buttons();
		
		// fire-up shadowbox
		Shadowbox.init({
			players:	 ["iframe","html"],
			counterType: ["skip"]
		});
		
		// disable buttons when clicked once
		$('.buttons').click(function(){
			$('.buttons').attr("disabled","disabled");
			$('.buttons').addClass("disabled");
			$('.buttons').blur();
		});
		
		// allow hover for IE6
		$('.buttons').hover(function(){
			$(this).addClass('buttonhover');
		}, function() {
			$(this).removeClass('buttonhover')
		});
		

		$('.pobox_confirm').click(function(){
			var str = document.forms[0].ship_address.value;
			var result = str.match(/box/i);
			
			if (result) {
				var yes = confirm("It looks like you are shipping to a PO BOX.\nThis will add 2 weeks to your delivery time.\nDo you still want to use this address?");
				if (yes) {
					xajax_cartstep('3',xajax.getFormValues('cart_form'));
				} else {
					enable_buttons();
				}
			} else {
				xajax_cartstep('3',xajax.getFormValues('cart_form'));
			}
		});
		
		$("#accordion").accordion({
			active: false,
			collapsible: true,
			autoHeight: false
		});

	});
	
	// HOVER fader for images
	function fader_init(domChunk){
		// set the opacity of the thumbs on load
		//$(".thumbs img").fadeTo("slow", 0.6);
		$(domChunk).hover(function(){
			// set the opacity on hover
			$(this).fadeTo("fast", 0.6);
		},function(){
			// set the opacity on mouseout
			$(this).fadeTo("fast", 1.3); 
		});
	}
	
	// enable buttons
	function enable_buttons(){
		$('.buttons').removeAttr("disabled");
		$('.buttons').removeClass("disabled");
	}

	
	
/*	
	// not used anywhere
	function toggler(obj) {
		var el = document.getElementById(obj);
		if ( el.style.display != 'none' ) {
			el.style.display = 'none';
		} else {
			el.style.display = '';
		}
	}
	
	// jquery moved to body to speed things up
	$(document).ready(function(){
		
		$("#navTree").treeview({
			animated: "fast",
			collapsed: true,
			unique: false,
			persist: "location"
		}).css('display','block');

		$('#mini_gallery').cycle({ 
			fx:    'fade', 
			speed:  2500 
		 }).css('display','block');

	
	});

	// jquery moved to body to speed things up
	$(function() {
		$('#mini_gallery').cycle({ 
			fx:    'fade', 
			speed:  2500 
		 });
	});
*/