if (!LANGUAGE || !LANGUAGE['support']) {    var LANGUAGE = LANGUAGE ? LANGUAGE : {};    LANGUAGE['support'] = 'AJAX desteklemeyen bir tarayıcı kullanıyorsunuz!';    LANGUAGE['fatal'] = 'AJAX işlemi gerçekleştirilemiyor!';    LANGUAGE['status'] = 'Sunucudan istenilen sayfa çağırılamadı!';    LANGUAGE['timeout'] = 'İstek zamanaşımına uğradı, lütfen tekrar deneyin!';    LANGUAGE['loading'] = 'Yükleniyor...';    LANGUAGE['loadingMessage'] = 'Yükleniyor... Lütfen bekleyiniz...';    LANGUAGE['processing'] = 'İşleniyor...';    LANGUAGE['saving'] = 'Kaydediliyor...';    LANGUAGE['deleting'] = 'Siliniyor...';    LANGUAGE['noResult'] = 'Kayıt bulunamadı!';    LANGUAGE['confirmDelete'] = 'Kaydı silmek istediğinize emin misiniz?';    LANGUAGE['noReturn'] = 'Sonuç dönmedi!';    LANGUAGE['noResponse'] = 'Sunucudan istenilen cevap gelmedi!';    LANGUAGE['unknownError'] = 'Bir hata oluştu!';    LANGUAGE['add'] = 'Ekle';    LANGUAGE['ok'] = 'Tamam';    LANGUAGE['yes'] = 'Evet';    LANGUAGE['no'] = 'Hayır';    LANGUAGE['save'] = 'Kaydet';    LANGUAGE['del'] = 'Sil';    LANGUAGE['cancel'] = 'Vazgeç';    LANGUAGE['upload'] = 'Yükle';    LANGUAGE['first'] = 'İlk';    LANGUAGE['previous'] = 'Önceki';    LANGUAGE['next'] = 'Sonraki';    LANGUAGE['last'] = 'Son';    LANGUAGE['total'] = 'Toplam';    LANGUAGE['close'] = 'Kapat';    LANGUAGE['noTarget'] = 'Hedef içerik bulunamadı!';    LANGUAGE['icon'] = 'Simge';    LANGUAGE['message'] = 'Mesaj';}function getEl(elID){    return document.getElementById(elID);}var Layer = function(isModal, setID){    this.isModal = isModal;    this.setID = setID ? setID : false;};Layer.dialogName = 'dialogBox';Layer.imagePath = 'objects/icons/';Layer.className = 'dialogBox';Layer.closeIcon = null;Layer.maxDepth = 5;Layer.prototype.create = function(){    var container = Layer.createElement('div');    container.style.position = 'absolute';    container.style.display = 'none';    container.className = Layer.className;    container.dialogBox = this;    this.container = container;    var mainTable = Layer.createElement('table', container);    mainTable.cellSpacing = '0';    mainTable.cellPadding = '0';    mainTable.border = '0';    var tBodyM = Layer.createElement('tbody', mainTable);    var rowM = Layer.createElement('tr', tBodyM);    var cellM = Layer.createElement('td', rowM);    var titleTable = Layer.createElement('table', cellM);    titleTable.cellSpacing = '0';    titleTable.cellPadding = '0';    titleTable.border = '0';    titleTable.width = '100%';    titleTable.className = 'dboxTbTitle';    var tBodyT = Layer.createElement('tbody', titleTable);    var rowT = Layer.createElement('tr', tBodyT);    var cellT = Layer.createElement('td', rowT);    cellT.className = 'dboxTbLeft';    var titleCell = Layer.createElement('td', rowT);    this.titleCell = titleCell;    titleCell.className = 'dboxTitle';    var cellT = Layer.createElement('td', rowT);    cellT.className = 'dboxTbRight';    Layer.initCloseIcon();    var closeIcon = Layer.createElement('img', cellT);    closeIcon.src = Layer.closeIcon.src;    closeIcon.border = '0';    closeIcon.alt = LANGUAGE['close'];    closeIcon.dialogBox = this;    var aLink = Layer.createElement('a', cellT);    aLink.href = 'javascript:void(0)';    aLink.appendChild(closeIcon);    aLink.onclick = Layer.closeBox;    var rowM = Layer.createElement('tr', tBodyM);    var cellM = Layer.createElement('td', rowM);    cellM.className = 'dboxMainPanel';    var contentArea = Layer.createElement('div', cellM);    this.contentArea = contentArea;    contentArea.className = 'dboxContentArea';    var rowB = Layer.createElement('tr', tBodyM);    var cellB = Layer.createElement('td', rowB);    cellB.className = 'dboxButtons';    var buttonsArea = Layer.createElement('div', cellB);    this.buttonsArea = buttonsArea;    Drag.init(titleCell, container, 0, null, 0);};Layer.prototype.createBox = function(){    var container = Layer.createElement('div');    container.style.position = 'absolute';    container.style.display = 'none';    container.dialogBox = this;    this.container = container;    var mainTable = Layer.createElement('table', container);    mainTable.bgColor = '#dddddd';    mainTable.cellSpacing = '10';    mainTable.cellPadding = '0';    mainTable.border = '0';    var tBodyM = Layer.createElement('tbody', mainTable);    var rowM = Layer.createElement('tr', tBodyM);    var cellM = Layer.createElement('td', rowM);    cellM.bgColor = '#ffffff';    var contentArea = Layer.createElement('div', cellM);    this.contentArea = contentArea;};Layer.prototype.show = function(){    if (this.isModal) {        this.veil = Layer.veiling.show(this.veilCss ? this.veilCss : null);    }    Layer.body.toTop(this.container);    this.container.style.display = 'block';    Layer.box.hideShowBehind();};Layer.prototype.hide = function(){    if (this.isModal) {        Layer.veiling.hide(this.veil);    }    if (this.contentType == 'object') {        this.contentArea.childNodes[0].style.display = 'none';        this.htmlContentParent.appendChild(this.contentArea.childNodes[0]);    }    this.container.parentNode.removeChild(this.container);    Layer.box.hideShowBehind();    if (this.closeFunction) {        this.closeFunction();    }};Layer.prototype.setWidth = function(width){    this.contentArea.style.width = width + 'px';};Layer.prototype.setHeight = function(height){    this.contentArea.style.height = height + 'px';    this.contentArea.style.overflow = 'auto';};Layer.prototype.setTitle = function(title){    this.titleCell.innerHTML = title;};Layer.prototype.setVeilCss = function(val){    this.veilCss = val;};Layer.prototype.setContent = function(htmlContent){    this.contentType = typeof htmlContent;    if (this.contentType == 'string') {        this.contentArea.innerHTML = htmlContent;        if (this.setID) {            this.container.id = (Layer.dialogName + Math.random());        }    }    else         if (this.contentType == 'object') {            htmlContent.style.position = 'relative';            htmlContent.style.display = 'block';            this.htmlContentParent = htmlContent.parentNode;            this.contentArea.appendChild(htmlContent);            if (this.setID) {                this.container.id = (Layer.dialogName + htmlContent.id);            }        }};Layer.prototype.resetForm = function(formName){    if (document.forms[formName]) {        document.forms[formName].reset();    }};Layer.prototype.setCloseFunction = function(func){    this.closeFunction = func;};Layer.prototype.addButton = function(attributes){    var button = document.createElement('input');    button.type = 'button';    button.id = (attributes.name ? attributes.name : ('btn' + Math.random()));    button.name = (attributes.name ? attributes.name : ('btn' + Math.random()));    button.value = (attributes.value ? attributes.value : 'Buton');    button.style.cssText = (attributes.css ? attributes.css : '');    button.onclick = attributes.onclick || Layer.closeBox;    this.buttonsArea.appendChild(button);};Layer.prototype.addToButtonsArea = function(html){    this.buttonsArea.innerHTML = html;};Layer.prototype.focusOn = function(el){    if (el) {        el.focus();    }    else {        var els = this.contentArea.getElementsByTagName('input');        if (els.length > 0) {            for (var i = 0; i < els.length; i++) {                if ((els[i].type == 'button') || (els[i].type == 'text')) {                    els[i].focus();                    break;                }            }        }        else {            var buts = this.buttonsArea.getElementsByTagName('input');            if (buts.length > 0) {                buts[buts.length - 1].focus();            }        }    }};Layer.prototype.moveTo = function(x, y){    if (!x || (x == -1)) {        x = Math.round((document.documentElement.clientWidth - this.container.offsetWidth) / 2);    }    if (!y || (y == -1)) {        y = Math.round((document.documentElement.clientHeight - this.container.offsetHeight) / 2) + getScrollTop();    }    this.container.style.left = x + 'px';    this.container.style.top = y + 'px';};Layer.prototype.setUrl = function(url, height, frmID){    if (!this.frmEl) {        this.frmEl = document.createElement('iframe');        this.frmEl.frameBorder = 'no';        this.frmEl.style.width = '100%';        if (height) {            this.frmEl.style.height = height + 'px';        }        if (frmID) {            this.frmEl.id = frmID;            this.frmEl.name = frmID;        }        this.contentArea.appendChild(this.frmEl);    }    this.frmEl.src = url;    if (this.setID) {        this.container.id = (Layer.dialogName + (frmID ? frmID : Math.random()));    }};Layer.prototype.getUrl = function(){    if (this.frmEl) {        var url = this.frmEl.src;        if (this.frmEl.contentWindow) {            try {                url = this.frmEl.contentWindow.location.href;            }             catch (e) {            }        }        return url;    }    return false;};Layer.prototype.getContentNode = function(){    return this.contentArea;};Layer.initCloseIcon = function(){    if (Layer.closeIcon == null) {        Layer.closeIcon = new Image();        Layer.closeIcon.src = Layer.imagePath + '16x16/close.gif';    }};Layer.closeBox = function(e){    if (!e) {        e = window.event;    }    var node = e.target ? e.target : e.srcElement;    var count = 0;    while ((node != null) && (count < Layer.maxDepth)) {        if (node.dialogBox) {            node.dialogBox.hide();            break;        }        node = node.parentNode;        count++;    }};Layer.closeBoxById = function(id){    var el = getEl(Layer.dialogName + id);    if (el && el.dialogBox) {        el.dialogBox.hide();    }};Layer.createElement = function(type, parent){    var el = null;    if (document.createElementNS) {        el = document.createElementNS('http://www.w3.org/1999/xhtml', type);    }    else {        el = document.createElement(type);    }    if (typeof(parent) != 'undefined') {        parent.appendChild(el);    }    return el;};Layer.body = {    toTop: function(el, unclickable){        if (!Layer.body.que) {            Layer.body.que = document.createElement('div');            document.body.appendChild(Layer.body.que);        }        if (!el.bodyZ) {            el.bodyZ = Layer.body.nid++;            if (!unclickable) {                addListener(el, 'mousedown', function(){                    Layer.body.toTop(el)                });            }            Layer.body.que.appendChild(el);            Layer.body.set(el);        }        else             if (el.bodyZ != Layer.body.last.bodyZ) {                Layer.body.set(el);            }    },    set: function(el){        el.style.zIndex = Layer.body.nextZ++;        Layer.body.last = el;    },    nid: 1,    nextZ: 10001};Layer.veiling = {    show: function(css){        var veil = Layer.veiling.create();        for (var prop in Layer.veiling.css)             veil.style[prop] = Layer.veiling.css[prop];        if (css) {            for (var prop in css)                 veil.style[prop] = css[prop];        }        else {            veil.style['backgroundColor'] = '#000000';            veil.style['filter'] = 'alpha(opacity=60)';            veil.style['opacity'] = 0.6;        }        veil.style.display = 'block';        return veil;    },    hide: function(el){        el.parentNode.removeChild(el);    },    create: function(){        var shadow = Layer.createElement('div');        shadow.innerHTML = '';        Layer.body.toTop(shadow, true);        addListener(window, 'resize', function(){            Layer.veiling.fix(shadow);        });        Layer.veiling.fix(shadow);        return shadow;    },    fix: function(el){        el.style.width = Math.max(document.body.scrollWidth, getWinW()) + 'px';        el.style.height = Math.max(document.body.scrollHeight, getWinH()) + 'px';    },    css: {        position: 'absolute',        display: 'none',        top: 0,        left: 0,        cursor: 'not-allowed'    }};Layer.box = {    getAllBox: function(){        var divs = new Array();        var els = document.getElementsByTagName('div');        for (var i = 0; i < els.length; i++) {            if (els[i].dialogBox) {                divs.push(els[i]);            }        }        return divs;    },    getTopBox: function(){        var divs = this.getAllBox();        if (divs.length > 0) {            return divs[divs.length - 1];        }        else {            return document.body;        }    },    hideShowBehind: function(){        var tags = new Array('object', 'applet', 'iframe');        if (navigator.appName == "Microsoft Internet Explorer") {            var rawVersion = /MSIE\s([0-9]+)\.[0-9];/g.exec(navigator.appVersion);            var version = parseInt(rawVersion[1]);            if (version < 7) {                tags.push('select');            }        }        for (var k = 0; k < tags.length; k++) {            var arr = document.getElementsByTagName(tags[k]);            for (var i = 0; i < arr.length; i++) {                arr[i].style.visibility = 'hidden';            }        }        var target = this.getTopBox();        for (var k = 0; k < tags.length; k++) {            var arr = target.getElementsByTagName(tags[k]);            for (var i = 0; i < arr.length; i++) {                arr[i].style.visibility = 'visible';            }        }    }};Layer.bubble = {    show: function(obj, tx, w, hideAfter){        if (hideAfter) {            this.autoHide(hideAfter);        }        if (!w) {            w = tx.length * 20;        }        this.init(w);        this.container.textContainer.innerHTML = tx;        document.body.appendChild(this.container);        var pos = getPosition(obj);        var sol = (pos.x - w + 15);        var ust = (pos.y - this.container.scrollHeight - 10);        if (sol < 0) {            sol = 0;        }        this.container.pointer.style.left = (pos.x - 15 - sol) + 'px';        if (ust < 0) {            ust = 0;        }        this.container.style.left = sol + 'px';        this.container.style.top = ust + 'px';        this.container.style.diplay = 'block';    },    hide: function(){        if (this.container && this.container.parentNode) {            this.container.parentNode.removeChild(this.container);        }    },    autoHide: function(sec){        if (sec <= 0) {            this.hide();        }        else {            var obj = this;            window.setTimeout(function(){                obj.autoHide(sec - 1);            }, 1000);        }    },    init: function(width){        if (!this.container) {            var container = Layer.createElement('div');            container.className = 'bubble';            container.style.position = 'absolute';            container.style.width = width + 'px';            this.container = container;            var tbl = Layer.createElement('table', container);            tbl.width = '100%';            tbl.border = '0';            tbl.cellPadding = '0';            tbl.cellSpacing = '0';            var tbdy = Layer.createElement('tbody', tbl);            var tr1 = Layer.createElement('tr', tbdy);            var td1 = Layer.createElement('td', tr1);            td1.style.width = '6px';            td1.style.height = '6px';            var img1 = Layer.createElement('img', td1);            img1.border = '0';            img1.width = '6';            img1.height = '6';            img1.alt = '';            img1.src = Layer.imagePath + 'bubble/bubble_left_top.gif';            var td2 = Layer.createElement('td', tr1);            td2.style.height = '6px';            td2.style.background = 'url(' + Layer.imagePath + 'bubble/bubble_top.gif)';            var img2 = Layer.createElement('img', td2);            img2.border = '0';            img2.width = '1';            img2.height = '6';            img2.alt = '';            img2.src = Layer.imagePath + 'bubble/spacer.gif';            var td3 = Layer.createElement('td', tr1);            td3.style.width = '6px';            td3.style.height = '6px';            var img3 = Layer.createElement('img', td3);            img3.border = '0';            img3.width = '6';            img3.height = '6';            img3.alt = '';            img3.src = Layer.imagePath + 'bubble/bubble_right_top.gif';            var tr2 = Layer.createElement('tr', tbdy);            var td4 = Layer.createElement('td', tr2);            td4.style.width = '6px';            td4.style.background = 'url(' + Layer.imagePath + 'bubble/bubble_left.gif)';            var img4 = Layer.createElement('img', td4);            img4.border = '0';            img4.width = '6';            img4.height = '1';            img4.alt = '';            img4.src = Layer.imagePath + 'bubble/spacer.gif';            var td5 = Layer.createElement('td', tr2);            td5.style.backgroundColor = '#ffffe1';            this.container.textContainer = Layer.createElement('div', td5);            var td6 = Layer.createElement('td', tr2);            td6.style.width = '6px';            td6.style.background = 'url(' + Layer.imagePath + 'bubble/bubble_right.gif)';            var img5 = Layer.createElement('img', td6);            img5.border = '0';            img5.width = '6';            img5.height = '1';            img5.alt = '';            img5.src = Layer.imagePath + 'bubble/spacer.gif';            var tr3 = Layer.createElement('tr', tbdy);            var td7 = Layer.createElement('td', tr3);            td7.style.width = '6px';            td7.style.height = '6px';            var img6 = Layer.createElement('img', td7);            img6.border = '0';            img6.width = '6';            img6.height = '6';            img6.alt = '';            img6.src = Layer.imagePath + 'bubble/bubble_left_bottom.gif';            var td8 = Layer.createElement('td', tr3);            td8.style.height = '6px';            td8.style.background = 'url(' + Layer.imagePath + 'bubble/bubble_bottom.gif)';            var img7 = Layer.createElement('img', td8);            img7.border = '0';            img7.width = '1';            img7.height = '6';            img7.alt = '';            img7.src = Layer.imagePath + 'bubble/spacer.gif';            var td9 = Layer.createElement('td', tr3);            td9.style.width = '6px';            td9.style.height = '6px';            var img8 = Layer.createElement('img', td9);            img8.border = '0';            img8.width = '6';            img8.height = '6';            img8.alt = '';            img8.src = Layer.imagePath + 'bubble/bubble_right_bottom.gif';            var dv = Layer.createElement('div', container);            dv.style.position = 'absolute';            dv.style.left = '15px';            dv.style.bottom = '-20px';            var img9 = Layer.createElement('img', dv);            img9.border = '0';            img9.width = '20';            img9.height = '21';            img9.alt = '';            img9.src = Layer.imagePath + 'bubble/bubble_pointer.gif';            this.container.pointer = dv;        }        this.container.style.width = width + 'px';    }};var Drag = {    obj: null,    init: function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper){        o.onmousedown = Drag.start;        o.hmode = bSwapHorzRef ? false : true;        o.vmode = bSwapVertRef ? false : true;        o.root = oRoot && oRoot != null ? oRoot : o;        if (o.hmode && isNaN(parseInt(o.root.style.left))) {            o.root.style.left = '0px';        }        if (o.vmode && isNaN(parseInt(o.root.style.top))) {            o.root.style.top = '0px';        }        if (!o.hmode && isNaN(parseInt(o.root.style.right))) {            o.root.style.right = '0px';        }        if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) {            o.root.style.bottom = '0px';        }        o.minX = typeof minX != 'undefined' ? minX : null;        o.minY = typeof minY != 'undefined' ? minY : null;        o.maxX = typeof maxX != 'undefined' ? maxX : null;        o.maxY = typeof maxY != 'undefined' ? maxY : null;        o.xMapper = fXMapper ? fXMapper : null;        o.yMapper = fYMapper ? fYMapper : null;        o.root.onDragStart = new Function();        o.root.onDragEnd = new Function();        o.root.onDrag = new Function();    },    start: function(e){        var o = Drag.obj = this;        e = Drag.fixE(e);        var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);        var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right);        o.root.onDragStart(x, y);        o.lastMouseX = e.clientX;        o.lastMouseY = e.clientY;        if (o.hmode) {            if (o.minX != null) {                o.minMouseX = e.clientX - x + o.minX;            }            if (o.maxX != null) {                o.maxMouseX = o.minMouseX + o.maxX - o.minX;            }        }        else {            if (o.minX != null) {                o.maxMouseX = -o.minX + e.clientX + x;            }            if (o.maxX != null) {                o.minMouseX = -o.maxX + e.clientX + x;            }        }        if (o.vmode) {            if (o.minY != null) {                o.minMouseY = e.clientY - y + o.minY;            }            if (o.maxY != null) {                o.maxMouseY = o.minMouseY + o.maxY - o.minY;            }        }        else {            if (o.minY != null) {                o.maxMouseY = -o.minY + e.clientY + y;            }            if (o.maxY != null) {                o.minMouseY = -o.maxY + e.clientY + y;            }        }        document.onmousemove = Drag.drag;        document.onmouseup = Drag.end;        return false;    },    drag: function(e){        e = Drag.fixE(e);        var o = Drag.obj;        var ey = e.clientY;        var ex = e.clientX;        var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);        var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right);        var nx, ny;        if (o.minX != null) {            ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);        }        if (o.maxX != null) {            ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);        }        if (o.minY != null) {            ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);        }        if (o.maxY != null) {            ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);        }        nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));        ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));        if (o.xMapper) {            nx = o.xMapper(y);        }        else             if (o.yMapper) {                ny = o.yMapper(x);            }        Drag.obj.root.style[o.hmode ? 'left' : 'right'] = nx + 'px';        Drag.obj.root.style[o.vmode ? 'top' : 'bottom'] = ny + 'px';        Drag.obj.lastMouseX = ex;        Drag.obj.lastMouseY = ey;        Drag.obj.root.onDrag(nx, ny);        return false;    },    end: function(){        document.onmousemove = null;        document.onmouseup = null;        Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode ? 'left' : 'right']), parseInt(Drag.obj.root.style[Drag.obj.vmode ? 'top' : 'bottom']));        Drag.obj = null;    },    fixE: function(e){        if (typeof e == 'undefined') {            e = window.event;        }        if (typeof e.layerX == 'undefined') {            e.layerX = e.offsetX;        }        if (typeof e.layerY == 'undefined') {            e.layerY = e.offsetY;        }        return e;    }};var ajaxObject = function(method, url, params, extras){    this.http = false;    this.running = false;    this.timeout = (extras && extras.timeout) ? extras.timeout : 30;    this.method = method;    this.url = (/\?/.test(url)) ? url : url + '?';    this.params = params ? (params.length > 0 ? params : 'null=null') : null;    this.extra = extras ? extras : {};    this.errors = {        'support': LANGUAGE['support'],        'fatal': LANGUAGE['fatal'],        'status': LANGUAGE['status'],        'timeout': LANGUAGE['timeout']    };    this.init();};ajaxObject.prototype.debug = false;ajaxObject.prototype.init = function(){    if (typeof(XMLHttpRequest) != 'undefined') {        this.http = new XMLHttpRequest();    }    else         if (window.ActiveXObject) {            try {                this.http = new ActiveXObject("Msxml2.XMLHTTP");            }             catch (e) {                try {                    this.http = new ActiveXObject("Microsoft.XMLHTTP");                }                 catch (e) {                    this.http = false;                }            }        }    if (this.http) {        this.running = true;        this.onIdle('start');    }    else {        this.onError('support');    }};ajaxObject.prototype.run = function(){    if (!this.running) {        return false;    }    var that = this;    try {        this.http.onreadystatechange = function(){            ajaxObject.handler(that);        };        this.timeID = window.setTimeout(function(){            ajaxObject.end(that)        }, (this.timeout * 1000));        if (this.debug) {            messageDialog('Method: ' + this.method + '<br />' + 'URL: ' + this.url + '<br />' + 'Parameters: ' + this.params);        }        if (this.method && (/post/i.test(this.method))) {            var uri = this.url + '&rnd=' + Math.random();            this.http.open("POST", uri, true);            this.http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");            this.http.setRequestHeader("Content-Length", (this.params ? this.params.length : 0));            this.http.setRequestHeader("Cache-control", "no-cache");            this.http.setRequestHeader("Connection", "close");            this.http.send(this.params);        }        else {            var uri = this.url + ((this.params && (this.params.length > 0)) ? '&' + this.params : '') + '&rnd=' + Math.random();            this.http.open("GET", uri, true);            this.http.send(null);        }    }     catch (e) {        this.http = false;        this.running = false;        this.onIdle('stop');        this.onError('fatal');    }    return true;};ajaxObject.end = function(refObj){    if (refObj.running) {        refObj.running = false;        refObj.http.abort();        refObj.http = false;        refObj.onIdle('stop');        refObj.onError('timeout');    }};ajaxObject.handler = function(refObj){    if (refObj.debug) {        messageDialog('State: ' + refObj.http.readyState, {            type: 'OK'        });    }    if (refObj.running) {        if ((refObj.http.readyState == 4) || (refObj.http.readyState == 'complete')) {            refObj.running = false;            refObj.onIdle('stop');            window.clearTimeout(refObj.timeID);            if (refObj.debug) {                messageDialog('Status: ' + refObj.http.status, {                    type: 'OK'                });            }            refObj.text = refObj.http.responseText;            refObj.xml = refObj.http.responseXML ? refObj.http.responseXML : null;            refObj.status = refObj.http.status;            if (refObj.http.status == 200) {                refObj.onLoad();                refObj.http = false;            }            else {                refObj.onError('status');            }        }    }};ajaxObject.prototype.onError = function(err){    if (this.errors[err]) {        messageDialog(this.errors[err], {            type: 'OK',            icon: 'warning.gif'        });    }    else {        messageDialog(err, {            type: 'OK',            icon: 'warning.gif'        });    }};ajaxObject.prototype.onIdle = function(act){    var type = this.extra.type ? this.extra.type : 'NONE';    var message = this.extra.message ? this.extra.message : 'Lütfen bekleyin...';    if (this.extra.target) {        if (typeof(this.extra.target) == 'object') {            var target = this.extra.target;        }        else             if ((typeof(this.extra.target) == 'string') && getEl(this.extra.target)) {                var target = getEl(this.extra.target);            }    }    if (this.extra.form) {        formDisabled(this.extra.form, (act == 'start' ? true : false));    }    switch (type) {        case 'DIALOG':            if (act == 'start') {                if (target) {                    if (!getEl('loadingpoint')) {                        var el = document.createElement('div');                        el.id = 'loadingpoint';                        el.className = 'loadingpoint';                        el.innerHTML = message;                        target.appendChild(el);                        ajaxObject.mask.show(target);                    }                    else {                        getEl('loadingpoint').innerHTML = message;                    }                }            }            else {                if (target) {                    if (getEl('loadingpoint')) {                        target.removeChild(getEl('loadingpoint'));                    }                    ajaxObject.mask.hide(target);                }            }            break;        case 'LIST':            if (target) {                if (act == 'start') {                    target.innerHTML = '<div style="color:#FF0000; text-align:center; line-height:40px;">' + message + '<\/div>';                }                else {                    target.innerHTML = '';                }            }            break;        case 'MESSAGE':            if (act == 'start') {                processDialog('show', message);            }            else {                processDialog('hide');            }            break;    }};ajaxObject.mask = {    maskID: 'dialogBoxMask',    show: function(target){        var el = this.create();        if (target) {            target.appendChild(el);            this.hideShowBehind(target, 'hidden');            this.buttons(target, true);        }        el.style.display = 'block';        el.style.width = target.scrollWidth + 'px';        el.style.height = target.scrollHeight + 'px';    },    hide: function(target){        var el = getEl(this.maskID);        if (el) {            el.parentNode.removeChild(el);            this.hideShowBehind(target, 'visible');            this.buttons(target, false);        }    },    buttons: function(target, disabled){        var el = getEl(Layer.dialogName + target.id);        if (el && el.dialogBox && el.dialogBox.buttonsArea) {            var els = el.dialogBox.buttonsArea.getElementsByTagName('input');            for (var i = 0; i < els.length; i++) {                els[i].disabled = disabled;            }        }    },    create: function(){        var el = getEl(this.maskID);        if (!el) {            var el = document.createElement('div');            el.setAttribute('id', this.maskID);            el.style['position'] = 'absolute';            el.style['top'] = 0;            el.style['left'] = 0;            el.style['backgroundColor'] = '#000000';            el.style['mozOpacity'] = '0.01';            el.style['opacity'] = '0.01';            el.style['filter'] = 'alpha(opacity=1)';            el.innerHTML = '&nbsp;';        }        return el;    },    hideShowBehind: function(target, act){        var tags = new Array('object', 'applet', 'iframe');        if (navigator.appName == "Microsoft Internet Explorer") {            var rawVersion = /MSIE\s([0-9]+)\.[0-9];/g.exec(navigator.appVersion);            var version = parseInt(rawVersion[1]);            if (version < 7) {                tags.push('select');            }        }        for (var k = 0; k < tags.length; k++) {            var arr = target.getElementsByTagName(tags[k]);            for (var i = 0; i < arr.length; i++) {                arr[i].style.visibility = act;            }        }    }};ajaxObject.prototype.onLoad = function(){};function ajax(method, url, params, callbackFunction, extra, debug){    var AJAX = new ajaxObject(method, url, params, extra);    if (debug) {        AJAX.debug = true;    }    AJAX.run();    AJAX.onLoad = function(){        if (typeof(callbackFunction) == 'function') {            callbackFunction(AJAX.xml, (extra ? extra : null), AJAX.text);        }    };};var formAction = function(){    return {        url: 'index.php',        uri: {            'x': 0,            'y': 20        },        vars: {},        width: 500,        title: 'Kayıt',        targetList: 'list',        targetDialog: 'dialog',        paging: true,        contents: {            'dialog': true,            'editing': true,            'deleting': true,            'listing': true        },        messages: {            'loading': LANGUAGE['loading'],            'saving': LANGUAGE['saving'],            'deleting': LANGUAGE['deleting'],            'noResult': LANGUAGE['noResult'],            'confirmDelete': LANGUAGE['confirmDelete'],            'noReturn': LANGUAGE['noReturn'],            'noResponse': LANGUAGE['noResponse']        },        labels: {            'save': LANGUAGE['save'],            'del': LANGUAGE['del'],            'cancel': LANGUAGE['cancel']        },        actions: {            'list': 'list',            'save': 'save',            'del': 'delete',            'values': 'values'        },        resetHiddens: function(){            var target = getEl(this.targetDialog);            if (target) {                var els = getEl(this.targetDialog).getElementsByTagName('input');                for (var i = 0; i < els.length; i++) {                    if (els[i].type == 'hidden') {                        els[i].value = !isNaN(parseInt(els[i].value)) ? 0 : '';                    }                }            }        },        show: function(id){            var obj = this;						            if (id && this.contents.deleting) {                var buttons = {                    type: 'SAVEDELETECANCEL',                    labelSAVE: this.labels.save,                    functionSAVE: function(){                        obj.save()                    },                    labelDELETE: this.labels.del,                    functionDELETE: function(){                        obj.del(id)                    },                    labelCANCEL: this.labels.cancel,                    functionCANCEL: function(){                        layer('hide', obj.targetDialog)                    }                }            }            else {                var buttons = {                    type: 'SAVECANCEL',                    labelSAVE: this.labels.save,                    functionSAVE: function(){                        obj.save()                    },                    labelCANCEL: this.labels.cancel,                    functionCANCEL: function(){                        layer('hide', obj.targetDialog)                    }                }            }            if ((typeof(this.onShow) == 'function') && !this.onShow()) {                return false;            }            layer('show', this.targetDialog, this.width, 300, this.title, buttons);            this.resetHiddens();            if (id) {                this.values(id);            }            else                 if (typeof(this.onInit) == 'function') {                    this.onInit();                }            return true;        },        list: function(uri, setUriToVars){            var obj = this;            var url = this.url + this.actions.list;            if (uri) {                this.uri = uri;                for (var prop in uri) {                    url += '&' + prop + '=' + uri[prop];                }                if (setUriToVars) {                    this.vars = uri;                }            }            var AJAX = new ajaxObject('get', url, null, {                type: 'LIST',                message: this.messages.loading,                target: this.targetList            });            AJAX.run();            AJAX.onLoad = function(){                obj.setList(AJAX.xml);            };        },        save: function(){            if (this.onSave && !this.onSave()) {                return false;            }            var obj = this;            var url = this.url + this.actions.save;            for (var prop in this.vars) {                url += '&' + prop + '=' + this.vars[prop];            }            var AJAX = new ajaxObject('post', url, getParams(this.form ? this.form : this.targetDialog + 'form'), {                type: (this.contents.dialog ? 'DIALOG' : 'MESSAGE'),                message: this.messages.saving,                target: (this.contents.dialog ? this.targetDialog : null)            });            AJAX.run();            AJAX.onLoad = function(){                obj.setResult(AJAX.xml, (obj.onAfterSave || null));            };            return true;        },        del: function(id){            var obj = this;            messageDialog(this.messages.confirmDelete, {                type: 'YESNO',                icon: 'caution.gif',                functionYES: function(){                    var url = obj.url + obj.actions.del;                    for (var prop in obj.vars) {                        url += '&' + prop + '=' + obj.vars[prop];                    }                    var AJAX = new ajaxObject('post', url, 'id=' + id, {                        type: (obj.contents.dialog ? 'DIALOG' : 'MESSAGE'),                        message: obj.messages.deleting,                        target: (obj.contents.dialog ? obj.targetDialog : null)                    });                    AJAX.run();                    AJAX.onLoad = function(){                        obj.setResult(AJAX.xml, (obj.onAfterDelete || null));                    };                }            });        },        values: function(id){            var obj = this;            var url = this.url + this.actions.values;            for (var prop in this.vars) {                url += '&' + prop + '=' + this.vars[prop];            }            var AJAX = new ajaxObject('get', url, 'id=' + id, {                type: (this.contents.dialog ? 'DIALOG' : 'MESSAGE'),                message: this.messages.loading,                target: (this.contents.dialog ? this.targetDialog : null)            });            AJAX.run();            AJAX.onLoad = function(){                if (this.xml) {                    var err = this.xml.getElementsByTagName('error');                    if (err.length > 0) {                        messageDialog(err.item(0).firstChild.data, {                            type: 'OK',                            icon: 'warning.gif'                        });                    }                    else {                        var xml = this.xml.getElementsByTagName('value');                        for (var i = 0; i < xml.length; i++) {                            if (xml.item(i).getAttribute('function')) {                                if (xml.item(i).getAttribute('function') == 'eval') {                                    eval(xml.item(i).firstChild.data);                                }                                else {                                    var arr = eval(xml.item(i).firstChild.data);                                    obj.getChilds((arr[0] != undefined ? arr[0] : null), (arr[1] != undefined ? arr[1] : null), (arr[2] != undefined ? arr[2] : null), (arr[3] != undefined ? arr[3] : null), (arr[4] != undefined ? arr[4] : null));                                }                            }                            else {                                setParam(xml.item(i).getAttribute('target'), xml.item(i).firstChild.data);                            }                        }                    }                }                else {                    messageDialog(obj.messages.noResponse, {                        type: 'OK',                        icon: 'warning.gif'                    });                }                if (typeof(obj.onValues) == 'function') {                    obj.onValues(obj.uri, this.xml);                }            };        },        setResult: function(response, func){            var obj = this;            var listFunction = function(){                var uri = obj.uri ? obj.uri : {};                uri.x = uri.x ? uri.x : 0;                uri.y = uri.y ? uri.y : 20;                obj.list(uri);            };            if (response) {                var err = response.getElementsByTagName('error');                if (err.length > 0) {                    messageDialog(err.item(0).firstChild.data, {                        type: 'OK',                        icon: 'warning.gif'                    });                }                else {                    var xml = response.getElementsByTagName('result');                    if (xml.length > 0) {                        if (xml.item(0).getAttribute('status') == 'OK') {                            if (this.contents.dialog) {                                layer('hide', this.targetDialog);                            }                            messageDialog(xml.item(0).firstChild.data, {                                type: 'OK',                                icon: 'info.gif',                                functionOK: func ||                                function(){                                    if (obj.contents.listing) {                                        listFunction()                                    }                                }                            });                        }                        else {                            messageDialog(xml.item(0).firstChild.data, {                                type: 'OK',                                icon: 'caution.gif'                            });                        }                    }                    else {                        messageDialog(this.messages.noReturn, {                            type: 'OK',                            icon: 'warning.gif'                        });                    }                }            }            else {                messageDialog(this.messages.noResponse, {                    type: 'OK',                    icon: 'warning.gif'                });            }        },        setList: function(response){            var target = getEl(this.targetList);            if (target.hasChildNodes()) {                while (target.childNodes.length >= 1) {                    target.removeChild(target.firstChild);                }            }            if (response) {                var xml = response.getElementsByTagName('list');                if (this.paging) {                    var stat = response.getElementsByTagName('stat');                    if (stat.length > 0) {                        var total = parseInt(stat.item(0).getAttribute('total'));                        var x = parseInt(stat.item(0).getAttribute('x'));                        var y = parseInt(stat.item(0).getAttribute('y'));                    }                    else {                        var total = 0;                        var x = 0;                        var y = 0;                    }                }                if (xml.length > 0) {                    if (this.paging) {                        var p = this.setPaging;                        p.obj = this;                        p.total = total;                        p.x = x;                        p.y = y;                        p.refObj = this;                        target.appendChild(p.show('top'));                    }                    if (this.listFunction && (typeof(this.listFunction) == 'function')) {                        target.appendChild(this.listFunction(xml));                    }                    else {                        for (var i = 0; i < xml.length; i++) {                            target.appendChild(this.parseXML(xml.item(i)));                        }                    }                    if (this.paging) {                        target.appendChild(p.show('bottom'));                    }                }                else {                    var div = Layer.createElement('div');                    div.className = 'warning';                    div.innerHTML = this.messages.noResult;                    target.appendChild(div);                }            }            else {                var div = Layer.createElement('div');                div.className = 'warning';                div.innerHTML = this.messages.noResponse;                target.appendChild(div);                messageDialog(this.messages.noResponse, {                    type: 'OK',                    icon: 'warning.gif'                });            }            if (typeof(this.onList) == 'function') {                this.onList(this.uri, response);            }        },        getChilds: function(act, targetObjID, parentID, selectedID, firstOpt){            var targetObj = getEl(targetObjID);            if (targetObj) {                clearList(targetObj);                listOptions(targetObj, this.messages.loading, 0);                var AJAX = new ajaxObject('get', this.url + act + '&id=' + parentID, null);                AJAX.run();                AJAX.onLoad = function(){                    if (this.xml) {                        var xml = this.xml.getElementsByTagName('list');                        clearList(targetObj);                        if (firstOpt && (firstOpt.value != undefined) && (firstOpt.text != undefined)) {                            listOptions(targetObj, firstOpt.text, firstOpt.value);                        }                        if (xml.length > 0) {                            for (var i = 0; i < xml.length; i++) {                                listOptions(targetObj, xml.item(i).firstChild.data, xml.item(i).getAttribute('id'));                            }                            if (selectedID != undefined) {                                setParam(targetObj, selectedID);                            }                        }                    }                }            }            else {                messageDialog(targetObjID + '??', {                    type: 'OK',                    icon: 'warning.gif'                });            }        },        setPaging: {            total: 0,            x: 0,            y: 20,            refObj: null,            labels: {                'first': LANGUAGE['first'],                'previous': LANGUAGE['previous'],                'next': LANGUAGE['next'],                'last': LANGUAGE['last'],                'total': LANGUAGE['total']            },            yS: {                10: 10,                20: 20,                30: 30,                50: 50            },            init: function(){                this.first_id = 0;                this.prev_id = this.x - this.y;                this.next_id = this.x + this.y;                this.last_id = this.total - ((this.total % this.y == 0) ? this.y : (this.total % this.y));            },            show: function(position){                this.init();                return this.createBody(position);            },            createFirst: function(obj){                var refObj = this.refObj;                if (this.first_id == this.x) {                    var show_first = Layer.createElement('span');                    show_first.style.color = '#cccccc';                    show_first.innerHTML = this.labels.first;                }                else {                    var show_first = Layer.createElement('a');                    show_first.href = 'javascript:void(0)';                    show_first.title = this.labels.first;                    show_first.onclick = function(){                        var uri = refObj.uri ? refObj.uri : {};                        uri.x = 0;                        uri.y = refObj.setPaging.getY(obj);                        refObj.list(uri);                    };                    show_first.innerHTML = this.labels.first;                }                return show_first;            },            createPrevious: function(obj){                var refObj = this.refObj;                if (this.x > 0) {                    var show_prev = Layer.createElement('a');                    show_prev.href = 'javascript:void(0)';                    show_prev.title = this.labels.previous;                    show_prev.onclick = function(){                        var uri = refObj.uri ? refObj.uri : {};                        uri.x = refObj.setPaging.prev_id;                        uri.y = refObj.setPaging.getY(obj);                        refObj.list(uri);                    };                    show_prev.innerHTML = this.labels.previous;                }                else {                    var show_prev = Layer.createElement('span');                    show_prev.style.color = '#cccccc';                    show_prev.innerHTML = this.labels.previous;                }                return show_prev;            },            createNext: function(obj){                var refObj = this.refObj;                if (this.x < (this.total - this.y)) {                    var show_next = Layer.createElement('a');                    show_next.href = 'javascript:void(0)';                    show_next.title = this.labels.next;                    show_next.onclick = function(){                        var uri = refObj.uri ? refObj.uri : {};                        uri.x = refObj.setPaging.next_id;                        uri.y = refObj.setPaging.getY(obj);                        refObj.list(uri);                    };                    show_next.innerHTML = this.labels.next;                }                else {                    var show_next = Layer.createElement('span');                    show_next.style.color = '#cccccc';                    show_next.innerHTML = this.labels.next;                }                return show_next;            },            createLast: function(obj){                var refObj = this.refObj;                if ((this.x >= (this.total - this.y)) || (this.y >= this.total)) {                    var show_last = Layer.createElement('span');                    show_last.style.color = '#cccccc';                    show_last.innerHTML = this.labels.last;                }                else {                    var show_last = Layer.createElement('a');                    show_last.href = 'javascript:void(0)';                    show_last.title = this.labels.last;                    show_last.onclick = function(){                        var uri = refObj.uri ? refObj.uri : {};                        uri.x = refObj.setPaging.last_id;                        uri.y = refObj.setPaging.getY(obj);                        refObj.list(uri);                    };                    show_last.innerHTML = this.labels.last;                }                return show_last;            },            createBody: function(position){                var obj = this;                var table = Layer.createElement('table');                table.width = '100%';                table.border = '0';                table.cellPadding = '5';                table.cellSpacing = '0';                var tbody = Layer.createElement('tbody', table);                var tr = Layer.createElement('tr', tbody);                var td1 = Layer.createElement('td', tr);                td1.width = '33%';                var td2 = Layer.createElement('td', tr);                td2.width = '34%';                td2.align = 'center';                var td3 = Layer.createElement('td', tr);                td3.width = '33%';                td3.align = 'right';                var select = Layer.createElement('select', td1);                select.name = 'paging' + Math.random();                select.onchange = function(){                    var uri = obj.refObj.uri ? obj.refObj.uri : {};                    uri.x = 0;                    uri.y = obj.getY(select);                    obj.refObj.list(uri);                };                var z = 0;                for (i in this.yS) {                    listOptions(select, this.yS[i], this.yS[i]);                    if (this.y == this.yS[i]) {                        select.options[z].selected = true;                    }                    z++;                }                var pipe = Layer.createElement('span');                pipe.innerHTML = '&nbsp;|&nbsp;';                if (position == 'top') {                    var span1 = Layer.createElement('span', td2);                    span1.innerHTML = this.labels.total + ': ' + this.total;                    td2.appendChild(pipe.cloneNode(true));                    var span2 = Layer.createElement('span', td2);                    span2.innerHTML = (this.x + 1) + ' - ' + (this.x + this.y);                }                else {                    var selectP = Layer.createElement('select', td2);                    selectP.name = 'pagingY';                    selectP.onchange = function(){                        var uri = obj.refObj.uri ? obj.refObj.uri : {};                        uri.x = obj.getY(selectP);                        uri.y = obj.getY(select);                        obj.refObj.list(uri);                    };                    for (i = 0; i < Math.ceil(this.total / this.y); i++) {                        listOptions(selectP, (i + 1), (i * this.y));                        if ((i * this.y) == this.x) {                            selectP.options[i].selected = true;                        }                    }                }                td3.appendChild(this.createFirst(select));                td3.appendChild(pipe.cloneNode(true));                td3.appendChild(this.createPrevious(select));                td3.appendChild(pipe.cloneNode(true));                td3.appendChild(this.createNext(select));                td3.appendChild(pipe);                td3.appendChild(this.createLast(select));                return table;            },            getY: function(obj){                return obj.options[obj.selectedIndex].value;            }        },        parseXML: function(xml){            var head = xml.getElementsByTagName('head');            var body = xml.getElementsByTagName('body');            var titles = [];            if (head.length > 0) {                titles = head.item(0).getElementsByTagName('title');            }            var rows = body.item(0).getElementsByTagName('row');            if (rows.length > 0) {                var table = Layer.createElement('table');                table.width = '100%';                table.border = '0';                table.cellPadding = '5';                table.cellSpacing = '0';                var tbody = Layer.createElement('tbody', table);                if (titles.length > 0) {                    var th = Layer.createElement('tr', tbody);                    for (var i = 0; i < titles.length; i++) {                        var td = Layer.createElement('td', th);                        td.className = 'gridTitle';                        if (titles.item(i).getAttribute('width')) {                            td.width = titles.item(i).getAttribute('width');                        }                        if (titles.item(i).getAttribute('align')) {                            td.align = titles.item(i).getAttribute('align');                        }                        td.innerHTML = titles.item(i).firstChild.data;                    }                }                for (var y = 0; y < rows.length; y++) {                    var tr = Layer.createElement('tr', tbody);                    var column = rows[y].childNodes;                    for (var i = 0; i < column.length; i++) {                        var td = Layer.createElement('td', tr);                        td.rowID = rows[y].getAttribute('id');                        if ((titles.length > 0) && titles.item(i).getAttribute('align')) {                            td.align = titles.item(i).getAttribute('align');                        }                        else {                            if (column[i].getAttribute('align')) {                                td.align = column[i].getAttribute('align');                            }                        }                        if (column[i].getAttribute('width')) {                            td.width = column[i].getAttribute('width');                        }                        if (rows[y].getAttribute('onmouseover')) {                            td.onmouseover = new Function(rows[y].getAttribute('onmouseover'));                        }                        if (rows[y].getAttribute('onmouseout')) {                            td.onmouseout = new Function(rows[y].getAttribute('onmouseout'));                        }                        if (this.contents.editing && rows[y].getAttribute('id')) {                            var obj = this;                            td.onclick = function(e){                                if (!e) {                                    e = window.event;                                }                                var node = e.target ? e.target : e.srcElement;                                if (node.rowID) {                                    obj.show(node.rowID);                                }                            }                        }                        else                             if (rows[y].getAttribute('onclick')) {                                td.onclick = new Function(rows[y].getAttribute('onclick'));                            }                        if (column[i].getAttribute('colspan')) {                            td.colSpan = column[i].getAttribute('colspan');                        }                        if (column[i].getAttribute('rowspan')) {                            td.rowSpan = column[i].getAttribute('rowspan');                        }                        if (column[i].getAttribute('class')) {                            td.className = column[i].getAttribute('class');                        }                        else {                            td.className = 'gridRow';                        }                        if (column[i].getAttribute('style')) {                            td.style.cssText = column[i].getAttribute('style');                        }                        td.innerHTML = (column[i] ? column[i].firstChild.data : '&nbsp;');                    }                }            }            return table;        },        tab: function(id, el){            var tabBar = getEl('tabs' + id);            var tabbingBar = getEl('tabbing' + id);            var tabs = [];            if (tabbingBar) {                var els = tabbingBar.getElementsByTagName('div');                for (var i = 0; i < els.length; i++) {                    if (els[i].className == 'tab') {                        tabs.push(els[i]);                    }                }            }            if (tabBar) {                var els = tabBar.getElementsByTagName('a');                if (!el && (els.length > 0)) {                    el = els[0];                }                for (var i = 0; i < els.length; i++) {                    els[i].parentNode.className = '';                    if (tabs[i]) {                        tabs[i].style.display = 'none';                    }                    if (els[i] == el) {                        els[i].parentNode.className = 'here';                        if (tabs[i]) {                            tabs[i].style.display = 'block';                        }                    }                }            }        },        errorSpan: {},        removeErrorSpan: function(field){            var target = typeof(field) == 'object' ? field : getEl(field);            if (target && this.errorSpan[field]) {                target.style.backgroundColor = '';                target.style.color = '';                this.errorSpan[field].parentNode.removeChild(this.errorSpan[field]);                this.errorSpan[field] = null;            }        },        showErrorSpan: function(field, errorText){            var target = typeof(field) == 'object' ? field : getEl(field);            if (target) {                this.removeErrorSpan(field);                target.style.backgroundColor = '#ff0000';                target.style.color = '#ffffff';                var el = Layer.createElement('span', target.parentNode);                el.style.color = '#ff0000';                el.innerHTML = errorText;                this.errorSpan[field] = el;            }        }    }};function getPosition(el){    var r = {        x: el.offsetLeft,        y: el.offsetTop    };    if (el.offsetParent) {        var tmp = getPosition(el.offsetParent);        r.x += tmp.x;        r.y += tmp.y;    }    return r;}function addListener(obj, evType, fn){    if (obj.addEventListener) {        obj.addEventListener(evType, fn, false);    }    else         if (obj.attachEvent) {            obj.attachEvent('on' + evType, fn);        }}function remListener(obj, evType, fn){    if (obj.removeEventListener) {        obj.removeEventListener(evType, fn, false);    }    else         if (obj.detachEvent) {            obj.detachEvent('on' + evType, fn);        }}function getWinW(){    if (document.documentElement && (document.documentElement.clientWidth > 0)) {        return document.documentElement.clientWidth;    }    else         if (window.innerWidth) {            return window.innerWidth;        }        else {            return document.body.clientWidth;        }}function getWinH(){    if (window.innerHeight) {        return window.innerHeight;    }    else         if (document.documentElement && (document.documentElement.clientHeight > 0)) {            return document.documentElement.clientHeight;        }        else {            return document.body.clientHeight;        }}function getScrollLeft(){    if (window.pageXOffset) {        return window.pageXOffset;    }    else         if (document.documentElement && (document.documentElement.scrollLeft > 0)) {            return document.documentElement.scrollLeft;        }        else {            return document.body.scrollLeft;        }}function getScrollTop(){    if (window.pageYOffset) {        return window.pageYOffset;    }    else         if (document.documentElement && (document.documentElement.scrollTop > 0)) {            return document.documentElement.scrollTop;        }        else {            return document.body.scrollTop;        }}function inArray(needle, haystack, strict){    var found = false, key, strict = !!strict;    for (key in haystack) {        if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {            found = true;            break;        }    }    return found;}function arrayKeyExists(key, search){    if (!search || ((search.constructor !== Array) && (search.constructor !== Object))) {        return false;    }    return key in search;}function arrayKeys(input, searchValue, strict){    var tmp_arr = new Array(), strict = !!strict, include = true, cnt = 0;    for (key in input) {        include = true;        if (searchValue != undefined) {            if (strict && (input[key] !== searchValue)) {                include = false;            }            else                 if (input[key] != searchValue) {                    include = false;                }        }        if (include) {            tmp_arr[cnt] = key;            cnt++;        }    }    return tmp_arr;}function arrayValues(input){    var tmp_arr = new Array(), cnt = 0;    for (key in input) {        tmp_arr[cnt] = input[key];        cnt++;    }    return tmp_arr;}function wolAdd(func){    addListener(window, 'load', function(){        eval(func)    });}function worAdd(func){    addListener(window, 'resize', function(){        eval(func)    });}function layer(status, target, width, height, title, buttons, opa){    if (status == 'hide') {        Layer.closeBoxById(target);    }    else {        var dialogObj = getEl(Layer.dialogName + target);        var targetObj = getEl(target);        if (!targetObj) {            messageDialog(LANGUAGE['noTarget'], {                type: 'OK',                icon: 'warning.gif'            });        }        else             if (!dialogObj) {                var dialog = new Layer(true, true);                dialog.create();                dialog.setWidth(width);                dialog.setTitle(title);                dialog.setContent(targetObj);                if (opa || (Layer.box.getAllBox().length > 0)) {                    dialog.setVeilCss({                        backgroundColor: '#ffffff',                        filter: 'alpha(opacity=0)',                        opacity: 0                    });                }                if (buttons) {                    if (buttons.align) {                        dialog.buttonsArea.style.textAlign = buttons.align;                    }                    if (buttons.onClose) {                        dialog.setCloseFunction(buttons.onClose);                    }                    switch (buttons.type) {                        case 'YESNO':                            var labelYES = buttons.labelYES ? buttons.labelYES : LANGUAGE['yes'];                            var labelNO = buttons.labelNO ? buttons.labelNO : LANGUAGE['no'];                            var functionYES = buttons.functionYES ? (typeof(buttons.functionYES) == 'function' ? buttons.functionYES : function(){                                eval(buttons.functionYES)                            }) : '';                            var functionNO = buttons.functionNO ? (typeof(buttons.functionNO) == 'function' ? buttons.functionNO : function(){                                eval(buttons.functionNO)                            }) : '';                            dialog.addButton({                                name: 'btnYes',                                value: labelYES,                                onclick: functionYES                            });                            dialog.addButton({                                name: 'btnNo',                                value: labelNO,                                onclick: functionNO                            });                            break;                        case 'YESNOCANCEL':                            var labelYES = buttons.labelYES ? buttons.labelYES : LANGUAGE['yes'];                            var labelNO = buttons.labelNO ? buttons.labelNO : LANGUAGE['no'];                            var labelCANCEL = buttons.labelCANCEL ? buttons.labelCANCEL : LANGUAGE['cancel'];                            var functionYES = buttons.functionYES ? (typeof(buttons.functionYES) == 'function' ? buttons.functionYES : function(){                                eval(buttons.functionYES)                            }) : '';                            var functionNO = buttons.functionNO ? (typeof(buttons.functionNO) == 'function' ? buttons.functionNO : function(){                                eval(buttons.functionNO)                            }) : '';                            var functionCANCEL = buttons.functionCANCEL ? (typeof(buttons.functionCANCEL) == 'function' ? buttons.functionCANCEL : function(){                                eval(buttons.functionCANCEL)                            }) : '';                            dialog.addButton({                                name: 'btnYes',                                value: labelYES,                                onclick: functionYES                            });                            dialog.addButton({                                name: 'btnNo',                                value: labelNO,                                onclick: functionNO                            });                            dialog.addButton({                                name: 'btnCancel',                                value: labelCANCEL,                                onclick: functionCANCEL                            });                            break;                        case 'OKCANCEL':                            var labelOK = buttons.labelOK ? buttons.labelOK : LANGUAGE['ok'];                            var labelCANCEL = buttons.labelCANCEL ? buttons.labelCANCEL : LANGUAGE['cancel'];                            var functionOK = buttons.functionOK ? (typeof(buttons.functionOK) == 'function' ? buttons.functionOK : function(){                                eval(buttons.functionOK)                            }) : '';                            var functionCANCEL = buttons.functionCANCEL ? (typeof(buttons.functionCANCEL) == 'function' ? buttons.functionCANCEL : function(){                                eval(buttons.functionCANCEL)                            }) : '';                            dialog.addButton({                                name: 'btnOk',                                value: labelOK,                                onclick: functionOK                            });                            dialog.addButton({                                name: 'btnCancel',                                value: labelCANCEL,                                onclick: functionCANCEL                            });                            break;                        case 'SAVECANCEL':                            var labelSAVE = buttons.labelSAVE ? buttons.labelSAVE : LANGUAGE['save'];                            var labelCANCEL = buttons.labelCANCEL ? buttons.labelCANCEL : LANGUAGE['cancel'];                            var functionSAVE = buttons.functionSAVE ? (typeof(buttons.functionSAVE) == 'function' ? buttons.functionSAVE : function(){                                eval(buttons.functionSAVE)                            }) : '';                            var functionCANCEL = buttons.functionCANCEL ? (typeof(buttons.functionCANCEL) == 'function' ? buttons.functionCANCEL : function(){                                eval(buttons.functionCANCEL)                            }) : '';                            dialog.addButton({                                name: 'btnSave',                                value: labelSAVE,                                onclick: functionSAVE                            });                            dialog.addButton({                                name: 'btnCancel',                                value: labelCANCEL,                                onclick: functionCANCEL                            });                            break;                        case 'SAVEDELETECANCEL':                            var labelSAVE = buttons.labelSAVE ? buttons.labelSAVE : LANGUAGE['save'];                            var labelDELETE = buttons.labelDELETE ? buttons.labelDELETE : LANGUAGE['del'];                            var labelCANCEL = buttons.labelCANCEL ? buttons.labelCANCEL : LANGUAGE['cancel'];                            var functionSAVE = buttons.functionSAVE ? (typeof(buttons.functionSAVE) == 'function' ? buttons.functionSAVE : function(){                                eval(buttons.functionSAVE)                            }) : '';                            var functionDELETE = buttons.functionDELETE ? (typeof(buttons.functionDELETE) == 'function' ? buttons.functionDELETE : function(){                                eval(buttons.functionDELETE)                            }) : '';                            var functionCANCEL = buttons.functionCANCEL ? (typeof(buttons.functionCANCEL) == 'function' ? buttons.functionCANCEL : function(){                                eval(buttons.functionCANCEL)                            }) : '';                            dialog.addButton({                                name: 'btnSave',                                value: labelSAVE,                                onclick: functionSAVE                            });                            dialog.addButton({                                name: 'btnDelete',                                value: labelDELETE,                                onclick: functionDELETE                            });                            dialog.addButton({                                name: 'btnCancel',                                value: labelCANCEL,                                onclick: functionCANCEL                            });                            break;                        case "OK":                            var labelOK = buttons.labelOK ? buttons.labelOK : LANGUAGE['ok'];                            var functionOK = buttons.functionOK ? (typeof(buttons.functionOK) == 'function' ? buttons.functionOK : function(){                                eval(buttons.functionOK)                            }) : '';                            dialog.addButton({                                name: 'btnOk',                                value: labelOK,                                onclick: functionOK                            });                            break;                        default:                            if (buttons.html) {                                dialog.addToButtonsArea(buttons.html);                            }                    }                }                dialog.show();                addListener(window, 'resize', function(){                    dialog.moveTo()                });                dialog.moveTo();                dialog.resetForm(target + 'form');                dialog.focusOn();            }    }}function messageDialog(message, properties, status){    var targetID = 'processDialog';    if (!properties) {        var properties = {};    }    if (status && (status == 'hide')) {        if (getEl(targetID)) {            layer('hide', targetID);            getEl(targetID).parentNode.removeChild(getEl(targetID));        }        return false;    }    if (getEl(targetID)) {        targetID = targetID + Math.random();    }    var el = Layer.createElement('div');    el.id = targetID;    var table = Layer.createElement('table', el);    table.width = '100%';    table.border = '0';    table.cellPadding = '0';    table.cellSadding = '0';    var tbody = Layer.createElement('tbody', table);    var tr = Layer.createElement('tr', tbody);    var td = Layer.createElement('td', tr);    td.align = 'center';    td.style.height = '85px';    if (properties && properties.icon) {        var im = Layer.createElement('img', td);        im.width = '32';        im.height = '32';        im.alt = LANGUAGE['icon'];        im.style.verticalAlign = 'middle';        im.style.border = '0';        im.style.padding = '0 5px';        im.src = Layer.imagePath + '32x32/' + properties.icon;    }    var span = Layer.createElement('span', td);    span.innerHTML = message;    document.body.appendChild(el);    var type = properties.type ? properties.type : 'OK';    var title = properties.title ? properties.title : LANGUAGE['message'];    var closeFunc = properties.onClose ? properties.onClose : '';    switch (type) {        case "YESNO":            var labelYES = properties.labelYES ? properties.labelYES : LANGUAGE['yes'];            var labelNO = properties.labelNO ? properties.labelNO : LANGUAGE['no'];            var functionYES = properties.functionYES ? (typeof(properties.functionYES) == 'function' ? function(){                layer('hide', targetID);                properties.functionYES()            } : function(){                layer('hide', targetID);                eval(properties.functionYES)            }) : function(){                layer('hide', targetID)            };            var functionNO = properties.functionNO ? (typeof(properties.functionNO) == 'function' ? function(){                layer('hide', targetID);                properties.functionNO()            } : function(){                layer('hide', targetID);                eval(properties.functionNO)            }) : function(){                layer('hide', targetID)            };            layer('show', targetID, 400, 160, title, {                type: 'YESNO',                labelYES: labelYES,                labelNO: labelNO,                height: 35,                align: 'center',                functionYES: functionYES,                functionNO: functionNO,                onClose: closeFunc            }, (properties.opa ? true : false));            break;        default:            var labelOK = properties.labelOK ? properties.labelOK : LANGUAGE['ok'];            var functionOK = properties.functionOK ? (typeof(properties.functionOK) == 'function' ? function(){                layer('hide', targetID);                properties.functionOK()            } : function(){                layer('hide', targetID);                eval(properties.functionOK)            }) : function(){                layer('hide', targetID)            };            layer('show', targetID, 400, 160, title, {                type: 'OK',                labelOK: labelOK,                height: 35,                align: 'center',                functionOK: functionOK,                onClose: closeFunc            }, (properties.opa ? true : false));    }    return true;}function processDialog(status, message){    var targetID = 'messageDialog';    if (status && (status == 'hide')) {        Layer.closeBoxById(targetID);        document.body.removeChild(getEl(targetID));    }    else {        var html = Layer.createElement('div');        html.id = targetID;        var table = Layer.createElement('table', html);        table.width = '100%';        table.border = '0';        table.cellPadding = '5';        table.cellSpacing = '0';        var tbody = Layer.createElement('tbody', table);        var tr1 = Layer.createElement('tr', tbody);        var tr2 = Layer.createElement('tr', tbody);        var td1 = Layer.createElement('td', tr1);        var td2 = Layer.createElement('td', tr2);        td1.style.cssText = 'text-align:center';        td2.style.cssText = 'text-align:center; color:#000000; font-weight:bold';        var img = Layer.createElement('img', td1);        img.width = '32';        img.height = '32';        img.style.border = '0';        img.src = Layer.imagePath + 'loaders/loading.gif';        img.alt = LANGUAGE['loading'];        td2.innerHTML = message ? message : LANGUAGE['loadingMessage'];        document.body.appendChild(html);        var dialog = new Layer(true, true);        dialog.createBox();        dialog.setWidth(250);        dialog.setContent(html);        dialog.setVeilCss({            backgroundColor: '#ffffff',            filter: 'alpha(opacity=0)',            opacity: 0        });        dialog.show();        addListener(window, 'resize', function(){            dialog.moveTo()        });        addListener(window, 'scroll', function(){            dialog.moveTo()        });        dialog.moveTo();    }}function listOptions(targetOpt, optlabel, optvalue){    var newOption = document.createElement('option');    newOption.text = optlabel;    newOption.value = optvalue;    try {        targetOpt.add(newOption, null);    }     catch (ex) {        targetOpt.add(newOption);    }    return newOption;};function clearList(targetOpt){    while (targetOpt.length > 0) {        targetOpt.remove(0);    }};function getValue(objID, defVal){    var typ = ((defVal != undefined) && (typeof defVal == 'number') ? 'number' : 'string');    var obj = getEl(objID);    var objs = document.getElementsByName(objID);    if (obj) {        switch (obj.type) {            case 'select-one':                if (obj.options.length > 0) {                    var returnValue = obj.options[obj.selectedIndex].value;                    return (typ == 'number' ? parseInt(returnValue) : returnValue.toString());                }                break;            case 'select-multiple':                if (obj.options.length > 0) {                    var tmp = new Array();                    for (var i = 0; i < obj.options.length; i++) {                        if (obj.options[i].selected) {                            tmp.push(obj.options[i].value);                        }                    }                    return tmp;                }                break;            case 'radio':            case 'checkbox':                if (navigator.appName == "Microsoft Internet Explorer") {                    if (!objs) {                        var objs = document.getElementsByName(obj.name);                    }                    for (var i = 0; i < objs.length; i++) {                        if (objs[i].checked) {                            var returnValue = objs[i].value;                            return (typ == 'number' ? parseInt(returnValue) : returnValue.toString());                        }                    }                }                else                     if (obj.checked) {                        var returnValue = obj.value;                        return (typ == 'number' ? parseInt(returnValue) : returnValue.toString());                    }                break;            case 'text':            case 'textarea':            case 'hidden':            case 'password':            case 'file':                var returnValue = obj.value;                return (typ == 'number' ? parseInt(returnValue) : returnValue.toString());                break;            default:                if (obj.innerHTML) {                    var returnValue = obj.innerHTML;                    return (typ == 'number' ? parseInt(returnValue) : returnValue.toString());                }        }    }    else         if (objs) {            for (var i = 0; i < objs.length; i++) {                if (objs[i].checked) {                    var returnValue = objs[i].value;                    return (typ == 'number' ? parseInt(returnValue) : returnValue.toString());                }            }        }    return (defVal != undefined ? defVal : null);};function getParams(formName){    var params = new Array();    if (document.forms[formName]) {        for (var i = 0; i < document.forms[formName].elements.length; i++) {            var obj = document.forms[formName].elements[i];            switch (obj.type) {                case 'select-one':                    var objName = obj.name;                    if (obj.options.length > 0) {                        var objValue = encodeURIComponent(obj.options[obj.selectedIndex].value);                    }                    else {                        var objValue = '0';                    }                    params.push(objName + '=' + objValue);                    break;                case 'select-multiple':                    var objName = obj.name;                    if (obj.options.length > 0) {                        var tmp = new Array();                        for (var y = 0; y < obj.options.length; y++) {                            if (obj.options[y].selected)                                 tmp.push(encodeURIComponent(obj.options[y].value));                        }                        var objValue = ((tmp.length > 0) ? tmp.join(',') : 0);                    }                    else {                        var objValue = '0';                    }                    params.push(objName + '=' + objValue);                    break;                case 'radio':                case 'checkbox':                    if (obj.checked) {                        var objName = obj.name;                        var objValue = encodeURIComponent(obj.value);                        params.push(objName + '=' + objValue);                    }                    break;                case 'text':                case 'textarea':                case 'hidden':                case 'password':                    var objName = obj.name;                    var objValue = encodeURIComponent(obj.value);                    params.push(objName + '=' + objValue);                    break;            }        }    }    return params.join('&');};function setParam(targetID, val){    if (typeof(targetID) == 'object') {        var target = targetID;    }    else {        var target = getEl(targetID);        var targets = document.getElementsByName(targetID);    }    if (target) {        switch (target.type) {            case "select-one":                for (var i = 0; i < target.options.length; i++) {                    if (target.options[i].value == val) {                        target.options[i].selected = true;                        break;                    }                }                break;            case "select-multiple":                var raw = val.split(',');                for (var i = 0; i < target.options.length; i++) {                    for (var y = 0; y < raw.length; y++) {                        if (raw[y] == target.options[i].value) {                            target.options[i].selected = true;                        }                    }                }                break;            case "radio":            case "checkbox":                if (navigator.appName == "Microsoft Internet Explorer") {                    if (!targets) {                        var targets = document.getElementsByName(target.name);                    }                    for (var i = 0; i < targets.length; i++) {                        if ((targets[i].type == 'radio') || (targets[i].type == 'checkbox')) {                            if (targets[i].value.toString() == val.toString()) {                                targets[i].checked = true;                            }                            else {                                targets[i].checked = false;                            }                        }                    }                }                else {                    if (target.value == val) {                        target.checked = true;                    }                    else {                        target.checked = false;                    }                }                break;            default:                target.value = val;                break;        }    }    else         if (targets) {            for (var i = 0; i < targets.length; i++) {                if ((targets[i].type == 'radio') || (targets[i].type == 'checkbox')) {                    if (val && (targets[i].value.toString() == val.toString())) {                        targets[i].checked = true;                    }                    else {                        targets[i].checked = false;                    }                }            }        }};function formDisabled(target, status){    var fr = document.forms[target];    if (fr) {        for (var i = 0; i < fr.elements.length; i++) {            fr.elements[i].disabled = status;        }    }};function overRow(obj, cl){    var target = obj.parentNode.getElementsByTagName('td');    for (var i = 0; i < target.length; i++) {        target[i].className = cl;    }};function isEmail(val){    var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;    if (pattern.test(val)) {        return true;    }    else {        return false;    }};function trim(pString){    pString = pString.replace(/^[\s]+/, '');    pString = pString.replace(/[\s]+$/, '');    return pString;};function toUpper(targetEl){    var obj = (typeof(targetEl) == 'object') ? targetEl : getEl(targetEl);    if (document.forms[targetEl]) {        var fr = document.forms[targetEl];        for (var i = 0; i < fr.elements.length; i++) {            tempObject = fr.elements[i];            if (tempObject && tempObject.type && (tempObject.type.toLowerCase() == 'text' || tempObject.type.toLowerCase() == 'textarea')) {                tempObject.value = trim(tempObject.value);                tempObject.value = tempObject.value.replace(/i/g, 'İ');                tempObject.value = tempObject.value.toUpperCase();            }        }    }    else         if (obj) {            tempObject = obj;            if (tempObject && tempObject.type && (tempObject.type.toLowerCase() == 'text' || tempObject.type.toLowerCase() == 'textarea')) {                tempObject.value = trim(tempObject.value);                tempObject.value = tempObject.value.replace(/i/g, 'İ');                tempObject.value = tempObject.value.toUpperCase();            }        }};function onlyNum(e){    var numbers = {};    numbers[8] = 8;    numbers[9] = 9;    numbers[46] = 46;    numbers[48] = 48;    numbers[49] = 49;    numbers[50] = 50;    numbers[51] = 51;    numbers[52] = 52;    numbers[53] = 53;    numbers[54] = 54;    numbers[55] = 55;    numbers[56] = 56;    numbers[57] = 57;    var k = e.keyCode ? e.keyCode : e.charCode;    if (!numbers[k]) {        return false;    }    else {        return true;    }};var onlyUpper = {    init: function(e){        if (!e) {            e = window.event;        }        var obj = e.target ? e.target : e.srcElement;        var key = e.keyCode ? e.keyCode : e.charCode;        var str = (key == 105 ? 'İ' : String.fromCharCode(key));        if (((key < 97) || (key > 122)) && !this.isTR(key)) {            return true;        }        if (obj.createTextRange) {            obj.caretPos = document.selection.createRange();            obj.focus(obj.caretPos);            obj.caretPos.text = this.toUpper(str);        }        else {            var pos = obj.selectionStart;            obj.value = obj.value.substr(0, pos) + this.toUpper(str) + obj.value.substr(pos);            obj.setSelectionRange((pos + 1), (pos + 1));        }        return false;    },    isTR: function(key){        var keys = [231, 246, 252, 287, 305, 351];        for (var i in keys) {            if (keys[i] == key) {                return true;            }        }        return false;    },    toUpper: function(str){        return str.replace('i', 'İ').toUpperCase().replace(/^\s+|\s+$/g, '');    }};function popup(url, width, height){    window.open(url, 'popup', 'width=' + width + ',height=' + height + ',resizable=no,status=no,scrollbars=yes');};function modalDialog(url, width, height){    showModalDialog(url, window.dialogArguments, 'dialogWidth:' + width + 'px; dialogHeight:' + height + 'px; help: 0; status: 0; resizable:0; center:1');};function textCounter(obj, target, maxlimit){    var limit = maxlimit ? maxlimit : 250;    var total = obj.value.length;    var countfield = getEl(target);    countfield.innerHTML = limit - total;    if (total > limit) {        obj.value = obj.value.substr(0, limit);    }};function isDate(obj){    var delimChar = '-';    obj.value = obj.value.replace(/\./g, delimChar);    obj.value = obj.value.replace(/\//g, delimChar);    var mo, day, yr;    var entry = obj.value;    var re = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/;    if (entry.length == 0) {        return true;    }    if (re.test(entry)) {        var splitted = entry.split(delimChar);        if (splitted.length == 3) {            day = splitted[0];            mo = splitted[1];            yr = splitted[2];            var testDate = new Date(yr, mo - 1, day);            if ((testDate.getDate() == day) && ((testDate.getMonth() + 1) == mo) && (testDate.getFullYear() == yr)) {                return true;            }        }        else {            return false;        }    }    return false;};function commafy(inpValue){    var re = /(\d+)(\d{3})/;    while (re.test(inpValue)) {        inpValue = eval('inpValue.replace(re, "$1.$2")');    }    return inpValue;};function deCommafy(inpValue){    var re = eval('/\\./g');    return inpValue.replace(re, '');};function formatCurrency(inpObj){    inpValue = inpObj.value;    if (inpValue.length == 0) {        return false;    }    var fromIndex = 0;    var toIndex = 0;    ytlVal = inpValue;    var unformattedString = deCommafy(ytlVal);    if (unformattedString.length > 9) {        unformattedString = unformattedString.substring(0, 9);    }    if (!isNaN(parseInt(unformattedString, 10))) {        unformattedString = parseInt(unformattedString, 10).toString();    }    else {        inpObj.value = '';        inpObj.focus();        return false;    }    inpObj.value = commafy(unformattedString);    return true;};function focusOn(objID){    obj = typeof(objID) == 'object' ? objID : getEl(objID);    if (obj) {        obj.focus();    }};function addToBookmarks(){    var t = document.title;    var u = document.URL;    if (window.sidebar) {        window.sidebar.addPanel(t, u, '');    }    else         if (document.all) {            window.external.AddFavorite(u, t);        }        else             if (window.opera && window.print) {                return true;            }};function kuki(){    this.setCookie = function(name, value, seconds){        if (typeof(seconds) != 'undefined') {            var date = new Date();            date.setTime(date.getTime() + (seconds * 1000));            var expires = '; expires=' + date.toGMTString();        }        else {            var expires = '';        }        document.cookie = name + '=' + value + expires + '; path=/';    };    this.getCookie = function(name){        name = name + '=';        var carray = document.cookie.split(';');        for (var i = 0; i < carray.length; i++) {            var c = carray[i];            while (c.charAt(0) == ' ') {                c = c.substring(1, c.length);            }            if (c.indexOf(name) == 0) {                return c.substring(name.length, c.length);            }        }        return null;    };    this.deleteCookie = function(name){        this.setCookie(name, '', -1);    }};var STR_PAD_LEFT = 1, STR_PAD_RIGHT = 2, STR_PAD_BOTH = 3;function pad(str, len, pad, dir){    if (typeof(len) == 'undefined') {        var len = 0;    }    if (typeof(pad) == 'undefined') {        var pad = ' ';    }    if (typeof(dir) == 'undefined') {        var dir = STR_PAD_RIGHT;    }    if (len + 1 >= str.length) {        switch (dir) {            case STR_PAD_LEFT:                str = Array(len + 1 - str.length).join(pad) + str;                break;            case STR_PAD_BOTH:                var right = Math.ceil((padlen = len - str.length) / 2);                var left = padlen - right;                str = Array(left + 1).join(pad) + str + Array(right + 1).join(pad);                break;            default:                str = str + Array(len + 1 - str.length).join(pad);                break;        }    }    return str;};var cycling = {    cycle: true,    height: 200,    speed: 100,    init: function(targetID, height, speed){        if (height)             this.height = height;        if (speed)             this.speed = (speed * 100);        this.start(targetID);        window.setTimeout(function(){            cycling.init(targetID)        }, this.speed);    },    start: function(targetID){        var obj = this.getChild(getEl(targetID));        if (!this.he) {            this.he = this.getScrollHeight(obj.parentNode);            if (obj.addEventListener) {                obj.addEventListener('mouseover', function(){                    cycling.cycle = false;                }, false);                obj.addEventListener('mouseout', function(){                    cycling.cycle = true;                }, false);            }            else {                obj.attachEvent('onmouseover', function(){                    cycling.cycle = false;                });                obj.attachEvent('onmouseout', function(){                    cycling.cycle = true;                });            }        }        if (this.cycle) {            this.setPosition(obj, (this.getPosition(obj) - 1));        }    },    getChild: function(obj){        var els = obj.getElementsByTagName('div');        if (els.length > 0) {            return els[0];        }        return;    },    getHeight: function(obj){        var raw = obj.style.height;        return raw.replace('px', '');    },    setHeight: function(obj){        obj.style.height = this.height + 'px';    },    getScrollHeight: function(obj){        return obj.scrollHeight;    },    getTop: function(obj){        var raw = obj.style.top;        return raw.replace('px', '');    },    getPosition: function(obj){        var h = this.getTop(obj);        if (h.length < 1) {            this.setHeight(obj.parentNode);            h = this.getHeight(obj.parentNode);            obj.style.position = 'absolute';            obj.style.top = h + 'px';        }        else             if (h < 0 && (Math.abs(h) > this.getScrollHeight(obj))) {                h = this.getHeight(obj.parentNode);                obj.style.top = h + 'px';            }        return h;    },    setPosition: function(obj, val){        obj.style.top = val + 'px';    }};var contextMenu = {    _menus: {},    _attachedElement: null,    _menuElement: null,    _setup: function(){        if (document.all && document.getElementById && !window.opera) {            this.IE = true;        }        if (!document.all && document.getElementById && !window.opera) {            this.FF = true;        }        if (document.all && document.getElementById && window.opera) {            this.OP = true;        }        if (contextMenu.IE || contextMenu.FF) {            document.oncontextmenu = this._show;            document.onclick = this._hide;        }    },    attach: function(menuId, attachObj){        this._setup();        this._menus[menuId] = attachObj;    },    detach: function(menuId){        if (this._menus[menuId]) {            delete this._menus[menuId];        }    },    _getMenuElementId: function(e){        contextMenu._attachedElement = contextMenu.IE ? event.srcElement : e.target;        if (contextMenu._attachedElement != null) {            for (var menuId in this._menus) {                if (contextMenu._menus[menuId] == contextMenu._attachedElement) {                    return menuId;                }            }        }        contextMenu._attachedElement = contextMenu.IE ? contextMenu._attachedElement.parentElement : contextMenu._attachedElement.parentNode;        return null;    },    _show: function(e){        contextMenu._hide();        var menuElementId = contextMenu._getMenuElementId(e);        if (menuElementId) {            var m = contextMenu._getMousePosition(e);            var s = contextMenu._getScrollPosition(e);            contextMenu._menuElement = getEl(menuElementId);            contextMenu._menuElement.style.left = m.x + s.x + 'px';            contextMenu._menuElement.style.top = m.y + s.y + 'px';            contextMenu._menuElement.style.display = 'block';            return false;        }        return true;    },    _hide: function(){        if (contextMenu._menuElement) {            contextMenu._menuElement.style.display = 'none';        }    },    _getMousePosition: function(e){        e = e ? e : window.event;        var position = {            'x': e.clientX,            'y': e.clientY        };        return position;    },    _getScrollPosition: function(){        var x = 0, y = 0;        if (typeof(window.pageYOffset) == 'number') {            x = window.pageXOffset;            y = window.pageYOffset;        }        else             if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {                x = document.documentElement.scrollLeft;                y = document.documentElement.scrollTop;            }            else                 if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {                    x = document.body.scrollLeft;                    y = document.body.scrollTop;                }        var position = {            'x': x,            'y': y        };        return position;    }};