function searchByDistrict (district) {
	if (district) window.location = '/en/developers-'+district+'.html';
	return false;
}

$().ready(function(){
	
//form	
	$().ready(function() {  
		var $select = $(this);
		var $wrapper = $('.sw1 .select');
		
		$wrapper.children().hide();
		$wrapper.each(function(i){
			var $t = $(this);
			$t.append('<div class="selectOver"><span>'+$('select :selected', $t).text()+'</span><ul></ul><a href="#" title="" class="selection hide" onclick="return false;"></a></div>');

			var $ul = $('ul', $t);
			var $option = $('select', $t);
			$('option', $option).each(function(ii){
				$ul.append('<li'+(this.selected ? ' class="selected"' : '')+'><a href="#" index="'+ this.value +'" onclick="return false;">'+ this.text +'</a></li>');
			});
			$t.click(function(ii){
				if( $('.selection', $(this)).is('.hide') ){
					$('ul', $(this)).slideDown('slow');
					$('.selection', $(this)).removeClass('hide');				
					$('.selection', $(this)).css({visibility:'visible'});
				}
				else{
					$('ul', $(this)).slideUp('slow');
					$('.selection', $(this)).addClass('hide');
					$('.selection', $(this)).css({visibility:'hidden'});
				}
				$(this).siblings().each(function(iii){
					if( !$('.selection', $(this)).is('.hide') ){
						$('ul', $(this)).slideUp('slow');
						$('.selection', $(this)).addClass('hide');
						$('.selection', $(this)).css({visibility:'hidden'});
					}
				});
			});
			$('li', $t).click(function(e) {
					var $select = $('a', this);
					var elText = $select.text();
					var elValue = $select.get(0).rel;
					var elIndex = $select.attr('index');
					$("option[value='"+elIndex+"']", $t).attr('selected', true);
					$('li', $t).removeClass('selected');
					$(this).show('slow').addClass('selected');
					$('.selectOver span', $t).html(elText);
			});
			if( $('ul li:visible', $t).length>5)	{
				$('ul', $t).addClass('scroll');
			}
		});	
	});
	
});
