jQuery(window).bind('load',function(){
		jQuery('#slideshow').cycle({
			fx : 'scrollLeft',
		    speed: 4000,
			timeout: 8000
		});
		
		jQuery('.hasChildren').hover(function(){
			
				jQuery(this).children('.submenu').show();
			
			},function(){
				jQuery(this).children('.submenu').hide();
			});
			
			
		jQuery('#category_qf').change(function(){
			
			
			if(jQuery(this).val()!='- ALL -')
			{
					jQuery('#sbct').hide();
					jQuery('#subcategory_qf').html('<option> - ALL - </option>');
					jQuery('#subcategory_qf').val('- ALL -');
					jQuery('#subcategory_qf').trigger('change')
			jQuery.get(jQuery('#url_qf').val() + 'get_subc.php',jQuery(this).val(),function(data){
					var i;
					
					jQuery('#subcategory_qf').html('<option> - ALL - </option>');
					jQuery('#subcategory_qf').val('- ALL -');
					jQuery('#subcategory_qf').trigger('change')
					if((data)&&(data.length>0))
					{
						jQuery('#sbct').show();
						for(i=0;i<data.length;i++)
						{
							jQuery('#subcategory_qf').append('<option value="category='+data[i].id+'">'+data[i].name+'</option>');
						}
					}
					else
					{
						jQuery('#sbct').hide();
					}
					
					
				},'JSON');
			}
			else
			{
				jQuery('#subcategory_qf').html('<option> - ALL - </option>');
				jQuery('#subcategory_qf').val('- ALL -');
				jQuery('#subcategory_qf').trigger('change')
				jQuery('#sbct').hide();
			}
			
		});
		
		jQuery('#go_filter').click(function(){			
				
				var str = jQuery('#url_qf').val();
				
				str=str + 'catalogsearch/advanced/result/?';
				
				if(jQuery('#price_qf').val()!='- ALL -')
				{
					var add_amp = true;
					
					str=str+ jQuery('#price_qf').val();
				}
				
				if(jQuery('#brand_qf').val()!='- ALL -')
				{
					if(add_amp) str = str+'&';
					else var add_amp = true;
					str = str+ jQuery('#brand_qf').val();
				}
				
				if(jQuery('#subcategory_qf').val()!='- ALL -')
				{
					if(add_amp) str = str+'&';
					else var add_amp = true;
					str = str+ jQuery('#subcategory_qf').val();
				}
				else if(jQuery('#category_qf').val()!='- ALL -')
				{
					if(add_amp) str = str+'&';
					str = str+ jQuery('#category_qf').val();
				}
				
				window.location.href =  str;	
				return false;		
		});
	});
