$(document).ready(function(){

	// find global
	$('#f_submit').click(function(){

		var url = '';

		var brend 				= $("#f_brend option:selected").val();
		var gender 				= $("#f_gender option:selected").val();
		var mechanism 			= $("#f_mechanism option:selected").val();
		var countryof 			= $("#f_countryof option:selected").val();
		var type 				= $("#f_type option:selected").val();
		var bracelet 			= $("#f_bracelet option:selected").val();
		var f_case 				= $("#f_case option:selected").val();
		var colorindices 		= $("#f_colorindices option:selected").val();
		var production 			= $("#f_production option:selected").val();
		var appearancetime 		= $("#f_appearancetime option:selected").val();
		var formbody 			= $("#f_formbody option:selected").val();
		var glass 				= $("#f_glass option:selected").val();
		var clasp 				= $("#f_clasp option:selected").val();

		if (brend != 0) 		url += '+brend=' + brend;
		if (gender != 0) 		url += '+gender=' + gender;
		if (mechanism != 0) 	url += '+mechanism=' + mechanism;
		if (countryof != 0) 	url += '+countryof=' + countryof;
		if (type != 0) 			url += '+type=' + type;
		if (bracelet != 0) 		url += '+bracelet=' + bracelet;
		if (f_case != 0) 		url += '+case=' + f_case;
		if (colorindices != 0) 	url += '+colorindices=' + colorindices;
		if (production != 0) 	url += '+production=' + production;
		if (appearancetime != 0)url += '+appearancetime=' + appearancetime;
		if (formbody != 0) 		url += '+formbody=' + formbody;
		if (glass != 0) 		url += '+glass=' + glass;
		if (clasp != 0) 		url += '+clasp=' + clasp;

		// checkBox
		if ( $('input[name=f_watertight]').is(':checked') ){ url += '+watertight=y' }
		if ( $('input[name=f_impactresistant]').is(':checked') ){ url += '+impactresistant=y' }
		if ( $('input[name=f_alarmclock]').is(':checked') ){ url += '+alarmclock=y' }
		if ( $('input[name=f_nightlight]').is(':checked') ){ url += '+nightlight=y' }
		if ( $('input[name=f_stones]').is(':checked') ){ url += '+stones=y' }

		url = url.replace(/^\+/,"");

		if (url != '') {
			window.location = '/filter/' + url + '/';
		}else{
			window.location = '/filter/';
		}

		return false;
	});

});
