function arata_lista_hoteluri()
{
	el_ajax_box=locate_el('ajax_box');
	el_over_ajax_box=locate_el('over_ajax_box');
	
	el_ajax_box.style.display='block';
	el_over_ajax_box.style.display='block';
	
	ellocatii=locate_el('locatii_hidden');
	elhoteluri=locate_el('hoteluri_hidden');
	
	var XHT=GetXmlHttpObjectdum();
	if (XHT==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	
	var url="actions/reqbox_hoteluri.php";
	url=url+"?locatii="+ellocatii.value;
	url=url+"&hoteluri="+elhoteluri.value;
	url=url+"&sid="+Math.random();
	
	XHT.onreadystatechange=function() {
		arata_lista_hoteluri_fill(XHT);
	}
	
	
	XHT.open("GET",url,true);
	XHT.send(null);
	
	
}

function arata_lista_hoteluri_fill(XHT) 
{ 
if (XHT.readyState!=4)
{
	
	showajaxloaderdum('over_ajax_box');
}
if (XHT.readyState==4)
{
	response=XHT.responseText;
	elbox=locate_el('over_ajax_box');
	elbox.innerHTML=response;
}
}


function ascunde_lista_hoteluri()
{
	el_ajax_box=locate_el('ajax_box');
	el_over_ajax_box=locate_el('over_ajax_box');
	
	el_ajax_box.style.display='none';
	el_over_ajax_box.style.display='none';
	
	load_hoteluri_now_added();
}



function load_hoteluri_now_added()
{
	elhoteluri=locate_el('hoteluri_hidden');

	var XHT=GetXmlHttpObjectdum();
	if (XHT==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	 
	var url="actions/load_hoteluri_now_added.php";
	url=url+"?hoteluri="+elhoteluri.value;
	url=url+"&sid="+Math.random();
	
	XHT.onreadystatechange=function() {
		show_hoteluri_now_added(XHT);
	}
	
	
	XHT.open("GET",url,true);
	XHT.send(null);	
}

function show_hoteluri_now_added(XHT) 
{ 
if (XHT.readyState!=4)
{
	showajaxloaderdum('hoteluri_now_added');
}
if (XHT.readyState==4)
{
	response=XHT.responseText;
	
	elbox=locate_el('hoteluri_now_added');
	elbox.innerHTML=response;
}
}


function salveaza_lista_hoteluri()
{
	elhoteluri=locate_el('hoteluri_hidden');
	var el_checkboxes_hotel=locate_el('checkboxes_hotel');
	var el_checkboxes_hotel_cam=locate_el('checkboxes_hotel_cam');
	
	var ids_ch=el_checkboxes_hotel.value.split('.');
	var ids_ch_cam=el_checkboxes_hotel_cam.value.split('.');
	
	var hval="";
	var curent;
	var prima=true;
	for(i=0; i<ids_ch.length; i++)
		{
			curent=locate_el("add_hotel_"+ids_ch[i].toString());
			if(curent)
				{
					if(curent.checked)
						{
							if(prima)
								{
									prima=false;
								}
							else
								{
									hval=hval+".";
								}
							hval=hval+ids_ch[i].toString();
							var curent_cam;
							for(j=0; j<ids_ch_cam.length; j++)
								{
									curent_cam=locate_el("add_camera_"+ids_ch[i].toString()+"_"+ids_ch_cam[j].toString());
									if(curent_cam.checked)
										{
											hval=hval+"-"+ids_ch_cam[j].toString();
										}
								}
						}
				}
		}
	elhoteluri.value=hval;
	ascunde_lista_hoteluri();
}

function arata_camere_hotel(id)
{
	var el_chbox=locate_el('add_hotel_'+id);
	var el_camere_hot=locate_el('camere_hot_'+id);
	
	if(el_chbox.checked)
		{
			el_camere_hot.style.display="table-row";
		}
	else
		{
			el_camere_hot.style.display="none";
		}
}