var form_hotel = {};

form_hotel.load = function(obj, record_id, type, change_elm_id){
	var change_elm = document.getElementById(change_elm_id);

	if ( change_elm.hasChildNodes() )
	{
		while ( change_elm.childNodes.length >= 1 )
		{
			change_elm.removeChild( change_elm.firstChild );
		}
	}

	var ajax = new ajax_request();
	ajax.async = false;
	ajax.call_back = "";
	ajax.file_path = 'templates/hotlereservation.php';
	ajax.class_name = 'hotlereservation_template';
	ajax.method_name = 'x_render';
	ajax.header = "xml";
	ajax.register_argument("id", record_id);
	ajax.register_argument("type", type);
	xml_response = ajax.send();

	if(document.all){
		var xml_doc = new ActiveXObject('Microsoft.XMLDOM');
		xml_doc.loadXML(xml_response.responseText);
	}else{
		var xml_doc = xml_response.responseXML;
	}

	var root = xml_doc.getElementsByTagName("root")[0];
	elmnts = root.getElementsByTagName("element");
	var opt = null;
	for(var z = 0; z < elmnts.length; z++){
		opt = document.createElement("option");
		opt.value = elmnts[z].getAttribute("id");
		opt.innerHTML = elmnts[z].firstChild.data;

		change_elm.appendChild(opt);
	}
}

function hotel_info(obj, id , pageid){
	var value =document.getElementById(id).value
	var info = document.getElementById('hotel_info');
	var link = '?page_id='+pageid+'&record_id='+value;
	info.innerHTML = '<a href="javascript:void(0);" onclick="javascript:window.open(\''+link+'\', null, \'width=700,status=yes,toolbar=no,menubar=no,location=no, scrollbars=yes \')" ><img src="images/info.gif" title="hotel info" /></a>';
}

