window.onresize = function(){ ajx.smartResizeRe(); } ajx = new Object(); ajx.init = function(parentId){ for(i=0; i < document.getElementsByTagName('table').length; i++){ fld = document.getElementsByTagName('table')[i]; if(fld.width == '503'){ act = fld.getAttribute("AJX:action"); cfg = ajx.getcfg(fld.getAttribute("AJX:cfg")); switch(act){ case "table": ajx.table(fld, cfg); break; case "table_overflow": ajx.table_overflow(fld, cfg); break; case "table-expanded": ajx.tableExpanded(fld, cfg); break; } } } collection = document.getElementsByTagName("div"); cfg = new Array(); for(cx=0; cx 0){ for(iz=0; iz cfg['length']){ var url = ''; if(cfg['liveValue'] == 1){ ajx.actualTipBox[ajx.actualTipBoxNum].value = ajx.actualTipBoxDisplay[ajx.actualTipBoxNum].value; } if(cfg['AJAX_CONTENT']){ AJAX.Send(cfg['AJAX_CONTENT']+this.value, 'ajx.tipBoxAjaxResponse'); } }else if(this.value.length == 0){ ajx.actualTipBox[ajx.actualTipBoxNum].value = ''; } } document.onclick = function(){ if(ajx.actualTipBoxLock != 1){ window.setTimeout('ajx.tipBoxAjaxRemove();"', 100); } } } } ajx.tipBoxAjaxResponse = function(txt){ txt = unescape(txt); if(txt){ txt = String(txt); txt = txt.split(';'); if(!document.getElementById('grshw4rqwy4wrsjhe5y7w4utdjiet')){ div = document.createElement("div"); div.style['position'] = 'relative'; div2 = document.createElement("div"); div2.className = 'ajxTipBoxDiv2'; div2.id = 'grshw4rqwy4wrsjhe5y7w4utdjiet'; div2.style['width'] = ajx.actualTipBoxDisplay[ajx.actualTipBoxNum].offsetWidth - 2; div2.style['overflowY'] = 'auto'; div2.style['height'] = '150px'; div.appendChild(div2); ajx.actualTipBoxDisplay[ajx.actualTipBoxNum].parentNode.insertBefore(div, ajx.actualTipBoxDisplay[ajx.actualTipBoxNum]); }else{ div2 = document.getElementById('grshw4rqwy4wrsjhe5y7w4utdjiet'); div2.innerHTML = ''; div2.style['display'] = 'block'; ajx.actualTipBoxDisplay[ajx.actualTipBoxNum].parentNode.insertBefore(div, ajx.actualTipBoxDisplay[ajx.actualTipBoxNum]); } for(i=0; i maxHei){ ajx.dropdownContainerDiv.style['top'] = 0 - (ajx.dropdownContainerDiv.offsetHeight) + 'px'; } offX = (ajx.dropdownEventMousePositionX) ? ajx.dropdownEventMousePositionX : event.clientX; if(ajx.dropdownCfg['width']){ maxWid = (document.body.clientWidth) ? document.body.clientWidth : window.innerWidth; if((offX + ajx.dropdownContainerDivFinalChild.offsetWidth) > maxWid){ ajx.dropdownContainerDiv.style['left'] = 4 - (ajx.dropdownContainerDiv.offsetWidth) + 'px'; } } ajx.dropdownMoved = 1; } } ajx.dropdownClose = function(){ ajx.dropdownContainerDiv.onclick(1); } ajx.tableExpandedcount = 0; ajx.actualSelectedTableExpandedTr = ''; ajx.tableExpanded = function(tableNative, cfg){ if(!cfg){ cfg = ajx.getcfg(tableNative.getAttribute("AJX:cfg")); } ajx.tableExpandedcount++; tableContainer = document.createElement('div'); tableContainer.id = 'AJXtableContainer'+ajx.tableExpandedcount; tableContainer.style['height'] = '300px'; tableContainer.style['width'] = tableNative.offsetWidth; tableContainer.style['overflowY'] = 'scroll'; tableContainer.style['overflowX'] = 'hidden'; tableNative.parentNode.insertBefore(tableContainer, tableNative); tableNative.style['visibility'] = 'hidden'; trContainer = (mozilla_ff) ? tableNative.childNodes[1] : tableNative.childNodes[0]; //push all childs to var trCount = 0 //show which TR is header if(trContainer){ for(c=0; c 0){ for(var i in ajx.smartResizeArray){ if(ajx.smartResizeArray[i] == fieldToResize){ ok = 0; break; } } } if(ok == 1){ ajx.smartResizeArray[ajx.smartResizeArray.length] = fieldToResize; ajx.smartResizeArray2[ajx.smartResizeArray2.length] = modHeight; ajx.smartResizeArray3[ajx.smartResizeArray3.length] = howDeep; ajx.smartResizeArray4[ajx.smartResizeArray4.length] = howDeep2; } stopChilds = 0; try{modHeight = (!modHeight) ? 0 : modHeight;}catch(e){} switch(howDeep){ default: if(fieldToResize.parentNode.tagName == "table"){ parentEl = fieldToResize.parentNode.parentNode; }else{ parentEl = fieldToResize.parentNode.parentNode; } heightLimit = fieldToResize.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.offsetHeight; break; case '1': parentEl = fieldToResize.parentNode; heightLimit = fieldToResize.parentNode.parentNode.parentNode.parentNode.parentNode.offsetHeight; break; case 'sameAsParentEl': parentEl = fieldToResize.parentNode.parentNode; heightLimit = parentEl.offsetHeight; break; case "crm-div": parentEl = fieldToResize.parentNode; heightLimit = parentEl.offsetHeight; break; case "crm-left": parentEl = fieldToResize.parentNode; stopChilds = 1; heightLimit = parentEl.offsetHeight; break; } switch(howDeep2){ case "crm-left": parentEl2 = fieldToResize.parentNode; widthLimit = parentEl2.parentNode.offsetWidth; break; } fieldToResize.style['display'] = 'block'; offsetHeightOfChilds = 0; offsetWidthOfChilds = 0; if(stopChilds == 0){ for(c=0; c 0){ if(!parentEl.childNodes[c].tagName.match(/SCRIPT|!/)){ offsetHeightOfChilds += parentEl.childNodes[c].offsetHeight; } } } } } if(howDeep2){ for(c=0; c 0){ if(!parentEl2.childNodes[c].tagName.match(/SCRIPT|!/)){ offsetWidthOfChilds += parentEl2.childNodes[c].offsetWidth; } } } } } if(heightLimit){ modHeight = parseInt(modHeight); fieldToResize.style['height'] = heightLimit - offsetHeightOfChilds + modHeight + 'px'; } if(howDeep2 && widthLimit){ modWidth = 0; modWidth = parseInt(modWidth); fieldToResize.style['width'] = widthLimit - offsetWidthOfChilds + modWidth + 'px'; } } } ajx.smartResizeRe = function(){ if(ajx.smartResizeArray.length > 0){ for(c=0; c 0){ arr_widths[z] = td.width; } if(td.tagName == "TD"){ if(cfg['header_mouseover_bg']){ td.setAttribute('header_mouseover_bg', td.style['background']); td.onmouseover = function(){ this.style['background'] = cfg['header_mouseover_bg']; } td.onmouseout = function(){ this.style['background'] = this.getAttribute('header_mouseover_bg'); } } if(cfg['header_clickable_mouseover_bg']){ if(td.getAttribute("AJX:sortby")){ td.setAttribute('header_clickable_mouseover_bg', td.style['background']); td.onmouseover = function(){ this.style['background'] = cfg['header_clickable_mouseover_bg']; } td.onmouseout = function(){ if(mozilla_ff){ this.style['background'] = this.parentNode.style['background']; }else{ this.style['background'] = this.parentNode.currentStyle.backgroundImage; } } } } if(cfg['header_js_onclick']){ if(td.getAttribute("AJX:sortby")){ td.style['cursor'] = 'pointer'; td.onclick = function(){ try{eval(cfg['header_js_onclick']+'("'+this.getAttribute("AJX:sortby")+'")');}catch(e){} } } } } } } } ob = (mozilla_ff) ? fld2.childNodes[1] : fld2.childNodes[0]; for(c=0; c
'+txt+'
'; document.body.appendChild(div); div = document.createElement("div"); div.id = 'dsklajdkieahigjaeijfiaehgea'; div.style['position'] = 'absolute'; div.style['left'] = left + 'px'; div.style['top'] = top + 'px'; div.style['width'] = wid + 'px'; div.style['height'] = hei + 'px'; div.style['background'] = '#ffffff'; div.style['opacity'] = '0.7'; div.style['filter'] = 'alpha(opacity:70)'; div.style['color'] = '#4b70ae'; div.style['textAlign'] = 'center'; div.style['fontWeight'] = 'bold'; div.style['fontSize'] = '13px'; div.style['fontFamily'] = 'Tahoma'; div.style['zIndex'] = 10; div2 = document.createElement("iframe"); div2.setAttribute("frameBorder", "0"); div2.setAttribute("frameSpacing", "0"); div2.setAttribute("marginHeight", "0"); div2.setAttribute("marginWidth", "0"); div2.setAttribute("scrolling", "auto"); div2.style['border'] = '0px'; div2.style['width'] = wid + 'px'; div2.style['height'] = hei + 'px'; div2.style['position'] = 'absolute'; div2.style['left'] = 0; div2.style['top'] = 0; div2.style['zIndex'] = 1; div.appendChild(div2); document.body.appendChild(div); } ajx.preloaderHide = function(){ try{document.body.removeChild(document.getElementById('dsklajdkieahigjaeijfiaehgea'));}catch(e){} try{document.body.removeChild(document.getElementById('dsklajdkieahigjaeijfiaehgeadakaejgea'));}catch(e){} } ajx.getcfg = function(dat, fldSet){ dat = dat.split(";"); cg = new Array(); for(var line in dat){ line = dat[line].split("=", 2); line[0] = line[0].replace(/^\s+|\s+$/g,""); if(line[0].length >= 1){ line[1] = String(line[1]); line[1] = line[1].replace("3542kh432jhnds", "="); line[1] = line[1].replace("3542kh432jhnds", "="); line[1] = line[1].replace("3542kh432jhnds", "="); line[1] = line[1].replace("3542kh432jhnds", "="); line[1] = line[1].replace("3542kh432jhnds", "="); line[1] = line[1].replace("3542kh432jhnds", "="); line[1] = line[1].replace("3542kh432jhnds", "="); cg[line[0]] = line[1]; try{if(fldSet){fldSet.setAttribute(line[0], line[1]);}}catch(e){} } } return cg; }