var indicator='<p align="center"><IMG src="'+host+'style/indicator.gif" width="32" height="32" alt="" border="0"/></p>';
var indicator_small='<IMG src="'+host+'style/indicator.gif" width="10" height="10" alt="" border="0"/>';

function markAsWaiting(target) { $(target).empty(); $(target).set('html',indicator); }
function markAsWaitingSmall(target) { $(target).empty(); $(target).set('html',indicator_small); }
function AjaxRequest(result, url, pars, clear) { var req = new Request.HTML({url:url, onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript) { if (result>"") { if (clear==true) { $(result).empty(); }  $(result).set('html', responseHTML);} }, onFailure: function() { if (result>"") { $(result).set('text', 'The request failed.');} } }); req.send(pars); }
function markAsFree(target) { $(target).empty(); $(target).set('html',indicator_ok); }


function changebrand(redirect) {  		var layer="catalog_menu";
  		markAsWaiting(layer);
  		var url=host+"modules/ajax.php";
  		var brand=$("brand").get('value')
  		var pars='action=changeBrand&brand='+brand;
  		var clear=false;
  		AjaxRequest("", url, pars, clear);;
  		window.location=redirect;
}

