function getCuisine(val){
	var extra = '';
	if(val != '')
		extra+='&val='+val;
	if($('selcuisine')){
			if($('selcuisine').value != '')
			extra+='&selectedcus='+$('selcuisine').value;
	}
	var url = SITE_URL+"index.php?file=c-getcuisine";
	var pars = extra;
	//alert(url+pars);
	var myHome = new Ajax.Updater('cuisinecomb', url,{method: 'get',parameters: pars});
}

function getProvience(val){
	var extra = '';
	if(val != '')
		extra+='&val='+val;
	var url = SITE_URL+"index.php?file=c-getprovience";
	var pars = extra;
	//alert(url+pars);
	//return false;
	var myAjax = new Ajax.Request(
			url,
			{
				method: 'get',
				parameters: pars,
				onComplete: provienceresponse
			});
	
}

function provienceresponse(originalRequest){
	if(originalRequest.responseText.indexOf('invalid') == -1)
	{
		var xmlDocument = originalRequest.responseXML; 
		var tot 		=  xmlDocument.getElementsByTagName('total').item(0).firstChild.data;
		var selectedCat	=	$("selstate").value;
		var control	=	$("vSearchState");
		
		control.options.length = 0;
		control.options[0] = new Option("---"+LBL_SELECT_STATE+"---");
		control.options[0].value = "";
		for(i=0,j=1; i< tot;i++)
		{	
			var statecode 		= xmlDocument.getElementsByTagName('statecode').item(i).firstChild.data;
			var state 			= xmlDocument.getElementsByTagName('vstate').item(i).firstChild.data;
			if(selectedCat == statecode)
			{
				control.options[j] = new Option(state);
				control.options[j].value = statecode;
				control.options[j].selected = true;
			}else
			{
				control.options[j] = new Option(state);
				control.options[j].value = statecode;
			}
			j++;
		}
	}
}
