var GdivName;function CreateAreaDropDown(divName){try{GdivName=divName;if(CityStuation){AreaWebService.GetCity(GetCityN,GeneralError);}else{if(BoroughStuation){AreaWebService.GetBor(1,GetBorN,GeneralError);}else{AreaWebService.GetArea(1,GetAreaNN,GeneralError);}}}catch(err){ErrorStuation("CreateAreaDropDown",err.description);}};function CreateAreaDropDownWV(divName,AreaId){try{GdivName=divName;AreaWebService.GetIdsByAreaId(AreaId,WV,GeneralError,AreaId);}catch(err){ErrorStuation("CreateAreaDropDownWV",err.description);}};var OCityId=0;var OBoroughId=0;var OAreaId=0;var WVStuaionC=false;var WVStuaionB=false;var WVStuaionA=false;function WV(result,AreaId){try{OCityId=result.CityId;OBoroughId=result.BorId;OAreaId=AreaId;if(CityStuation){WVStuaionC=true;WVStuaionB=true;WVStuaionA=true;AreaWebService.GetCity(GetCityN,GeneralError);}else{if(BoroughStuation){WVStuaionB=true;WVStuaionA=true;AreaWebService.GetBor(OCityId,GetBorN,GeneralError);}else{WVStuaionA=true;AreaWebService.GetArea(OBoroughId,GetAreaNN,GeneralError);}}}catch(err){ErrorStuation("WV",err.description);}};function GetCityN(result){try{var ADDHtml=new Sys.StringBuilder();var resultL=result.length;ADDHtml.append('<table>');ADDHtml.append('<tr>');ADDHtml.append('<td>');ADDHtml.append('<select id="CitySelect" onchange="GetBorough()">');ADDHtml.append('<option value="0">'+CityChoose+'</option>');for(var i=0;i<resultL;i++){ADDHtml.append('<option value="'+result[i].CityId+'">'+result[i].CityName+'</option>');}ADDHtml.append('</select>');ADDHtml.append('<div id="CitySelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('<td>');ADDHtml.append('<select id="BoroughSelect" disabled="disabled" onchange="GetArea()">');ADDHtml.append('<option selected="selected"  value="0">'+BoroughChoose+'</option>');ADDHtml.append('</select>');ADDHtml.append('<div id="BoroughSelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('<td>');ADDHtml.append('<select id="AreaSelectD" disabled="disabled">');ADDHtml.append('<option value="0">'+AreaChoose+'</option>');ADDHtml.append('</select>');ADDHtml.append('<div id="AreaSelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('</tr>');ADDHtml.append('</table>');document.getElementById(GdivName).innerHTML=ADDHtml.toString();if(WVStuaionC==true){AddCity(result);WVStuaionC=false;}}catch(err){ErrorStuation("GetCityN",err.description);}};function GetBorN(result){try{var ADDHtml=new Sys.StringBuilder();var resultL=result.length;ADDHtml.append('<table>');ADDHtml.append('<tr>');ADDHtml.append('<td>');ADDHtml.append('<select id="CitySelect"  disabled="disabled" >');ADDHtml.append('<option   value="1">İstanbul</option>');ADDHtml.append('</select>');ADDHtml.append('<div id="CitySelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('<td>');ADDHtml.append('<select id="BoroughSelect" onchange="GetArea()" onclick="OnBorClick()" >');ADDHtml.append('<option  selected="selected"  value="0">'+BoroughChoose+'</option>');for(var i=0;i<resultL;i++){ADDHtml.append('<option value="'+result[i].BorId+'">'+result[i].BorName+'</option>');}ADDHtml.append('</select>');ADDHtml.append('<div id="BoroughSelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('<td>');ADDHtml.append('<select id="AreaSelectD" disabled="disabled">');ADDHtml.append('<option  value="0">'+AreaChoose+'</option>');ADDHtml.append('</select>');ADDHtml.append('<div id="AreaSelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('</tr>');ADDHtml.append('</table>');document.getElementById(GdivName).innerHTML=ADDHtml.toString();if(WVStuaionB==true){AddBorough(result);WVStuaionB=false;}}catch(err){ErrorStuation("GetBorN",err.description);}};function GetAreaNN(result){try{var ADDHtml=new Sys.StringBuilder();var resultL=result.length;ADDHtml.append('<table>');ADDHtml.append('<tr>');ADDHtml.append('<td>');ADDHtml.append('<select id="CitySelect" disabled="disabled" >');ADDHtml.append('<option value="1">İstanbul</option>');ADDHtml.append('</select>');ADDHtml.append('<div id="CitySelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('<td>');ADDHtml.append('<select id="BoroughSelect"  disabled="disabled" >');ADDHtml.append('<option value="1">Kadiköy</option>');ADDHtml.append('</select>');ADDHtml.append('<div id="BoroughSelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('<td>');ADDHtml.append('<select id="AreaSelectD">');ADDHtml.append('<option  value="0">'+AreaChoose+'</option>');for(var i=0;i<resultL;i++){ADDHtml.append('<option value="'+result[i].AreaId+'">'+result[i].AreaName+'</option>');}ADDHtml.append('</select>');ADDHtml.append('<div id="AreaSelectDiv"></div>');ADDHtml.append('</td>');ADDHtml.append('</tr>');ADDHtml.append('</table>');document.getElementById(GdivName).innerHTML=ADDHtml.toString();if(WVStuaionA==true){AddArea(result);WVStuaionA=false;}}catch(err){ErrorStuation("GetAreaNN",err.description);}};function AddCity(result){try{var resultL=result.length;var p=document.getElementById("CitySelect");RemoveMember("CitySelect");var t=document.createElement('option');t.value=0;t.text=CityChoose;p.add(t);for(var i=0;i<resultL;i++){var y=document.createElement('option');y.value=result[i].CityId;y.text=result[i].CityName;if(result[i].CityId==OCityId)y.selected=true;p.add(y);}p.disabled=false;if(WVStuaionB==true){WVStuaionB=false;AreaWebService.GetBor(OCityId,AddBorough,GeneralError);}}catch(err){ErrorStuation("AddCity",err.description);}};function AddBorough(result){try{var resultL=result.length;var p=document.getElementById("BoroughSelect");RemoveMember("BoroughSelect");var t=document.createElement('option');t.value=0;t.text=BoroughChoose;p.options.add(t);for(var i=0;i<resultL;i++){var y=document.createElement('option');y.value=result[i].BorId;y.text=result[i].BorName;if(result[i].BorId==OBoroughId)y.selected=true;p.options.add(y);}p.disabled=false;if(WVStuaionA==true){WVStuaionAs=false;AreaWebService.GetArea(OBoroughId,AddArea,GeneralError);}}catch(err){ErrorStuation("AddBorough",err.description);}};function AddArea(result){try{var resultL=result.length;var p=document.getElementById("AreaSelectD");RemoveMember("AreaSelectD");var t=document.createElement('option');t.value=0;t.text=AreaChoose;p.options.add(t);for(var i=0;i<resultL;i++){var y=document.createElement('option');y.value=result[i].AreaId;y.text=result[i].AreaName;if(result[i].AreaId==OAreaId)y.selected=true;p.options.add(y);}p.disabled=false;}catch(err){ErrorStuation("AddArea",err.description);}};function GetBorough(){try{var CityId=document.getElementById("CitySelect").value;if(CityId!=0)AreaWebService.GetBor(CityId,GetBoroughN,GeneralError);else{var x=document.getElementById("BoroughSelect");RemoveMember("BoroughSelect");var z=document.createElement('option');z.value==0;z.text=BoroughChoose;z.selected=true;x.options.add(z);document.getElementById("BoroughSelect").disabled=true;var p=document.getElementById("AreaSelectD");RemoveMember("AreaSelectD");var t=document.createElement('option');t.value=0;t.text=AreaChoose;t.selected=true;p.options.add(t);document.getElementById("AreaSelectD").disabled=true;}}catch(err){ErrorStuation("GetBorough",err.description);}};function GetBoroughN(result){try{var resultL=result.length;var x=document.getElementById("BoroughSelect");RemoveMember("BoroughSelect");var z=document.createElement('option');z.value==0;z.text=BoroughChoose;z.selected=true;x.options.add(z);for(var i=0;i<resultL;i++){var y=document.createElement('option');y.value=result[i].BorId;y.text=result[i].BorName;x.options.add(y);}document.getElementById("BoroughSelect").disabled=false;}catch(err){ErrorStuation("GetBoroughN",err.description);}};function GetArea(){try{var BoroughId=document.getElementById("BoroughSelect").value;if(BoroughId!=0)AreaWebService.GetArea(BoroughId,GetAreaN,GeneralError);else{var x=document.getElementById("AreaSelectD");RemoveMember("AreaSelectD");var z=document.createElement('option');z.value=0;z.text=AreaChoose;z.selected=true;x.options.add(z);document.getElementById("AreaSelectD").disabled=true;}EnterWebService.SiteStatistic2("GetAreaEnt;"+BoroughId,StatConf,GeneralError);}catch(err){ErrorStuation("GetArea",err.description);}};function GetAreaN(result){try{var resultL=result.length;var x=document.getElementById("AreaSelectD");RemoveMember("AreaSelectD");var z=document.createElement('option');z.value=0;z.text=AreaChoose;z.selected=true;x.options.add(z);for(var i=0;i<resultL;i++){var y=document.createElement('option');y.value=result[i].AreaId;y.text=result[i].AreaName;x.options.add(y);}document.getElementById("AreaSelectD").disabled=false;}catch(err){ErrorStuation("",err.description);}};function AreaDContol(){try{var stuation=true;if(document.getElementById("CitySelect").value==0){document.getElementById("CitySelect").style.color="#FF6600";document.getElementById("CitySelect").style.fontWeight="bold";stuation=false;}else{document.getElementById("CitySelect").style.color="#000000";document.getElementById("CitySelect").style.fontWeight="normal";}if(document.getElementById("BoroughSelect").value==0){document.getElementById("BoroughSelect").style.color="#FF6600";document.getElementById("BoroughSelect").style.fontWeight="bold";stuation=false;}else{document.getElementById("BoroughSelect").style.color="#000000";document.getElementById("BoroughSelect").style.fontWeight="normal";}if(document.getElementById("AreaSelectD").value==0){document.getElementById("AreaSelectD").style.color="#FF6600";document.getElementById("AreaSelectD").style.fontWeight="bold";stuation=false;}else{document.getElementById("AreaSelectD").style.color="#000000";document.getElementById("AreaSelectD").style.fontWeight="normal";}return stuation;}catch(err){ErrorStuation("AreaDContol",err.description);}};function RemoveMember(SelectO){try{_Option=document.getElementById(SelectO);Size=_Option.options.length;if(Size>0){for(i=Size;i>-1;i--){_Option.options[i]=null;}}}catch(err){ErrorStuation("RemoveMember",err.description);}};function OnBorClick(){EnterWebService.SiteStatistic2("OnBorClick",StatConf,GeneralError);};if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
