
function validateSearchBox(id){
	var searchBox=jQuery(id).find('input[type="text"]');
	if(searchBox.val()===""){
	
		return false;
	}else{
		return true;
	}
}


jQuery(document).ready(function(jQuery) {
	
	
		//add span to every list heading
 		jQuery(".shopp_categories > li").contents().filter(function(){ return this.nodeType != 1; }).wrap("<span class='sidebar_header'/>");
		jQuery(".sidebar_header").prepend("<img class='sidebar_pointer' width=20 height=15 style='display:none; padding-right:2px;' />");
		
		jQuery(".shopp_categories > li span").toggle(function(){
			if(active){
				active.click();
			}
			active=jQuery(this);
			active.next().slideDown('slow');
			active.find("img").attr('src', ArrowActive);
		},function(){
			jQuery(this).next().slideUp('slow');
			jQuery(this).find("img").attr('src', ArrowInactive);
			active=null;
		});
		jQuery(".shopp_categories li ul ").hide();
		//jQuery(".sidebar_pointer").attr('src', ArrowInactive).css({'display':'inline'});
		
		//find the supercategory that is "active" 
		var active=jQuery(".shopp_categories > li ul.active").siblings('span').click();
		
		
/*		
		var x=0; var y=0;
		var moveBgAround=function(callback) {
			x+=300;
			var time =20000;
		
			jQuery(".hadadlogobackground").animate({
				backgroundPosition: '(' + (x) + 'px ' + (y * -1) + 'px)'
			}, time, "linear", function(){ callback(callback); } );
		};
		var xx=0; yy=0; direction=1;
		var moveBgAround2=function(callback) {
			var yy=Math.floor(Math.random()*300);
			if (xx > 1050){
				direction=-1   
			}
			if(xx < -1050){
				direction=1;
			}
			xx+=100*direction;
			yy=(3*xx*xx)/6050;
			
			var time=700;
			
			//random generated time it takes to move
			//var time = Math.floor(Math.random()*1001) + 2000;
			//make the background image move!
			jQuery("#wrapper").animate(
				{ 'background-position': '(' + (xx ) + 'px ' + (yy*-1) + 'px)' },
				time,
				"linear", 
				function() { callback(callback); }
			);
		}
		moveBgAround(moveBgAround); //hadad logo
		
		*/
		//moveBgAround2(moveBgAround2); //background light
		/*
		var updateSidebarHeight = function(){
		
		var rightHeight = jQuery("#right-col").height();
		var leftHeight = jQuery("#left-col").height();
		if(leftHeight > rightHeight) {
			jQuery("#right-col").height(leftHeight);
		}
		};
		updateSidebarHeight();
		jQuery(".grid").click(updateSidebarHeight);
		jQuery(".list").click(updateSidebarHeight);
		*/
	
	
	
	


});
 
 