var searchmall = {
	'#mallsch' : function(el) {
		var self = this
		self.schval = false;
		el.onclick = function() {
			self.schval = this.checked;
		}
	},
	'#bsearch2' : function(el) {
		var self = this;
		smooth = new Fx.Slide('livesearchFold2', {duration: 1000});
		
		$('livesearchFold2').innerHTML = 'Results returned here..';

		doit2 = function(a,b,c,d){
			$('aloader2').innerHTML = '';
			$('livesearchFold2').innerHTML = c;
			smooth.toggle();
			$('btnasearch2').disabled = false;
		}
		el.onsubmit = function() {
			if($('doasearch2').value == ''){
				alert('Search Required'); 
				$('doasearch2').focus();
				return false;
			}
			var myschval = self.schval ? 'm' : 's';
			smooth.hide();
			//var myCall = new Ajax ('/server/response.php', {postBody: 'action=mall&find='+$('doasearch2').value+'&store='+$('strid').value+'&type='+myschval+'', update: $('livesearchFold2'), onComplete: doit2});
			//myCall.request();
			
			new Request.HTML({
			update: $('livesearchFold2'), 
			onComplete: doit2
		}).get('/server/response.php?action=mall&find='+$('doasearch2').value+'&store='+$('strid').value+'&type='+myschval+'');
			
			$('aloader2').innerHTML = '<br /><img src="/images/icons/handpoint.gif" alt="searching" title="searching" />';
			$('livesearchFold2').innerHTML = '';
			$('btnasearch2').disabled = true;
			return false;
		}
	}
};
Behaviour.register(searchmall);