
	// 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();
		
		// 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')
		});
		
		// dropshadows
		$('h2, h3, h4, .shadow, .buttons').dropShadow({
			left    : 2,
			top     : 2,
			blur    : 2,
			opacity : 1,
			color   : "black",
			swap    : false
			});

		$('.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'));
			}
	
		});

	});
	
	// 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.7);
		},function(){
			// set the opacity on mouseout
			$(this).fadeTo("fast", 1.0); 
		});
	}
	
	// enable buttons
	function enable_buttons(){
		$('.buttons').removeAttr("disabled");
		$('.buttons').removeClass("disabled");
	}