/* Arama kutusu 2015 - 01 - 10 : Static search 2014- 04 - 22 Turkce disindaki dil problemi duzeltildi 2014 - 01 - 27 : Post url düzeltildi 2013 - 05 - 18 2013 - 08 - 14 : aynı sayfada iki tane kutucuk hataya yol açıyor yozcaliskan */ if(typeof(Sys)!='undefined'){Type.registerNamespace("WIY");Type.registerNamespace("WIY.Arama");WIY.Arama=function(element){WIY.Arama.initializeBase(this,[element]);this._radCombo=null;this._invoker=null;this._emptyMessage='Aranacak metin';this._isInvoking=false;this._comboTxt=null;this._inputClass=null;this._suggestEnabled=true;this._Anah=0;this._siteAnah=0;this._dilAnah=0;this._sablonUrl='';this._prm=Sys.WebForms.PageRequestManager.getInstance();if(this._prm){this._prm.add_beginRequest(Function.createDelegate(this,function(s1,ea){if(this._prm._postBackSettings.async&&this._prm._postBackSettings.asyncTarget.toLowerCase().indexOf('ucaramasonuclari')>-1){var adaData=this._getAdaHiddensValue();var oBody=ea.get_request().get_body();if(!oBody.endsWith("&")) oBody+='&';oBody+=adaData;ea.get_request().set_body(oBody);}}));}} WIY.Arama._gotoSearchPage=WIY.Arama.make=function(tts,anah,sitea,dila,sablon){if(typeof(wiy_page_data)!='undefined'){var createHidden=function(n,v){var set_att=function(x,n,v){x.setAttribute(n,v);};var inp=document.createElement('input');set_att(inp,'type','hidden');set_att(inp,'id',n);set_att(inp,'name',n);set_att(inp,'value',v);return inp;};tts=tts.replace(/\s{2,}/gi,' ');if(jQuery&&jQuery.trim) tts=jQuery.trim(tts);if(typeof(sitea)=='undefined')sitea=sitea!=null?sitea:wiy_page_data.SiteAnah;if(typeof(dila)=='undefined')dila=dila!=null?dila:wiy_page_data.DilAnah;if(typeof(sablon)=='undefined')sablon=sablon!=null?sablon:'';if(typeof(anah)=='undefined')anah=anah!=null?anah:0;var dummyForm=document.createElement('form');document.body.appendChild(dummyForm);var func_add_att=function(x,n,v){x.setAttribute(n,v);};var post_url=wiy_page_data.AppUrl;post_url+='/arama?_Dil='+dila;func_add_att(dummyForm,'action',post_url);func_add_att(dummyForm,'id','__form'+(window.document.forms.length+1));func_add_att(dummyForm,'method','post');dummyForm.appendChild(createHidden('_ADA_ARAMA',true));dummyForm.appendChild(createHidden('_SITEANAH',sitea));dummyForm.appendChild(createHidden('_DILANAH',dila));dummyForm.appendChild(createHidden('_ANAH',anah));dummyForm.appendChild(createHidden('_SABLONURL',sablon));dummyForm.appendChild(createHidden('_ARANACAK',tts));dummyForm.appendChild(createHidden('__EVENTTARGET',''));dummyForm.appendChild(createHidden('__EVENTARGUMENT',''));dummyForm.submit();}};WIY.Arama.prototype.createHidden=function(n,v){var set_att=function(x,n,v){x.setAttribute(n,v);};var inp=document.createElement('input');set_att(inp,'type','hidden');set_att(inp,'id',n);set_att(inp,'name',n);set_att(inp,'value',v);return inp;};WIY.Arama.prototype.initialize=function(){WIY.Arama.callBaseMethod(this,'initialize');if(this._radCombo!=null){this._radCombo.set_emptyMessage(this._emptyMessage);this._radCombo.set_closeDropDownOnBlur(true);this._comboTxt=this._radCombo.get_inputDomElement();if(this._comboTxt!=null) $addHandler(this._comboTxt,'keyup',Function.createDelegate(this,this._HandleTextChange),true);if(this._invoker!=null){if(typeof(this._invoker)=='string') this._invoker=$get(this._invoker);} if(this._invoker!=null){$addHandler(this._invoker,'click',Function.createDelegate(this,this._HandleInvokerClick));} if(this._inputClass!=null){this.get_radCombo().get_inputDomElement().className=this._inputClass;}}} WIY.Arama.prototype.dispose=function(){WIY.Arama.callBaseMethod(this,'dispose');} WIY.Arama.prototype._appendAdaHiddens=function(form){form.appendChild(this.createHidden('_ADA_ARAMA',true));form.appendChild(this.createHidden('_SITEANAH',this.get_siteAnah()));form.appendChild(this.createHidden('_DILANAH',this.get_dilAnah()));form.appendChild(this.createHidden('_ANAH',this.get_Anah()));form.appendChild(this.createHidden('_SABLONURL',this.get_sablonUrl()));form.appendChild(this.createHidden('_ARANACAK',this.get_radCombo().get_text()));} WIY.Arama.prototype._getAdaHiddensValue=function(){var nf=document.createElement('p');this._appendAdaHiddens(nf);var formBody=new Sys.StringBuilder();for(i=0;i0){this._radCombo.get_items().clear();Array.forEach(data.ListResult,function(k){var item=new Telerik.Web.UI.RadComboBoxItem();item.set_text(k);item.set_value(k);this._radCombo.get_items().add(item);},this);if(!this._radCombo.get_dropDownVisible()) this._radCombo.showDropDown();} else this._radCombo.hideDropDown();}} catch(ex){this._radCombo.hideDropDown();}}}} WIY.Arama.prototype._HandleTextChange=function(a,b){var txt=this.get_radCombo().get_text();if(txt&&txt.length>2){var cc=a.keyCode?a.keyCode:a.charCode;if(cc==13) this._gotoSearchPage(txt);else this._InvokeSuggests(txt);} else{this._radCombo.hideDropDown();}} WIY.Arama.prototype._HandleInvokerClick=function(a,b){if(a.stopPropagation) a.stopPropagation();if(a.preventDefault) a.preventDefault();var txt=this.get_radCombo().get_text();if(txt.length>2) this._gotoSearchPage(txt);} WIY.Arama.prototype.get_radCombo=function(){return this._radCombo;} WIY.Arama.prototype.set_radCombo=function(rcb){this._radCombo=rcb;} WIY.Arama.prototype.get_invoker=function(){return this._invoker;} WIY.Arama.prototype.set_invoker=function(inv){this._invoker=inv;} WIY.Arama.prototype.get_inputClass=function(){return this._inputClass;} WIY.Arama.prototype.set_inputClass=function(c){this._inputClass=c;} WIY.Arama.prototype.set_emptyMessage=function(msg){this._emptyMessage=msg;} WIY.Arama.prototype.get_emptyMessage=function(){return this._emptyMessage;} WIY.Arama.prototype.set_suggestEnabled=function(v){this._suggestEnabled=v;} WIY.Arama.prototype.get_suggestEnabled=function(){return this._suggestEnabled;} WIY.Arama.prototype.set_Anah=function(v){this._Anah=v;} WIY.Arama.prototype.get_Anah=function(){return this._Anah;} WIY.Arama.prototype.set_dilAnah=function(v){this._dilAnah=v;} WIY.Arama.prototype.get_dilAnah=function(){return this._dilAnah;} WIY.Arama.prototype.set_siteAnah=function(v){this._siteAnah=v;} WIY.Arama.prototype.get_siteAnah=function(){return this._siteAnah;} WIY.Arama.prototype.set_sablonUrl=function(v){this._sablonUrl=v;} WIY.Arama.prototype.get_sablonUrl=function(){return this._sablonUrl;} WIY.Arama.fixAsyncScroll=function(id){if(jQuery){jQuery("html,body").animate({scrollTop:0},"slow",function(){jQuery('#'+id).scrollTop(2);});}} WIY.Arama.registerClass("WIY.Arama",Sys.UI.Control);Sys.Application.notifyScriptLoaded();}