﻿function fun(result){if(result.length>0){str="<select id=ddlresort style='width:156px;' onchange=bindhotelsbyresort(this.value)>";str+="<option value=-1>Please select...</option>";for(var i=0;i<result.length;i++){str+= "<option value="+result[i].resortid+">"+result[i].RetrieveResort+"</option>";}str+="</select>";document.getElementById("divresort").innerHTML=str;}else{str="<select  id=ddlresort style='width:156px;>";str+= "<option value=-1 Unselectable=false>Please select...</option>";str+="</select>";document.getElementById ("divresort").innerHTML=str;}}function actualshowhotels(result){var str="";str="<select  id=ddlhotel style=width:156px;>";str+="<option value=-1>Please select...</option>";for(var i=0;i<result.length;i++){str+= "<option value="+result[i].hotelid+">"+result[i].RetrieveHotel+"</option>";}str+="</select>";document.getElementById ("divhotel").innerHTML=str}function bindhotelsbyresort(result){var str="";WebService.bindhotels(result,actualshowhotels);}function createallselectoptions(){var str1="";str1="<select  id=ddlresort>";str1+= "<option value=-1 Unselectable=true>Please select...</option>";str1+="</select>";document.getElementById ("divresort").innerHTML=str1;var str2="";str2="<select  id=ddlhotel style='width:156px;'>";str2+= "<option value=-1 Unselectable=false>Please select...</option>";str2+="</select>";document.getElementById ("divhotel").innerHTML=str2;}function binddivboard(board){var strdivboard="";if(board.length!=0){strdivboard="<select  id=ddlboard style='width:156px;'>";strdivboard+= "<option value=-1>Any</option>";for(var i=0;i<board.length;i++){strdivboard+= "<option value="+board[i].Brid+">"+board[i].BoardName+"</option>";}strdivboard+="</select>";document.getElementById("divboard").innerHTML=strdivboard;}}function masterfun(){if(document.getElementById("divresort") != null){WebService.bindresorts(fun);createallselectoptions();WebService.bindboard(binddivboard);}}
