if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.common ) com.chilibytes.ccl.common = {}; var CB_BASE64_CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; com.chilibytes.ccl.common.CB_Base64 = { _initiated: false, _charsetA: new Array(), _charcodeA: new Array(), _Init: function() { var i = 0; this._charsetA = new Array(); this._charcodeA = new Array(); for ( i = 0; i < CB_BASE64_CHARSET.length; i++ ) { this._charsetA[i] = CB_BASE64_CHARSET.charAt( i ); this._charcodeA[CB_BASE64_CHARSET.charAt( i )] = i; } this._initiated = true; }, _CharcodeArray2String: function( charArray ) { var strValue = ""; var i = 0; for ( i = 0; i < charArray.length; i++ ) { strValue += String.fromCharCode( charArray[i] ); } return strValue; }, Encode: function( strValue ) { var tmpA = new Array(); var tmpIx = ""; var strLen = strValue.length; var i = 0; if ( !this._initiated ) this._Init(); if ( strLen % 3 == 1 ) { strValue[strLen] = 0; strValue[strLen+1] = 0; } if ( strLen % 3 == 2 ) { strValue[strLen] = 0; } while ( i < strLen ) { tmpIx = strValue.charCodeAt( i ) >> 2; tmpA.push( this._charsetA[tmpIx] ); tmpIx = ( ( strValue.charCodeAt( i ) & 3 ) << 4 ) | ( strValue.charCodeAt( i + 1 ) >> 4 ); tmpA.push( this._charsetA[tmpIx] ); tmpIx = ( ( strValue.charCodeAt( i + 1 ) & 15 ) << 2 ) | ( strValue.charCodeAt( i + 2 ) >> 6 ); tmpA.push( this._charsetA[tmpIx] ); tmpIx = ( strValue.charCodeAt( i + 2 ) & 63 ); tmpA.push( this._charsetA[tmpIx] ); if ( i % 57 == 54 ) { tmpA.push( "\n" ); } i += 3; } if ( strLen % 3 == 1 ) { tmpA[tmpA.length - 1] = "="; tmpA[tmpA.length - 2] = "="; } if ( strLen % 3 == 2 ) { tmpA[tmpA.length - 1] = "="; } return tmpA.join( "" ); }, Decode: function( strValue ) { var tmpA = new Array(); var i = 0; if ( !this._initiated ) this._Init(); strValue = strValue.replace( /\n|\r/g, "" ); strValue = strValue.replace( /=/g, "" ); while ( i < strValue.length ) { tmpA.push( ( this._charcodeA[strValue.charAt( i )] << 2 ) | ( this._charcodeA[strValue.charAt( i + 1 )] >> 4 ) ); tmpA.push( ( ( this._charcodeA[strValue.charAt( i+ 1 )] & 15 ) << 4 ) | ( this._charcodeA[strValue.charAt( i + 2 )] >> 2 ) ); tmpA.push( ( ( this._charcodeA[strValue.charAt( i+ 2 )] & 3 ) << 6 ) | ( this._charcodeA[strValue.charAt( i + 3 )] ) ); i += 4; } if ( strValue.length % 4 == 2 ) { tmpA = tmpA.slice( 0, tmpA.length - 2 ); } else if ( strValue.length % 4 == 3 ) { tmpA = tmpA.slice( 0, tmpA.length - 1 ); } return this._CharcodeArray2String( tmpA ); } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.common ) com.chilibytes.ccl.common = {}; com.chilibytes.ccl.common.CB_Keys = { _crc32Table: "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E" + " 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB" + " F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8" + " 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940" + " 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599" + " B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106" + " 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB" + " 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457" + " 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074" + " D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5" + " AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E" + " 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A" + " EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27" + " 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0" + " 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1" + " A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79" + " CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92" + " 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F" + " 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4" + " F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C" + " 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D" + " 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A" + " 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37" + " C30C8EA1 5A05DF1B 2D02EF8D", CRC32: function( sourceS, crcN ) { if ( crcN == window.undefined ) crcN = 0; var n = 0; var x = 0; crcN = crcN ^ (-1); for ( var i = 0, iTop = sourceS.length; i < iTop; i++ ) { n = ( crcN ^ sourceS.charCodeAt( i ) ) & 0xFF; x = "0x" + CB_Keys._crc32Table.substr( n * 9, 8 ); crcN = ( crcN >>> 8 ) ^ x; } return crcN ^ (-1); }, IntKeyGenerate: function() { var key = 0xFFFFFFFF * Math.random(); if ( key < 0 ) key *= -1; return parseInt( key ); } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.html ) com.chilibytes.ccl.html = {}; var CB_ENVIRONMENT_BROWSER_IDENT_MISC = 0x00000000; var CB_ENVIRONMENT_BROWSER_IDENT_IE = 0x000000FF; var CB_ENVIRONMENT_BROWSER_IDENT_IE_OLD = 0x00000001; var CB_ENVIRONMENT_BROWSER_IDENT_IE4x = 0x00000002; var CB_ENVIRONMENT_BROWSER_IDENT_IE5x = 0x00000004; var CB_ENVIRONMENT_BROWSER_IDENT_IE55 = 0x00000008; var CB_ENVIRONMENT_BROWSER_IDENT_IE6x = 0x00000010; var CB_ENVIRONMENT_BROWSER_IDENT_IE7x = 0x00000020; var CB_ENVIRONMENT_BROWSER_IDENT_IE8x = 0x00000040; var CB_ENVIRONMENT_BROWSER_IDENT_GECKO = 0x0000FF00; var CB_ENVIRONMENT_BROWSER_IDENT_MOZILLA = 0x00000100; var CB_ENVIRONMENT_BROWSER_IDENT_NS_OLD = 0x00000200; var CB_ENVIRONMENT_BROWSER_IDENT_NS6 = 0x00000400; var CB_ENVIRONMENT_BROWSER_IDENT_NS7 = 0x00000800; var CB_ENVIRONMENT_BROWSER_IDENT_FF0x = 0x00001000; var CB_ENVIRONMENT_BROWSER_IDENT_FF1x = 0x00002000; var CB_ENVIRONMENT_BROWSER_IDENT_FF2x = 0x00004000; var CB_ENVIRONMENT_BROWSER_IDENT_OPERA = 0x00FF0000; var CB_ENVIRONMENT_BROWSER_IDENT_OPERA5 = 0x00010000; var CB_ENVIRONMENT_BROWSER_IDENT_OPERA6 = 0x00020000; var CB_ENVIRONMENT_BROWSER_IDENT_OPERA7 = 0x00040000; var CB_ENVIRONMENT_BROWSER_IDENT_OPERA8 = 0x00080000; var CB_ENVIRONMENT_BROWSER_IDENT_OPERA9 = 0x00100000; var CB_ENVIRONMENT_BROWSER_IDENT_KHTML = 0xFF000000; var CB_ENVIRONMENT_BROWSER_IDENT_K2 = 0x01000000; var CB_ENVIRONMENT_BROWSER_IDENT_K3 = 0x02000000; var CB_ENVIRONMENT_BROWSER_IDENT_SAFARI = 0x04000000; com.chilibytes.ccl.html.CB_Environment = { CurrentClientBrowser: function() { var famVersion = null; var tmpA = null; var agentVersion = null; var agent = navigator.userAgent; var regExp = /(\S+)\/(\d\.\d+)\s\((.+)\)\s?(.*)/; var tmpInfoA = agent.match( regExp ); if ( !tmpInfoA ) { alert( "Regular expressions parse error -> " + regExp ); return null; } else if ( tmpInfoA[1] == "Mozilla" ) { famVersion = parseFloat( tmpInfoA[2] ); if ( famVersion == 2.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE_OLD; } if ( famVersion == 4.0 || famVersion == 5.0 ) { if ( tmpInfoA[4].indexOf( "Opera" ) != -1 ) { regExp = /Opera\s(\d\.\d+)/; tmpA = tmpInfoA[4].match( regExp ); if ( tmpA ) { switch ( parseInt( tmpA[1] ) ) { case 5: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA5; case 6: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA6; case 7: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA7; case 8: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA8; case 9: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA9; } } else { alert( "Regular expressions parse error ->" + regExp ); } } else if ( tmpInfoA[3].indexOf ( "MSIE" ) != -1 ) { regExp = /MSIE\s(\d\.\d+)/; tmpA = tmpInfoA[3].match( regExp ); if ( tmpA ) { ieVersion = parseFloat( tmpA[1] ); if ( ieVersion == 8.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE8x; } else if ( ieVersion == 7.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE7x; } else if ( ieVersion == 6.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE6x; } else if ( ieVersion == 5.5 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE55; } else if ( ieVersion >= 5.0 && ieVersion < 5.5 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE5x; } else if ( ieVersion >= 4.0 && ieVersion < 5.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE4x; } else { return CB_ENVIRONMENT_BROWSER_IDENT_IE_OLD; } } else { alert( "Regular expressions parse error ->" + regExp ); } } else if ( tmpInfoA[3].indexOf( "Konqueror" ) != -1 ) { regExp = /Konqueror\/(\d\.\d+\.?\d?)/; tmpA = tmpInfoA[3].match( regExp ); if ( tmpA ) { switch ( parseInt( tmpA[1] ) ) { case 2: return CB_ENVIRONMENT_BROWSER_IDENT_K2; case 3: return CB_ENVIRONMENT_BROWSER_IDENT_K3; } } else { alert( "Regular expressions parse error ->" + regExp ); } } else if ( tmpInfoA[4].indexOf( "Safari" ) != -1 ) { return CB_ENVIRONMENT_BROWSER_IDENT_SAFARI; } else if ( tmpInfoA[4].indexOf( "Gecko" ) != -1 ) { regExp = /Gecko\/\d+\s(\S+)\/(\d\.\d+\.?\d*)/; tmpA = tmpInfoA[4].match( regExp ); if ( !tmpA ) { return CB_ENVIRONMENT_BROWSER_IDENT_MOZILLA; } agentVersion = parseFloat( tmpA[2] ); if ( tmpA[1].indexOf( "Firefox" ) != -1 ) { if ( agentVersion < 1.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_FF0x; } else if ( agentVersion < 2.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_FF1x; } else { return CB_ENVIRONMENT_BROWSER_IDENT_FF2x; } } else if ( tmpA[1].indexOf( "Netscape" ) != -1 ) { switch ( parseInt( agentVersion ) ) { case 6: return CB_ENVIRONMENT_BROWSER_IDENT_NS6; case 7: return CB_ENVIRONMENT_BROWSER_IDENT_NS7; } } else { return CB_ENVIRONMENT_BROWSER_IDENT_GECKO; } } } else if ( ( famVersion > 4.0 && famVersion < 5.0 ) || ( famVersion < 4.0 && famVersion > 3.0 ) ) { return CB_ENVIRONMENT_BROWSER_IDENT_NS_OLD; } else { return CB_ENVIRONMENT_BROWSER_IDENT_MISC; } } else if ( tmpInfoA[1] == "Opera" ) { famVersion = parseInt( tmpInfoA[2] ); switch ( famVersion ) { case 5: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA5; case 6: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA6; case 7: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA7; case 8: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA8; case 9: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA9; } } else { return CB_ENVIRONMENT_BROWSER_IDENT_MISC; } }, DocumentDimensionGet: function() { var dimA = new Array(); if (self.innerHeight) { dimA["W"] = self.innerWidth; dimA["H"] = self.innerHeight; } else if ( document.documentElement && document.documentElement.clientHeight ) { dimA["W"] = document.documentElement.clientWidth; dimA["H"] = document.documentElement.clientHeight; } else if ( document.body ) { dimA["W"] = document.body.clientWidth; dimA["H"] = document.body.clientHeight; } return dimA; } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.html ) com.chilibytes.ccl.html = {}; com.chilibytes.ccl.html.CB_CSS = { CSSAttributeGet: function( obj, attr, scaleUnit ) { var obj; var attr; var scaleUnit; var retVal = null; if ( obj ) { if ( obj.ownerDocument.defaultView ) { retVal = obj.ownerDocument.defaultView.getComputedStyle( obj, "" ).getPropertyValue( attr ); } else if( obj.currentStyle ) { attr = CB_CSS._CSSAttributeIEFormat( attr ); retVal = obj.currentStyle[attr]; } if ( scaleUnit && retVal.indexOf( scaleUnit ) != -1 ) { retVal = retVal.replace( scaleUnit, "" ); } } return retVal; }, ClassNameSwitch: function( objP, prefix ) { if ( objP ) { var hoverIX = objP.className.indexOf( prefix ); if ( hoverIX < 0 ) { objP.className = objP.className + prefix; } else { objP.className = objP.className.substring( 0, hoverIX ); } } }, ClassNameSuffixAdd: function( objP, suffix ) { if ( objP ) { var suffixIx = objP.className.indexOf( suffix ); if ( suffixIx < 0 ) { objP.className = objP.className + suffix; } } }, ClassNameSuffixRemove: function( objP, suffix ) { if ( objP ) { var suffixIx = objP.className.indexOf( suffix ); if ( suffixIx >= 0 ) { objP.className = objP.className.substring( 0, suffixIx ); } } }, _CSSAttributeIEFormat: function( attr ) { var elemA = attr.split( "-" ); var retVal = ""; if ( elemA.length > 0 ) { for ( var i = 0; i < elemA.length; i++ ) { if ( i > 0 ) { elemA[i] = elemA[i].substring( 0, 1 ).toUpperCase() + elemA[i].substring( 1 ); } retVal += elemA[i]; } } else retVal = attr; return retVal; } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.controls ) com.chilibytes.ccl.controls = {}; var CB_Environment = com.chilibytes.ccl.html.CB_Environment; com.chilibytes.ccl.controls.CB_WindowEvents = function() { this.constructor = com.chilibytes.ccl.controls.CB_WindowEvents; this._currWindowP = ( CB_Environment.CurrentClientBrowser() & CB_ENVIRONMENT_BROWSER_IDENT_IE ? document : window ); this._InitWindowEvents(); this._InitMouseEvents(); } com.chilibytes.ccl.controls.CB_WindowEvents.prototype._InitWindowEvents = function() { var self = this; var windowOnLoadEventListP = window.onload; window.onload = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); if ( windowOnLoadEventListP ) windowOnLoadEventListP.call( self, eventP ); self.WindowOnLoad( eventP ); }; var windowOnUnloadEventListP = window.onunload; window.onunload = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); if ( windowOnUnloadEventListP ) windowOnUnloadEventListP.call( self, eventP ); self.WindowOnUnload( eventP ); }; var windowOnResizeEventListP = window.onresize; window.onresize = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); if ( windowOnResizeEventListP ) windowOnResizeEventListP.call( self, eventP ); self.WindowOnResize( eventP ); }; } com.chilibytes.ccl.controls.CB_WindowEvents.prototype._InitMouseEvents = function() { var self = this; var windowOnMouseMoveEventListP = this._currWindowP.onmousemove; this._currWindowP.onmousemove = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); if ( windowOnMouseMoveEventListP ) windowOnMouseMoveEventListP.call( self, eventP ); self.WindowOnMouseMove( eventP ); } var windowOnMouseUpEventListP = this._currWindowP.onmouseup; this._currWindowP.onmouseup = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); if ( windowOnMouseUpEventListP ) windowOnMouseUpEventListP.call( self, eventP ); self.WindowOnMouseUp( eventP ); } } com.chilibytes.ccl.controls.CB_WindowEvents.prototype.WindowOnLoad = function( eventP ) {} com.chilibytes.ccl.controls.CB_WindowEvents.prototype.WindowOnResize = function( eventP ) {} com.chilibytes.ccl.controls.CB_WindowEvents.prototype.WindowOnUnload = function( eventP ) {} com.chilibytes.ccl.controls.CB_WindowEvents.prototype.WindowOnMouseMove = function( eventP ) {} com.chilibytes.ccl.controls.CB_WindowEvents.prototype.WindowOnMouseUp = function( eventP ) {} if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.controls ) com.chilibytes.ccl.controls = {}; var CB_Environment = com.chilibytes.ccl.html.CB_Environment; com.chilibytes.ccl.controls.CB_ControlEvents = function( controlP ) { this.constructor = com.chilibytes.ccl.controls.CB_ControlEvents; this._InitControlEvents( controlP ); } com.chilibytes.ccl.controls.CB_ControlEvents.prototype._InitControlEvents = function( controlP ) { var self = this; var onMouseOverEventListP = controlP.onmouseover; controlP.onmouseover = function( eventP ) { var retVal = true; eventP = ( !eventP ? window.event : eventP ); if ( onMouseOverEventListP ) retVal = retVal && onMouseOverEventListP.call( self, eventP ); retVal = retVal && self.OnMouseOver( eventP ); return retVal; } var onMouseOutEventListP = controlP.onmouseout; controlP.onmouseout = function( eventP ) { var retVal = true; eventP = ( !eventP ? window.event : eventP ); if ( onMouseOutEventListP ) retVal = retVal && onMouseOutEventListP.call( self, eventP ); retVal = retVal && self.OnMouseOut( eventP ); return retVal; } var onClickEventListP = controlP.onclick; controlP.onclick = function( eventP ) { var retVal = true; eventP = ( !eventP ? window.event : eventP ); if ( onClickEventListP ) retVal = retVal && onClickEventListP.call( self, eventP ); retVal = retVal && self.OnClick( eventP ); return retVal; } var onKeyUpEventListP = controlP.onkeyup; controlP.onkeyup = function( eventP ) { var retVal = true; eventP = ( !eventP ? window.event : eventP ); if ( onKeyUpEventListP ) retVal = retVal && onKeyUpEventListP.call( self, eventP ); retVal = retVal && self.OnKeyUp( eventP ); return retVal; } var onKeyDownEventListP = controlP.onkeydown; controlP.onkeydown = function( eventP ) { var retVal = true; eventP = ( !eventP ? window.event : eventP ); if ( onKeyDownEventListP ) retVal = retVal && onKeyDownEventListP.call( self, eventP ); retVal = retVal && self.OnKeyDown( eventP ); return retVal; } var onFocusLostEventListP = controlP.onblur; controlP.onblur = function( eventP ) { var retVal = true; eventP = ( !eventP ? window.event : eventP ); if ( onFocusLostEventListP ) retVal = retVal && onFocusLostEventListP.call( self, eventP ); retVal = retVal && self.OnLostFocus( eventP ); return retVal; } } com.chilibytes.ccl.controls.CB_ControlEvents.prototype.OnMouseOver = function( eventP ) {} com.chilibytes.ccl.controls.CB_ControlEvents.prototype.OnMouseOut = function( eventP ) {} com.chilibytes.ccl.controls.CB_ControlEvents.prototype.OnClick = function( eventP ) {} com.chilibytes.ccl.controls.CB_ControlEvents.prototype.OnKeyUp = function( eventP ) {} com.chilibytes.ccl.controls.CB_ControlEvents.prototype.OnKeyDown = function( eventP ) {} com.chilibytes.ccl.controls.CB_ControlEvents.prototype.OnLostFocus = function( eventP ) {} var CB_XMLHTTPREQUESTFACTORY_CACHE_SIZE = 10; if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.ajax ) com.chilibytes.ccl.ajax = {}; com.chilibytes.ccl.ajax.CB_XMLHttpRequestFactory = { fObjectPoolA: new Array(), fPrecached: false, PrecacheObjects: function() { if ( !this.fPrecached ) { for ( var i=0; i < CB_XMLHTTPREQUESTFACTORY_CACHE_SIZE; i++ ) { var xmlHttpRequestObj = this._CreateXMLRequestObject(); this.fObjectPoolA.push( xmlHttpRequestObj ); } this.fPrecached = true; } }, GetInstance: function() { var instance = null; if ( this.fObjectPoolA.length > 0 ) { instance = this.fObjectPoolA.shift(); } else { instance = this._CreateXMLRequestObject(); } return instance; }, ReleaseInstance: function( xmlHttpRequestInstance ) { if ( xmlHttpRequestInstance ) { xmlHttpRequestInstance.onreadystatechange = function() {}; this.fObjectPoolA.push( xmlHttpRequestInstance ); } }, _CreateXMLRequestObject: function() { var xmlRequestObject = null; if ( window.XMLHttpRequest ) { xmlRequestObject = new XMLHttpRequest(); if ( xmlRequestObject.overrideMimeType ) { xmlRequestObject.overrideMimeType('text/xml'); } } else if ( window.ActiveXObject ) { try { xmlRequestObject = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { xmlRequestObject = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) { xmlRequestObject = null; } } } return xmlRequestObject; } } com.chilibytes.ccl.ajax.CB_XMLHttpRequestFactory.PrecacheObjects(); if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.ajax ) com.chilibytes.ccl.ajax = {}; var CB_Keys = com.chilibytes.ccl.common.CB_Keys; var CB_Environment = com.chilibytes.ccl.html.CB_Environment; var CB_XMLHttpRequestFactory = com.chilibytes.ccl.ajax.CB_XMLHttpRequestFactory; var CB_AJAX_CONNECTION_READYSTATE_UNINITIALIZED = 0; var CB_AJAX_CONNECTION_READYSTATE_OPEN = 1; var CB_AJAX_CONNECTION_READYSTATE_SENT = 2; var CB_AJAX_CONNECTION_READYSTATE_RECEIVING = 3; var CB_AJAX_CONNECTION_READYSTATE_LOADED = 4; var CB_AJAX_CONNECTION_HTTPSTATUS_CONNECTION_SUCCESSFULLY = 200; var CB_AJAX_CONNECTION_REQUEST_METHOD_GET = "GET"; var CB_AJAX_CONNECTION_REQUEST_METHOD_POST = "POST"; var CB_AJAX_CONNECTION_EVENTID_CONNECTION_TIMEOUT = "eventConnTimeout"; var CB_AJAX_CONNECTION_CONNECTION_TIMEOUT = 15000; com.chilibytes.ccl.ajax.CB_AjaxConnection = function( parentP ) { this.constructor = com.chilibytes.ccl.ajax.CB_AjaxConnection; this.fXMLRequestA = new Array(); this._parentP = parentP; this._userAgent = CB_Environment.CurrentClientBrowser(); this.fConnectionTimeout = null; this.fEventHandlerA = new Array(); } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype.XMLRequest = function( xmlURL, eventFunctionP ) { this._XMLRequest( xmlURL, CB_AJAX_CONNECTION_REQUEST_METHOD_GET, null, eventFunctionP, null ); } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype.XMLQueryRequest = function( xmlURL, eventFunctionP, queryString ) { this._XMLRequest( xmlURL, CB_AJAX_CONNECTION_REQUEST_METHOD_POST, queryString, eventFunctionP, "application/x-www-form-urlencoded" ); } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype.XMLFormRequest = function( url, eventFunctionP, queryString, formFieldA ) { if ( !formFieldA ) formFieldA = new Array(); for ( var fieldName in formFieldA ) { if ( queryString != "" ) queryString += "&"; queryString += fieldName + "=" + formFieldA[fieldName]; } this.XMLQueryRequest( url, eventFunctionP, queryString ); } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype._XMLRequest = function( xmlURL, requestMethod, queryString, eventFunctionP, contentType ) { var self = this; var objectId = "obj-" + CB_Keys.IntKeyGenerate(); this.fXMLRequestA[objectId] = CB_XMLHttpRequestFactory.GetInstance(); if ( !this.fXMLRequestA[objectId] ) { alert('Error:\nNo valid XML HTTP request object.\nClass initialization might be failed.'); } else { try { this.fXMLRequestA[objectId].open( requestMethod, xmlURL, true ); this.fXMLRequestA[objectId].onreadystatechange = function() { self._EventOnReadyStateChange( eventFunctionP, objectId ); }; if ( contentType ) this.fXMLRequestA[objectId].setRequestHeader( "Content-Type", contentType ); this._ConnectionTimeoutControl( true ); return this.fXMLRequestA[objectId].send( queryString ); } catch( exceptionP ) { this.fXMLRequestA[objectId].abort(); } } } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype._EventOnReadyStateChange = function( callbackEventP, objectId ) { try { var xmlRequestObj = this.fXMLRequestA[objectId]; if ( xmlRequestObj.readyState == CB_AJAX_CONNECTION_READYSTATE_LOADED && xmlRequestObj.status == CB_AJAX_CONNECTION_HTTPSTATUS_CONNECTION_SUCCESSFULLY ) { var receivedXmlDomObj = xmlRequestObj.responseXML; var recievedXmlDomText = xmlRequestObj.responseText; if ( callbackEventP && receivedXmlDomObj ) { this._ConnectionTimeoutControl( false ); callbackEventP.call( this._parentP, receivedXmlDomObj, recievedXmlDomText ); } else { var msg = "Error:\nNo XML document response, callback function not executed."; if ( console ) { console.log( msg ); } else alert( msg ); } CB_XMLHttpRequestFactory.ReleaseInstance( xmlRequestObj ); this.fXMLRequestA[objectId] = null; } } catch ( exceptionP ) { if ( xmlRequestObj ) { xmlRequestObj.abort(); CB_XMLHttpRequestFactory.ReleaseInstance( xmlRequestObj ); } } } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype._ConnectionTimeoutControl = function( setNew ) { if ( this.fConnectionTimeout ) { window.clearTimeout( this.fConnectionTimeout ); } else if ( setNew ){ this.fConnectionTimeout = window.setTimeout( this._EventConnectionTimeout, CB_AJAX_CONNECTION_CONNECTION_TIMEOUT ); } } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype.EventConnectionTimeoutAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAX_CONNECTION_EVENTID_CONNECTION_TIMEOUT, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype._EventConnectionTimeout = function() { console.log( "get connection timout" ); this._ConnectionTimeoutControl( false ); if ( this.fEventHandlerA[CB_AJAX_CONNECTION_EVENTID_CONNECTION_TIMEOUT] ) { this.fEventHandlerA[CB_AJAX_CONNECTION_EVENTID_CONNECTION_TIMEOUT]["event"].call( this.fEventHandlerA[CB_AJAX_CONNECTION_EVENTID_CONNECTION_TIMEOUT]["parent"], xmlObject, xmlStructure ); } } com.chilibytes.ccl.ajax.CB_AjaxConnection.prototype._EventAttach = function( eventIdentifier, eventCallbackParentP, eventCallbackFunctionP ) { if ( eventCallbackFunctionP ) { this.fEventHandlerA[eventIdentifier] = new Array(); this.fEventHandlerA[eventIdentifier]["parent"] = eventCallbackParentP; this.fEventHandlerA[eventIdentifier]["event"] = eventCallbackFunctionP; } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.json ) com.chilibytes.ccl.json = {}; var CB_Environment = com.chilibytes.ccl.html.CB_Environment; var CB_JSON_CONNECTOR_REQUEST_METHOD_GET = "GET"; var CB_JSON_CONNECTOR_REQUEST_METHOD_POST = "POST"; var CB_JSON_CONNECTOR_READYSTATE_UNINITIALIZED = 0; var CB_JSON_CONNECTOR_READYSTATE_OPEN = 1; var CB_JSON_CONNECTOR_READYSTATE_SENT = 2; var CB_JSON_CONNECTOR_READYSTATE_RECEIVING = 3; var CB_JSON_CONNECTOR_READYSTATE_LOADED = 4; var CB_JSON_CONNECTOR_HTTPSTATUS_CONNECTION_SUCCESSFULLY = 200; com.chilibytes.ccl.json.CB_JSONConnector = function( parentP, responseEventHandler ) { this.constructor = com.chilibytes.ccl.json.CB_JSONConnector; this._connectionObjectP = null; this._parentP = parentP; this._responsenEventHandler = responseEventHandler; this._userAgent = CB_Environment.CurrentClientBrowser(); this._Initialize(); } com.chilibytes.ccl.json.CB_JSONConnector.prototype._Initialize = function() { if ( window.XMLHttpRequest ) { this._connectionObjectP = new XMLHttpRequest(); } else if ( window.ActiveXObject ) { try { this._connectionObjectP = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { this._connectionObjectP = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) { this._connectionObjectP = false; } } } } com.chilibytes.ccl.json.CB_JSONConnector.prototype.RequestObject = function( requestTargetURL, queryString ) { this._RequestObject( requestTargetURL, CB_JSON_CONNECTOR_REQUEST_METHOD_POST, queryString ); } com.chilibytes.ccl.json.CB_JSONConnector.prototype._RequestObject = function( requestTargetURL, requestMethod, queryString ) { var self = this; if ( !this._connectionObjectP ) { alert('Error:\nNo valid XML HTTP request object.\nClass initialisation might be failed.'); } else { try { if ( this._userAgent & CB_ENVIRONMENT_BROWSER_IDENT_IE ) this._connectionObjectP.abort(); if ( this._userAgent & CB_ENVIRONMENT_BROWSER_IDENT_OPERA ) this._Initialize(); this._connectionObjectP.onreadystatechange = function() { self._EventOnReadyStateChange(); }; this._connectionObjectP.open( requestMethod, requestTargetURL, true ); this._connectionObjectP.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" ); this._connectionObjectP.send( queryString ); } catch( exceptionP ) { this._connectionObjectP.abort(); } } } com.chilibytes.ccl.json.CB_JSONConnector.prototype._EventOnReadyStateChange = function() { try { if ( this._connectionObjectP.readyState == CB_JSON_CONNECTOR_READYSTATE_LOADED && this._connectionObjectP.status == CB_JSON_CONNECTOR_HTTPSTATUS_CONNECTION_SUCCESSFULLY ) { var jsonObject = eval( '(' + this._connectionObjectP.responseText + ')' ); if ( this._responsenEventHandler ) { this._responsenEventHandler.call( this._parentP, jsonObject ); } else { var msg = "Error:\nNo document response, callback function not executed."; if ( console ) { console.log( msg ); } else alert( msg ); } } } catch ( exceptionP ) { this._connectionObjectP.abort(); } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.ajax ) com.chilibytes.ccl.ajax = {}; var CB_AjaxConnection = com.chilibytes.ccl.ajax.CB_AjaxConnection; var CB_JSONConnector = com.chilibytes.ccl.json.CB_JSONConnector; var CB_Base64 = com.chilibytes.ccl.common.CB_Base64; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO = 0x001; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_LOGOUT = 0x002; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_DATA_WRITE = 0x003; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_ISAUTHORIZED = 0x004; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_NAVIGATION_ITEMS = 0x010; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_CONTENT_ITEMS = 0x020; var CB_AJAXCOMMONINTERFACE_IDENTIFIER_CONTENT = "contentid"; var CB_AJAXCOMMONINTERFACE_EVENTID_NAVIGATIONMENUREQUEST = "eventMenu"; var CB_AJAXCOMMONINTERFACE_EVENTID_CONTENTREQUEST = "eventContent"; var CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGINREQUEST = "eventSSOLogin"; var CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST = "eventSSOLogout"; var CB_AJAXCOMMONINTERFACE_EVENTID_SSOWRITEREQUEST = "eventSSOWrite"; var CB_AJAXCOMMONINTERFACE_EVENTID_SSOISAUTHORIZED = "eventSSOIsAuthorized"; var CB_AJAXCOMMONINTERFACE_EVENTID_CONNECTION_TIMEOUT = "eventConnTimeout"; com.chilibytes.ccl.ajax.CB_AjaxCommonInterface = function( ajaxInterfaceURL ) { this.constructor = com.chilibytes.ccl.ajax.CB_AjaxCommonInterface; this.fAjaxConnection = new CB_AjaxConnection( this ); this.fJSONConnector = new CB_JSONConnector( this, this._EventNavigationMenuRequest ); this.fAjaxInterfaceURL = ajaxInterfaceURL; this.fEventHandlerA = new Array(); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype._EventAttach = function( eventIdentifier, eventCallbackParentP, eventCallbackFunctionP ) { if ( eventCallbackFunctionP ) { this.fEventHandlerA[eventIdentifier] = new Array(); this.fEventHandlerA[eventIdentifier]["parent"] = eventCallbackParentP; this.fEventHandlerA[eventIdentifier]["event"] = eventCallbackFunctionP; } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.EventNavigationMenuRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_NAVIGATIONMENUREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.EventConnectionTimeoutAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_CONNECTION_TIMEOUT, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.EventContentRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_CONTENTREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.EventSSOLoginRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGINREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.EventSSOLogoutRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.EventSSODataWriteResultAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOWRITEREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.EventSSOIsAuthorizedResultAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOISAUTHORIZED, parentP, eventFuncP ); } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.NavigationMenuRequest = function( menuID ) { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_NAVIGATION_ITEMS + "&mid=" + menuID; if ( this.fJSONConnector != null ) { this.fJSONConnector.RequestObject( this.fAjaxInterfaceURL, query ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.ContentItemsRequest = function( contentID ) { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_CONTENT_ITEMS + "&" + CB_AJAXCOMMONINTERFACE_IDENTIFIER_CONTENT + "=" + contentID; if ( this.fAjaxConnection != null ) { this.fAjaxConnection.XMLQueryRequest( this.fAjaxInterfaceURL, this._EventContentItemRequest, query ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype._EventNavigationMenuRequest = function( jsonObject ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_NAVIGATIONMENUREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_NAVIGATIONMENUREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_NAVIGATIONMENUREQUEST]["parent"], jsonObject ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype._EventContentItemRequest = function( xmlObject, xmlStructure ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_CONTENTREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_CONTENTREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_CONTENTREQUEST]["parent"], xmlObject, xmlStructure ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.SSOLogin = function( formFieldValueArray ) { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO; if ( this.fAjaxConnection != null ) { this.fAjaxConnection.XMLFormRequest( this.fAjaxInterfaceURL, this._EventSSOLoginRequest, query, formFieldValueArray ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype._EventSSOLoginRequest = function( xmlObject, xmlStructure ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGINREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGINREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGINREQUEST]["parent"], xmlObject, xmlStructure ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.SSOIsAuthorized = function() { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_ISAUTHORIZED; if ( this.fAjaxConnection != null ) { this.fAjaxConnection.XMLQueryRequest( this.fAjaxInterfaceURL, this._EventSSOIsAuthorizedRequest, query ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype._EventSSOIsAuthorizedRequest = function( xmlObject, xmlStructure ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOISAUTHORIZED] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOISAUTHORIZED]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOISAUTHORIZED]["parent"], xmlObject, xmlStructure ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.SSOLogout = function() { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_LOGOUT; if ( this.fAjaxConnection != null ) { this.fAjaxConnection.XMLQueryRequest( this.fAjaxInterfaceURL, this._EventSSOLogoutRequest, query ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype._EventSSOLogoutRequest = function( xmlObject, xmlStructure ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST]["parent"], xmlObject, xmlStructure ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype.SSODataFieldWrite = function( fieldName, dataValue ) { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_DATA_WRITE + "&ssoDataField=" + encodeURIComponent( CB_Base64.Encode( fieldName ) ) + "&ssoDataValue=" + encodeURIComponent( CB_Base64.Encode( dataValue ) ); if ( this.fAjaxConnection != null ) { this.fAjaxConnection.XMLQueryRequest( this.fAjaxInterfaceURL, this._EventSSODataFielWriteRequest, query ); } } com.chilibytes.ccl.ajax.CB_AjaxCommonInterface.prototype._EventSSODataFielWriteRequest = function( xmlObject, xmlStructure ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOWRITEREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOWRITEREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOWRITEREQUEST]["parent"], xmlObject, xmlStructure ); } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.cms ) com.chilibytes.ccl.cms = {}; com.chilibytes.ccl.cms.CB_ObjectContainer = function( name ) { this.constructor = com.chilibytes.ccl.cms.CB_ObjectContainer; this.fItemA = new Array(); this.fItemHashA = new Array(); this.fCurrentItemIx = 0; } com.chilibytes.ccl.cms.CB_ObjectContainer.prototype.ItemCountGet = function() { return this.fItemA.length; } com.chilibytes.ccl.cms.CB_ObjectContainer.prototype.ObjectIndexGet = function( value ) { return this.fItemHashA[value]; } com.chilibytes.ccl.cms.CB_ObjectContainer.prototype.HasChildren = function() { return ( this.fItemA.length > 0 ); } com.chilibytes.ccl.cms.CB_ObjectContainer.prototype.Rewind = function() { this.fCurrentItemIx = 0; } com.chilibytes.ccl.cms.CB_ObjectContainer.prototype.Next = function() { var nextItem = null; if ( this.ItemCountGet() > this.fCurrentItemIx ) { nextItem = this.fItemA[this.fCurrentItemIx]; this.fCurrentItemIx++; } return nextItem; } com.chilibytes.ccl.cms.CB_ObjectContainer.prototype.Add = function( itemObject ) { this.fItemA.push( itemObject ); this.fItemHashA[itemObject] = this.fItemA.length-1; return this.fItemHashA[itemObject]; } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.html ) com.chilibytes.ccl.html = {}; var CB_Environment = com.chilibytes.ccl.html.CB_Environment; var CB_CSS = com.chilibytes.ccl.html.CB_CSS; var CB_ControlEvents = com.chilibytes.ccl.controls.CB_ControlEvents; com.chilibytes.ccl.html.CB_MenuItem = function( domObjID ) { this.constructor = com.chilibytes.ccl.html.CB_MenuItem; this.fObjP = document.getElementById( domObjID ); CB_ControlEvents.call( this, this.fObjP ); this.fEventHandlerA = new Array(); this.fParent = null; this.fCssClass = this.fObjP.className; this.fCssHighlighting = false; this.fLinkControl = true; this.fDisableItemRefreshing = false; this.fIsClicked = false; this.fHREFOnLoadChecked = false; this.fHREFCheckEnabled = true; this.fImageSwapOnLoad = true; this.fImagesInfoA = new Array(); this.fImageA = new Array(); this.fImageA["selected"] = new Array(); this.fImageA["selected"]["default"] = null; this.fHref = "#"; this.fTarget = ""; this.fAlternativeLabelA = new Array(); this.fAlternativeLabelA["current"] = this.fObjP.innerHTML; this.fAlternativeLabelA["alternative"] = null; this.fUserdataA = new Array(); this.fSubMenuID = null; if ( this.__wakeup ) this.__wakeup(); } var _menuItemInheritP = function() {}; _menuItemInheritP.prototype = CB_ControlEvents.prototype; com.chilibytes.ccl.html.CB_MenuItem.prototype = new _menuItemInheritP(); com.chilibytes.ccl.html.CB_MenuItem.prototype.ParentGet = function() { return this.fParent; } com.chilibytes.ccl.html.CB_MenuItem.prototype.ParentSet = function( value ) { this.fParent = value; } com.chilibytes.ccl.html.CB_MenuItem.prototype.DisableItemRefreshingGet = function() { return this.fDisableItemRefreshing; } com.chilibytes.ccl.html.CB_MenuItem.prototype.DisableItemRefreshingSet = function( value ) { this.fDisableItemRefreshing = value; } com.chilibytes.ccl.html.CB_MenuItem.prototype.AlternativeLabelSet = function( value ) { this.fAlternativeLabelA["alternative"] = value; } com.chilibytes.ccl.html.CB_MenuItem.prototype.IDGet = function() { return this.fObjP.id; } com.chilibytes.ccl.html.CB_MenuItem.prototype.HREFSet = function( targetHref ) { this.fHref = targetHref; } com.chilibytes.ccl.html.CB_MenuItem.prototype.HREFGet = function() { return this.fHref; } com.chilibytes.ccl.html.CB_MenuItem.prototype.HREFCheckEnabled = function( value ) { this.fHREFCheckEnabled = value; } com.chilibytes.ccl.html.CB_MenuItem.prototype.TargetSet = function( target ) { this.fTarget = target; this.fHREFOnLoadChecked = false; } com.chilibytes.ccl.html.CB_MenuItem.prototype.TargetGet = function() { return this.fTarget; } com.chilibytes.ccl.html.CB_MenuItem.prototype.IDGet = function() { return this.fObjP.id; } com.chilibytes.ccl.html.CB_MenuItem.prototype.SubMenuSet = function( subMenuID ) { this.fSubMenuID = subMenuID; } com.chilibytes.ccl.html.CB_MenuItem.prototype.UserDataSet = function( indexKey, value ) { this.fUserdataA[indexKey] = value; } com.chilibytes.ccl.html.CB_MenuItem.prototype.UserDataGet = function( indexKey ) { return ( this.fUserdataA[indexKey] ? this.fUserdataA[indexKey] : null ); } com.chilibytes.ccl.html.CB_MenuItem.prototype.SwapImageSet = function( imgId, imgSrc ) { this.fImagesInfoA["imgObjSwap"] = document.getElementById( imgId ); if ( this.fImagesInfoA["imgObjSwap"] ) { this.fImagesInfoA["imgSrcOriginal"] = this.fImagesInfoA["imgObjSwap"].src; this.fImagesInfoA["imgSrcSwap"] = imgSrc; } } com.chilibytes.ccl.html.CB_MenuItem.prototype.IsClicked = function() { return this.fIsClicked; } com.chilibytes.ccl.html.CB_MenuItem.prototype.SelectedImageSet = function( imgId, imgSrc ) { this.SelectedImageAdd( imgId, imgSrc, true ); } com.chilibytes.ccl.html.CB_MenuItem.prototype.SelectedImageAdd = function( imgId, imgSrc, isDefault ) { var imageInfoA = new Array(); imageInfoA["obj"] = document.getElementById( imgId ); if ( imageInfoA["obj"] ) { imageInfoA["src"] = imgSrc; if ( isDefault ) this.fImageA["selected"]["default"] = imageInfoA; this.fImageA["selected"].push( imageInfoA ); } } com.chilibytes.ccl.html.CB_MenuItem.prototype.CSSHighlightingEnable = function( enableCSS ) { this.fCssHighlighting = enableCSS; } com.chilibytes.ccl.html.CB_MenuItem.prototype.LinkControl = function( enabled ) { this.fLinkControl = enabled; } com.chilibytes.ccl.html.CB_MenuItem.prototype.SwapImageOnLoad = function( enabled ) { this.fImageSwapOnLoad = enabled; } com.chilibytes.ccl.html.CB_MenuItem.prototype._HighlightControl = function() { var highlighted = false; if ( this.fObjP ) { if ( this.fCssHighlighting ) { var cssClass = this.fCssClass; if ( this.fIsClicked ) { cssClass += "__selected"; highlighted = true; } this.fObjP.className = cssClass; } if ( this.fImageSwapOnLoad && this.fIsClicked && this.fImageA["selected"].length > 0 ) { for ( var i = 0; i < this.fImageA["selected"].length; i++ ) { if ( this.fImageA["selected"][i]["obj"] ) { this.fImageA["selected"][i]["obj"].src = this.fImageA["selected"][i]["src"]; } } highlighted = true; } if ( highlighted ) { this._EventHandlerOnHighlighted(); } } } com.chilibytes.ccl.html.CB_MenuItem.prototype._SubMenuControl = function() { if ( this.fSubMenuID ) { var subMenuObj = document.getElementById( this.fSubMenuID ); if ( subMenuObj ) { if ( this.fIsClicked ) { CB_CSS.ClassNameSuffixAdd( subMenuObj, "__visible" ); } else { CB_CSS.ClassNameSuffixRemove( subMenuObj, "__visible" ); } } } } com.chilibytes.ccl.html.CB_MenuItem.prototype.OnClick = function( eventP ) { this.Activate(); } com.chilibytes.ccl.html.CB_MenuItem.prototype.Activate = function() { if ( this.fLinkControl ) { if ( this.fTarget == "" || this.fTarget == "_self" ) { location.href = this.fHref; } else if ( this.fTarget == "_blank" ) { window.open( this.fHref, this.fTarget ); } else { var targetObj = document.getElementById( this.fTarget ); if ( targetObj && targetObj.src ) { targetObj.src = this.fHref; } } } this._EventHandlerOnClick(); this.fIsClicked = true; this.Update(); } com.chilibytes.ccl.html.CB_MenuItem.prototype.OnMouseOver = function( eventP ) { if ( !this.fIsClicked || ( this.fImageA["selected"]["default"] && this.fImagesInfoA["imgObjSwap"] != this.fImageA["selected"]["default"]["obj"] ) ) { if ( this.fImagesInfoA["imgObjSwap"] ) { this.fImagesInfoA["imgObjSwap"].style.cursor = "pointer"; this.fImagesInfoA["imgSrcOriginal"] = this.fImagesInfoA["imgObjSwap"].src; this.fImagesInfoA["imgObjSwap"].src = this.fImagesInfoA["imgSrcSwap"]; } } this._EventHandlerOnHover( true ); } com.chilibytes.ccl.html.CB_MenuItem.prototype.OnMouseOut = function( eventP ) { if ( !this.fIsClicked || ( this.fImageA["selected"]["default"] && this.fImagesInfoA["imgObjSwap"] != this.fImageA["selected"]["default"]["obj"] ) ) { if ( this.fImagesInfoA["imgObjSwap"] ) { this.fImagesInfoA["imgObjSwap"].style.cursor = "normal"; this.fImagesInfoA["imgObjSwap"].src = this.fImagesInfoA["imgSrcOriginal"]; } } this._EventHandlerOnHover( false ); } com.chilibytes.ccl.html.CB_MenuItem.prototype.Update = function() { var targetObj = document.getElementById( this.fTarget ); var currUrl = document.URL; if ( targetObj ) { if ( targetObj.contentDocument ) { currUrl = targetObj.contentDocument.URL; } else if ( document.frames[targetObj.id].document ) { currUrl = document.frames[targetObj.id].document.location.href; } } if ( this.IsParentVisible() && !this.fHREFOnLoadChecked && this.fHREFCheckEnabled ) { this.fIsClicked = ( currUrl.indexOf( this.fHref ) != -1 ); this.fHREFOnLoadChecked = true; } this._HighlightControl(); this._SubMenuControl(); this.fImageSwapOnLoad = true; } com.chilibytes.ccl.html.CB_MenuItem.prototype.Invalidate = function() { this.fHREFOnLoadChecked = false; this.Reset(); } com.chilibytes.ccl.html.CB_MenuItem.prototype.IsParentVisible = function() { var visible = false; if ( this.fParent && this.fParent.className ) { visible = ( this.fParent.className.indexOf( "__visible" ) > -1 ); } return visible; } com.chilibytes.ccl.html.CB_MenuItem.prototype.Reset = function() { this.fIsClicked = false; if ( this.fObjP.innerHTML ) { this.fObjP.innerHTML = this.fAlternativeLabelA["current"]; } this.Update(); } com.chilibytes.ccl.html.CB_MenuItem.prototype.AlternativeLabelSwitch = function() { if ( this.fAlternativeLabelA["alternative"] != null ) { var tmpAlt = this.fAlternativeLabelA["alternative"]; this.fAlternativeLabelA["alternative"] = this.fAlternativeLabelA["current"]; this.fAlternativeLabelA["current"] = tmpAlt; this.Reset(); } } com.chilibytes.ccl.html.CB_MenuItem.prototype.EventOnHoverAttach = function( parentP, eventFuncP ) { if ( eventFuncP ) { this.fEventHandlerA["onHover"] = new Array(); this.fEventHandlerA["onHover"]["parent"] = parentP; this.fEventHandlerA["onHover"]["event"] = eventFuncP; } } com.chilibytes.ccl.html.CB_MenuItem.prototype.EventOnClickAttach = function( parentP, eventFuncP ) { if ( eventFuncP ) { this.fEventHandlerA["onClick"] = new Array(); this.fEventHandlerA["onClick"]["parent"] = parentP; this.fEventHandlerA["onClick"]["event"] = eventFuncP; } } com.chilibytes.ccl.html.CB_MenuItem.prototype.EventOnHighlightedAttach = function( parentP, eventFuncP ) { if ( eventFuncP ) { this.fEventHandlerA["onHighlighted"] = new Array(); this.fEventHandlerA["onHighlighted"]["parent"] = parentP; this.fEventHandlerA["onHighlighted"]["event"] = eventFuncP; this.fHREFOnLoadChecked = false; } } com.chilibytes.ccl.html.CB_MenuItem.prototype._EventHandlerOnHover = function( hasFocus ) { if ( this.fEventHandlerA["onHover"] ) { this.fEventHandlerA["onHover"]["event"].call( this.fEventHandlerA["onHover"]["parent"], this, hasFocus ); } } com.chilibytes.ccl.html.CB_MenuItem.prototype._EventHandlerOnClick = function() { if ( this.fEventHandlerA["onClick"] ) { this.fEventHandlerA["onClick"]["event"].call( this.fEventHandlerA["onClick"]["parent"], this ); } } com.chilibytes.ccl.html.CB_MenuItem.prototype._EventHandlerOnHighlighted = function() { if ( this.fEventHandlerA["onHighlighted"] ) { this.fEventHandlerA["onHighlighted"]["event"].call( this.fEventHandlerA["onHighlighted"]["parent"], this ); } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.html ) com.chilibytes.ccl.html = {}; var CB_AjaxCommonInterface = com.chilibytes.ccl.ajax.CB_AjaxCommonInterface; var CB_MenuItem = com.chilibytes.ccl.html.CB_MenuItem; com.chilibytes.ccl.html.CB_Menu = function( menuID, ajaxCommonInterfaceURL ) { this.constructor = com.chilibytes.ccl.html.CB_Menu; this.fMenuID = menuID; this.fEventHandlerA = new Array(); this.fMenuItemA = new Array(); this.fClickHistoryA = new Array(); this.fAjaxCommonInterface = new CB_AjaxCommonInterface( ajaxCommonInterfaceURL ); if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.EventNavigationMenuRequestAttach( this, this.EventNavigationMenuRequest ); } } com.chilibytes.ccl.html.CB_Menu.prototype.IDGet = function() { return this.fMenuID; } com.chilibytes.ccl.html.CB_Menu.prototype.PreviousClickedMenuItemGet = function() { var menuItemObj = null; if ( this.fClickHistoryA && this.fClickHistoryA.length > 1 ) { menuItemObj = this.fClickHistoryA[this.fClickHistoryA.length-2]; } return menuItemObj; } com.chilibytes.ccl.html.CB_Menu.prototype.ClickedItemGet = function() { var menuItem = null; for ( var menuItemIx in this.fMenuItemA ) { if ( this.fMenuItemA[menuItemIx].IsClicked() ) { menuItem = this.fMenuItemA[menuItemIx]; break; } } return menuItem; } com.chilibytes.ccl.html.CB_Menu.prototype.Initialize = function() { if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.NavigationMenuRequest( this.IDGet() ); } } com.chilibytes.ccl.html.CB_Menu.prototype.EventMenuItemOnHoverAttach = function( parentP, eventFuncP ) { if ( eventFuncP ) { this.fEventHandlerA["onHover"] = new Array(); this.fEventHandlerA["onHover"]["parent"] = parentP; this.fEventHandlerA["onHover"]["event"] = eventFuncP; } } com.chilibytes.ccl.html.CB_Menu.prototype.EventMenuItemOnClickAttach = function( parentP, eventFuncP ) { if ( eventFuncP ) { this.fEventHandlerA["onClick"] = new Array(); this.fEventHandlerA["onClick"]["parent"] = parentP; this.fEventHandlerA["onClick"]["event"] = eventFuncP; } } com.chilibytes.ccl.html.CB_Menu.prototype.EventMenuItemOnHighlightedAttach = function( parentP, eventFuncP ) { if ( eventFuncP ) { this.fEventHandlerA["onHighlighted"] = new Array(); this.fEventHandlerA["onHighlighted"]["parent"] = parentP; this.fEventHandlerA["onHighlighted"]["event"] = eventFuncP; } } com.chilibytes.ccl.html.CB_Menu.prototype.MenuItemRefresh = function( invalidate ) { for ( var i = 0; i < this.fMenuItemA.length; i++ ) { if ( invalidate ) { this.fMenuItemA[i].Invalidate(); } else { this.fMenuItemA[i].Reset(); } } } com.chilibytes.ccl.html.CB_Menu.prototype.MenuItemOnHoverEvent = function( menuItemObj, hasFocus ) { if ( this.fEventHandlerA["onHover"] ) { this.fEventHandlerA["onHover"]["event"].call( this.fEventHandlerA["onHover"]["parent"], menuItemObj, hasFocus ); } } com.chilibytes.ccl.html.CB_Menu.prototype.MenuItemOnClickEvent = function( menuItemObj ) { if ( !menuItemObj.DisableItemRefreshingGet() ) { this.MenuItemRefresh() } if ( menuItemObj ) { this.fClickHistoryA.push( menuItemObj ); if ( this.fEventHandlerA["onClick"] ) { this.fEventHandlerA["onClick"]["event"].call( this.fEventHandlerA["onClick"]["parent"], menuItemObj ); } } } com.chilibytes.ccl.html.CB_Menu.prototype.MenuItemOnHighlightedEvent = function( menuItemObj ) { if ( this.fEventHandlerA["onHighlighted"] ) { this.fEventHandlerA["onHighlighted"]["event"].call( this.fEventHandlerA["onHighlighted"]["parent"], menuItemObj ); } } com.chilibytes.ccl.html.CB_Menu.prototype.MenuItemActivate = function( menuItemID ) { for ( var menuItemIx in this.fMenuItemA ) { if ( this.fMenuItemA[menuItemIx].IDGet() == menuItemID ) { this.fMenuItemA[menuItemIx].Activate(); break; } } } com.chilibytes.ccl.html.CB_Menu.prototype.EventNavigationMenuRequest = function( ajaxObject ) { if ( ajaxObject && ajaxObject.cb_menuitems ) { for ( var i=0; i < ajaxObject.cb_menuitems.length; i++ ) { var currObj = ajaxObject.cb_menuitems[i]; for ( var classMember in CB_MenuItem.prototype ) { currObj[classMember] = CB_MenuItem.prototype[classMember]; } try { CB_MenuItem.call( currObj, currObj.__constructparams[0] ); currObj.EventOnClickAttach( this, this.MenuItemOnClickEvent ); currObj.EventOnHighlightedAttach( this, this.MenuItemOnHighlightedEvent ); currObj.EventOnHoverAttach( this, this.MenuItemOnHoverEvent ); currObj.Update(); this.fMenuItemA.push( currObj ); } catch ( exceptionP ) { } } } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.security ) com.chilibytes.ccl.security = {}; var CB_AjaxCommonInterface = com.chilibytes.ccl.ajax.CB_AjaxCommonInterface; com.chilibytes.ccl.security.CB_SSO = function( ajaxCommonInterfaceURL ) { this.constructor = com.chilibytes.ccl.security.CB_SSO; this.fEventHandlerA = new Array(); this.fAjaxCommonInterface = new CB_AjaxCommonInterface( ajaxCommonInterfaceURL ); if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.EventSSODataWriteResultAttach( this, this.EventSSODataWriteResult ); } } com.chilibytes.ccl.security.CB_SSO.prototype.DataFieldWrite = function( fieldName, value ) { if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.SSODataFieldWrite( fieldName, value ); } } com.chilibytes.ccl.security.CB_SSO.prototype.EventSSODataWriteResult = function( ajaxDomObject, ajaxDomStructure ) { if ( ajaxDomObject ) { } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.html ) com.chilibytes.ccl.html = {}; var CB_WindowEvents = com.chilibytes.ccl.controls.CB_WindowEvents; var CB_Menu = com.chilibytes.ccl.html.CB_Menu; var CB_SSO = com.chilibytes.ccl.security.CB_SSO; com.chilibytes.ccl.html.CB_Page = function( ajaxInterfaceURL ) { this.constructor = com.chilibytes.ccl.html.CB_Page; CB_WindowEvents.call( this ); this.fAjaxInterfaceURL = ajaxInterfaceURL; this.fMenuA = new Array(); this.fSSO = new CB_SSO( ajaxInterfaceURL ); } var _cbPageInherit = function() {}; _cbPageInherit.prototype = CB_WindowEvents.prototype; com.chilibytes.ccl.html.CB_Page.prototype = new _cbPageInherit(); com.chilibytes.ccl.html.CB_Page.prototype.MenuAdd = function( menuP ) { if ( menuP ) { menuP.Initialize(); this.fMenuA[menuP.IDGet()] = menuP; } } com.chilibytes.ccl.html.CB_Page.prototype.MenuGet = function( menuID ) { return this.fMenuA[menuID]; } com.chilibytes.ccl.html.CB_Page.prototype.AJAXInterfaceURLGet = function() { return this.fAjaxInterfaceURL; } com.chilibytes.ccl.html.CB_Page.prototype.SSOGet = function() { return this.fSSO; } com.chilibytes.ccl.html.CB_Page.prototype.WindowOnLoad = function( eventP ) { for ( var menuID in this.fMenuA ) { if ( this.fMenuA[menuID] && this.fMenuA[menuID].Initialize ) { this.fMenuA[menuID].Initialize(); } } } var CBPage = new com.chilibytes.ccl.html.CB_Page( "ajaxinterface.php" );