if (!window.getComputedStyle) { window.getComputedStyle = function (el, pseudo) { this.el = el; this.getPropertyValue = function (prop) { var re = /(\-([a-z]){1})/g; if (prop == 'float') prop = 'styleFloat'; if (re.test(prop)) { prop = prop.replace(re, function () { return arguments[2].toUpperCase(); }); } return el.currentStyle[prop] ? el.currentStyle[prop] : null; } return this; } } if (!Array.indexOf) { Array.prototype.indexOf = function (obj) { for (var i = 0; i < this.length; i++) { if (this[i] === obj) { return i; } } return -1; } } function xClass() { } xClass.prototype.construct = function () { } xClass.extend = function (_d) { var _a = function () { if (arguments[0] !== xClass) { this.construct.apply(this, arguments); } } var _b = new this(xClass); var _c = this.prototype; for (var n in _d) { var _e = _d[n]; if (_e instanceof Function) _e.$ = _c; _b[n] = _e; } _a.prototype = _b; _a.extend = this.extend; return _a; } var j = xClass.extend({ browser: '', isiE7and8: false, isiE7: false, SpacerIMG: '/Style/Common/Resource/spacer.gif', topLayer: 10, qf: new Array(), CurrentCompany: 9, QueueFunction: function (stmt) { Core.qf.push(stmt); }, EvaluateFix: function (text) { var foundStart = -1; var foundStart2 = -1; var foundEnd = -1; var src = "|script"; var totalExecuted = 0; for (var i = 0; i < text.length; i++) { if (totalExecuted > 10) break; if (foundStart == -1) { if (text.substring(i, i + src.length) == src) { foundStart = i + src.length; i = foundStart; src = "|"; } } if ((foundStart != -1) && (foundStart2 == -1)) { if (text.substring(i, i + src.length) == src) { foundStart2 = i + src.length; i = foundStart2; src = "|/script|"; } } if (foundStart2 != -1) { if (text.substring(i, i + src.length) == src) { foundEnd = i; eval(text.substring(foundStart2, foundEnd)); totalExecuted++; foundStart = -1; foundStart2 = -1; foundEnd = -1; src = "|script"; } } } }, ControlCollection: new Array(), AddControl: function (context, controlID) { var len = Core.ControlCollection.push([context, controlID]); //alert(controlID + ' : ' + Core.ControlCollection[len - 1][1].id); }, FindControl: function (controlID) { for (var i = 0; i < Core.ControlCollection.length; i++) { //alert(Core.ControlCollection[i][1].id + '==' + controlID); if (Core.ControlCollection[i][1].GetID() == controlID) { return Core.ControlCollection[i][1]; } } return null; }, construct: function () { var ua = navigator.userAgent.toLowerCase(); var isStrict = document.compatMode == "CSS1Compat", isOpera = ua.indexOf("opera") > -1, isChrome = ua.indexOf("chrome") > -1, isSafari = !isChrome && (/webkit|khtml/).test(ua), isSafari3 = isSafari && ua.indexOf("webkit/5") != -1, isIE = !isOpera && ua.indexOf("msie") > -1, isIE7 = !isOpera && ua.indexOf("msie 7") > -1, isIE8 = !isOpera && ua.indexOf("msie 8") > -1, isGecko = !isSafari && !isChrome && ua.indexOf("gecko") > -1, isGecko3 = isGecko && ua.indexOf("rv:1.9") > -1, isBorderBox = isIE && !isStrict, isWindows = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1), isMac = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1), isAir = (ua.indexOf("adobeair") != -1), isLinux = (ua.indexOf("linux") != -1), isSecure = window.location.href.toLowerCase().indexOf("https") === 0; if (isOpera) this.browser = "op"; else if (isChrome) this.browser = "ch"; else if (isIE7 || isIE8) { this.browser = "ie"; this.isiE7and8 = true; } else if (isIE) this.browser = "ie"; else if (isGecko || isGecko3) this.browser = "ff"; else if (isSafari || isSafari3) this.browser = "sa"; if (isIE7) this.isiE7 = true; }, GetPageSize: function () { var _a, _b; if (window.innerHeight && window.scrollMaxY) { _a = document.body.scrollWidth; _b = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { _a = document.body.scrollWidth; _b = document.body.scrollHeight; } else { _a = document.body.offsetWidth; _b = document.body.offsetHeight; }; var _c, _d; if (self.innerHeight) { _c = self.innerWidth; _d = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { _c = document.documentElement.clientWidth; _d = document.documentElement.clientHeight; } else if (document.body) { _c = document.body.clientWidth; _d = document.body.clientHeight; }; if (_b < _d) { _f = _d; } else { _f = _b; }; if (_a < _c) { _e = _c; } else { _e = _a; }; arrayPageSize = new Array(_e, _f, _c, _d); return arrayPageSize; }, GetScrollPos: function () { return new Array(document.body.scrollTop, document.body.scrollLeft); }, FindObjectPosition: function (obj) { _a = obj.offsetLeft; _b = obj.offsetTop; _c = obj.offsetParent; while (_c != null && _c.tagName.toUpperCase() != "BODY") { _a += _c.offsetLeft; _b += _c.offsetTop; _c = _c.offsetParent; }; _d = obj.offsetHeight; _f = obj.offsetWidth; var _e = new Array(); _e[0] = _a; _e[1] = _b; _e[2] = _f; _e[3] = _d; return _e; }, FindObjectOffset: function (element, options) { var getWindow = function (elem) { return isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; }; var isWindow = function (obj) { return obj != null && obj == obj.window; }; var docElem, win, rect, doc, elem; elem = element; if (!elem) { return; } rect = elem.getBoundingClientRect(); // Make sure element is not hidden (display: none) or disconnected if (rect.width || rect.height || elem.getClientRects().length) { doc = elem.ownerDocument; win = getWindow(doc); docElem = doc.documentElement; return { top: rect.top + win.pageYOffset - docElem.clientTop, left: rect.left + win.pageXOffset - docElem.clientLeft }; } }, GID: function (id) { return document.getElementById(id); }, AttEvt: function (obj, name, fnc) { if (window.addEventListener) { obj.addEventListener(name, fnc, false); } else if (window.attachEvent) { obj.attachEvent('on' + name, fnc); }; }, RmvEvt: function (obj, name, fnc) { if (window.addEventListener) { obj.removeEventListener(name, fnc, false); } else if (window.attachEvent) { obj.removeEvent('on' + name, fnc); }; }, GetToppestLayer: function () { if (typeof (elem) == typeof (undefined)) elem = "*"; var getComputedStyle = null; if (typeof (document.defaultView) != typeof (undefined) && typeof (document.defaultView.getComputedStyle) != typeof (undefined)) getComputedStyle = document.defaultView.getComputedStyle; else getComputedStyle = window.getComputedStyle; var elems = document.getElementsByTagName(elem); var highest = 0; for (var i = 0; i < elems.length; i++) { var zindex = getComputedStyle(elems[i], null).getPropertyValue("z-index"); if ((zindex > highest) && (zindex != 'auto')) { highest = zindex; } } return highest; //Old //return Core.topLayer++; }, SetCookie: function (c_name, value, exdays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); document.cookie = c_name + "=" + c_value; }, EvaluateScripts: function (_content) { if ((_content == null) || (_content.length < 4)) return; var step = 0; while (true) { step = _content.indexOf("", step); var scriptWithTags = _content.substring(step, step2 + 9); step = step + 7; step = _content.indexOf(">", step) + 1; var script = _content.substring(step, step2); var isTemplateBlock = scriptWithTags.indexOf("text/x-template") >= 0; if (!isTemplateBlock) eval(script); step = step2; } }, init: function () { var inp = document.getElementsByTagName("INPUT"); for (var i = 0; i < inp.length; i++) { if (inp[i].getAttribute("rel") == "moneyMask") { try { inp[i].onkeydown = Mask.MoneyMask; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; try { inp[i].onkeyup = Mask.formatFloat; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; inp[i].setAttribute("rel", ""); } else if (inp[i].getAttribute("rel") == "dateMask") { try { if (this.browser == "op") inp[i].onkeypress = Mask.DateMask; else inp[i].onkeydown = Mask.DateMask; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; if (inp[i].getAttribute("validate") == "true") { try { this.AttEvt(inp[i], "blur", Valid.date); } catch (e) { alert("Library Not Found\n\nInclude validation.js"); }; }; inp[i].setAttribute("rel", ""); } else if (inp[i].getAttribute("rel") == "timeMask") { //try { inp[i].onblur = Mask.TimeMask; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; try { inp[i].onblur = Mask.TimeCheck; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; try { inp[i].onkeydown = Mask.TimeMask; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; try { inp[i].onfocus = Mask.TimeMask; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; inp[i].setAttribute("rel", ""); } else if (inp[i].getAttribute("rel") == "integerMask") { try { inp[i].onkeydown = Mask.IntegerMask; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; //try { inp[i].onmous inp[i].setAttribute("rel", ""); } else if (inp[i].getAttribute("rel") == "phoneMask") { try { if (this.browser == "op") inp[i].onkeypress = Mask.PhoneMask; else inp[i].onkeydown = Mask.PhoneMask; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; inp[i].setAttribute("rel", ""); } else if (inp[i].getAttribute("rel") == "phoneMaskWithCode") { try { if (this.browser == "op") inp[i].onkeypress = Mask.PhoneMaskWithCode; else inp[i].onkeydown = Mask.PhoneMaskWithCode; } catch (e) { alert("Library Not Found\n\nInclude Mask.js"); }; inp[i].setAttribute("rel", ""); }; }; var div = document.getElementsByTagName("DIV"); for (var i = 0; i < div.length; i++) { if (div[i].getAttribute("rel") == "selectBox") { try { gSelect.create(div[i]); } catch (e) { alert("Library Not Found\n\nInclude selectBox.js"); }; div[i].setAttribute("rel", ""); } else if (div[i].getAttribute("rel") == "dataset") { div[i].style.display = "none"; div[i].setAttribute("rel", ""); } else if (div[i].getAttribute("rel") == "button") { try { button.create(div[i]); } catch (e) { alert("Library Not Found\n\nInclude button.js"); }; div[i].setAttribute("rel", ""); } else if (div[i].getAttribute("rel") == "gallery") { try { gallery.create(div[i]); } catch (e) { alert(e.description); }; div[i].setAttribute("rel", ""); } } for (var i = 0; i < Core.qf.length; i++) { eval(Core.qf[i]); } } }); var Core = new j(); function st() { Core.init(); } if (window.addEventListener) { window.addEventListener("load", st, false); } else if (window.attachEvent) { window.attachEvent('onload', st); } var DataTable = xClass.extend({ tables: new Array(), columns: new Array(), data: new Array(), pageURL: "", construct : function (name) { this.tables[this.tables.length] = name; }, AddRow: function (array) { array.unshift(this.data.length); this.data.push(array); }, AddRows: function (array) { for (var i = 0; i < array.length; i++) { array[i].unshift(this.data.length); this.data.push(array[i]); } }, SetColumns: function (array) { this.columns.push("id"); for (var i = 0; i < array.length; i++) this.columns.push(array[i]); }, Query: function () { }, PrepareAjaxCall :function(r) { if (window.XMLHttpRequest) { r = new XMLHttpRequest(); if (r.overrideMimeType) r.overrideMimeType('text/html'); } else if (window.ActiveXObject) r = new ActiveXObject("Msxml2.XMLHTTP"); r.open("POST", "/Adapter.aspx", true); r.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=utf-8"); return r; }, AjaxCallCheckForUpdates : function(content) { if (content.indexOf("", startIndex)); finishIndex = (content.indexOf(")-->", startIndex))-startIndex; eval(content.substr(startIndex, finishIndex)); content = content.replace(content.substr(startIndex-9, finishIndex+4), ""); this.AjaxCallCheckForUpdates(content, theEnd); } return content; } }); var SchemaCollection = xClass.extend({ RowCountField: null, Fields: new Array(), Data: new Array(), Controller: null, Fill: function (obj) { this.Data = obj; if (this.Controller == null) return; try { this.Controller.DataBind(); } catch (e) { } }, CurrentPage: 1, construct: function (obj) { this.Fields = obj; }, GetRowCellValue: function (columnIndex, rowIndex) { return this.Data[rowIndex][columnIndex]; } }); var j = xClass.extend({ tDay: 18, tMonth: 12, tYear: 2010, Calendar_Month_January: "January", Calendar_Month_February: "Fabruary", Calendar_Month_March: "March", Calendar_Month_April: "April", Calendar_Month_May: "May", Calendar_Month_June: "June", Calendar_Month_July: "July", Calendar_Month_August: "August", Calendar_Month_September: "September", Calendar_Month_October: "October", Calendar_Month_November: "November", Calendar_Month_December: "December", Calendar_Day_Monday: "Monday", Calendar_Day_Tuesday: "Tuesday", Calendar_Day_Wednesday: "Wednesday", Calendar_Day_Thursday: "Thursday", Calendar_Day_Friday: "Friday", Calendar_Day_Saturday: "Saturday", Calendar_Day_Sunday: "Sunday", format: function (k, v) { for (var i = 0; i < v.length; i++) { k = k.replace('{' + (i + 1) + '}', v[i]); } return k; } }); var Translate = new j(); var j = xClass.extend({ MoneyMask: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var kc = (Core.browser == "ie") ? window.event.keyCode : e.which; if (((kc == 188) || (kc == 110)) && (obj.value.indexOf(',') != -1)) { return false; }; if ((kc == 188) && (obj.value == '')) { return false; }; if (((kc >= 48) && (kc <= 57)) || ((kc >= 95) && (kc <= 106)) || (kc == 8) || (kc == 9) || (kc == 110) || (kc == 13) || ((kc >= 35) && (kc <= 40)) || (kc == 46) || (kc == 188)) { obj.focus(); return true; } else { obj.focus(); return false; }; }, formatFloat: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var kc = (Core.browser == "ie") ? window.event.keyCode : e.which; if ((kc == 37) || (kc == 38) || (kc == 39) || (kc == 40)) { return false; }; var _b = obj.value.length; var _a = Mask.gtap(obj); obj.value = Mask.commaSplit(obj); _a = _a + (obj.value.length - _b); Mask.stap(obj, _a); }, commaSplit: function (obj) { var _a = '' + Mask.filterNum(obj.value); if (_a == "") { obj.select(); obj.focus(); return ""; } else { var _c = new RegExp('([0-9])([0-9][0-9][0-9][.,])'); var _b = _a.split(','); _b[0] += ','; do { _b[0] = _b[0].replace(_c, '$1.$2'); } while (_c.test(_b[0])); if (_b.length > 1) { return _b.join(''); } else { return _b[0].split(',')[0]; }; }; }, filterNum: function (str) { re = /^\$|\./g; return str.replace(re, ""); }, IntegerMask: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var kc = (Core.browser == "ie") ? window.event.keyCode : e.which; if (((kc > 46) && (kc < 58)) || ((kc > 95) && (kc < 106)) || (kc == 9) || (kc == 37) || (kc == 39) || (kc == 39) || (kc == 35) || (kc == 36) || (kc == 8) || (kc == 13) || (kc == 46)) { return true; }; return false; }, DateMask: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var kc = (Core.browser == "ie") ? window.event.keyCode : e.which; var _a = obj.value; if (_a == "") { _a = "__.__.____"; }; var _b = Mask.gtap(obj); if (((kc > 46) && (kc < 58)) || ((kc > 95) && (kc < 106))) { if (_b == 10) return false; if ((_b == 2) || (_b == 5)) _b++; if (kc > 60) kc = kc - 48; obj.value = _a.substring(0, _b) + String.fromCharCode(kc) + _a.substring(_b + 1, _a.length); Mask.stap(obj, _b + 1); } else if (kc == 8) { if (_b == 0) return false; if ((_b == 3) || (_b == 6)) _b--; obj.value = _a.substring(0, _b - 1) + "_" + _a.substring(_b, _a.length); Mask.stap(obj, _b - 1); } else if ((kc == 9) || (kc == 37) || (kc == 39) || (kc == 39) || (kc == 35) || (kc == 36)) { return true; }; return false; }, TimeCheck: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var _a = obj.value; var timeRe = /(00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23):[0-5][0-9]/; if (!timeRe.test(_a)) { obj.value = "00:00"; } }, TimeMask: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var kc = (Core.browser == "ie") ? window.event.keyCode : e.which; var _a = obj.value; if (_a == "") { _a = "__:__"; }; var timeRe = /(00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23):[0-5][0-9]/; var timeRe2 = /([01]?[0-9]|2[0-3])/; var _b = Mask.gtap(obj); if (((kc > 46) && (kc < 58)) || ((kc > 95) && (kc < 106))) { if (_b == 5) { if (timeRe.test(_a)) { return false; } else { obj.value = "00:00"; return false; } } if ((_b == 2)) _b++; if (kc > 60) kc = kc - 48; obj.value = _a.substring(0, _b) + String.fromCharCode(kc) + _a.substring(_b + 1, _a.length); Mask.stap(obj, _b + 1); } else if (kc == 8) { if (_b == 0) return false; if ((_b == 3)) _b--; obj.value = _a.substring(0, _b - 1) + "_" + _a.substring(_b, _a.length); Mask.stap(obj, _b - 1); } else if ((kc == 9) || (kc == 37) || (kc == 39) || (kc == 39) || (kc == 35) || (kc == 36)) { if (timeRe.test(_a)) return true; else { obj.value = "00:00"; return false; } }; return false; }, PhoneMask: function (e) { var kc = (Core.browser == "ie") ? window.event.keyCode : e.which; var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var _a = obj.value; if (_a == "") { _a = "(___) ___-____"; }; var phoneRe = /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/; var _b = Mask.gtap(obj); if (((kc > 46) && (kc < 58)) || ((kc > 95) && (kc < 106))) { // input if (_b == 14) return false; if ((_b == 0) || (_b == 5) || (_b == 9)) _b++; if ((_b == 4)) _b = _b + 2; if (kc > 60) kc = kc - 48; obj.value = _a.substring(0, _b) + String.fromCharCode(kc) + _a.substring(_b + 1, _a.length); Mask.stap(obj, _b + 1); } else if (kc == 8) { // backspace if (_b == 1) return false; if ((_b == 5) || (_b == 10)) _b--; if ((_b == 6)) _b = _b - 2; obj.value = _a.substring(0, _b - 1) + "_" + _a.substring(_b, _a.length); Mask.stap(obj, _b - 1); } else if ((kc == 9) || (kc == 37) || (kc == 39) || (kc == 39) || (kc == 35) || (kc == 36)) { // tab if (phoneRe.test(_a)) return true; else return false; }; return false; }, PhoneMaskWithCode: function (e) { var kc = (Core.browser == "ie") ? window.event.keyCode : e.which; var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; var _a = obj.value; if (_a == "") { _a = "+___(___) ___-____"; }; var phoneRe = /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/; var _b = Mask.gtap(obj); if (((kc > 46) && (kc < 58)) || ((kc > 95) && (kc < 106))) { // input if (_b == 18) return false; if ((_b == 0) || (_b == 4) || (_b == 9) || (_b == 13)) _b++; if ((_b == 8)) _b = _b + 2; //if ((_b == 3) || (_b == 8)) _b = _b + 2; if (kc > 60) kc = kc - 48; obj.value = _a.substring(0, _b) + String.fromCharCode(kc) + _a.substring(_b + 1, _a.length); Mask.stap(obj, _b + 1); } else if (kc == 8) { // backspace if (_b == 1) return false; if ((_b == 5) || (_b == 9) || (_b == 14)) _b--; if ((_b == 10)) _b = _b - 2; //if ((_b == 5) || (_b == 10)) _b = _b - 2; obj.value = _a.substring(0, _b - 1) + "_" + _a.substring(_b, _a.length); Mask.stap(obj, _b - 1); } else if ((kc == 9) || (kc == 37) || (kc == 39) || (kc == 39) || (kc == 35) || (kc == 36)) { // tab if (phoneRe.test(_a)) return true; else return false; }; return false; }, //miscellaneous gtap: function (obj) { var _a = 0; if (document.selection) { obj.focus(); var Sel = document.selection.createRange(); Sel.moveStart('character', -obj.value.length); _a = Sel.text.length; } else if (obj.selectionStart || obj.selectionStart == '0') { _a = obj.selectionStart; }; return (_a); }, stap: function (obj, _a) { if (obj.setSelectionRange) { obj.focus(); obj.setSelectionRange(_a, _a); } else if (obj.createTextRange) { var _b = obj.createTextRange(); _b.collapse(true); _b.moveEnd('character', _a); _b.moveStart('character', _a); _b.select(); }; } }); var Mask = new j(); var j = xClass.extend({ //input validations date: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; if (!Valid.isDate(obj.value)) obj.value = ""; }, time: function (e) { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; if (!Valid.isTime(obj.value)) obj.value = ""; }, //common functions isTime: function (e) { }, isDate: function (_a) { var _g = "."; var _c = 1900; var _d = 2100; var _b = new Array(); for (var i = 1; i <= 12; i++) { _b[i] = 31; if (i == 4 || i == 6 || i == 9 || i == 11) { _b[i] = 30 }; if (i == 2) { _b[i] = 29 }; }; var _e = _a.indexOf(_g); var _f = _a.indexOf(_g, _e + 1); var _j = _a.substring(_e + 1, _f); var _i = _a.substring(0, _e); var _m = _a.substring(_f + 1); _k = _m; if (_i.charAt(0) == "0" && _i.length > 1) _i = _i.substring(1); if (_j.charAt(0) == "0" && _j.length > 1) _j = _j.substring(1); for (var i = 1; i <= 3; i++) { if (_k.charAt(0) == "0" && _k.length > 1) _k = _k.substring(1); }; month = parseInt(_j); day = parseInt(_i); _h = parseInt(_k); if (_e == -1 || _f == -1) { return false; }; if ((_j.length < 1) || (month < 1) || (month > 12)) { return false; }; if ((_i.length < 1) || (day < 1) || (day > 31) || ((month == 2) && (day > (((_h % 4 == 0) && ((!(_h % 100 == 0)) || (_h % 400 == 0))) ? 29 : 28))) || (day > _b[month])) { return false; }; if ((_m.length != 4) || (_h == 0) || (_h < _c) || (_h > _d)) { return false; }; if (_a.indexOf(_g, _f + 1) != -1 || Valid.isNumeric(this.stripChars(_a, _g)) == false) { return false; }; return true; }, stripChars: function (s, bag) { var i; var _a = ""; for (i = 0; i < s.length; i++) { var c = s.charAt(i); if (bag.indexOf(c) == -1) _a += c; }; return _a; }, isNumeric: function (_a) { var _d = "0123456789"; var _c; var _b = true; if (_a.length == 0) return false; for (i = 0; i < _a.length && _b == true; i++) { _c = _a.charAt(i); if (_d.indexOf(_c) == -1) { _b = false; }; }; return _b; }, isEmail: function (str) { if ((str == null) || (str == "")) { return false; }; var at = "@"; var dot = "."; var lat = str.indexOf(at); var lstr = str.length; var ldot = str.indexOf(dot); if (str.indexOf(at) == -1) { return false; } if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) { return false; } if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) { return false; } if (str.indexOf(at, (lat + 1)) != -1) { return false; } if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) { return false; } if (str.indexOf(dot, (lat + 2)) == -1) { return false; } if (str.indexOf(" ") != -1) { return false; } return true; }, isBlank: function (str) { if (str == "") return true; for (var i = 0; i < str.length; i++) { if (str[i] != " ") return false; } return true; }, isLessThan: function (identifier, str) { if (parseInt(identifier, 10) > parseInt(str, 10)) { return true; } return false; }, isMoreThan: function (identifier, str) { if (parseInt(identifier, 10) < parseInt(str, 10)) { return true; } return false; }, isGreaterDate: function (x, y) { var firstDate = x.split('.'); for (var i = 0; i < firstDate.length; i++) { if (firstDate[i].length < 4) firstDate[i] = ("00" + firstDate[i]).slice(-2); } firstDate = firstDate.reverse(); x = firstDate.join(""); var firstDateInteger = parseInt(x); var secondDate = y.split('.'); for (var i = 0; i < secondDate.length; i++) { if (secondDate[i].length < 4) secondDate[i] = ("00" + secondDate[i]).slice(-2); } secondDate = secondDate.reverse(); y = secondDate.join(""); var secondDateInteger = parseInt(y); return firstDateInteger > secondDateInteger; }, englishCharacters: function (text) { var stext = text.replace(/\bi\b/gi, 'ı'); stext = stext.toUpperCase(); var allowed = "ABCDEFGHIJKLMNOPQRSTUVWYZX "; for (var i = 0; i < stext.length; i++) { if (allowed.indexOf(stext.substring(i, i + 1)) == -1) return false; } return true; } }); var Valid = new j(); var j = xClass.extend({ trim: function (str) { var strL = str.length; if (strL == 0) return ""; for (var i = 0; i < strL; i++) { if (str.substr(0, 1) == " ") { str = str.substr(1, str.length); } } strL = str.length; for (var i = 0; i < strL; i++) { if (str.substr(str.length - 1, str.length) == " ") { str = str.substr(0, str.length - 1); } else { break; } } return str; }, EncodeNameForQS: function (name) { var re = /(^|\s)(&)(\s|$)/g; return name.replace(re, "|"); } }); var StringFunctions = new j(); var j = xClass.extend({ currentDate: function (format) { if (format == null) format = ''; if ((format.indexOf('d') == -1) || (format.indexOf('m') == -1) || (format.indexOf('Y') == -1)) format = "m/d/Y"; var currentTime = new Date(); var cD = (currentTime.getDate().length == 1) ? "0" : ""; var cM = ((currentTime.getMonth() + 1).length == 1) ? "0" : ""; var crDate = format.replace('m', cM + "" + (currentTime.getMonth() + 1)); crDate = crDate.replace('d', cD + "" + currentTime.getDate()); crDate = crDate.replace('Y', currentTime.getFullYear()); return crDate; }, calcAge: function (dateNow, dateBirth) { var dateBegin = dateBirth.split("."); var dateEnd = dateNow.split("."); var tempAge = parseInt(dateEnd[2], 10) - parseInt(dateBegin[2], 10); if (parseInt(dateBegin[1], 10) > parseInt(dateEnd[1], 10)) { tempAge = tempAge - 1; } else if (parseInt(dateBegin[1], 10) == parseInt(dateEnd[1], 10)) { if (parseInt(dateEnd[0], 10) < parseInt(dateBegin[0], 10)) { tempAge = tempAge - 1; } } return tempAge; }, addDays: function (date1, numberOfDays, format) { if (format == null) format = ''; if ((format.indexOf('d') == -1) || (format.indexOf('m') == -1) || (format.indexOf('Y') == -1)) format = "m/d/Y"; var d1Split = date1.split("."); var sDate = new Date((d1Split[1] < 10 ? d1Split[1].toString().replace('0', '') : d1Split[1].toString()) + "/" + (d1Split[0] < 10 ? d1Split[0].toString().replace('0', '') : d1Split[0].toString()) + "/" + d1Split[2]); sDate.setDate(parseInt(sDate.getDate()) + parseInt(numberOfDays)); nday = (sDate.getDate().toString().length > 1) ? sDate.getDate() : "0" + sDate.getDate(); nmonth = ((sDate.getMonth() + 1).toString().length > 1) ? (sDate.getMonth() + 1) : "0" + (sDate.getMonth() + 1); nyear = sDate.getFullYear(); var crDate = format.replace('m', nmonth); crDate = crDate.replace('d', nday); crDate = crDate.replace('Y', nyear); return crDate; }, daysBetween: function (date1, date2) { var d1Split = date1.split("."); var d2Split = date2.split("."); var sDate = new Date(d1Split[1] + "/" + d1Split[0] + "/" + d1Split[2]); var eDate = new Date(d2Split[1] + "/" + d2Split[0] + "/" + d2Split[2]); var daysApart = Math.abs(Math.round((sDate - eDate) / 86400000)); return daysApart; }, inBetween: function (d1, d2, d3, d4) { var d1Split = d1.split("."); var sDate = new Date(d1Split[1] + "/" + d1Split[0] + "/" + d1Split[2]); var sd1 = Math.abs(Math.round((sDate) / 86400000)); var d2Split = d2.split("."); var sDate = new Date(d2Split[1] + "/" + d2Split[0] + "/" + d2Split[2]); var sd2 = Math.abs(Math.round((sDate) / 86400000)); var d3Split = d3.split("."); var sDate = new Date(d3Split[1] + "/" + d3Split[0] + "/" + d3Split[2]); var sd3 = Math.abs(Math.round((sDate) / 86400000)); var d4Split = d4.split("."); var sDate = new Date(d4Split[1] + "/" + d4Split[0] + "/" + d4Split[2]); var sd4 = Math.abs(Math.round((sDate) / 86400000)); if ((sd1 < sd2) && (sd3 < sd4)) { if (sd1 < sd3) { if (sd2 <= sd3) { return false; } } else { if (sd4 <= sd1) { return false; } } } return true; }, check2Dates: function (x, y) { var datevalue1 = x; var datevalue2 = y; var day1 = datevalue1.substring(0, 2); var month1 = datevalue1.substring(3, 6); var year1 = datevalue1.substring(7, 11); var day2 = datevalue2.substring(0, 2); var month2 = datevalue2.substring(3, 6); var year2 = datevalue2.substring(7, 11); month1 = parseInt(month1, 10) - 1; month2 = parseInt(month2, 10) - 1; var d1 = new Date(year1, month1, day1); var d2 = new Date(year2, month2, day2); if (d1 > d2) { return true; } else { return false; } } }); var DateFunctions = new j(); var SpriteGoogle = xClass.extend({ Left : "-0px -0px", LeftHover : "-10px -0px", LeftDown : "-20px -0px", LeftDisabled : "-30px -0px", Main : "-0px -0px", MainHover : "-0px -30px", MainDown : "-0px -60px", MainDisabled : "-0px -90px", Right : "-40px -0px", RightHover : "-50px -0px", RightDown : "-60px -0px", RightDisabled : "-70px -0px", Height: "22px", Font: "11px tahoma", Color: "#000000", HoverColor: "#000000", DownColor: "#000000", DisabledColor: "#856d6d", Cursor:"pointer" }); var SpriteMozilla = xClass.extend({ Left: "-0px -30px", LeftHover: "-10px -30px", LeftDown: "-20px -30px", LeftDisabled: "-30px -30px", Main: "-0px -120px", MainHover: "-0px -150px", MainDown: "-0px -180px", MainDisabled: "-0px -210px", Right: "-40px -30px", RightHover: "-50px -30px", RightDown: "-60px -30px", RightDisabled: "-70px -30px", Height: "24px", Font: "11px tahoma", Color: "#000000", HoverColor: "#000000", DownColor: "#000000", DisabledColor: "#856d6d", Cursor: "pointer" }); var SpriteProduct = xClass.extend({ Left: "-0px -60px", LeftHover: "-10px -60px", LeftDown: "-20px -60px", LeftDisabled: "-30px -60px", Main: "-0px -240px", MainHover: "-0px -270px", MainDown: "-0px -300px", MainDisabled: "-0px -330px", Right: "-40px -60px", RightHover: "-50px -60px", RightDown: "-60px -60px", RightDisabled: "-70px -60px", Height: "24px", Font: "11px tahoma", Color: "#FFFFFF", HoverColor: "#EFEFEF", DownColor: "#000000", DisabledColor: "#856d6d", Cursor: "pointer" }); var j = xClass.extend({ firstViolence: null, ValidationGroup: new Array(), AddValidation: function (name, obj) { this.ValidationGroup.push([name, obj]); }, Validate: function (group) { var anyViolence = false; firstValidated = null; for (var i = 0; i < this.ValidationGroup.length; i++) { if (this.ValidationGroup[i][0] == group) { try { var dim = Core.FindObjectPosition(this.ValidationGroup[i][1].GetControl()); if (dim[0] == 0 && dim[1] == 0 && dim[2] == 0 && dim[3] == 0) continue; if (!this.ValidationGroup[i][1].GetClientEnabled() && !this.ValidationGroup[i][1].Validate()) { anyViolence = true; if (firstValidated == null) firstValidated = this.ValidationGroup[i][1]; } } catch (e) { } } } return !anyViolence; }, GetFirstValidatedControl: function () { return firstValidated; } }); var Validation = new j(); var SelectBox = xClass.extend({ id: "", UniqueID: '', construct: function (id) { this.id = id; }, GetID: function () { return this.id.replace('_', ''); }, GetControl: function () { return document.forms[0].elements[this.GetID()]; }, GetValue: function () { try { var option = this.GetControl().options[this.GetControl().selectedIndex]; return option.value; } catch (e) { } return "-1"; }, SetValue: function () { this.SelectItem('-1'); }, GetText: function () { var option = this.GetControl().options[this.GetControl().selectedIndex]; return option.text; }, SetClientEnabled: function (val) { document.forms[0].elements[this.GetID()].disabled = (val) ? false : true; }, GetClientEnabled: function () { return document.forms[0].elements[this.GetID()].disabled; }, AddOption: function (itemValue, itemText) { var isExist = false; var y = this.GetControl().options.length; for (var i = 0; i < y; i++) { if (this.GetControl().options[i].value == itemValue) { isExist = true; break; } } if (!isExist) { var opt = document.createElement("OPTION"); opt.value = itemValue; opt.text = itemText; this.GetControl().options.add(opt); } }, RemoveOption: function (value) { var y = this.GetControl().options.length; for (var i = 0; i < y; i++) { if (this.GetControl().options[i].value == value) { this.GetControl().remove(i); break; } } }, SelectItem: function (value) { try { var y = this.GetControl().options.length; for (var i = 0; i < y; i++) { if (this.GetControl().options[i].value == value) { this.GetControl().selectedIndex = i; break; } } } catch (Exception) {} }, IsEmpty: function () { //alert(this.id + ': ' + this.GetControl().options.length); if (this.GetControl().options.length > 0) return false; else return true; }, SetSelectedIndex: function (index) { this.GetControl().selectedIndex = index; }, GetSelectedIndex: function () { return this.GetControl().selectedIndex; }, Clear: function () { var y = this.GetControl().options.length; for (var i = 0; i < y; i++) { try { if (this.GetControl().options[i].value != '-1') { try { this.GetControl().options.remove(i); } catch (err) { this.GetControl().options[i] = null; } } } catch (err) { } } }, Validate: function () { try { var container = this.GetControl().parentNode; container.style.width = "100px"; container.style.padding = "1px"; if (this.GetValue() == "-1") { container.style.border = "1px solid red"; container.style.padding = "0px"; return false; } } catch (e) { alert('HATA (Validate) : ' + e.Description); } container.style.border = "none"; return true; }, ValidateByControl: function (groupName) { this.Validate(); }, Focus: function () { this.GetControl().focus(); } }); var Label = xClass.extend({ id: '', controlInstance: null, construct: function (id) { this.id = id; }, GetInstance: function () { return document.getElementById(this.id.replace("_", "")); }, GetText: function () { return this.GetInstance().innerHTML; }, SetText: function (value) { this.GetInstance().innerHTML = value; } }); var lastMultipleCombo = null; var Combo = xClass.extend({ id: "", LoaderText: "LoadingText", NullableText: "Choose", AllText: "Tümünü Seç", dataTable: null, values: new Array(), showLoaderOnCallback: false, controlID: "", controlMultiID: "", loaderText: '', UniqueID: '', isMultiple: false, multipleValue: "", onChange: "", valueHasChanged: false, GetID: function () { if (this.isMultiple) return this.controlMultiID; return this.id.replace('_', ''); }, GetMultiID: function () { return this.controlMultiID; }, GetContext: function () { return this.UniqueID; }, GetControl: function () { return document.getElementById(this.controlID); }, GetMultiControl: function () { return document.getElementById(this.controlMultiID); }, GetValue: function () { return (document.getElementById(this.controlID).value == '' ? '-1' : document.getElementById(this.controlID).value); }, GetText: function () { var obj = document.getElementById(this.controlID); var option = obj.options[obj.selectedIndex]; return option.text; }, IsEmpty: function () { var obj = document.getElementById(this.controlID); //alert(this.id + ': ' + obj.options.length); if (obj.options.length > 0) return false; else return true; }, GetContainerID: function () { return this.controlMultiID + "_ItemContainer"; }, AddOption: function (itemValue, itemText) { var opt = document.createElement("OPTION"); opt.value = itemValue; opt.text = itemText; this.GetControl().options.add(opt); }, SelectItem: function (value) { var y = this.GetControl().options.length; for (var i = 0; i < y; i++) { if (this.GetControl().options[i].value == value) { this.GetControl().selectedIndex = i; break; } } }, Clear: function () { var y = this.GetControl().options.length; for (var i = 0; i < y; i++) { try { this.GetControl().options.remove(0); } catch (err) { this.GetControl().options[0] = null; } } }, Validate: function () { var container = this.GetControl().parentNode; var dim = (Core.FindObjectPosition(container.childNodes[0])); container.style.width = dim[2].toString() + "px"; container.style.padding = "1px"; if (this.GetValue() == "") { container.style.border = "1px solid red"; container.style.padding = "0px"; return false; } container.style.border = "none"; return true; }, ValidateByControl: function (groupName) { this.Validate(); }, Focus: function () { this.GetControl().focus(); }, GetMultipleValue: function () { if (this.multipleValue == "") { return ""; } var obj = document.getElementById(this.controlID); var mss = this.multipleValue.split(','); var text = ""; for (var i = 0; i < mss.length; i++) { if (mss[i] == "") continue; text += mss[i] + ", "; } text = (text != "") ? text.substring(0, text.length - 2) : ""; return text; }, SetMultipleValue: function (value) { this.multipleValue = value; this.SetShowCaseValue(); }, SummonContainer: function (dontShow) { if (lastMultipleCombo != null) { var rt = false; if (lastMultipleCombo.id = this.id) rt = true; lastMultipleCombo.Dismiss(); if (rt) return; } lastMultipleCombo = (dontShow == null) ? this : null; this.valueHasChanged = false; var pos = Core.FindObjectPosition(this.GetMultiControl()); var main = null; if (document.getElementById(this.controlMultiID + "_ItemContainer") != null) { main = document.getElementById(this.controlMultiID + "_ItemContainer"); } else { main = document.body.appendChild(document.createElement("DIV")); var width = ((pos[2] + 20) < 150) ? 150 : pos[2] + 50; var height = 150; main.id = this.controlMultiID + "_ItemContainer"; main.className = "calendarMain"; main.style.position = "absolute"; main.style.width = width.toString() + "px"; main.style.height = height.toString() + "px"; main.style.zIndex = "+999"; main.innerHTML = "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
" + "" + "" + "" + "" + "" + "" + "
" + "
" + "" + "" + "" + "" + "" + "" + "
" + "
"; Core.AttEvt(document.body, 'click', Combo_BodyClicked); } if (dontShow == null) document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "-36px 0px"; main.style.display = (dontShow == null) ? "" : "none"; main.style.top = (pos[1] + pos[3] - 3) + "px"; main.style.left = (pos[0] - 2) + "px"; }, MouseOver: function () { try { if (lastMultipleCombo == null) document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "-18px 0px;"; else if (lastMultipleCombo.id == this.id) document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "-54px 0px"; else document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "-18px 0px;"; } catch (e) { } }, MouseOut: function () { try { if (lastMultipleCombo == null) document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "0px 0px;"; else if (lastMultipleCombo.id == this.id) document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "-36px 0px"; else document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "0px 0px;"; } catch (e) { } }, Dismiss: function () { try { document.getElementById(this.controlMultiID + "_ItemContainer").style.display = "none"; if ((this.onChange != "") && (this.valueHasChanged)) eval(this.onChange); lastMultipleCombo = null; document.getElementById(this.controlMultiID + "_Image").style.backgroundPosition = "0px 0px"; } catch (e) { } }, IsAllChecked: function () { var obj = document.getElementById(this.controlID); for (var j = 0; j < obj.options.length; j++) { if (obj.options[j].value == "-") continue; if (!this.HasValue(obj.options[j].value)) return 0; } return 1; }, AllClicked: function (chc) { var obj = document.getElementById(this.controlID); var y = 0; var x = 0; if (Core.browser == "ch") { var el = document.getElementsByTagName("INPUT"); var elLength = el.length; for (var t = 0; t < obj.options.length; t++) { if (obj.options[t].value == "-") { continue; } for (var k = 0; k < elLength; k++) { if (el[k].name == this.controlMultiID + "_ItemContainerChc_" + obj.options[t].value) { el[k].checked = false; this.ChcClicked(el[k]); } } y++; } } if (Core.browser == "ch") { var el = document.getElementsByTagName("INPUT"); var elLength = el.length; for (var t = 0; t < obj.options.length; t++) { if (obj.options[t].value == "-") { continue; } for (var k = 0; k < elLength; k++) { if (el[k].name == this.controlMultiID + "_ItemContainerChc_" + obj.options[t].value) { el[k].checked = chc.checked; this.ChcClicked( el[k]); } } x++; } } for (var t = 0; t < obj.options.length; t++) { if (obj.options[t].value == "-") { continue; } document.getElementsByTagName("INPUT")[this.controlMultiID + "_ItemContainerChc_" + obj.options[t].value].checked = false; this.ChcClicked(document.getElementsByTagName("INPUT")[this.controlMultiID + "_ItemContainerChc_" + obj.options[t].value]); y++; } for (var j = 0; j < obj.options.length; j++) { if (obj.options[j].value == "-") { continue; } document.getElementsByTagName("INPUT")[this.controlMultiID + "_ItemContainerChc_" + obj.options[j].value].checked = chc.checked; this.ChcClicked(document.getElementsByTagName("INPUT")[this.controlMultiID + "_ItemContainerChc_" + obj.options[j].value]); x++; } }, GenerateMultiple: function () { this.SummonContainer(true); this.SetShowCaseValue(); var obj = document.getElementById(this.controlID); var div = document.getElementById(this.controlMultiID + "_ItemContainerDIV"); div.innerHTML = ""; var sb = ""; for (var j = 0; j < obj.options.length; j++) { if (j == 0) { sb += ""; sb += ""; sb += ""; sb += ""; } if (obj.options[j].value == "-") continue; var checked = (this.HasValue(obj.options[j].value)) ? " checked" : ""; sb += ""; sb += ""; sb += ""; sb += ""; } sb += "
" + this.AllText + "
" + obj.options[j].text + "
"; div.innerHTML = sb; }, ChcClicked: function (obj) { var mss = this.multipleValue.split(","); if (obj.checked && !this.HasValue(obj.value)) mss.push(obj.value); else { var index = 0; for (var i = 0; i < mss.length; i++) { if (mss[i].toString() == obj.value.toString()) { index = i; break; } } mss.splice(i, 1); } this.multipleValue = mss.join(","); this.SetShowCaseValue(); this.valueHasChanged = true; }, HasValue: function (value) { var mss = this.multipleValue.split(','); for (var i = 0; i < mss.length; i++) { // alert(mss[i].toString()); // if (mss[i] == "") continue; if (mss[i].toString() == value.toString()) return true; } return false; }, SetShowCaseText: function (txt) { document.getElementById(this.controlMultiID + "ShowCase").value = txt; }, SetShowCaseValue: function () { var text = ""; var obj = document.getElementById(this.controlID); var mss = this.multipleValue.split(','); if (this.multipleValue == "") { this.SetShowCaseText(this.NullableText); return; } for (var i = 0; i < mss.length; i++) { if (mss[i] == "") continue; for (var j = 0; j < obj.options.length; j++) { if (obj.options[j].value.toString() == mss[i].toString()) { text += obj.options[j].text + ", "; } } } text = (text != "") ? text.substring(0, text.length - 2) : ""; document.getElementById(this.controlMultiID + "ShowCase").value = text; }, DoCallback: function (args) { eval("try { " + this.controlID + ".BeginCallback(args); } catch(e) {}"); WebForm_DoCallback(this.GetContext(), this.__getAllValues() + '|:SEP:|' + args, this.__endCallback, '', this.__errorCallback, false); if (this.showLoaderOnCallback) { this.Clear(); this.AddOption('', this.loaderText); if (this.isMultiple) this.SetShowCaseText(this.loaderText); } }, //PRIVATE FUNCTIONS construct: function (id) { this.id = id; this.dataTable = new DataTable(); }, __getAllValues: function () { var y = this.GetControl().options.length; var str = ""; for (var i = 0; i < y; i++) { str += encodeURI(this.GetControl().options[i].value) + "=" + encodeURI(this.GetControl().options[i].text) + "&"; } return str; }, __endCallback: function (arg, context) { var tempArgs = arg.split('|:SEP:|'); eval(tempArgs[1]); eval("try { " + tempArgs[0] + ".EndCallback(\"" + tempArgs[2] + "\"); } catch(e) {}"); eval("var y = " + tempArgs[0] + ".GetControl().options.length; for (var i = 0; i < y; i++) { " + tempArgs[0] + ".GetControl().options[i].text = decodeURI(" + tempArgs[0] + ".GetControl().options[i].text); }; if (" + tempArgs[0] + ".isMultiple) " + tempArgs[0] + ".GenerateMultiple();"); }, __errorCallback: function (arg, context) { alert(arg); } //END OF PRIVATE FUNCTIONS }); function Combo_BodyClicked(e) { try { if (lastMultipleCombo == null) return; var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; if (obj == lastMultipleCombo.GetMultiControl()) return; if (obj.parentNode != null) { while (obj.parentNode.tagName != "BODY") { if ((obj.parentNode.id == lastMultipleCombo.controlMultiID) || (obj.parentNode.id == lastMultipleCombo.GetContainerID())) return; obj = obj.parentNode; } } } catch (e) { alert(e.Description); } lastMultipleCombo.Dismiss(); } var TextEdit = xClass.extend({ id: '', maxValue: '', minValue: '', number: '', increment: 0, controlInstance: null, readonly : false, Mask: null, construct: function (id) { this.id = id; }, GetID: function () { return this.id.replace('_', ''); }, GetControl: function () { return document.forms[0].elements[this.GetID()]; }, GetText: function () { return document.forms[0].elements[this.GetID()].value; //unescape(document.forms[0].elements[this.GetID()].value); }, GetValue: function () { return this.GetText(); }, SetValue: function () { document.forms[0].elements[this.GetID()].value = ''; }, SetText: function (val) { document.forms[0].elements[this.GetID()].value = val; //escape(val); }, SetMaxLength: function (val) { document.forms[0].elements[this.GetID()].maxLength = val; document.forms[0].elements[this.GetID()].value = ''; }, SetVisible: function (val) { document.forms[0].elements[this.GetID()].style.display = (val) ? "" : "none"; }, SetClientEnabled: function (val) { document.forms[0].elements[this.GetID()].disabled = (val) ? false : true; if (this.Mask == "dateMask") { var cnt = document.forms[0].elements[this.GetID()]; cnt.parentNode.parentNode.getElementsByTagName("TD")[1].style.display = (val) ? "" : "none"; } }, GetClientEnabled: function () { return document.forms[0].elements[this.GetID()].disabled; }, Validate: function () { var container = this.GetControl().parentNode; var dim = (Core.FindObjectPosition(container.childNodes[0])); container.style.width = dim[2].toString() + "px"; container.style.padding = "1px"; if (!this.GetClientEnabled() && this.GetText() == "") { container.style.border = "1px solid red"; container.style.padding = "0px"; return false; } container.style.border = "none"; return true; }, Focus: function () { this.GetControl().focus(); }, ValidateByControl: function (groupName) { this.Validate(); }, SetSpinEditParams: function (_max, _min, _inc, _default) { this.maxValue = _max; this.minValue = _min; this.increment = _inc; this.number = _default; this.SetText(this.number); }, SetValueUp: function () { if (!this.GetClientEnabled()) { if (isNaN(this.GetText()) || this.GetText() == '') this.SetText('0'); if (parseInt(this.GetText()) >= parseInt(this.maxValue)) { return false; } this.SetText(parseInt(this.GetText()) + parseInt(this.increment)); } }, SetValueDown: function () { if (!this.GetClientEnabled()) { if (isNaN(this.GetText()) || this.GetText() == '') this.SetText('0'); if (parseInt(this.GetText()) <= parseInt(this.minValue)) { return false; } this.SetText(parseInt(this.GetText()) - parseInt(this.increment)); } }, OnKeyUp: function () { if (parseInt(this.GetText()) >= parseInt(this.maxValue)) { return this.SetText(this.maxValue); } else if (parseInt(this.GetText()) <= parseInt(this.minValue)) { return this.SetText(this.minValue); } } }); var TextArea = xClass.extend({ id: "", construct: function (ID) { this.id = ID; }, GetID: function () { return this.id.replace('_', ''); }, GetControl: function () { return document.forms[0].elements[this.GetID()]; }, GetText: function () { return document.forms[0].elements[this.GetID()].value; }, GetValue: function () { return document.forms[0].elements[this.GetID()].value; }, SetText: function (val) { document.forms[0].elements[this.GetID()].value = val; }, SetClientEnabled: function (val) { document.forms[0].elements[this.GetID()].disabled = (val) ? false : true; }, GetClientEnabled: function () { return document.forms[0].elements[this.GetID()].disabled; }, Validate: function () { var container = this.GetControl().parentNode; var dim = (Core.FindObjectPosition(container.childNodes[0])); container.style.width = dim[2].toString() + "px"; container.style.padding = "1px"; if (!this.GetClientEnabled() && this.GetText() == "") { container.style.border = "1px solid red"; container.style.padding = "0px"; return false; } container.style.border = "none"; return true; }, ValidateByControl: function (groupName) { this.Validate(); }, Focus: function () { this.GetControl().focus(); } }); var Label = xClass.extend({ id: '', controlInstance: null, construct: function (id) { this.id = id; }, GetInstance: function () { return document.getElementById(this.id.replace("_", "")); }, GetText: function () { return this.GetInstance().innerHTML; }, SetText: function (value) { this.GetInstance().innerHTML = value; } }); var Button = xClass.extend({ id: '', controlInstance: null, enabled: true, clickFnc: "", sprite: null, UniqueID: "", tableID: "", construct: function (id) { this.id = id; }, GetID: function () { return this.id.replace('_', ''); }, GetControl: function () { var coll = this.controlInstance.getElementsByTagName("TD"); return coll[1].getElementsByTagName("SPAN")[0].innerHTML; }, GetText: function () { var coll = this.controlInstance.getElementsByTagName("TD"); return coll[1].getElementsByTagName("SPAN")[0].innerHTML; }, Enable: function () { this.enabled = true; var coll = this.controlInstance.getElementsByTagName("TD"); coll[0].style.backgroundPosition = this.sprite.Left; coll[1].style.backgroundPosition = this.sprite.Main; coll[1].style.color = this.sprite.Color; coll[2].style.backgroundPosition = this.sprite.Right; }, Disable: function () { this.enabled = false; var coll = this.controlInstance.getElementsByTagName("TD"); coll[0].style.backgroundPosition = this.sprite.LeftDisabled; coll[1].style.backgroundPosition = this.sprite.MainDisabled; coll[1].style.color = this.sprite.DisabledColor; coll[2].style.backgroundPosition = this.sprite.RightDisabled; }, __mouseOver: function () { if (!this.enabled) return; var coll = this.controlInstance.getElementsByTagName("TD"); coll[0].style.backgroundPosition = this.sprite.LeftHover; coll[1].style.backgroundPosition = this.sprite.MainHover; coll[1].style.color = this.sprite.HoverColor; coll[2].style.backgroundPosition = this.sprite.RightHover; this.controlInstance.style.cursor = (this.enabled) ? this.sprite.Cursor : "default"; }, __mouseOut: function () { if (!this.enabled) return; var coll = this.controlInstance.getElementsByTagName("TD"); coll[0].style.backgroundPosition = this.sprite.Left; coll[1].style.backgroundPosition = this.sprite.Main; coll[1].style.color = this.sprite.Color; coll[2].style.backgroundPosition = this.sprite.Right; }, __mouseDown: function () { if (!this.enabled) return; var coll = this.controlInstance.getElementsByTagName("TD"); coll[0].style.backgroundPosition = this.sprite.LeftDown; coll[1].style.backgroundPosition = this.sprite.MainDown; coll[1].style.color = this.sprite.DownColor; coll[2].style.backgroundPosition = this.sprite.RightDown; }, __mouseUp: function () { if (!this.enabled) return; eval(decodeURI(this.clickFnc)); }, click: function () { this.__mouseUp(); }, initialize: function () { this.controlInstance = document.getElementById(this.tableID); var coll = this.controlInstance.getElementsByTagName("TD"); coll[0].style.background = "transparent"; coll[0].style.backgroundImage = "url(/Style/Editors/Resource/SingleSprite.png)"; coll[0].style.backgroundRepeat = "no-repeat"; coll[0].style.backgroundPosition = this.sprite.Left; coll[0].style.width = "10px" coll[0].style.height = this.sprite.Height; coll[0].innerHTML = ""; coll[1].style.background = "transparent"; coll[1].style.backgroundImage = "url(/Style/Editors/Resource/HorizontalLayout.png)"; coll[1].style.backgroundRepeat = "repeat-x"; coll[1].style.backgroundPosition = this.sprite.Main; coll[1].style.height = this.sprite.Height; coll[1].style.font = this.sprite.Font; coll[1].style.color = this.sprite.Color; coll[2].style.background = "transparent"; coll[2].style.backgroundImage = "url(/Style/Editors/Resource/SingleSprite.png)"; coll[2].style.backgroundRepeat = "no-repeat"; coll[2].style.backgroundPosition = this.sprite.Right; coll[2].style.width = "10px" coll[2].style.height = this.sprite.Height; coll[2].innerHTML = ""; } }); var CheckBox = xClass.extend({ id: '', controlInstance: null, construct: function (id) { this.id = id; }, GetID: function () { return this.id.replace('_', ''); }, GetChecked: function () { return document.forms[0].elements[this.GetID()].checked; }, GetValue: function () { return document.forms[0].elements[this.GetID()].checked; }, SetValue: function () { this.SetChecked(false); }, SetChecked: function (value) { document.forms[0].elements[this.GetID()].checked = value; }, SetClientEnabled: function (val) { document.forms[0].elements[this.GetID()].disabled = (val) ? false : true; }, Validate: function () { return true; }, GetText: function () { return document.getElementById(this.GetID() + "_checkbox").innerHTML; }, SetText: function (value) { document.getElementById(this.GetID() + "_checkbox").innerHTML = value; } }); var ImageUpload = xClass.extend({ id: "", controlID: "", UniqueID: "", ImageURL: "", PreviewWidth: 0, PreviewHeight: 0, AllowWidth: 0, AllowHeight: 0, ErrorMsg: "", GetID: function () { return this.id.replace('_', ''); }, GetContext: function () { return this.UniqueID; }, GetControl: function () { return document.getElementById(this.controlID); }, GetPreviewControl: function () { return document.getElementById(this.id.replace('_', '') + '_PRE'); }, GetImageURL: function () { return this.ImageURL; }, construct: function (id) { this.id = id; } }); var RadioGroup = xClass.extend({ id: "", controlID: "", UniqueID: "", clientID: "", HadCallback: false, keys: new Array(), values: new Array(), GetID: function () { return this.id.replace('_', ''); }, GetControl: function () { //var temp = this.UniqueID.replace(this.id.replace("_", ""), this.controlID); //return document.getElementsByTagName("input")["ctl00$ContentPlaceHolder1$"+this.controlID]; return document.getElementsByTagName("input")[this.clientID]; }, GetCallbackValue: function () { var i = 0; var x = ""; if (this.HadCallback) { x = "TransferID"; } else { x = this.clientID.replace(this.id, "") + "_" + this.controlID; } while (true) { if (document.getElementById(x + "_" + i.toString())) { var s = document.getElementById(x + "_" + i.toString()).value; if (document.getElementById(x + "_" + i.toString()).checked) { return s; } } else break; i++; if (i > 100) break; } }, GetValues: function () { var i = 0; while (true) { if (document.getElementById(this.clientID + "_" + i.toString())) { var s = document.getElementById(this.clientID + "_" + i.toString()).value; if (document.getElementById(this.clientID + "_" + i.toString()).checked) { return s; } } else break; i++; if (i > 100) break; } }, GetValue: function () { var i = 0; while (true) { if (document.getElementById(this.controlID + "_" + i.toString())) { var s = document.getElementById(this.controlID + "_" + i.toString()).value; if (document.getElementById(this.controlID + "_" + i.toString()).checked) { return s; } } else break; i++; if (i > 100) break; } }, SetValue: function (val) { var i = 0; while (true) { if (document.getElementById(this.controlID + "_" + i.toString())) { if (val == document.getElementById(this.controlID + "_" + i.toString()).value) { document.getElementById(this.controlID + "_" + i.toString()).checked = true; return; } } else break; i++; if (i > 10) break; } }, SetValue: function () { for (var i = 0; i < this.GetControl().length; i++) { this.GetControl()[i].checked = false; } }, Validate: function () { return true; }, construct: function (id) { this.id = id; } }); var MultiSelectCheckBox = xClass.extend({ id: '', construct: function (id) { this.id = id; }, GetID: function () { return this.id.replace('_', ''); }, GetControl: function () { return document.getElementById(this.GetID()); }, GetItems: function () { try { return this.GetControl().getElementsByTagName("input"); } catch (e) { return; } }, GetValue: function () { var selectedValues = ""; var items = this.GetItems(); if (items != null) { for (var i = 0; i < items.length; i++) { if (items[i].checked) { selectedValues += items[i].value + ','; } } } return selectedValues; }, SetValue: function (value) { var items = this.GetItems(); for (var i = 0; i < items.length; i++) { if (items[i].value == val[x]) { items[i].checked = true; break; } } return false; }, SetValue: function () { var items = this.GetItems(); for (var i = 0; i < items.length; i++) { items[i].checked = false; } return false; }, Validate: function () { return true; } }); var TabView = xClass.extend({ id: '', selectedItem: '', controlInstance: null, construct: function (id) { this.id = id; }, GetID: function () { return this.id.replace('_', ''); }, GetControl: function () { return document.forms[0].elements[this.GetID()]; }, SetVisible: function (val) { document.forms[0].elements[this.GetID()].style.display = (val) ? "" : "none"; }, SetClientEnabled: function (val) { document.forms[0].elements[this.GetID()].disabled = (val) ? false : true; }, GetClientEnabled: function () { return document.forms[0].elements[this.GetID()].disabled; }, Focus: function () { this.GetControl().focus(); }, TabView_OnMouseOver: function (obj) { obj.className = 'tabItem_mouseover'; }, TabView_OnMouseOut: function (obj) { obj.className = 'tabItem'; }, TabView_OnMouseDown: function (obj) { obj.className = 'tabItem_mouseover'; }, SetSelectedItem: function (val) { this.selectedItem = val; }, TabView_ItemOnClick: function (val) { var selected = document.getElementById(val + '_tbl'); document.getElementById(this.selectedItem + '_tbl').style.display = 'none'; selected.style.display = ''; this.selectedItem = val; }, ItemNext: function () { // document.getElementById(this.selectedItem + '_tbl').style.display = 'none'; // var name = this.selectedItem.split('_')[0]; // var index = this.selectedItem.split('_')[1]; // alert(name + '|' + index); // //var selected = document.getElementById(parseInt(index++) + '_tbl'); // //selected.style.display = ''; // //this.selectedItem = name + '_' + index; // //alert(this.selectedItem); } }); var j = xClass.extend({ boundControl: null, minDate: '', maxDate: '', selectedDate: '', currentMonth: 0, currentYear: 0, enabledDates: null, DevXControl: null, opener: null, ValueChangedEventHandler: null, constructor: function () { }, SetEnabledDates: function (enabledDates) { Calendar.enabledDates = enabledDates; //console.log(enabledDates); }, SetDevXContrl: function (devx) { Calendar.DevXControl = devx; }, SetValueChangedEventHandler: function (arr) { Calendar.ValueChangedEventHandler = arr; }, Show: function (boundControl, e) { Calendar.opener = (Core.browser == "ie") ? window.event.srcElement : e.target; Calendar.boundControl = boundControl; Calendar.ValueChangedEventHandler = new Array(); try { Calendar.selectedDate = Calendar.boundControl.GetText(); } catch (e) { if (Valid.isDate(Calendar.boundControl.value)) Calendar.selectedDate = Calendar.boundControl.value; else { Calendar.selectedDate = ((Translate.tDay < 10) ? "0" + Translate.tDay.toString() : Translate.tDay.toString()) + "." + ((Translate.tMonth < 10) ? "0" + Translate.tMonth.toString() : Translate.tMonth.toString()) + "." + Translate.tYear.toString(); } } var main = null; if (document.getElementById("Calendar_ShowCase")) { main = document.getElementById("Calendar_ShowCase"); } else { main = document.body.appendChild(document.createElement("DIV")); var width = 140; var height = 140; main.id = "Calendar_ShowCase"; main.style.position = "absolute"; main.style.width = width.toString() + "px"; main.style.height = height.toString() + "px"; main.className = "calendarMain"; main.style.zIndex = Core.GetToppestLayer(); main.innerHTML = "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
" + Calendar.getDayString(1).substring(0, 1) + "" + Calendar.getDayString(2).substring(0, 1) + "" + Calendar.getDayString(3).substring(0, 1) + "" + Calendar.getDayString(4).substring(0, 1) + "" + Calendar.getDayString(5).substring(0, 1) + "" + Calendar.getDayString(6).substring(0, 1) + "" + Calendar.getDayString(7).substring(0, 1) + "
PSÇPCCP
" + "
" + "" + "" + "" + "" + "" + "" + "
" + "
"; Core.AttEvt(document.body, 'mousedown', Calendar_BodyClicked); } var pos = Core.FindObjectPosition(Calendar.boundControl); setTimeout("Calendar.Manipulate()", 10); main.style.display = ""; main.style.top = (pos[1] + pos[3]) + "px"; main.style.left = pos[0] + "px"; }, Manipulate: function () { var d = parseInt(Calendar.selectedDate.split(".")[0], 10); var m = parseInt(Calendar.selectedDate.split(".")[1], 10); var y = parseInt(Calendar.selectedDate.split(".")[2], 10); var tbl = document.getElementsByTagName("TABLE")["Calendar_TABLE"]; var tot = tbl.rows.length; for (var i = 0; i < tot; i++) { try { tbl.deleteRow(2); } catch (e) { } } var pc = 0; var pr = 2; var row = tbl.insertRow(pr++); for (var i = 0; i < Calendar.firstDayOfMonth(m, y); i++) { var cell = row.insertCell(pc++); cell.innerHTML = " "; cell.className = "emptyDay"; } for (var i = 1; i < Calendar.daysInMonth(m, y) + 1; i++) { if (pc == 7) { pc = 0; row = tbl.insertRow(pr++); } cell = row.insertCell(pc++); var htmlDate = ((i < 10) ? "0" + i.toString() : i.toString()) + "." + Calendar.selectedDate.split(".")[1] + "." + Calendar.selectedDate.split(".")[2]; //console.log("htmlDate"+htmlDate); //console.log("selectedDate" + Calendar.selectedDate); //console.log(Calendar.enabledDates); //console.log(index); if (Calendar.enabledDates != null){ index = Calendar.enabledDates.indexOf(htmlDate); cell.className = Calendar.GetClassNameByDateAndType(htmlDate, Calendar.enabledDates[index+1]); } else if (Calendar.minDate != "") cell.className = Calendar.GetClassNameByDate(htmlDate); else cell.className = "enabledDay"; var s = ""; cell.innerHTML = s; } if (pc != 7) { var temp = pc; temp = temp - 1; for (var i = 1; i < 7 - temp; i++) { cell = row.insertCell(pc++); var nextM = m + 1; var nextY = y; if (nextM == 13) { nextM = 1; nextY = nextY + 1; } var htmlDate = ((i < 10) ? "0" + i.toString() : i.toString()) + "." + ((nextM < 10) ? "0" + nextM.toString() : nextM.toString()) + "." + nextY.toString(); if (Calendar.enabledDates != null) { index = Calendar.enabledDates.indexOf(htmlDate); cell.className = Calendar.GetClassNameByDateAndType(htmlDate, Calendar.enabledDates[index + 1]); } else if (Calendar.minDate != "") cell.className = Calendar.GetClassNameByDate(htmlDate); else cell.className = "enabledDay"; var s = ""; cell.innerHTML = s; } } document.getElementsByTagName("TD")["Calendar_Month"].innerHTML = "" + Calendar.getMonthString(m) + "-" + y.toString() + ""; }, ChangeMonth: function (inc) { var m = parseInt(Calendar.selectedDate.split(".")[1], 10); var y = parseInt(Calendar.selectedDate.split(".")[2], 10); m = m + inc; if (m == 0) { m = 12; y = y - 1; } else if (m == 13) { m = 1; y = y + 1; } Calendar.selectedDate = ("01" + "." + ((m < 10) ? "0" + m.toString() : m.toString()) + "." + y.toString()); Calendar.Manipulate(); }, daysInMonth: function (month, year) { var m = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; if (month != 2) return m[month - 1]; if (year % 4 != 0) return m[1]; if (year % 100 == 0 && year % 400 != 0) return m[1]; return m[1] + 1; }, firstDayOfMonth: function (month, year) { var date = new Date(month + "/01/" + year); if (date.getDay() == 0) return 6; else return date.getDay() - 1; }, getMonthString: function (month) { switch (month) { case 1: return Translate.Calendar_Month_January; break; case 2: return Translate.Calendar_Month_February; break; case 3: return Translate.Calendar_Month_March; break; case 4: return Translate.Calendar_Month_April; break; case 5: return Translate.Calendar_Month_May; break; case 6: return Translate.Calendar_Month_June; break; case 7: return Translate.Calendar_Month_July; break; case 8: return Translate.Calendar_Month_August; break; case 9: return Translate.Calendar_Month_September; break; case 10: return Translate.Calendar_Month_October; break; case 11: return Translate.Calendar_Month_November; break; case 12: return Translate.Calendar_Month_December; break; } }, getDayString: function (day) { switch (day) { case 1: return Translate.Calendar_Day_Monday; break; case 2: return Translate.Calendar_Day_Tuesday; break; case 3: return Translate.Calendar_Day_Wednesday; break; case 4: return Translate.Calendar_Day_Thursday; break; case 5: return Translate.Calendar_Day_Friday; break; case 6: return Translate.Calendar_Day_Saturday; break; case 7: return Translate.Calendar_Day_Sunday; break; } }, GetClassName: function (date) { for (var i = 0; i < Calendar.enabledDates.length; i++) { if (date == Calendar.enabledDates[i]) return "enabledDay"; } return "disabledDay"; }, GetClassNameByDate: function (date) { return (DateFunctions.check2Dates(Calendar.minDate, date)) ? "disabledDay" : "enabledDay"; }, GetClassNameByDateAndType: function (date, type) { //console.log(type); for (var i = 0; i < Calendar.enabledDates.length; i++) { if (date == Calendar.enabledDates[i]) if(type==1) return "enabledDayCharter"; else if (type==2) return "enabledDayRegular"; else if (type==3) return "enabledDayCharterRegular"; else return "enabledDay"; } return "disabledDay"; }, SelectDate: function (date) { if (Calendar.DevXControl != null) Calendar.DevXControl.SetText(date); else Calendar.boundControl.value = date; if (Calendar.ValueChangedEventHandler.length > 0) { var strFunction = Calendar.ValueChangedEventHandler[0] + "("; for (var i = 1; i < Calendar.ValueChangedEventHandler.length; i++) { strFunction += "'" + Calendar.ValueChangedEventHandler[i] + "'"; if (Calendar.ValueChangedEventHandler.length != i + 1) strFunction += ","; } strFunction += ")"; eval(strFunction); } Calendar.Hide(); }, Hide: function () { try { document.getElementById("Calendar_ShowCase").style.display = "none"; Calendar.boundControl = null; Calendar.DevXControl = null; } catch (e) { } } }); var Calendar = new j(); function Calendar_BodyClicked(e) { try { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; if (obj == Calendar.opener) return; if (obj.parentNode != null) { while (obj.parentNode.tagName != "BODY") { if (obj.parentNode.id == "Calendar_ShowCase") return; obj = obj.parentNode; } } } catch (e) { } Calendar.Hide(); } var j = xClass.extend({ obj: new Array(), startX: 0, startY: 0, objPos: new Array(), openObj: new Array(), isClosable : true, ClickedToMove: function (objID, e) { for (var i = 0; i < objID.length; i++) { DragDrop.obj.push(document.getElementById(objID[i])); DragDrop.objPos.push(Core.FindObjectPosition(DragDrop.obj[i])); if (objID[i].indexOf("_IFRAME") != -1) { document.getElementById(objID[i]).style.zIndex = "-1"; } if (!e) var e = window.event; if (e.pageX || e.pageY) { DragDrop.startX = e.pageX; DragDrop.startY = e.pageY; } else if (e.clientX || e.clientY) { DragDrop.startX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; DragDrop.startY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } } }, ClickedToDrag: function () { for (var i = 0; i < DragDrop.obj.length; i++) { if (DragDrop.obj[i].id.indexOf("_IFRAME") != -1) { DragDrop.obj[i].style.zIndex = Core.GetToppestLayer(); } } DragDrop.obj = new Array(); DragDrop.objPos = new Array(); }, MouseMove: function (e) { if (DragDrop.obj.length > 0) { var newX = 0; var newY = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { newX = e.pageX; newY = e.pageY; } else if (e.clientX || e.clientY) { newX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; newY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } var diffX = newX - DragDrop.startX; var diffY = newY - DragDrop.startY; for (var i = 0; i < DragDrop.obj.length; i++) { DragDrop.obj[i].style.left = (DragDrop.objPos[i][0] + diffX) + "px"; DragDrop.obj[i].style.top = (DragDrop.objPos[i][1] + diffY) + "px"; } } }, WindowScroll: function (e) { if (DragDrop.openObj.length > 0) { for (var i = 0; i < DragDrop.openObj.length; i++) { var x = document.documentElement.scrollLeft; var y = document.documentElement.scrollTop; var ox = parseInt(DragDrop.openObj[i][1]); var oy = parseInt(DragDrop.openObj[i][2]); var cx = (ox - x); var cy = (oy - y); DragDrop.openObj[i][0].style.left = (parseInt(DragDrop.openObj[i][0].style.left) - (cx)).toString() + "px"; DragDrop.openObj[i][0].style.top = (parseInt(DragDrop.openObj[i][0].style.top) - (cy)).toString() + "px"; DragDrop.openObj[i][1] = x; DragDrop.openObj[i][2] = y; } } }, Register: function (objID) { for (var i = 0; i < objID.length; i++) { DragDrop.openObj.push([document.getElementById(objID[i]), document.documentElement.scrollLeft, document.documentElement.scrollTop]); } }, UnRegister: function (objID) { for (var i = 0; i < objID.length; i++) { var j = 0; var found = false; for (var j = 0; j < DragDrop.openObj.length; j++) { if (DragDrop.openObj[j][0].id == objID[i]) { found = true; break; } } if (found) { DragDrop.openObj.splice(j, 1); } } } }); var DragDrop = new j(); var StaticWindowOverlay = null; var StaticWindow = xClass.extend({ id: "", title: '', width: 0, height: 0, isModal: false, text: '', url: '', title: '', iframeObject: null, callbackPanelObject: null, regObjects: new Array(), SetText: function (text) { this.text = text; this.url = ""; }, SetURL: function (url) { this.url = url; this.text = ""; }, SetTitle: function (title) { this.title = title; }, Create: function () { if (StaticWindowOverlay == null) { StaticWindowOverlay = document.body.appendChild(document.createElement("DIV")); StaticWindowOverlay.style.position = "absolute"; StaticWindowOverlay.style.top = "0px"; StaticWindowOverlay.style.left = "0px"; StaticWindowOverlay.style.display = "none"; StaticWindowOverlay.style.backgroundColor = "#000000"; StaticWindowOverlay.style.opacity = ".30"; StaticWindowOverlay.style.filter = "alpha(opacity=30)"; StaticWindowOverlay.style.zIndex = Core.GetToppestLayer(); StaticWindowOverlay.id = "StaticWindowOverlayObject"; StaticWindowOverlay.style.width = "100%"; StaticWindowOverlay.style.height = "100%"; } if (this.id == "_ProductFlightDetail") this.width = 1100; var width = this.width; var height = this.height; if (this.isModal) { var xxx = Core.GetPageSize(); document.getElementById("StaticWindowOverlayObject").style.display = ""; StaticWindowOverlay.style.height = xxx[1] + "px"; } var div = document.body.appendChild(document.createElement("DIV")); div.style.position = "absolute"; div.style.zIndex = Core.GetToppestLayer(); div.id = this.id + "__StaticWindow"; var pageSize = Core.GetPageSize(); var sPos = pageScroll.GetCurrentScrollPosition(); width = (pageSize[2] < width) ? pageSize[2] - 20 : width; height = (pageSize[3] < height) ? pageSize[3] - 30 : height; var left = Math.round((pageSize[2] - width) / 2); var top = Math.round((pageSize[3] - height) / 2) + pageScroll.GetCurrentScrollPosition(); div.style.top = top.toString() + "px"; div.style.left = left.toString() + "px"; div.style.width = width.toString() + "px"; div.style.height = height.toString() + "px"; var closeButton = (this.isClosable) ? "" : ""; var divText = (this.text != "") ? this.text : ""; var dragThing = ""; if (this.callbackPanelObject == null) { if (this.text == "") { this.iframeObject = document.body.appendChild(document.createElement("IFRAME")); this.iframeObject.style.position = "absolute"; this.iframeObject.setAttribute("name", this.id + "__StaticWindow_IFRAME"); this.iframeObject.style.width = (width - 28).toString() + "px"; this.iframeObject.style.height = (height - 52).toString() + "px"; this.iframeObject.style.top = (top + 38).toString() + "px"; this.iframeObject.style.left = (left + 14).toString() + "px"; this.iframeObject.location = "about:blank"; this.iframeObject.id = this.id + "__StaticWindow_IFRAME"; dragThing = this.id + "__StaticWindow_IFRAME"; this.iframeObject.style.zIndex = Core.GetToppestLayer(); try { this.iframeObject.frameBorder = "0"; this.iframeObject.border = "0px"; } catch (e) { this.iframeObject.setAttribute("frameborder", "0"); } } } else { this.callbackPanelObject.SetWidth((width - 28)); this.callbackPanelObject.SetWidth((height - 28)); this.callbackPanelObject.SetClientVisible(true); dragThing = this.callbackPanelObject.name; var fd = document.getElementsByTagName("DIV"); for (var i = 0; i < fd.length; i++) { if (fd[i].id.indexOf(this.callbackPanelObject.name) != -1) { fd[i].style.position = "absolute"; fd[i].style.zIndex = Core.GetToppestLayer(); fd[i].style.top = (top + 38).toString() + "px"; fd[i].style.left = (left + 14).toString() + "px"; break; } } } this.regObjects[0] = this.id + "__StaticWindow"; if (dragThing != "") this.regObjects[1] = dragThing; div.innerHTML = "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
" + "" + "" + "" + "" + "" + "" + "" + "
" + this.title + "" + closeButton + "
" + divText + "
" + "
"; DragDrop.Register(this.regObjects); }, Dispose: function () { StaticWindowOverlay.style.display = "none"; if ((this.callbackPanelObject == null) && (this.text == "")) document.body.removeChild(document.getElementById(this.id + "__StaticWindow_IFRAME")); else if (this.callbackPanelObject != null) this.callbackPanelObject.SetClientVisible(false); this.DisposeChildren(document.getElementById(this.id + "__StaticWindow")); document.body.removeChild(document.getElementById(this.id + "__StaticWindow")); DragDrop.UnRegister(this.regObjects); }, DisposeChildren: function (el) { for (var i = 0; i < el.childNodes.length; i++) { if (el.childNodes[i].childNodes.length > 0) { this.DisposeChildren(el.childNodes[i]); } el.removeChild(el.childNodes[0]); } }, Open: function (callback) { this.Create(); if (typeof (callback) == "function") callback(); }, Close: function (callback) { if (typeof (callback) == "function") callback(); this.Dispose(); }, NavigateURL: function (url) { if (this.callbackPanelObject != null) return; if ((Core.browser == "sa") || (Core.browser == "ch") || (Core.browser == "ff")) { document.getElementById(this.iframeObject.id).src = url; return; } try { window.frames[this.iframeObject.id].location = url; } catch (e) { document.getElementById(this.iframeObject.id).src = url; } }, construct: function (id) { this.id = id; } }); function DragDrop_MouseMove(e) { DragDrop.MouseMove(e); } function DragDrop_WindowScroll(e) { setTimeout("DragDrop.WindowScroll();", 100); } if (window.addEventListener) { window.addEventListener("mousemove", DragDrop_MouseMove, false); } else if (window.attachEvent) { window.attachEvent('onmousemove', DragDrop_MouseMove); } if (window.addEventListener) { window.addEventListener("scroll", DragDrop_WindowScroll, false); } else if (window.attachEvent) { window.attachEvent('onscroll', DragDrop_WindowScroll); } var j = xClass.extend({ opener: null, softDIV: null, highestZIndex: 0, Init: function () { if (this.highestZIndex == 0) this.highestZIndex = Core.GetToppestLayer(); }, Show: function (obj, width, height, text, adv) { if (adv == null) adv = 0; ToolTip.Hide(); var pos = Core.FindObjectPosition(obj); var offset = Core.FindObjectOffset(obj); var div = document.body.appendChild(document.createElement("DIV")); if (this.highestZIndex == 0) this.highestZIndex = Core.GetToppestLayer(); div.style.width = width.toString() + "px"; div.style.height = height.toString() + "px"; div.style.position = "absolute"; div.style.left = (pos[0] - width) + "px"; div.style.top = (offset.top + (adv)) + "px"; div.style.zIndex = this.highestZIndex + 1; div.id = "ToolTip_ShowCase"; ToolTip.opener = obj; div.innerHTML = "
 
" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
" + text + "
" + "" + "" + "" + "" + "" + "" + "
" + "
"; Core.AttEvt(document.body, 'click', ToolTip_BodyClicked); }, Hide: function () { try { document.body.removeChild(document.getElementById('ToolTip_ShowCase')); Core.RmvEvt(document.body, 'click', ToolTip_BodyClicked); } catch (e) { } }, ShowSoft: function (obj, text) { if (ToolTip.SoftDiv == null) { ToolTip.SoftDiv = document.body.appendChild(document.createElement("DIV")); with (ToolTip.SoftDiv.style) { top = "0px"; left = "0px"; position = "absolute"; background = "#efefef"; border = "1px solid #cccccc"; display = "none"; font = "12px arial"; padding = "3px"; zIndex = "+999"; } } ToolTip.SoftDiv.innerHTML = text; ToolTip.SoftDiv.style.display = ""; var pos = Core.FindObjectPosition(obj); with (ToolTip.SoftDiv.style) { top = pos[1] + pos[3] + "px"; left = pos[0] + "px"; } }, HideSoft: function () { ToolTip.SoftDiv.style.display = "none"; } }); var ToolTip = new j(); ToolTip.Init(); function ToolTip_BodyClicked(e) { try { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; if (obj == ToolTip.opener) return; while (obj.parentNode.tagName != "BODY") { if (obj.parentNode.id == ("ToolTip_ShowCase")) { return; } obj = obj.parentNode; } } catch (e) { } ToolTip.Hide(); } var j = xClass.extend({ boundControl: null, DevXControl: null, opener: null, ValueChangedEventHandler: null, minimumSelection: 1, minimumSelectionException: 'Seçim Yapabileceğiniz Minimum Sayı', maximumSelection: 4, maximumSelectionException: 'Seçim Yapabileceğiniz Maximum Sayı', dataSource: new Array([1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30]), selectionSeperator: ',', keyFieldIndex: 0, valueFieldIndex: 0, cellsPerRow: 6, itemStyle: '', itemClassName: 'selectionItem', selectedStyle: '', selectedClassName: 'selectionSelected', overStyle: '', overClassName: 'selectionOver', headerText: 'Select Night Stay', headerClassName: 'selectionHeaderText', selectedValue: new Array(), constructor: function () { }, SetDevXControl: function (devx) { OtiSelection.DevXControl = devx; }, SetValueChangedEventHandler: function (arr) { OtiSelection.ValueChangedEventHandler = arr; }, SetDataSource: function (obj) { OtiSelection.dataSource = obj; }, Show: function (boundControl, e) { OtiSelection.opener = (Core.browser == "ie") ? window.event.srcElement : e.target; OtiSelection.boundControl = boundControl; OtiSelection.ValueChangedEventHandler = new Array(); // try to get value of bound control var virtualValue = ""; if (OtiSelection.DevXControl != null) { virtualValue = OtiSelection.DevXControl.GetText(); } else { virtualValue = OtiSelection.boundControl.value; } OtiSelection.selectedValue = new Array(); if (virtualValue != "") { var sp = virtualValue.split(OtiSelection.selectionSeperator); for (var i = 0; i < sp.length; i++) { OtiSelection.selectedValue.push(StringFunctions.trim(sp[i])); } } if (OtiSelection.selectedValue.length > 0) { for (var i = 0; i < OtiSelection.selectedValue.length; i++) { OtiSelection.selectedValue[i] = OtiSelection.GetKeyForValue(OtiSelection.selectedValue[i]); } } // got it var main = null; if (document.getElementById("OtiSelection_ShowCase")) { main = document.getElementById("OtiSelection_ShowCase"); } else { main = document.body.appendChild(document.createElement("DIV")); main.id = "OtiSelection_ShowCase"; main.style.position = "absolute"; main.className = "selectionMain"; main.innerHTML = "" + "" + "" + "
"; Core.AttEvt(document.body, 'click', OtiSelection_BodyClicked); } var pos = Core.FindObjectPosition(OtiSelection.boundControl); main.style.display = ""; main.style.top = (pos[1] + pos[3] - 70) + "px"; main.style.left = (pos[0]+74) + "px"; setTimeout("OtiSelection.Manipulate()", 10); }, Manipulate: function () { var tbl = document.getElementsByTagName("TABLE")["OtiSelection_TABLE"]; var tot = tbl.rows.length; for (var i = 0; i < tot; i++) { try { tbl.deleteRow(0); } catch (e) { } } var pc = 0; var pr = 0; var row = tbl.insertRow(pr++); var cell = row.insertCell(0); cell.colSpan = OtiSelection.cellsPerRow; var span = cell.appendChild(document.createElement("SPAN")); span.innerHTML = OtiSelection.headerText; span.className = OtiSelection.headerClassName; row = tbl.insertRow(pr++); var x = ""; for (var i = 0; i < OtiSelection.dataSource.length; i++) { if (pc == OtiSelection.cellsPerRow) { pc = 0; row = tbl.insertRow(pr++); } cell = row.insertCell(pc++); cell.style.width = "20px"; cell.style.height = "20px"; var s = "
"; s += OtiSelection.dataSource[i][OtiSelection.valueFieldIndex] + "
"; cell.innerHTML = s; } }, ItemOver: function (key) { var item = document.getElementById("OtiSelection_Key_" + key); if (!OtiSelection.HasKey(key)) { if (OtiSelection.overClassName != "") { item.className = OtiSelection.overClassName; } else { item.setAttribute("style", OtiSelection.overStyle); } } }, ItemOut: function (key) { var item = document.getElementById("OtiSelection_Key_" + key); if (!OtiSelection.HasKey(key)) { if (OtiSelection.itemClassName != "") { item.className = OtiSelection.itemClassName; } else { item.setAttribute("style", OtiSelection.itemStyle); } } }, ItemClick: function (key) { var item = document.getElementById("OtiSelection_Key_" + key); if (!OtiSelection.HasKey(key)) { if (OtiSelection.selectedValue.length == OtiSelection.maximumSelection) { alert(OtiSelection.maximumSelectionException + ':' + OtiSelection.maximumSelection); return; } item.className = OtiSelection.selectedClassName; OtiSelection.selectedValue.push(key); } else { if (OtiSelection.selectedValue.length == OtiSelection.minimumSelection) { alert(OtiSelection.minimumSelectionException + ':' + OtiSelection.minimumSelection); return; } item.className = OtiSelection.itemClassName; for (var i = 0; i < OtiSelection.selectedValue.length; i++) { if (OtiSelection.selectedValue[i] == key) { OtiSelection.selectedValue.splice(i, 1); break; } } } OtiSelection.ChangeControlValue(); }, ChangeControlValue: function () { var virtualValues = ""; for (var i = 0; i < OtiSelection.selectedValue.length; i++) { virtualValues += OtiSelection.GetValueForKey(OtiSelection.selectedValue[i]); if (i != OtiSelection.selectedValue.length - 1) virtualValues += OtiSelection.selectionSeperator; } if (OtiSelection.DevXControl != null) { OtiSelection.DevXControl.SetText(virtualValues); } else { OtiSelection.boundControl.value = virtualValues; } }, HasKey: function (key) { for (var i = 0; i < OtiSelection.selectedValue.length; i++) { if (OtiSelection.selectedValue[i] == key) { return true; } } return false; }, GetKeyForValue: function (value) { for (var i = 0; i < OtiSelection.dataSource.length; i++) { if (OtiSelection.dataSource[i][OtiSelection.valueFieldIndex] == value) { return OtiSelection.dataSource[i][OtiSelection.keyFieldIndex]; } } return -1124123; }, GetValueForKey: function (key) { for (var i = 0; i < OtiSelection.dataSource.length; i++) { if (OtiSelection.dataSource[i][OtiSelection.keyFieldIndex] == key) { return OtiSelection.dataSource[i][OtiSelection.valueFieldIndex]; } } return ""; }, Hide: function () { document.getElementById("OtiSelection_ShowCase").style.display = "none"; OtiSelection.boundControl = null; OtiSelection.DevXControl = null; } }); var OtiSelection = new j(); function OtiSelection_BodyClicked(e) { try { var obj = (Core.browser == "ie") ? window.event.srcElement : e.target; if (obj == OtiSelection.opener) return; if (obj.parentNode != null) { while (obj.parentNode.tagName != "BODY") { if (obj.parentNode.id == "OtiSelection_ShowCase") return; obj = obj.parentNode; } } } catch (e) { } OtiSelection.Hide(); } var jsTree = xClass.extend({ /*------------------------------- PROPERTIES -------------------------------*/ name: '', instanceName: '', renderTo: null, width: 0, height: 0, areas: new Array(), iconDimensions: new Array(16, 16), nodeSize: 20, spriteIMG: '', generatedHTML: '', nonExpandableNodeLevel: -1, nodeIconPositions: new Array(), nodeDefaultIconPosition: new Array(0, 0), hasCheckBox: false, loaderIMG: '', expandedNodes: new Array(), mouseOverBG: '#699cb7', checkedValues: new Array(), rootValues: new Array(), /*------------------------------- GETTERS SETTERS -------------------------------*/ SetInstanceName: function (name) { this.instanceName = name; }, SetMouseOverBG: function (color) { this.mouseOverBG = color; }, SetRenderingContainer: function (obj) { this.renderTo = obj; var dim = Core.FindObjectPosition(obj); this.width = dim[2]; this.height = dim[3]; }, SetData: function (areas) { this.areas = areas; }, SetIconDimensions: function (width, height) { this.iconDimensions = new Array(width, height); }, SetNodeSize: function (size) { this.nodeSize = 20; }, SetSpriteIMG: function (url) { this.spriteIMG = url; }, GetHTML: function () { return this.generatedHTML; }, SetNonExpandableNodeLevel: function (level) { this.nonExpandableNodeLevel = level; }, SetNodeIconPosition: function (node, position) { this.nodeIconPositions.push(new Array(node, position)); }, SetNodeDefaultIconPosition: function (left, top) { this.nodeDefaultIconPosition = new Array(left, top); }, HasCheckBox: function (cond) { this.hasCheckBox = cond; }, Loader: function (cond, url) { if (cond) this.loaderIMG = url; else this.loaderIMG = ''; }, /*------------------------------- PRIVATE METHODS -------------------------------*/ construct: function () { var d = new Date(); this.name = 'jsTree' + d.getTime(); }, hasChildNodes: function (node) { for (i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[2] == node) { return true; } } return false; }, getNodeIcon: function (node) { for (var i = 0; i < this.nodeIconPositions.length; i++) { if (this.nodeIconPositions[i][0] == node) { return this.nodeIconPositions[i][1]; } } return this.nodeDefaultIconPosition[1]; }, nodeSelection: function (nodeID, parentNodeID, cond) { var div = document.getElementById(this.name + "_container_" + nodeID + "_parentNodeID"); for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[2] == nodeID) { document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]).childNodes[1].childNodes[0].checked = cond; this.nodeSelection(pair[0], pair[2], cond); } } }, isAllChecked: function (parentID) { if (parentID == 0) return; var checked = true; var mn = 0; for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[0] == parentID) { mn = pair[2]; break; } } for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[2] == parentID) { if (!document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]).childNodes[1].childNodes[0].checked) { checked = false; document.getElementById(this.name + "_main_" + parentID + "_" + mn).childNodes[1].childNodes[0].checked = false; this.isAllChecked(mn); break; } } } if (checked) document.getElementById(this.name + "_main_" + parentID + "_" + mn).childNodes[1].childNodes[0].checked = true; this.isAllChecked(mn); }, changeSelection: function (obj) { if (!this.hasCheckBox) return; if (obj.tagName == "INPUT") { var sp = obj.id.split("_"); var checked = obj.checked; var nodeID = sp[sp.length - 2]; var parentNodeID = sp[sp.length - 1]; if (this.hasChildNodes(sp[sp.length - 2])) { this.nodeSelection(nodeID, parentNodeID, checked); } this.isAllChecked(parentNodeID); try { eval(this.instanceName + "_SelectionChanged();"); } catch (e) { } } }, getChildNodes: function (node, parentID, depth) { var paddingLeft = this.iconDimensions[0] * depth; for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[2] == node) { var pd = (this.nonExpandableNodeLevel >= depth) ? "block" : "none"; var nodePadding = this.nodeSize * depth; var nodeWidth = this.width - 20; this.generatedHTML += "
"; nodeWidth = nodeWidth - this.nodeSize; var ndip = new Array(this.nodeDefaultIconPosition[0], this.getNodeIcon(depth)); if (pd == "block") { ndip[0] = this.nodeDefaultIconPosition[0] + this.iconDimensions[0]; this.expandedNodes.push(pair[0] + "_" + pair[2]); } this.generatedHTML += "" + ""; if (this.hasCheckBox) { nodeWidth = nodeWidth - this.nodeSize; this.generatedHTML += ""; } nodeWidth = nodeWidth - nodePadding; this.generatedHTML += ""; this.generatedHTML += "
"; this.generatedHTML += "
"; this.getChildNodes(pair[0], pair[2], depth + 1); this.generatedHTML += "
"; } } }, resetDelegate: function (parentID, depth) { this.expandedNodes.splice(0, this.expandedNodes.length); for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[2] == parentID) { var div = document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]); div.style.display = ""; var cnt = document.getElementById(this.name + "_container_" + pair[0] + "_" + pair[2]); var objTop = div.childNodes[0].childNodes[0].style.backgroundPosition.split(" ")[1]; div.childNodes[0].childNodes[0].style.display = ""; if (this.hasChildNodes(pair[0])) div.childNodes[0].childNodes[0].style.backgroundPosition = (this.nonExpandableNodeLevel >= depth) ? "-" + (this.nodeDefaultIconPosition[0] + this.iconDimensions[0]).toString() + "px " + objTop : "-0px " + objTop; cnt.style.display = (this.nonExpandableNodeLevel >= depth) ? "block" : "none"; this.resetDelegate(pair[0], depth + 1); } } }, searchDelegate: function (parentNode) { for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[0] == parentNode) { var div = document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]); var cnt = document.getElementById(this.name + "_container_" + pair[0] + "_" + pair[2]); div.style.display = ""; cnt.style.display = ""; if (pair[2] == 0) break; this.searchDelegate(pair[2]); break; } } }, expandNode: function (value, obj) { var ne = -1; for (var i = 0; i < this.expandedNodes.length; i++) { if (this.expandedNodes[i] == value) { ne = i; break; } } if (ne > -1) this.expandedNodes.splice(ne, 1); else this.expandedNodes.push(value); var objTop = obj.style.backgroundPosition.split(" ")[1]; obj.style.backgroundPosition = (ne > -1) ? "-0px " + objTop : "-" + (this.nodeDefaultIconPosition[0] + this.iconDimensions[0]) + "px " + objTop; document.getElementById(this.name + '_container_' + value).style.display = (ne > -1) ? "none" : "block"; }, GetCheckedValueRecursive: function (nodeID) { for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if (pair[2] == nodeID) { if (!this.hasChildNodes(pair[0])) { if (document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]).childNodes[1].childNodes[0].checked) { if ((',' + this.checkedValues.join(',') + ',').indexOf(',' + pair[0] + ',') == -1) this.checkedValues.push(pair[0]); } } else { this.GetCheckedValueRecursive(pair[0]); } } } }, /*------------------------------- PUBLIC METHODS -------------------------------*/ GetCheckedValues: function () { this.checkedValues = new Array(); for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; if ((pair[2] == 0) && (!this.hasChildNodes(pair[0]))) { if (document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]).childNodes[1].childNodes[0].checked) { this.checkedValues.push(pair[0]); } } else { this.GetCheckedValueRecursive(pair[0]); } } return this.checkedValues; }, Generate: function () { if (this.instanceName == '') { alert("You have to specify the instance name of this object using SetInstanceName(string instanceName) method"); return; } this.generatedHTML = ''; this.getChildNodes(0, 0, 0); if (this.renderTo) { this.renderTo.innerHTML = this.generatedHTML; } return; }, Reset: function () { this.ClearSelection(); this.resetDelegate(0, 0); }, ClearSelection: function () { for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]).childNodes[1].childNodes[0].checked = false; } try { eval(this.instanceName + "_SelectionChanged();"); } catch (e) { alert(e.description); } }, Search: function (txt) { if ((txt == null) || (txt == '')) { this.Reset(0, 0); } else { var triggerParents = new Array(); for (var i = 0; i < this.areas.length; i++) { var pair = this.areas[i]; var div = document.getElementById(this.name + "_main_" + pair[0] + "_" + pair[2]); div.childNodes[0].childNodes[0].style.display = "none"; if (pair[1].toLowerCase().indexOf(txt.toLowerCase()) != -1) { div.style.display = ""; triggerParents.push(pair[2]); } else { div.style.display = "none"; } } for (var i = 0; i < triggerParents.length; i++) this.searchDelegate(triggerParents[i]); } } }); var j = xClass.extend({ StringType : "StringType", ImageType : "ImageType", SpriteImageType : "SpriteImageType", ShortStringType : "ShortStringType" }); var GridViewColumnTypes = new j(); var j = xClass.extend({ SetSpriteImagePosition : "SetSpriteImagePosition", SetHyperLinkVisibility : "SetHyperLinkInvisible", SetCustomValue : "SetCustomValue", SetJoinedColumnsVisibility : "SetJoinedColumnsInvisible", SetToolTipTextVisibility : "SetToolTipTextInvisible" }); var GridViewValueSettings = new j(); var j = xClass.extend({ IsEqualTo : "IsEqualTo", IsGreaterThan : "IsGreaterThan", IsSmallerThan : "IsSmallerThan", IsBetween : "IsBetween" }); var GridViewConditionalOperators = new j(); var GridViewConditionalRendering = xClass.extend({ SourceValue: null, SourceColumn: null, // instanceOF : GridViewColumn Operator: null, // instanceOF : GridViewConditionalOperators TargetValue: null, TargetColumn: null, // instanceOF : GridViewColumn KeyToSet: null, // instanceOF : GridViewValueSettings ValueToSet: null, CreateForSpriteImageFromColumn: function (column, operator, targetColumn, value) { this.Create(column, operator, targetColumn, null, GridViewValueSettings.SetSpriteImagePosition, value); return this; }, CreateForSpriteImageFromValue: function (column, operator, targetValue, value) { this.Create(column, operator, null, targetValue, GridViewValueSettings.SetSpriteImagePosition, value); return this; }, CreateForHyperLinkFromColumn: function (column, operator, targetValue, value) { this.Create(column, operator, targetColumn, null, GridViewValueSettings.SetHyperLinkVisibility, value); return this; }, CreateForHyperLinkFromValue: function (column, operator, targetValue, value) { this.Create(column, operator, null, targetValue, GridViewValueSettings.SetHyperLinkVisibility, value); return this; }, CreateForCustomValueFromColumn: function (column, operator, targetValue, value) { this.Create(column, operator, targetColumn, null, GridViewValueSettings.SetCustomValue, value); return this; }, CreateForCustomValueFromValue: function (column, operator, targetValue, value) { this.Create(column, operator, null, targetValue, GridViewValueSettings.SetCustomValue, value); return this; }, CreateForJoinedColumnsVisibilityFromColumn: function (column, operator, targetValue, value) { this.Create(column, operator, targetColumn, null, GridViewValueSettings.SetJoinedColumnsVisibility, value); return this; }, CreateForJoinedColumnsVisibilityFromValue: function (column, operator, targetValue, value) { this.Create(column, operator, null, targetValue, GridViewValueSettings.SetJoinedColumnsVisibility, value); return this; }, CreateForToolTipTextVisibilityFromColumn: function (column, operator, targetValue, value) { this.Create(column, operator, targetColumn, null, GridViewValueSettings.SetToolTipTextVisibility, value); return this; }, CreateForToolTipTextVisibilityFromValue: function (column, operator, targetValue, value) { this.Create(column, operator, null, targetValue, GridViewValueSettings.SetToolTipTextVisibility, value); return this; }, Create : function(column, operator, targetColumn, targetValue, keyToSet, value) { this.SourceColumn = column; this.Operator = operator; this.TargetColumn = targetColumn; this.TargetValue = targetValue; this.KeyToSet = keyToSet; this.ValueToSet = value; } }); var GridViewColumnEvents = xClass.extend({ Click : null, MouseDown : null, MouseUp : null }); var GridView = xClass.extend({ construct: function (theme, name) { this.Theme = theme; this.ComName = name; }, /*Properties*/ ComName: "", Theme: "", CurrentPage: 1, SpriteImage: "", SpacerImage: "", Renderer: "", Columns: new Array(), // stores : GridViewColumn obj BandedColumns: new Array(), // stores : GridViewBandedColumn obj TotalRowsPerPage: 10, TotalDataForCallback: 100, CurrentStateHasFirst: false, CurrentStateHasLast: false, BlockStart: 1, BlockStep: 5, PagerMode: "Lazy", //Lazy,Static,Dynamic Texts: new Array("Previous", "Next", "No Records Found"), /*Private Properties*/ __schema: null, /*Private Functions*/ __columnExists: function (fieldName) { for (var i = 0; i < this.Columns.length; i++) { if (this.Columns[i].FieldName == fieldName) { return true; } } return false; }, __getValueVirtually: function (value, rowIndex) { var _value = (value == undefined) ? "" : value; if (_value.indexOf("{") == -1) return _value; for (var i = 0; i < this.__schema.Fields.length; i++) { if (this.__columnExists(this.__schema.Fields[i])) { var vv = null; eval("vv = " + this.__schema.Fields[i] + ";"); _value = _value.replace("{" + this.__schema.Fields[i] + "}", this.__schema.Data[rowIndex][vv.__dataSourceIndex]); } } return _value; }, /*Public Functions*/ AddBandedColumn: function (obj) { this.BandedColumns.push(obj); }, AddColumn: function (obj) { this.Columns.push(obj); obj.__parentComp = this; }, AddColumns: function (obj) { for (var i = 0; i < obj.length; i++) { this.AddColumn(obj[i]); obj[i].__parentComp = this; } }, SetSchema: function (obj) { this.__schema = obj; obj.Controller = this; }, GetColumnValue: function (columnName, rowIndex) { var value = ""; if (this.__columnExists(columnName)) { var vv = null; eval("vv = " + columnName + ";"); return this.__schema.Data[rowIndex][vv.__dataSourceIndex]; } return value = ""; }, SetTexts: function (arr) { this.Texts = arr; }, // MAIN FUNCTION GOES HERE DataBind: function () { if (!document.getElementById(this.Renderer)) { alert("Couldn't Find Any Control To Render"); return; } var buildIN = document.getElementById(this.Renderer); var sb = "" + ""; var orderStatus = 0; for (var i = 0; i < this.Columns.length; i++) { //if (this.Columns[i].VisibleIndex == orderStatus) { if (this.Columns[i].IsVisible) { sb += ""; orderStatus++; } } sb = sb.replace("id=\"hd_" + (orderStatus - 1) + "\"", "id=\"hd_" + (orderStatus - 1) + "\" style=\"border-right:none;\""); sb += ""; // -------------------------------- // RENDER DATA // -------------------------------- var blockEnd = 1; while (true) { if (blockEnd > this.CurrentPage) break; blockEnd = blockEnd + this.BlockStep; } this.BlockStart = blockEnd - this.BlockStep; if (this.__schema.Data != null) { for (var i = 0; i < this.Columns.length; i++) { for (var j = 0; j < this.__schema.Fields.length; j++) { if (this.__schema.Fields[j] == this.Columns[i].FieldName) { this.Columns[i].__dataSourceIndex = j; break; } } } var className = "gridViewOdd"; var startIndex = (this.PagerMode == "Static") ? (this.CurrentPage - 1) * this.TotalRowsPerPage : (this.CurrentPage - this.BlockStart) * this.TotalRowsPerPage; var finisher = (this.TotalRowsPerPage + startIndex); if (this.__schema.Data.length < finisher) finisher = this.__schema.Data.length; for (var j = startIndex; j < finisher; j++) { try { sb += ""; orderStatus = 0; for (var i = 0; i < this.Columns.length; i++) { if (this.Columns[i].IsVisible) { var columnValue = this.Columns[i].__getProcessedValue(j); // SET JOINED COLUMNS if ((this.Columns[i].ShowJoinedColumns) && (this.Columns[i].JoinedColumns.length > 0)) { for (var k = 0; k < this.Columns[i].JoinedColumns.length; k++) { var toBeAdded = this.Columns[i].JoinedColumns[k][1].__getProcessedValue(j); if (this.Columns[i].JoinedColumns[k][2]) columnValue = toBeAdded + this.Columns[i].JoinedColumns[k][0] + columnValue; else columnValue += this.Columns[i].JoinedColumns[k][0] + toBeAdded; } } sb += ""; orderStatus++; } } sb += ""; className = (className == "gridViewOdd") ? "gridViewEven" : "gridViewOdd"; } catch (e) { alert(e.description); } } } var totalRowCount = 0; if ((this.__schema.Data != null) && (this.__schema.Data.length > 0)) { var ht = ""; var totalData = this.__schema.Data.length; if (this.PagerMode == "Lazy") { totalData = totalData + (this.BlockStart * this.BlockStep); } if (totalData > this.TotalRowsPerPage) { ht = "
" + "" + this.Columns[i].Caption + "" + "
" + ((this.Columns[i].ColumnStarter != "") ? this.Columns[i].ColumnStarter : "") + columnValue + ((this.Columns[i].ColumnFinisher != "") ? this.Columns[i].ColumnFinisher : "") + "
" + ""; if (this.PagerMode == "Lazy") { var x = (this.TotalDataForCallback < this.__schema.Data.length) ? this.TotalDataForCallback : this.__schema.Data.length; var totalPages = Math.ceil(x / this.TotalRowsPerPage); if (this.CurrentPage != 1) { var ppScript = ((this.CurrentPage - 1) == (this.BlockStart - 1)) ? this.ComName + "_pageIndexChanging(" + (this.BlockStart - this.BlockStep).toString() + ", " + (this.BlockStart - 1) + ");" : this.ComName + "_pageIndexChangingStatically(" + (this.CurrentPage - 1).toString() + ");"; ht += ""; } if (this.BlockStart != 1) { ht += ""; } for (var i = this.BlockStart; i < this.BlockStart + totalPages; i++) { ht += ""; } var hasNext = false; if (this.CurrentStateHasLast) { ht += ""; hasNext = true; } else if ((this.BlockStart + totalPages - 1) != this.CurrentPage) { hasNext = true; } if (hasNext) { var npScript = ((this.CurrentPage + 1) == (this.BlockStart + this.BlockStep)) ? this.ComName + "_pageIndexChanging(" + (this.BlockStart + this.BlockStep).toString() + ");" : this.ComName + "_pageIndexChangingStatically(" + (this.CurrentPage + 1).toString() + ");"; ht += ""; } } else if (this.PagerMode == "Static") { if (this.CurrentPage != 1) ht += ""; var x = this.__schema.Data.length; var totalPages = Math.ceil(x / this.TotalRowsPerPage); for (var i = ((this.CurrentPage - 3 <= 0) ? 1 : this.CurrentPage - 3) ; i < this.CurrentPage; i++) { if (i == 0) break; ht += ""; } ht += ""; for (var i = this.CurrentPage + 1; i < this.CurrentPage + 4; i++) { if (i > totalPages) break; ht += ""; } if (this.CurrentPage != totalPages) ht += ""; } ht += "" + "
« " + this.Texts[0] + "" + (this.BlockStart - 1).toString() + ""; if (this.CurrentPage != i) ht += ""; ht += i.toString(); if (this.CurrentPage != i) ht += ""; ht += "" + (this.BlockStart + this.BlockStep).toString() + "" + this.Texts[1] + " »« " + this.Texts[0] + "" + i.toString() + "" + this.CurrentPage.toString() + "" + i.toString() + "" + this.Texts[1] + " »
"; sb += "" + "" + ht + "" + ""; } } else { sb += "" + "" + this.Texts[2] + "" + ""; } sb += ""; buildIN.innerHTML = sb; } }); var GridViewColumn = xClass.extend({ /*Public Properties*/ ColumnStarter: "", ColumnFinisher: "", TextAlign: "justify", FieldName: "", VisibleIndex: 0, IsVisible: false, Caption: "", HyperLink: null, HyperLinkColumn: null, // instanceOF : GridViewColumn HyperLinkTarget: "_self", ColumnType: GridViewColumnTypes.StringType, // instanceOF : GridViewColumnTypes SpriteImageProperties: new Array(), // stores: int width, int height, string backgroundPosition ImageProperties: new Array(), // stores : string imagePath, string imageExtension BeginEndTags: new Array(), // stores : string beginHTML, string endHTML JoinedColumns: new Array(), //stores : [String seperator, GridViewColumn obj] ToolTipText: null, ToolTipColumn: null, // instanceOF : GridViewColumn ConditionalRendering: new Array(), // stores : GridViewConditionalRendering ShowJoinedColumns: true, MaxChars: -1, ColumnEvents: new GridViewColumnEvents(), /*Private Properties*/ __parentComp: null, __dataSourceIndex: 0, /*Public Functions*/ String: function (fieldName, visibleIndex, caption) { this.__refresh(fieldName, visibleIndex, caption); this.ColumnType = GridViewColumnTypes.StringType; if (visibleIndex >= 0) this.IsVisible = true; else this.IsVisible = false; return this; }, ShortString: function (fieldName, visibleIndex, caption, maxChars) { this.__refresh(fieldName, visibleIndex, caption); this.ColumnType = GridViewColumnTypes.ShortStringType; this.MaxChars = maxChars; if (visibleIndex >= 0) this.IsVisible = true; else this.IsVisible = false; return this; }, Image: function (fieldName, visibleIndex, caption, imagePath, imageExtension) { this.__refresh(fieldName, visibleIndex, caption); this.ColumnType = GridViewColumnTypes.ImageType; this.ImageProperties.push(imagePath); this.ImageProperties.push(imageExtension); if (visibleIndex >= 0) this.IsVisible = true; else this.IsVisible = false; return this; }, SpriteImage: function (fieldName, visibleIndex, caption, width, height, backgroundPosition) { this.__refresh(fieldName, visibleIndex, caption); this.ColumnType = GridViewColumnTypes.SpriteImageType; this.SpriteImageProperties.push(width); this.SpriteImageProperties.push(height); this.SpriteImageProperties.push(backgroundPosition); if (visibleIndex >= 0) this.IsVisible = true; else this.IsVisible = false; return this; }, JoinColumn: function (seperator, obj, isBefore) { if (isBefore == null) isBefore = false; this.JoinedColumns.push([seperator, obj, isBefore]); }, AddCondition: function (conditionalRendering) { this.ConditionalRendering.push(conditionalRendering); }, SetVisibleIndex: function (visibleIndex) { this.VisibleIndex = visibleIndex; if (visibleIndex >= 0) this.IsVisible = true; else this.IsVisible = false; }, /* Private Functions */ __refresh: function (fieldName, visibleIndex, caption, isVisible) { this.FieldName = fieldName; this.VisibleIndex = visibleIndex; if (typeof (isVisible) == typeof (undefined)) this.IsVisible = visibleIndex >= 0; else this.IsVisible = isVisible; this.Caption = caption; this.HyperLink = null; this.HyperLinkColumn = null; this.HyperLinkTarget = "_self"; this.ColumnType = null; this.SpriteImageProperties = new Array(), this.ImageProperties = new Array(); this.BeginEndTags = new Array(); this.JoinedColumns = new Array(); this.ToolTipText = null; this.ToolTipColumn = null; this.ConditionalRendering = new Array(); this.ColumnEvents = new GridViewColumnEvents(); }, __getProcessedValue: function (rowIndex) { var valueRow = this.__parentComp.__schema.Data[rowIndex]; var virtualValue = this.__parentComp.__getValueVirtually(valueRow[this.__dataSourceIndex], rowIndex); //HyperLink WorkAround var hyperLink = ""; if (this.HyperLink != null) { hyperLink = this.__parentComp.__getValueVirtually(this.HyperLink, rowIndex); } else if (this.HyperLinkColumn != null) { hyperLink = this.__parentComp.__getValueVirtually(valueRow[this.HyperLinkColumn.__dataSourceIndex], rowIndex); } var hyperLinkArray = new Array( (hyperLink != "") ? "" : "" ); if (this.ColumnEvents.Click != null) { var fncString = "onclick=\"" + this.FieldName + ".ColumnEvents.Click('" + this.FieldName + "', " + rowIndex + ",this);\" "; if (hyperLinkArray[0] == "") { hyperLinkArray[0] = "" : ""; //ToolTip WorkAround var toolTipText = ""; if (this.ToolTipText != null) { toolTipText = this.__parentComp.__getValueVirtually(this.ToolTipText, rowIndex); } else if (this.ToolTipColumn != null) { toolTipText = this.__parentComp.__getValueVirtually(valueRow[this.ToolTipColumn.__dataSourceIndex], rowIndex); } else if (this.ColumnType == GridViewColumnTypes.ShortStringType) { if (virtualValue.length > this.MaxChars) toolTipText = virtualValue; } if (toolTipText != "") toolTipText = toolTipText; //onmousemove ets. //SpriteImage WorkAround var spriteImagePosition = ""; if (this.ColumnType == GridViewColumnTypes.SpriteImageType) spriteImagePosition = this.SpriteImageProperties[2]; // SET CONDITIONAL RENDERINGS this.ShowJoinedColumns = true; for (var k = 0; k < this.ConditionalRendering.length; k++) { var c = this.ConditionalRendering[k]; var scValue = this.__parentComp.__getValueVirtually(valueRow[c.SourceColumn.__dataSourceIndex], rowIndex).toString(); if (scValue.toString() == ((c.TargetColumn == null) ? c.TargetValue.toString() : this.__parentComp.__getValueVirtually(valueRow[c.TargetColumn.__dataSourceIndex], rowIndex))) { if (c.KeyToSet == GridViewValueSettings.SetCustomValue) { virtualValue = c.ValueToSet; } else if ((c.KeyToSet == GridViewValueSettings.SetSpriteImagePosition) && (this.ColumnType == GridViewColumnTypes.SpriteImageType)) { spriteImagePosition = c.ValueToSet; } else if (c.KeyToSet == GridViewValueSettings.SetHyperLinkVisibility) { //alert(scValue); if (!c.ValueToSet) hyperLinkArray = new Array("", ""); } else if (c.KeyToSet == GridViewValueSettings.SetToolTipTextVisibility) { if (!c.ValueToSet) toolTipText = ""; } else if (c.KeyToSet == GridViewValueSettings.SetJoinedColumnsVisibility) { this.ShowJoinedColumns = c.ValueToSet; } } } // SET coumnValue RENDERINGS var columnValue = ""; if (this.ColumnType == GridViewColumnTypes.ImageType) { columnValue = ""; } else if (this.ColumnType == GridViewColumnTypes.StringType) { columnValue = ((this.BeginEndTags.length == 2) ? this.BeginEndTags[0] : "") + virtualValue + ((this.BeginEndTags.length == 2) ? this.BeginEndTags[1] : ""); } else if (this.ColumnType == GridViewColumnTypes.SpriteImageType) { columnValue = ""; } else if (this.ColumnType == GridViewColumnTypes.ShortStringType) { columnValue = ((this.BeginEndTags.length == 2) ? this.BeginEndTags[0] : "") + ((virtualValue.length > this.MaxChars) ? virtualValue.substring(0, this.MaxChars) + "..." : virtualValue) + ((this.BeginEndTags.length == 2) ? this.BeginEndTags[1] : ""); } return ((toolTipText != "") ? "" : "") + hyperLinkArray[0] + columnValue + hyperLinkArray[1] + ((toolTipText != "") ? "" : ""); }, SetCaption: function (name) { this.Caption = name; } }); var GridViewBandedColumn = xClass.extend({ /*Properties*/ VisibleIndex: 0, Caption: "", ColSpan: 0, IsVisible: false, /*Public Functions*/ construct: function (caption, colspan, visibleIndex) { this.VisibleIndex = visibleIndex; this.Caption = caption; this.ColSpan = colspan; if (visibleIndex >= 0) this.IsVisible = true; else this.IsVisible = false; }, SetVisibleIndex: function (visibleIndex) { this.VisibleIndex = visibleIndex; if (visibleIndex >= 0) this.IsVisible = true; else this.IsVisible = false; } }); var j = xClass.extend({ frameTotal: 25, obj: new Array(), directions: new Array(), intervals: new Array(), ticks: new Array(), onlyDimension: new Array(), noLeftTop: new Array(), noWidthHeight: new Array(), frameTot: new Array(), start: function (obj, left, top, width, height, opac, speed, ease, frameTotal) { if (tween.checkObj(obj.id) > -1) { tween.stopObj(tween.checkObj(obj.id)); } if ((left == -1) || (top == -1)) tween.noLeftTop.push(true); else tween.noLeftTop.push(false); if ((width == -1) || (height == -1)) tween.noWidthHeight.push(true); else tween.noWidthHeight.push(false); if (obj.tagName != "BODY") var oP = core.findObjectPosition2(obj); else var oP = new Array(0, 0, 0, 0); var frameTotal = (frameTotal) ? frameTotal : tween.frameTotal; tween.frameTot.push(frameTotal); if (core.browser == "ie") { oP[4] = obj.style.filter; oP[4] = oP[4].replace("alpha(opacity=", ""); oP[4] = oP[4].replace(")", ""); oP[4] = parseInt(oP[4]); } else { oP[4] = obj.style.opacity; } if (oP[4] == 0) { oP[4] = 100; } else { if (oP[4] < 2) oP[4] = oP[4] * 100; } if (speed > 10) speed = 10; else if (speed < 1) speed = 1; speed = 110 - ((speed + 1) * 10); var dir = new Array(); var lF = new Array(); var tF = new Array(); var wF = new Array(); var hF = new Array(); var oF = new Array(); var lD = Math.abs(oP[0] - left) / frameTotal; var tD = Math.abs(oP[1] - top) / frameTotal; var wD = Math.abs(oP[2] - width) / frameTotal; var hD = Math.abs(oP[3] - height) / frameTotal; var oD = Math.abs(oP[4] - opac) / frameTotal; var tmp = 0; for (var i = 0; i < frameTotal; i++) { if (oP[4] == opac) oF[i] = oP[4]; else { if (oP[4] > opac) oF[i] = (oD * (frameTotal - (i + 1))) + opac; else oF[i] = (oD * (i + 1)) + oP[4]; } if (oP[3] == height) hF[i] = oP[3]; else { if (oP[3] > height) { hF[i] = (hD * (frameTotal - (i + 1))) + height; } else { hF[i] = (hD * (i + 1)) + oP[3]; } } if (oP[2] == width) wF[i] = oP[2]; else { if (oP[2] > width) { wF[i] = (wD * (frameTotal - (i + 1))) + width; } else { wF[i] = (wD * (i + 1)) + oP[2]; } } if (oP[0] == left) lF[i] = oP[0]; else { if (oP[0] > left) { lF[i] = (lD * (frameTotal - (i + 1))) + left; } else { lF[i] = (lD * (i + 1)) + oP[0]; } } if (oP[1] == top) tF[i] = oP[1]; else { if (oP[1] > top) { var s = (tD * (frameTotal - (i + 1))) + top; tF[i] = (tD * (frameTotal - (i + 1))) + top; } else { var s = (tD * (i + 1)) + oP[1]; tF[i] = (tD * (i + 1)) + oP[1]; } } } var track = 0; var str = ""; lF[frameTotal - 1] = left; tF[frameTotal - 1] = top; wF[frameTotal - 1] = width; hF[frameTotal - 1] = height; oF[frameTotal - 1] = opac; tween.obj.push(obj); tween.directions.push(new Array(lF, tF, wF, hF, oF)); tween.ticks.push(0); var twCount = tween.intervals.length; tween.intervals[twCount] = setInterval("tween.playObj('" + twCount + "')", speed); }, playObj: function (intID) { if (tween.ticks[intID] == tween.frameTot[intID]) { var ii = tween.obj[intID].id; eval("try { " + ii + "_stop(); } catch (e) {}"); tween.stopObj(intID); return; } with (tween.obj[intID].style) { if (!tween.noWidthHeight[intID]) { height = tween.directions[intID][3][tween.ticks[intID]]; width = tween.directions[intID][2][tween.ticks[intID]]; } if (!tween.noLeftTop[intID]) { top = tween.directions[intID][1][tween.ticks[intID]]; left = tween.directions[intID][0][tween.ticks[intID]]; } } if (core.browser == "ie") { tween.obj[intID].style.filter = "alpha(opacity=" + (tween.directions[intID][4][tween.ticks[intID]]).toString() + ")"; } else { tween.obj[intID].style.MozOpacity = ((tween.directions[intID][4][tween.ticks[intID]]) / 100).toString(); tween.obj[intID].style.opacity = ((tween.directions[intID][4][tween.ticks[intID]]) / 100).toString(); } tween.ticks[intID]++; }, stopObj: function (intID) { clearInterval(tween.intervals[intID]); tween.intervals[intID] = null; tween.obj[intID] = null; tween.directions[intID] = null; }, checkObj: function (objID) { for (var i = 0; i < tween.obj.length; i++) if ((tween.obj[i] != null)) if (tween.obj[i].id == objID) return i; return -1; } }); var tween = new j(); var j = xClass.extend({ interval: null, obj: null, currentScrollPiece: 0, scrollPieces: 20, firstStop: 0, nextStop: 0, BeginScroll: function (obj) { if (!Core.GID(obj)) return; if (pageScroll.interval != null) return; var objPos = Core.FindObjectPosition(Core.GID(obj)); pageScroll.nextStop = objPos[1]; pageScroll.firstStop = pageScroll.GetCurrentScrollPosition(); pageScroll.currentScrollPiece = 0; pageScroll.interval = setInterval("pageScroll.AnimatedScroll()", 10); }, AnimatedScroll: function () { var goTo = 0; if (pageScroll.currentScrollPiece == pageScroll.scrollPieces) { goTo = pageScroll.nextStop; clearInterval(pageScroll.interval); pageScroll.interval = null; } else { var gg = Math.round(Math.abs(pageScroll.nextStop - pageScroll.firstStop) / pageScroll.scrollPieces); if (pageScroll.firstStop > pageScroll.nextStop) goTo = pageScroll.firstStop - (gg * pageScroll.currentScrollPiece); else goTo = pageScroll.firstStop + (gg * pageScroll.currentScrollPiece); pageScroll.currentScrollPiece++; } window.scroll(0, goTo); }, GetCurrentScrollPosition: function () { var ScrollTop = document.body.scrollTop; if (ScrollTop == 0) { if (window.pageYOffset) ScrollTop = window.pageYOffset; else ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0; } return ScrollTop; } }); var pageScroll = new j(); var j = xClass.extend({ gals: new Array(), banners: new Array(), currentPic: new Array(), intervals: new Array(), playIntervals: new Array(), shadows: new Array(), shadowFade: new Array(), isBusy: new Array(), buttonStyle: new Array(), buttonSelectedStyle: new Array(), btsArray: new Array(), btssArray: new Array(), create: function (obj) { obj.style.width = obj.getAttribute("width"); obj.style.height = obj.getAttribute("height"); obj.style.overflow = "hidden"; var bts = "width:24px; line-height:24px; height:24px; text-align:center; display:table-cell; background:transparent url(/images/playerSprite.png) no-repeat 0px 0px; font:11px arial; color:#ffffff; cursor:pointer;"; var btss = "width:24px; line-height:24px; height:24px; text-align:center; display:table-cell; background:transparent url(/images/playerSprite.png) no-repeat -24px 0px; font:11px arial; color:#000000; cursor:pointer; "; gallery.buttonStyle.push(bts); gallery.buttonSelectedStyle.push(btss); gallery.gals.push(obj.id); var dxPos = core.findObjectPosition(obj); var dxLeft = (parseInt(dxPos[0]) + parseInt(dxPos[2])) - 10 - 40; var dxTop = (parseInt(dxPos[1]) + 10); var bbs = new Array(); var div = obj.getElementsByTagName("IMG"); var pushed = 0; var navText = ""; var dx = document.body.appendChild(document.createElement("DIV")); dx.id = obj.id + "_btnContainer"; var dxb = document.body.appendChild(document.createElement("DIV")); dxb.id = obj.id + "_btnPlayer"; var myImages = new Array(); for (var i = 0; i < div.length; i++) { if (div[i].style.display == "none") { myImages.push(new Array(div[i].getAttribute("src"), div[i].getAttribute("click"))); } } obj.innerHTML = ""; for (var i = 0; i < myImages.length; i++) { pushed++; var d = obj.appendChild(document.createElement("DIV")); if (pushed == 1) { d.style.display = ""; if (core.browser == "ie") { d.style.filter = "alpha(opacity=100)"; } else { d.style.MozOpacity = 1; } } else { d.style.display = ""; } d.id = obj.id + "_" + pushed; bbs.push(d); d.style.position = "relative"; d.style.top = "0px"; d.style.lefth = "0px"; var str = "
" + pushed + "
"; } gallery.banners.push(bbs); gallery.isBusy.push(false); gallery.currentPic.push(1); gallery.intervals.push(null); gallery.playIntervals.push(null); gallery.shadowFade.push(0); var dxWidth = ((24 * bbs.length) + 1); dx.style.position = "absolute"; dx.style.zIndex = "996"; dx.style.top = dxTop + "px"; dx.style.left = (dxLeft - dxWidth) + "px"; dx.style.width = dxWidth + "px"; dx.innerHTML = navText; core.gID(obj.id + "_" + 2).style.display = ""; dxb.style.position = "absolute"; dxb.style.zIndex = "997"; dxb.style.top = dxTop + "px"; dxb.style.left = (dxLeft + 10) + "px"; dxb.style.width = "24px"; dxb.innerHTML = " "; core.gID(obj.id + "_" + 1).style.display = ""; gallery.setPlay(obj.id, true); }, setShadow: function (id, name) { var gID = gallery.findGal(name); gallery.isBusy[gID] = true; if (gallery.shadowFade[gID] == -1) { clearInterval(gallery.intervals[gID]); gallery.currentPic[gID] = parseInt(id); gallery.intervals[gID] = setInterval("gallery.getShadow(" + id + ",'" + name + "')", 20); } gallery.shadowFade[gID] = gallery.shadowFade[gID] - 1; if (core.browser == "ie") { gallery.banners[gID][gallery.currentPic[gID] - 1].childNodes[0].style.filter = "alpha(opacity=" + (gallery.shadowFade[gID] * 10).toString() + ")"; } else { gallery.banners[gID][gallery.currentPic[gID] - 1].style.MozOpacity = ((gallery.shadowFade[gID]) / 10).toString(); gallery.banners[gID][gallery.currentPic[gID] - 1].style.opacity = ((gallery.shadowFade[gID]) / 10).toString(); } }, getShadow: function (id, name) { var gID = gallery.findGal(name); if (gallery.shadowFade[gID] == -1) { for (var i = 0; i < gallery.banners[gID].length; i++) { gallery.banners[gID][i].style.display = "none"; } gallery.banners[gID][parseInt(id) - 1].style.display = ""; } if (gallery.shadowFade[gID] == 11) { clearInterval(gallery.intervals[gID]); gallery.isBusy[gID] = false; } gallery.shadowFade[gID] = gallery.shadowFade[gID] + 1; if (core.browser == "ie") { gallery.banners[gID][gallery.currentPic[gID] - 1].childNodes[0].style.filter = "alpha(opacity=" + (gallery.shadowFade[gID] * 10).toString() + ")"; } else { gallery.banners[gID][gallery.currentPic[gID] - 1].style.MozOpacity = ((gallery.shadowFade[gID]) / 10).toString(); gallery.banners[gID][gallery.currentPic[gID] - 1].style.opacity = ((gallery.shadowFade[gID]) / 10).toString(); } }, setPlay: function (name, cond) { var gID = gallery.findGal(name); var pN = core.gID("butPlay_" + name).parentNode; if (cond) { if (gallery.playIntervals[gID] != null) return; gallery.playIntervals[gID] = setInterval("gallery.player('" + name + "');", 10000); pN.innerHTML = " "; } else { clearInterval(gallery.playIntervals[gID]); gallery.playIntervals[gID] = null; pN.innerHTML = " "; } }, player: function (name) { var gID = gallery.findGal(name); var toPic = (gallery.currentPic[gID] == gallery.banners[gID].length) ? 1 : gallery.currentPic[gID] + 1; gallery.changePic(toPic, name); }, changePic: function (id, gal) { var gID = gallery.findGal(gal); if (gallery.isBusy[gID]) return; gallery.shadowFade[gID] = 10; for (var i = 1; i < gallery.banners[gID].length + 1; i++) { core.gID("but_" + gal + "_" + i).style.backgroundPosition = "0px 0px"; core.gID("but_" + gal + "_" + i).style.color = "#ffffff"; } core.gID("but_" + gal + "_" + id).style.backgroundPosition = "-24px 0px"; core.gID("but_" + gal + "_" + id).style.color = "#000000"; gallery.intervals[gID] = setInterval("gallery.setShadow(" + id + ",'" + gal + "')", 20); }, findGal: function (name) { var s = -1; for (var i = 0; i < gallery.gals.length; i++) { if (gallery.gals[i] == name) s = i; } return s; } }); var gallery = new j(); //Array.prototype.toString = function () { return '(' + this.join(' ') + ')'; }; [ ].indexOf || (Array.prototype.indexOf = function (v, n) { n = (n == null) ? 0 : n; var m = this.length; for (var i = n; i < m; i++) if (this[i] == v) return i; return -1; }); var OtiGridView = xClass.extend({ id: '', CurrentPage: 1, SelectedValues: new Array(), GetID: function () { return this.id.replace('_', ''); }, construct: function (name) { this.id = name; }, AddSelectedItem: function (params) { var idx = this.SelectedValues.indexOf(params); if (idx != -1) { this.RemoveSelectedItem(idx); return false; } else { this.SelectedValues.push(params); return true; } }, GetSelectedItems: function () { return this.SelectedValues.join('|'); }, RemoveSelectedItem: function (idx) { this.SelectedValues.splice(idx, 1); }, Clear_SelectedItems: function () { this.SelectedValues = new Array(); } }); var TabPanel = xClass.extend({ id: "", UniqueID: "", Items: new Array(), ActiveItemIndex: -1, construct: function (id) { this.id = id; this.UniqueID = id; }, Init: function () { // var parentComp = document.getElementById(this.id + "_Table"); // var pos = Core.FindObjectPosition(parentComp); if (this.ActiveItemIndex == -1) { if (this.Items.length > 0) { this.ActiveItemIndex = 0; this.ChangeIndex(); } } }, ChangeIndex: function () { for (var i = 0; i < this.Items.length; i++) document.getElementById(this.id + "_Item_" + i.toString()).className = "tabRegular"; document.getElementById(this.id + "_Item_" + this.ActiveItemIndex.toString()).className = "tabSelected"; var item = this.FindItem(this.ActiveItemIndex); if (item[2] != "") eval(item[2]); }, SelectedIndexChanging: function (index) { var item = this.FindItem(index); if (item[1] != "") { var cond = true; eval("cond = " + item[1]); if (!cond) return; } this.ActiveItemIndex = index; this.ChangeIndex(); }, FindItem: function (index) { for (var i = 0; i < this.Items.length; i++) if (this.Items[i][0] == index) return this.Items[i]; return null; }, AddItem: function (i, beforeChange, afterChange) { this.Items.push([i, beforeChange, afterChange]); } });