var Utility = {}; Utility.IsInList = function(ID, List) { for (var i = 0; i < List.length; i++) if (List[i] == ID) return true; return false }; Utility.clearDDL = function(ddl) { while (ddl.options.length > 0) ddl.options[0] = null }; Utility.selectValue = function(ddl, value) { for (var i = 0; i < ddl.options.length; i++) if (ddl.options[i].value == value) ddl.options[i].selected = true }; Utility.addEvent = function(elm, event, func, execOnLoad) { if (window.attachEvent) elm.attachEvent(event, func); else if (window.addEventListener) { if (event == "onchange") event = "change"; if (event == "onclick") event = "click"; elm.addEventListener(event, func, true) } if (execOnLoad) func() }; var YB = { about: { version: "0.1.2", copyright: "&copy 2006, Yenibiris.com" }, require: function(namespace, id) { try { if (namespace != null) { var script; if (typeof namespace == 'string') { script = document.createElement("SCRIPT"); script.type = "text/javascript"; script.text = (new X()).c(namespace, 'GET', null, null, null, 'text'); document.getElementsByTagName("HEAD")[0].appendChild(script) } else if (YB.ById(id) == null) { for (var i = 0; i < namespace.length; i++) { script = document.createElement("SCRIPT"); script.type = "text/javascript"; script.id = id; script.text = (new X()).c(YB.FrameworkVirtualPath + namespace[i], 'GET', null, null, null, 'text'); document.getElementsByTagName("HEAD")[0].appendChild(script) } } } } catch (e) { return false } return true }, VirtualPath: $YBVP, FrameworkVirtualPath: $YBVP + "/Scripts", ById: function(id) { return document.getElementById(id) }, bodyOnLoad: function(fnc) { window.body = document.getElementsByTagName('BODY')[0]; if ((window.body != null && window.body.readyState == 'complete') || (!YB.html.IsIE && window.body != null)) { fnc() } else { window.setTimeout('YB.bodyOnLoad(' + fnc + ')', 200); return } }, html: { isIE: (navigator.userAgent.indexOf('MSIE') > -1), isNum: function(o) { var n = parseInt(o); if (isNaN(n)) return false; return true }, resetForm: function(elems) { for (var i = 0; i < arguments.length; i++) { if (arguments[i] == null) continue; if (arguments[i].tagName == 'INPUT' || arguments[i].tagName == 'TEXTAREA') arguments[i].value = ''; if (arguments[i].tagName == 'SELECT') arguments[i].selectedIndex = 0 } }, disablePage: function() { if (YB.html.divBlack.self == null) { YB.html.divBlack.create() } YB.html.divBlack.self.style.display = '' }, enablePage: function() { if (YB.html.divBlack.self == null) { YB.html.divBlack.create() } var scrollHeight = document.body.scrollHeight; var offsetHeight = document.body.offsetHeight; YB.html.divBlack.self.style.height = scrollHeight > offsetHeight ? scrollHeight : offsetHeight; YB.html.divBlack.self.style.display = 'none' }, divBlack: { create: function() { YB.html.divBlack.self = document.createElement("DIV"); var scrollHeight = document.body.scrollHeight; var offsetHeight = document.body.offsetHeight; YB.html.divBlack.self.className = "disablePage"; YB.html.divBlack.self.style.height = scrollHeight > offsetHeight ? scrollHeight : offsetHeight; YB.html.divBlack.self.style.width = "100%"; YB.html.divBlack.self.innerHTML = "<table width='100%' height='100%' bgcolor='#000000'><tr><td></td></tr></table>"; document.body.appendChild(YB.html.divBlack.self) }, self: null} }, ms: { Validate: function(data, authorize) { if (data == null) { alert('Isleminiz sirasinda bir hata olustu, lutfen tekrar deneyin.'); return false } if (authorize) { if (!YB.ms.Authorize(data)) { document.location.href = YB.VirtualPath + "/Uyelik/UyeGirisi.aspx"; return } } if (data.Errors != null && data.Errors.length > 0) { alert(data.Errors); return false } return true }, Authenticate: function(data) { return data.Errors != null && data.Errors[0] == "Not Authenticated" }, Authorize: function(data) { if (data.Errors != null && data.Errors[0] == "Unauthorized") { document.location.href = YB.VirtualPath + "/Uyelik/UyeGirisi.aspx"; return false } return true }, VirtualPath: $YBVP + "/YBServices" }, dnd: { startDrag: function(e, element) { try { if (dragStart == null || typeof dragStart == "undefined") return } catch (e) { return } dragStart(e, element) } }, dom: { swapNode: function(e1, e2) { if (YB.html.isIE) e1.swapNode(e2); else { var p = e2.parentNode; var s = e2.nextSibling; e1.parentNode.replaceChild(e2, e1); p.insertBefore(e1, s) } }, centerPos: function(element) { var w = parseInt(element.offsetWidth); var h = parseInt(element.offsetHeight); var wh = getWindowHeight() / 2 + getScrollHeight(); var ww = getWindowWidth(); var xc = (ww - w) / 2; var yc = (wh - h / 2); element.style.left = xc + "px"; element.style.top = yc + "px" }, centerPosIV: function(element) { var tblOut = YB.ById("tblHeader"); tblOut = tblOut ? tblOut : YB.ById("tblOut"); var w = parseInt(element.offsetWidth); var h = parseInt(element.offsetHeight); xc = Math.round(((tblOut.clientWidth) / 2) - (w / 2)) + tblOut.offsetLeft; yc = Math.round((document.body.clientHeight / 2) - (h / 2)) + document.body.scrollTop; element.style.left = xc + "px"; element.style.top = yc + "px" }, mergeSelectList: function(ddl1, ddl2) { var iOption = null; for (var i = 0; i < firstList.length; i++) { iOption = document.createElement("OPTION"); secondList.options.add(iOption); iOption.innerHTML = firstList.options.item(i).innerHTML; iOption.value = firstList.options.item(i).value } }, selectTextFromSelectList: function(ddl, text) { for (var i = 0; i < ddl.options.length; i++) { if (ddl.options.item(i).innerHTML == text) { ddl.options.item(i).selected = true; break } } }, selectValueFromSelectList: function(ddl, value) { for (var i = 0; i < ddl.options.length; i++) { if (ddl.options.item(i).value == value) { ddl.options.item(i).selected = true; break } } }, getValueFromSelectListByText: function(ddl, text) { for (var i = 0; i < ddl.options.length; i++) { if (ddl.options.item(i).innerHTML == text) { return ddl.options.item(i).value } } }, getTextFromSelectListByValue: function(ddl, value) { for (var i = 0; i < ddl.options.length; i++) { if (ddl.options.item(i).value == value) { return ddl.options.item(i).innerHTML } } }, isTextInSelectList: function(text, ddl) { for (var i = 0; i < ddl.options.length; i++) { if (ddl.options[i].innerHTML == text) return true } return false }, replaceNode: function(Node1, Node2) { Node1.replaceNode ? Node1.replaceNode(Node2) : Node1.parentNode.replaceChild(Node2, Node1) }, deleteNode: function(node) { if (YB.html.isIE) { node.removeNode(1) } else { node.parentNode.removeChild(node) } } }, Namespaces: { ClientValidatorManager: ["/ClientValidatorManager.js?v=0.1.4"], YBPopup: ["/YBPopup/YBPopup.js?v=0.1.1"], DND: ["/DND/draganddrop.js"], AutoComplete: ["/AutoComplete/common.js", "/AutoComplete/actb.js"] }, LoadedNameSpaces: [], IsNamespaceLoaded: function(namespace) { for (var i = 0; i < YB.LoadedNameSpaces.length; i++) if (YB.LoadedNameSpaces[i] == namespace[0]) return true; return false } }; function addEvent(elm, event, func, execOnLoad) { if (window.attachEvent) elm.attachEvent(event, func); else if (window.addEventListener) { if (event == "onchange") event = "change"; if (event == "onclick") event = "click"; elm.addEventListener(event, func, true) } if (execOnLoad) func() }; function IsInList(list, value) { for (var i = 0; i < list.length; i++) if (list[i] == value) return true; return false }; function getScrollPos() { scrollY = (document.all) ? document.body.scrollTop : window.pageYOffset; return scrollY }; var YBMonths = [["Ocak", "January"], ["Şubat", "February"], ["Mart", "March"], ["Nisan", "April"], ["Mayıs", "May"], ["Haziran", "June"], ["Temmuz", "July"], ["Ağustos", "August"], ["Eylül", "September"], ["Ekim", "October"], ["Kasım", "November"], ["Aralık", "December"]]; function DateTimeToString(date, includeday, includemonth, lang) { lang--; var month = YBMonths[date.getMonth()][lang]; var d = includeday ? date.getDate() : ""; d += " " + includemonth ? month : ""; d += " " + date.getYear(); return d }; function MonthToString(month, lang) { lang--; return YBMonths[month - 1][lang] }; String.prototype.startsWith = function(str) { return this.toLowerCase().indexOf(str.toLowerCase()) == 0 }; String.prototype.endsWith = function(str, suffix, start, end) { return this.toLowerCase().lastIndexOf(str.toLowerCase()) > -1 }; String.prototype.trim = function() { return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "")) }; function getWindowHeight() { var h = 0; if (typeof (window.innerHeight) == 'number') { h = window.innerHeight } else if (document.documentElement && (document.documentElement.clientHeight)) { h = document.documentElement.clientHeight } else if (document.body && (document.body.clientHeight)) { h = document.body.clientHeight } return h }; function getWindowWidth() { var w = 0; if (typeof (window.innerWidth) == 'number') { w = window.innerWidth } else if (document.documentElement && (document.documentElement.clientWidth)) { w = document.documentElement.clientWidth } else if (document.body && (document.body.clientWidth)) { w = document.body.clientWidth } return w }; var IsIE = (navigator.userAgent.indexOf('MSIE') > -1); var StaticErrorMessage = 'Islem sirasinda bir hata olustu, lutfen tekrar deneyiniz.'; function $MS(id) { return document.getElementById(id) }; function SelectListToSelectList(firstList, secondList) { for (var i = 0; i < firstList.length; i++) { var iOption = document.createElement("OPTION"); secondList.options.add(iOption); iOption.innerHTML = firstList.options.item(i).innerHTML; iOption.value = firstList.options.item(i).value } }; function SelectValueFromSelectList(ddl, value) { for (var i = 0; i < ddl.length; i++) { if (ddl.options.item(i).value == value) { ddl.options.item(i).selected = true; break } } }; function replaceNode(Node1, Node2) { Node1.replaceNode ? Node1.replaceNode(Node2) : Node1.parentNode.replaceChild(Node2, Node1) }; function ImportScript(url) { var script = document.createElement("SCRIPT"); script.setAttribute('src', url); script.setAttribute('type', 'text/javascript'); document.getElementsByTagName("head")[0].appendChild(script) } function DeleteObject(obj) { if (obj == null) return; if (YB.isIE) { obj.removeNode(1) } else { obj.parentNode.removeChild(obj) } }; function bodyOnLoad(fnc) { window.body = document.getElementsByTagName('BODY')[0]; if (window.body == null) window.setTimeout('bodyOnLoad(fnc)', 60); else fnc() }; function writeFlash(id, w, h, v) { var str = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='" + w + "' height='" + h + "' id='myflash'>"; str += "<param name='menu' value='false' />"; str += "<param name='allowScriptAccess' value='always' />"; str += "<param name='movie' value='" + v + "' />"; str += "<param name='quality' value='high' />"; str += " <param name='wmode' value='transparent' />"; str += "<embed menu='false' wmode='transparent' src='" + v + "' quality='high'  width='" + w + "' height='" + h + "' name='mymovie' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"; str += "</object>"; document.getElementById(id).innerHTML = str }; function getURL(url) { document.location.href = url }; String.format = function() { if (arguments.length == 0) return null; var str = arguments[0]; for (var i = 1; i < arguments.length; i++) { var re = new RegExp('\\{' + (i - 1) + '\\}', 'gm'); str = str.replace(re, arguments[i]) } return str }; String.prototype.trim = function() { return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1") }; String.prototype.toTrkCase = function() { var str = []; for (var i = 0; i < this.length; i++) { var ch = this.charCodeAt(i); var c = this.charAt(i); if (ch == 105) str.push('I'); else if (ch == 305) str.push('I'); else if (ch == 287) str.push('G'); else if (ch == 252) str.push('Ü'); else if (ch == 351) str.push('S'); else if (ch == 246) str.push('Ö'); else if (ch == 231) str.push('Ç'); else if (ch >= 97 && ch <= 122) str.push(c.toUpperCase()); else str.push(c) } return str.join('') }; String.prototype.replaceTrkChars = function() { var str = []; for (var i = 0; i < this.length; i++) { var ch = this.charCodeAt(i); var c = this.charAt(i); if (ch == 105) str.push('i'); else if (ch == 305) str.push('i'); else if (ch == 287) str.push('g'); else if (ch == 252) str.push('u'); else if (ch == 351) str.push('s'); else if (ch == 246) str.push('o'); else if (ch == 231) str.push('c'); else str.push(c) } return str.join('') }; function DataSet(source, IsGrouped) { if (typeof source != 'object') return null; var o = source.DataSet; if (IsGrouped) { for (var i = 0; i < o.Tables.length; i++) { for (var j = 0; j < o.Tables[i].Records.length; j++) { for (var n = 0; n < o.Tables[i].Records[j].length; n++) { for (var k = 0; k < o.Tables[i].Fields.length; k++) { o.Tables[i].Records[j][n][o.Tables[i].Fields[k]] = o.Tables[i].Records[j][n][k] } } } } } else { for (var i = 0; i < o.Tables.length; i++) { for (var j = 0; j < o.Tables[i].Records.length; j++) { for (var k = 0; k < o.Tables[i].Fields.length; k++) { o.Tables[i].Records[j][o.Tables[i].Fields[k]] = o.Tables[i].Records[j][k] } } } } return o }; var X_isNav = (navigator.appName.indexOf("Netscape") != -1); var X_isIE = (navigator.appName.indexOf("Microsoft") != -1); var $nCount = 0; var XCounter = 0; function GXO() { var x = false; try { x = new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { x = new ActiveXObject("Microsoft.XMLHTTP") } catch (e) { try { x = new XMLHttpRequest() } catch (e) { x = false } } } return x }; function X(cacheArray) { function PR(x, content, cacheKey, notify) { try { var retVal; switch (content) { case "xml": retVal = x; break; case "text": retVal = String(x.responseText); break; default: retVal = eval("( " + x.responseText + " )") } if (notify) { notify(-1) } if (cache && x.status == 200) { cache[cacheKey] = retVal } return retVal } catch (e) { if (notify) { notify(-2) } return null } }; var cache = cacheArray; var xmlhttp = GXO(), bComplete = false; if (!xmlhttp) { return null } this.c = function(sURL, sMethod, sVars, fnDone, notificationFunc, contentType, state) { if (!xmlhttp) { return false } var typeFnDone = String("" + typeof (fnDone)); if (!(fnDone === null || typeFnDone == "undefined" || typeFnDone == "function")) { alert("WARNING! Something wrong with async function. Might be a wrong parameter error!\r\nURL: " + sURL + "\r\nThe following should be a function definition.\r\n" + fnDone) } if (notificationFunc) { notificationFunc(1) } var async = (fnDone) ? true : false; bComplete = false; sMethod = (!sMethod) ? "GET" : sMethod.toUpperCase(); if (!sVars) { sVars = "" } if ("" + contentType == "undefined") { contentType = "json" } try { var cacheKey = sMethod + sURL + sVars; if (cache && cache[cacheKey]) { if (notificationFunc) { notificationFunc(-1) } if (async) { fnDone(cache[cacheKey], state, true); return true } else { return cache[cacheKey] } } else { if (sMethod == "GET") { xmlhttp.open(sMethod, sURL + "?" + sVars, async); sVars = "" } else { xmlhttp.open(sMethod, sURL, async); xmlhttp.setRequestHeader("Method", "POST " + sURL + " HTTP/1.1"); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") } if (async) { xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && !bComplete) { bComplete = true; fnDone(PR(xmlhttp, contentType, cacheKey, notificationFunc), state, false) } } } xmlhttp.send(sVars); if (!async) { return PR(xmlhttp, contentType, cacheKey, notificationFunc) } } } catch (z) { if (notificationFunc) { notificationFunc(-1) } return false } return true }; this.cs = function(sURL, sMethod, sVars, fnDone, contentType, cbFuncParams) { if (!xmlhttp) return false; sMethod = sMethod.toUpperCase(); try { OpenConnection(sURL, sMethod, sVars, fnDone, contentType, false); xmlhttp.send(sVars); ExecuteResult(contentType, fnDone, cbFuncParams) } catch (e) { alert(e.description); return false } return true }; function OpenConnection(sURL, sMethod, sVars, fnDone, contentType, async) { if (sMethod == "GET") { xmlhttp.open(sMethod, sURL + "?" + sVars, async); sVars = "" } else { xmlhttp.open(sMethod, sURL, async); xmlhttp.setRequestHeader("Method", "POST " + sURL + " HTTP/1.1"); xmlhttp.setRequestHeader("X-Application", "Yenibir"); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") } }; function ExecuteResult(contentType, fnDone, cbFuncParams) { var obj; if (xmlhttp.status != 200) obj = null; else try { switch (contentType) { case "xml": obj = xmlhttp; break; case "text": obj = new String(xmlhttp.responseText); break; default: obj = eval("(" + xmlhttp.responseText + ")"); break } } catch (e) { obj = null } fnDone(obj, false, cbFuncParams); XCounter++ }; return this }; function Parameters() { var aQs = [], key, value; if (document.location.search.length > 0) { aQs = document.location.search.substr(1).split("&") } for (var i = 0; i < aQs.length; i++) { var aKeyValue = aQs[i].split("="); if (aKeyValue.length < 2) { this[unescape(aKeyValue).toUpperCase()] = "" } else { this[unescape(aKeyValue[0].toUpperCase())] = unescape(aKeyValue[1]) } } this.getValue = function(str) { return ("" + this[str] == "undefined") ? "" : this[str] } }; function getCookieVal(offset) { var endstr = document.cookie.indexOf(";", offset); if (endstr == -1) { endstr = document.cookie.length } return unescape(document.cookie.substring(offset, endstr)) }; function getCookie(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) { return getCookieVal(j) } i = document.cookie.indexOf(" ", i) + 1; if (!i) { break } } return null }; var parameters = new Parameters(); function XSL(url) { var xsl; var xmlhttp = GXO(); xmlhttp.open("GET", url, false); xmlhttp.send(null); if (X_isIE) { xsl = xmlhttp.responseXML } else { xsl = new XSLTProcessor(); var xslRef = xmlhttp.responseXML; xsl.importStylesheet(xslRef) } this.transform = function(element, xmlObj) { var fragment; if (X_isIE) { fragment = xmlObj.transformNode(xsl); element.innerHTML = (fragment) } else { fragment = xsl.transformToFragment(xmlObj, document); element.appendChild(fragment) } }; return this }; function findNode(node, xPath) { if (X_isIE) { return node.selectSingleNode(xPath) } else { var xpe = new XPathEvaluator(); var nsResolver = xpe.createNSResolver(node.ownerDocument === null ? node.documentElement : node.ownerDocument.documentElement); var result = xpe.evaluate(xPath, node, nsResolver, 0, null); var found = []; var res = result.iterateNext(); return res } }; function ShowErrors(arr) { if (arr && arr.length && arr.length > 0) { var elm = document.getElementById('__ErrorMessage'); if (elm && elm.timeout) { clearTimeout(elm.timeout) } if (!elm) { elm = document.createElement("div"); elm.id = '__ErrorMessage'; var s = elm.style; s.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=80)"; s.opacity = ".50"; s.fontWeight = "bold"; s.display = "none"; s.position = "absolute"; s.top = "3px"; s.left = "500px"; s.backgroundColor = "#A00000"; s.border = "1px solid white"; s.color = "white"; s.font = "italic normal bolder 12pt Tahoma" } document.getElementsByTagName("body")[0].appendChild(elm); if (elm.style.display.length > 0) { elm.innerHTML = arr.join("<br  />") } else { var lines = elm.innerHTML.split("<br  />"); for (var j = 0; j < arr.length; j++) { var item = arr[j], found = false; for (var i = 0; i < lines.length; i++) { var line = lines[i]; if (line == item) { found = true; break } } if (!found) { elm.innerHTML += "<br  />" + item } } } elm.style.display = ""; elm.timeout = setTimeout("with(document.getElementById('__ErrorMessage')) {style.display='none'; innerHTML='';}", 11000) } }; function CheckErrors(o) { if (!o) { ShowErrors(["Could not get document! Request failed."]) } else if (o.Errors) { ShowErrors(o.Errors) } return o }; function C(s, w) { var r = ""; var t = s.length; if (t === 0) { return "" } var u = false; var breaked = false; for (var x = 0; x < t; x++) { if (x === 0) { u = true } if (u === true) { if (s.charCodeAt(x) == 105 || s.charCodeAt(x) == 304) { r += "İ" } else if (s.charCodeAt(x) == 305) { r += "I" } else { r += s.charAt(x).toUpperCase() } } else { if (s.charCodeAt(x) == 304) { r += "i" } else if (s.charCodeAt(x) == 73 || s.charCodeAt(x) == 305) { r += "ı" } else { r += s.charAt(x).toLowerCase() } } var e = s.charCodeAt(x); if (e == 32 || e == 45 || e == 46 || e == 160) { u = true } else { u = false } if (e == 32 || e == 160) { breaked = true } if (!breaked && x > 15) { r += " "; breaked = true } if (w && x >= w) { r += '...'; break } } return r }; function XNotify(val) { var elm = document.getElementById('__NotificationMessage'); var s; var top = window.document.body.scrollTop; if (elm === null) { elm = document.createElement("div"); elm.id = '__NotificationMessage'; s = elm.style; s.filter = "alpha(opacity=80)"; s.display = "none"; s.position = "absolute"; s.top = top; s.zIndex = 100000; s.left = "0"; s.width = "100%"; s.border = "1px solid #FFFFFF"; s.backgroundColor = "#A00000"; s.color = "white"; s.font = "normal normal bold 12px Tahoma"; s.padding = "20"; s.opacity = ".80"; document.getElementsByTagName("body")[0].appendChild(elm) } else { s = elm.style; s.top = top } if (val < 0) { $nCount--; YB.html.enablePage() } else { $nCount++; YB.html.disablePage() } elm.style.display = ($nCount < 1) ? "none" : ""; elm.innerHTML = "<img src=/App_Themes/Default/Images/General/loading.gif width=22 height=22 align=absmiddle>  Bilgiler güncelleniyor, lütfen bekleyin... "; return $nCount }; function focusTip(obj, msg) { return false }; function blurTip() { try { YBToolTip.Hide() } catch (e) { return false } }; function focusTip2(obj, msg) { YB.require(["/YBToolTip/YBToolTip2.js?v=1.00.123"], "scrYBToolTip"); YBToolTip.Show(obj, msg) }; function blurTip2() { try { YBToolTip.Hide() } catch (e) { return false } };
