
function xajax_refreshSubCats(catid){
	var req = new Request.HTML({method: 'get', url:'/ajax/advert/refreshSubCats.php',
		onSuccess: function(html) {
        //Clear the text currently inside the results div.
        $('xajax_subCats').set('text', '');
        //Inject the new DOM elements into the results div.
        $('xajax_subCats').adopt(html);
      },
      //Our request will most likely succeed, but just in case, we'll add an
      //onFailure method which will let the user know what happened.
      onFailure: function() {
            $('xajax_subCats').set('text', '');
      }
    });
    req.send('catId='+catid);
}

function xajax_selectSubCat(subcatid){
	var req = new Request.HTML({method: 'get', url:'/ajax/advert/selectSubCat.php',
		onSuccess: function(html) {
		 //Clear the text currently inside the results div.
        $('xajax_subCatsText').set('text', '');
        //Inject the new DOM elements into the results div.
        $('xajax_subCatsText').adopt(html);
      },
      onFailure: function() {
    	  
    }
    });
    req.send('id='+subcatid);
}