function ws_urls(){
	(function($) {
		var form=$('form[name=wedding_dress_search_form]');
		if(form.length<=0){
			return;
		}

		//style[]
		var style_filter='';
		$('input[name="style[]"]',form).each(function(){
			if(this.checked){				
				style_filter+=','+this.value;
			}			
		});
		if(style_filter!=''){
			style_filter=style_filter.substring(1);
			style_filter='/'+style_filter;
		}
				
		//price[]
		var price_filter='';
		$('input[name="price[]"]',form).each(function(){
			if(this.checked){				
				price_filter+=','+this.value;
			}			
		});
		if(price_filter!=''){
			price_filter=price_filter.substring(1);
			price_filter='/'+price_filter;
		}		
		
		//embellishment[]
		var embellishment_filter='';
		$('input[name="embellishment[]"]',form).each(function(){
			if(this.checked){
				if(this.value=='other')
					this.value='other-embellishment';
				embellishment_filter+=','+this.value;
			}			
			
		});
		if(embellishment_filter!=''){
			embellishment_filter=embellishment_filter.substring(1);
			embellishment_filter='/'+embellishment_filter;
		}
		
		//color[]
		var color_filter='';
		$('input[name="color[]"]',form).each(function(){
			if(this.checked){		
				if(this.value=='other')
					this.value='other-color';
				color_filter+=','+this.value;
			}			
		});
		if(color_filter!=''){
			color_filter=color_filter.substring(1);
			color_filter='/'+color_filter;
		}	
		
		//bodyshape[]
		var bodyshape_filter='';
		$('input[name="bodyshape[]"]',form).each(function(){			
			if(this.checked){		
				if(this.value=='other')
					this.value='other-bodyshape';
				bodyshape_filter+=','+this.value;
			}			
		});
		if(bodyshape_filter!=''){
			bodyshape_filter=bodyshape_filter.substring(1);
			bodyshape_filter='/'+bodyshape_filter;
		}	
		
		//neckline[]
		var neckline_filter='';
		$('input[name="neckline[]"]',form).each(function(){			
			if(this.checked){		
				if(this.value=='other')
					this.value='other-neckline';
				neckline_filter+=','+this.value;
			}			
		});
		if(neckline_filter!=''){
			neckline_filter=neckline_filter.substring(1);
			neckline_filter='/'+neckline_filter;
		}	
		
		//brand
		var brand_filter='';
		brand_filter=$('select[name=brand] option:selected',form).text();
		if(brand_filter!="All designers"){
			brand_filter=brand_filter.substring(1);
		}
		brand_filter=brand_filter.replace(/^\s\s*/, '').replace(/\s\s*$/, '');// first char is ' ' 		
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter=brand_filter.toLowerCase().replace(' ','-');		
		brand_filter='/'+brand_filter;
		
		
		//final url
		var final_url='/wedding-dresses/'+style_filter+price_filter+embellishment_filter+color_filter+bodyshape_filter+neckline_filter+brand_filter;
		
		document.location.href=final_url;
		
	})(jQuery)
}

function bs_urls(){
	(function($) {
		var form=$('form[name=bridesmaids_search_form]');
		if(form.length<=0){
			return;
		}

		//length[]
		var length_filter='';
		$('input[name="length[]"]',form).each(function(){
			if(this.checked){				
				length_filter+=','+this.value;
			}			
		});
		if(length_filter!=''){
			length_filter=length_filter.substring(1);
			length_filter='/'+length_filter;
		}
				
		//price[]
		var price_filter='';
		$('input[name="price[]"]',form).each(function(){
			if(this.checked){				
				price_filter+=','+this.value;
			}			
		});
		if(price_filter!=''){
			price_filter=price_filter.substring(1);
			price_filter='/'+price_filter;
		}		
				
		//color[]
		var color_filter='';
		$('input[name="color[]"]',form).each(function(){
			if(this.checked){		
				if(this.value=='other')
					this.value='other-color';
				color_filter+=','+this.value;
			}			
		});
		if(color_filter!=''){
			color_filter=color_filter.substring(1);
			color_filter='/'+color_filter;
		}	
		
		//bodyshape[]
		var bodyshape_filter='';
		$('input[name="bodyshape[]"]',form).each(function(){			
			if(this.checked){		
				if(this.value=='other')
					this.value='other-bodyshape';
				bodyshape_filter+=','+this.value;
			}			
		});
		if(bodyshape_filter!=''){
			bodyshape_filter=bodyshape_filter.substring(1);
			bodyshape_filter='/'+bodyshape_filter;
		}	
		
		//season[]
		var season_filter='';
		$('input[name="season[]"]',form).each(function(){			
			if(this.checked){		
				if(this.value=='other')
					this.value='other-season';
				season_filter+=','+this.value;
			}			
		});
		if(season_filter!=''){
			season_filter=season_filter.substring(1);
			season_filter='/'+season_filter;
		}	
		
		//brand
		var brand_filter='';
		brand_filter=$('select[name=brand] option:selected',form).text().replace(/^\s\s*/, '').replace(/\s\s*$/, '');		
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter='/'+brand_filter;
		
		//final url
		var final_url='/bridesmaids-party'+length_filter+price_filter+color_filter+bodyshape_filter+season_filter+brand_filter;
		
		document.location.href=final_url;
		
	})(jQuery)
}

function js_urls(){
	(function($) {
		var form=$('form[name=accessories_search_form]');
		if(form.length<=0){
			return;
		}

		//hair[]
		var hair_filter='';
		$('input[name="hair[]"]',form).each(function(){
			if(this.checked){	
				if(this.value=='other')
					this.value='other-hair';
				hair_filter+=','+this.value;
			}			
		});
		if(hair_filter!=''){
			hair_filter=hair_filter.substring(1);
			hair_filter='/'+hair_filter;
		}

		//jewelry[]
		var jewelry_filter='';
		$('input[name="jewelry[]"]',form).each(function(){
			if(this.checked){		
				if(this.value=='other')
					this.value='other-jewelry';
				jewelry_filter+=','+this.value;
			}			
		});
		if(jewelry_filter!=''){
			jewelry_filter=jewelry_filter.substring(1);
			jewelry_filter='/'+jewelry_filter;
		}		
				
		//shoe[]
		var shoe_filter='';
		$('input[name="shoe[]"]',form).each(function(){
			if(this.checked){		
				if(this.value=='other')
					this.value='other-shoe';
				shoe_filter+=','+this.value;
			}			
		});
		if(shoe_filter!=''){
			shoe_filter=shoe_filter.substring(1);
			shoe_filter='/'+shoe_filter;
		}	
		
		//other[]
		var other_filter='';
		$('input[name="other[]"]',form).each(function(){			
			if(this.checked){		
				if(this.value=='other')
					this.value='others';
				other_filter+=','+this.value;
			}			
		});
		if(other_filter!=''){
			other_filter=other_filter.substring(1);
			other_filter='/'+other_filter;
		}			
		
		//brand
		var brand_filter='';
		brand_filter=$('select[name=brand] option:selected',form).text().replace(/^\s\s*/, '').replace(/\s\s*$/, '');		
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter=brand_filter.toLowerCase().replace(' ','-');
		brand_filter='/'+brand_filter;
		
		//final url
		var final_url='/accessories-beauty'+hair_filter+jewelry_filter+shoe_filter+other_filter+brand_filter;
		
		document.location.href=final_url;
		
	})(jQuery)
}
