PageSourceSearch

https://www.teb.com.tr/Scripts/ascMustScripts.js

js teb.com.tr collected 2026-10-01 11:26:04 UTC 14,034 bytes, 429 lines download raw bytes

1// JScript File
2function yorumEkle(yrmId, intClickValue, anaNesne, indexno)
3{  
4    anaNesne = anaNesne + (indexno <= 9 ? '0' : '') + indexno;
5    
6    prm = "yrm=" + yrmId + "&value=" +intClickValue;
7
8    $.post('/yorum/ajxYorumDeg.aspx', prm, function(data) {
9        if (fieldDondur(data, 'ERR_MESSAGE') == "") {
10            $("#" + anaNesne + '_btnYorumEvetHayir').css("display", 'none');
11            $("#" + anaNesne + '_lbfYorumTesekkur').css("display", '');
12            // seçilen kayıdı vir arttıralım
13            if (intClickValue == "1")
14                $("#" + anaNesne + '_lblYorumEvet').text(parseInt($("#" + anaNesne + '_lblYorumEvet').text()) + 1);
15            else
16                $("#" + anaNesne + '_lblYorumHayir').text(parseInt($("#" + anaNesne + '_lblYorumHayir').text()) + 1);
17        }
18    });
19    
20     //else // hata mesajı gelebilir.
21}
22	
23//E-mail Kontrolü
24function checkEmail(myForm) {
25    var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
26    if (regex.test(myForm)) {
27        return (true)
28    }
29    alert(strGNL_MAILKONTROL)
30    return (false)
31}
32
33function returnRadioIndex(rdButton)
34{
35	retIndex = -1;
36	if (rdButton != null)
37	for (i=0; i < rdButton.length; i++)
38	{
39		if (rdButton[i].checked)
40			retIndex = i;
41	}
42
43	return retIndex;
44}
45function returnRadioListIndex(rdButton)
46{
47 var ret=null; 
48 var aControls = document.getElementsByTagName("input"); 
49 if (aControls) 
50 {       
51   for (var i=0; i< aControls.length ; i++) 
52   { 
53         if (aControls[i].id.lastIndexOf(rdButton.id) !=-1)
54         { 
55            if (aControls[i].checked)
56            {
57                ret =aControls[i]; 
58                break; 
59            }
60         } 
61    } 
62  } 
63 return ret; 
64} 
65/*Session Doldu*/
66var elapsedTime = 0;
67// set to the Session.Timeout value to notify users
68// one minute after their Session times out.
69var maxTime = (maxSessionTime - 1) * 60;
70
71var oneSecond;
72if ((document.location.pathname.indexOf("arama") == -1) && (document.location.pathname.substring(1,document.location.pathname.length).indexOf("/") != -1) && (document.location.pathname.indexOf("sitereklam.aspx") != -1))
73	oneSecond = window.setTimeout("timeoutCheck();",1000);
74function timeoutCheck() {
75
76    elapsedTime = elapsedTime + 1;
77    if (elapsedTime > maxTime) {
78        window.location = "/login.aspx?ses=0";
79    }
80    else {
81        oneSecond = window.setTimeout("timeoutCheck();",1000);
82    }
83}
84
85
86//Hata Mesajı
87var errArray=new Array();
88function alertErr(errMsg)
89{
90    var errKayit = '';var errMesaj = '';var errToplam = '';
91    for (iCnt=0; iCnt < errMsg.length; iCnt++)
92    {
93        errKayit = errMsg[iCnt].substring(0,errMsg[iCnt].indexOf('|'));
94        errMesaj = errMsg[iCnt].substring(errMsg[iCnt].indexOf('|')+1,errMsg[iCnt].length);
95        if (errMesaj.substring(0,4) == ' str' || errMesaj.substring(0,3) == 'str')
96        {
97            errMesaj = eval(errMesaj);
98        }
99        errToplam = errToplam + "Kayit = " + errKayit + "; MSG = " + errMesaj + "\n";
100    }
101        alert(errToplam);
102}
103//Hata Mesajı Bitti
104
105
106//Listelerdeki silme onay islemleri kayıt yoksa yada kayıt seçilmemisse uyari vercek 
107function checkForm(type)
108{			
109	elm=theForm.elements;
110	var i =0;
111	var count=0;
112	while (i<elm.length)
113	{
114	
115		if((elm[i].type=="checkbox") && (elm[i].id.indexOf("chk_sec")>-1))
116		{
117			if(elm[i].checked==true)
118			{
119				count++;		
120			}				
121		}
122
123		if (count>0)
124		{
125			if (type=='sil')
126				return confirm(strGNL_SILONAY);
127			//else if (type=='onay')
128			//	return true;
129			else //if (type=='diger')
130				return true;
131		}
132		i++;
133	}
134	alert(strGNL_SECONAY);
135	return false;
136}
137
138function formAction(type,value,kod)
139{
140    if (kod=="")
141    {
142        //if (checkForm(type))
143        {
144            elm = document.aspnetForm.elements;    
145            for (var k=0;k<elm.length;k++)
146	        {
147		        if (elm[k].type=="checkbox" && elm[k].id.indexOf("chk_sec")>-1)
148		        {
149			        if (elm[k].checked == true )
150			        {
151			            chk_str = elm[k].id;
152			            kod =  chk_str.substring(7,chk_str.length)+ "," +kod;
153			        }
154		        }
155	        }
156		    				
157	        kod = kod.substring(kod.length - 1 ,0);
158        }
159//        else
160//        {
161//            // hiç bir seçim yapılmamış ise
162//            return false;
163//        }
164    }
165    window.location.href = window.location.pathname + "?" + (getUrlVars()["lang"] != "" ? "lang=" + getUrlVars()["lang"] + "&" : "") + "KODLAR=" + kod + "&ACT=" + type + "&VALUE=" + value;
166    
167    return false;
168}
169// eğer listelerden popup açarken; checkboxın valuesi ni de aktarmak istiyorsak
170function kiyasla(urn_kodlar, strUrl) {
171//    var kiyasUrl = "<%=csMLNGFunc.createLink("/urun_kiyaslama.aspx?kat="+ Request["kat"] +"strUrl.substring(strUrl.length - 1 ,0)")%>";
172//    window.location.href = kiyasUrl;
173//	elm=document.aspnetForm.elements;
174//	var checkValueList="";
175//	var i =0;
176//	while (i<elm.length)
177//	{	
178//		if((elm[i].type=="checkbox") && (elm[i].id.indexOf("chkOZS_KOD")>-1))
179//		{
180//			if(elm[i].checked==true)
181//                checkValueList = elm[i].value + "," + checkValueList;	
182//		}
183//		i++;
184    //	}
185//    if (urn_kodlar != "")
186//        window.location.href = strUrl.replace("$kodlar$", '&uKods='+ urn_kodlar.substring(urn_kodlar.length - 1 ,0));
187//    else
188//        alert($("span[id$='lbfKIYASLAMA_VLD']").html());
189//	return false;         
190}
191function SingleSelect(chkName,current)
192{
193    var oldCheckhed = current.checked;
194    elm=document.aspnetForm.elements;
195    for(i = 0; i < elm.length; i++) 
196    {
197        if (elm[i].type == 'checkbox')
198        if (elm[i].name.indexOf(chkName) > -1)
199            elm[i].checked = false;
200    }
201    current.checked = oldCheckhed;
202}
203function SelectAllListboxItem(LeftList)
204{
205
206	LeftList = eval(LeftList);
207	for (var i=0; i < LeftList.length; i++) 
208	{	
209		LeftList.options[LeftList.selectedIndex].selected =true;
210	}
211}
212
213
214
215var result = '';
216function getHTTPObject() {
217    var request = false;
218    if (window.XMLHttpRequest) { // Mozilla, Safari,...
219        request = new XMLHttpRequest();
220        if (request.overrideMimeType) {
221            request.overrideMimeType('text/html');
222        }
223    } else if (window.ActiveXObject) { // IE
224        try {
225            request = new ActiveXObject("Msxml2.XMLHTTP");
226        } catch (e) {
227            try {
228                request = new ActiveXObject("Microsoft.XMLHTTP");
229            } catch (e) { }
230        }
231    }
232    return request;
233}
234
235var result = '';
236function makePOSTRequest(url, parameters) {
237    errMessage = '';
238    http_request = getHTTPObject();
239    if (!http_request) {
240        errMessage = 'Hata : XMLHTTP instance oluşturulamıyor!';
241    }
242    http_request.open('POST', url, false);
243    http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
244    http_request.setRequestHeader("Content-length", parameters.length);
245    http_request.setRequestHeader("Connection", "close");
246    http_request.send(parameters);
247
248    if (http_request.readyState == 4) {
249        if (http_request.status == 200) {
250            errMessage = '';
251            result = http_request.responseText;
252            //eval(result);  // Gönderilen mesajların getLines arrayinin içine doldurulması...
253        } else {
254            errMessage = 'Hata : Internet erişim problemi!';
255        }
256    }
257    if (errMessage != '')
258        result = errMessage
259
260    return result;
261}
262function makePOSTRequestLoading(url, parameters, objId) {
263    errMessage = '';
264    http_request = getHTTPObject();
265    if (!http_request) {
266        errMessage = 'Hata : XMLHTTP instance oluşturulamıyor!';
267    }
268    http_request.onreadystatechange = function() { alertContents(objId) };
269    http_request.open('POST', url, true);
270    http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
271    http_request.setRequestHeader("Content-length", parameters.length);
272    http_request.setRequestHeader("Connection", "close");
273    http_request.send(parameters);
274}
275function alertContents(objId) {
276    var dC = document.getElementById(objId);
277    if (http_request.readyState == 4) {
278        if (http_request.status == 200)
279            dC.innerHTML = http_request.responseText;
280        else
281            alert('Hata : Internet erişim problemi!');
282    }
283    else if (http_request.readyState == 1) {
284        dC.innerHTML = (document.getElementById("ctl00_divLoading") != null ? document.getElementById("ctl00_divLoading").innerHTML : "<img src='/images/ajaxtabs/loading.gif' /> Yükleniyor...");
285    }
286}
287// Ajax bilgisindeki Field ları döndürme
288function fieldDondur(text, field) {
289
290    if (text.indexOf('<' + field + '>') == -1 || text.indexOf('</' + field + '>') == -1)
291        return "";
292    
293    retStr = text.substring(text.indexOf('<' + field + '>') + field.length + 2, text.indexOf('</' + field + '>'));
294    return retStr;
295}
296
297function sonucGoster()
298{
299}
300
301function printLayout(title1,body1)
302{
303  
304    var yazici_sayfasi=window.open("about:blank","yazici","heigth=600,width=700,scrollbars=yes");
305    with(yazici_sayfasi.document)
306    {
307        write("<html><head><title>" + document.getElementById(title1).innerHTML + "</title><STYLE media=\"print\">.noprint {visibility:hidden;position:absolute}</STYLE>");
308        
309        // style ları popup'a taşımak için 
310        if(document.getElementsByTagName) 
311            var Lt = document.getElementsByTagName('link');
312        else if( document.styleSheets && document.all ) 
313            var Lt = document.all.tags('LINK');
314        for(i=0; (cacheobj=Lt[i]); i++) 
315            write("<link href=\""+ cacheobj.href+ "\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\"/>");
316        
317        write("</head><body>\n");
318        write("<div class=\"noprint yazdirDiv\">");
319        write(" <div class=\"yazdirDiv_yazdir\">");
320        write("  <a href=\"javascript:window.print();\" class=\"btnDefault btnYazdir\"> "+ strGNL_YAZDIR +"</a>");
321        write(" </div><div class=\"yazdirDiv_kapat\">");
322        write("  <a href=\"#\" onclick=\"window.close();\" class=\"btnDefault btnKapat\"> "+ strGNL_KAPAT +"</a>");
323        write(" </div>");
324        write("</div><br>");
325        write((document.getElementById(body1)!=null ?  document.getElementById(body1).innerHTML : ""));
326        close();
327    }//end with
328}
329
330//Sepete atarken, miktarın satış katı kadar olmasını kontrol ediyor.
331function checkKatMiktar(actItem, urnSatisKati, urnMinSatis, urnMaxSatis)
332{
333    var actItemValue = new Number(actItem.value.replace(',','.'));
334    if ( ( isNaN(actItemValue)) || (actItemValue <= 0)) 
335	{
336	    actItem.value = urnSatisKati;
337		alert(strSPT_ADET_VLD) ;
338		return false;
339    }
340    // Min Satış Miktarı Kontrolü
341    if (urnMinSatis > 0  && actItemValue < urnMinSatis) 
342    {
343        var strAlertMsg = strSPT_MINSATIS_VLD.replaceAll('$strMinSatis$', urnMinSatis.toString());
344        alert(strAlertMsg);
345        actItem.value = urnMinSatis.toFixed(0).toString().replace('.', ',');
346        return false;
347    }
348    // Max Satış Miktarı Kontrolü
349    if (urnMaxSatis > 0 && actItemValue > urnMaxSatis) {
350        var strAlertMsg = strSPT_MAXSATIS_VLD.replaceAll('$strMaxSatis$', urnMaxSatis.toString());
351        alert(strAlertMsg);
352        actItem.value = urnMaxSatis.toFixed(0).toString().replace('.', ',');
353        return false;
354    }
355    // Satış Katı Kontrolü
356    if (actItemValue % urnSatisKati != 0)
357    {
358        var strAlertMsg = strSPT_SATISKATI_VLD.replace('$strSatisKati$', urnSatisKati.toString());
359        alert(strAlertMsg);
360        var actItemNewValue = 0;
361        while (actItemNewValue < actItemValue)
362        {
363            actItemNewValue += urnSatisKati;
364        }
365        actItem.value = actItemNewValue.toFixed(0).toString().replace('.',',');
366        return false;
367    }
368    else
369        return true;
370}
371
372//bu fonksiyon bir nesnenin onkeydown attribute'ne eklenerek tetiklenir.
373// Örn: onkeydown="enterKontrol(event, 'btnArzlardaArama');" 
374//btnArzlardaArama: nesnenin id'si gönderiliyor. 
375function enterKontrol(evt, btnName) {
376    if (evt.which || evt.keyCode) {
377	    if ((evt.which == 13) || (evt.keyCode == 13)) {
378	            window.location = $('[id$=' + btnName + ']').attr('href');
379	            return false;
380	        }
381	            return true;
382    }
383}
384
385//Limited Char
386function limitChars(elemId){
387	var charLimit = $('#'+elemId).attr('limited');
388	var text = $('#'+elemId).val(); 
389	var textlength = text.length;
390	if(textlength > charLimit){
391		$('#'+elemId).val(text.substr(0,charLimit));
392	}
393}
394$(function(){
395	$('*[limited]').keyup(function(){
396		var elemId = $(this).attr('id');
397		limitChars(elemId);
398	})
399});
400//Page Method Yöntemi
401function pageMethod(url, data, success, error) {
402    var pagePath = window.location.pathname;
403
404    $.ajax({
405        type: "POST",
406        url: url,
407        contentType: "application/json; charset=utf-8",
408        data: data,
409        dataType: "json",
410        success: success,
411        error: error
412    });
413    return false;
414}
415//urldeki parametrenin değerini alıyor. örn: getUrlVars()["ref"]
416function getUrlVars() {
417    var vars = [], hash;
418    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
419    for (var i = 0; i < hashes.length; i++) {
420        hash = hashes[i].split('=');
421        vars.push(hash[0]);
422        vars[hash[0]] = hash[1];
423    }
424    return vars;
425}
426//Chrome, ie'deki viewstate sorunu için replace işlemi yapılıyor.
427function dataReplace(data) {
428    return data.replaceAll('__VIEWSTATE', 'v_state').replaceAll('__EVENTVALIDATION', 'e_validation');
429}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.