var PHX_SESSION_EXPIRATION_REDIRECT=""; var PHX_NET_WEB_AJAX_INTERFACE="bin/F24AJAXInterface.php"; var CB_HTML_ID_PREFIX="PHX:"; var PHX_I18N_QUERY_VARNAME="PHXML"; var PHX_I18N_COOKIE_VARNAME="PHX_LANG_ISO"; var PHX_I18N_COOKIE_VARNAME_DB="PHX_BUILD_VERSION"; var PHX_I18N_COOKIE_LIFETIME="7776000"; var PHX_I18N_DEFAULT_LANGUAGE="de-DE"; var PHX_SESSION_IDENTIFIER_NAME="PHX_SSO_ID"; var PHX_SESSION_COOKIE_LIFETIME="7776000"; var PHX_SESSION_LIFETIME="14400"; var PHX_SESSION_COOKIE_PATH="/"; var PHX_SESSION_AUTHENTIFICATION_VARNAME_USER="phx_ssoauth_username"; var PHX_SESSION_AUTHENTIFICATION_VARNAME_LOGIN="phx_ssoauth_password"; var PHX_SSO_AUTH_DEFAULT_ID="phx_ssoauth"; var PHX_PASSWORD_CHANGE_WIDGET_ID="phx_pwchange"; var PHX_REFVAR_PORTAL="PHXP"; var PHX_REFVAR_USER="PHXUID"; if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; 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_IE9x = 0x00000080; 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_FF3x = 0x00008000; 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_OPERA10 = 0x00200000; 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.net.web.Environment = { CurrentClientBrowser: function() { var famVersion = null; var tmpA = null; var agentVersion = null; var agent = navigator.userAgent; // 1. brackets (index 1): Agent-family // 2. brackets (index 2): Agent-family-version // 3. brackets (index 3): Agent-engine-informations // 4. brackets (index 4): Agent-sepcial-information var regExp = /(\S+)\/(\d\.\d+)\s\((.+)\)\s?(.*)/; var tmpInfoA = agent.match( regExp ); // Netscape, KHTML, Mozilla, Firefox, Opera compatibility, IE identity if ( !tmpInfoA ) { alert( "Regular expressions parse error -> " + regExp ); return null; } else if ( tmpInfoA[1] == "Mozilla" ) { famVersion = parseFloat( tmpInfoA[2] ); // Old IEs (<4) uses familiy version 2.0 if ( famVersion == 2.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE_OLD; } if ( famVersion == 4.0 || famVersion == 5.0 ) { // First of all, the opera comptibility mode // Also contains the MSIE-Tag 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; case 10: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA10; } } 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 == 9.0 ) { return CB_ENVIRONMENT_BROWSER_IDENT_IE9x; } else 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 ) { // Version number could be x.x.x or x.x 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 ) { // String contains 'Gecko/xxxxxxx Browsername/x.x(.x)' regExp = /Gecko\/\d+\s(\S+)\/(\d\.\d+\.?\d*)/; tmpA = tmpInfoA[4].match( regExp ); // The regexp don't match the string on mozilla 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 < 3.0 ){ return CB_ENVIRONMENT_BROWSER_IDENT_FF2x; } else { return CB_ENVIRONMENT_BROWSER_IDENT_FF3x; } } 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; } } } // Old Netscapeagents (3.x, 4.x) uses this familiy-versions else if ( ( famVersion > 4.0 && famVersion < 5.0 ) || ( famVersion < 4.0 && famVersion > 3.0 ) ) { return CB_ENVIRONMENT_BROWSER_IDENT_NS_OLD; } // Unsupported familiy-versions else { return CB_ENVIRONMENT_BROWSER_IDENT_MISC; } } // Original Opera indentity 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; case 10: return CB_ENVIRONMENT_BROWSER_IDENT_OPERA10; } } // Unsupported agent-families else { return CB_ENVIRONMENT_BROWSER_IDENT_MISC; } }, DocumentDimensionGet: function() { var dimA = new Array(); // all except Explorer if (self.innerHeight) { dimA["W"] = self.innerWidth; dimA["H"] = self.innerHeight; } // Explorer 6 Strict Mode else if ( document.documentElement && document.documentElement.clientHeight ) { dimA["W"] = document.documentElement.clientWidth; dimA["H"] = document.documentElement.clientHeight; } // other Explorers else if ( document.body ) { dimA["W"] = document.body.clientWidth; dimA["H"] = document.body.clientHeight; } return dimA; }, CurrentURL: function( removeFragment ) { var docURI = document.URL; if ( removeFragment ) { var indexOfFragment = docURI.indexOf( "#" ); if ( indexOfFragment > 0 ) docURI = docURI.substr( 0, indexOfFragment ); } return docURI; }, GetCookie: function( cookieKey ) { var value = null; var cookieRegExpr = new RegExp( cookieKey + "\\=(.+)" ); var cookiePartA = document.cookie.split( ";" ); for( var i=0; i 1 ) { value = matchA[1]; break; } } return value; } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.gui ) com.chilibytes.ccl.gui = {}; var Environment = com.chilibytes.ccl.net.web.Environment; com.chilibytes.ccl.gui.AbstractWindowEvents = function() { // Constructor this.constructor = com.chilibytes.ccl.gui.AbstractWindowEvents; // Current window for events this._currWindowP = ( Environment.CurrentClientBrowser() & CB_ENVIRONMENT_BROWSER_IDENT_IE ? document : window ); // Init this._InitWindowEvents(); this._InitMouseEvents(); } com.chilibytes.ccl.gui.AbstractWindowEvents.prototype._InitWindowEvents = function() { var self = this; // Onload var windowOnLoadEventListP = window.onload; window.onload = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); var continueEvent = true; if ( windowOnLoadEventListP ) continueEvent = windowOnLoadEventListP.call( self, eventP ); if ( continueEvent != false ) continueEvent = self.WindowOnLoad( eventP ); return continueEvent; }; var windowOnBeforeUnloadEventListP = window.onbeforeunload; window.onbeforeunload = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); var continueEvent = true; if ( windowOnBeforeUnloadEventListP ) continueEvent = windowOnBeforeUnloadEventListP.call( self, eventP ); if ( continueEvent != false ) continueEvent = self.WindowOnBeforeUnload( eventP ); return continueEvent; }; var windowOnUnloadEventListP = window.onunload; window.onunload = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); var continueEvent = true; if ( windowOnUnloadEventListP ) continueEvent = windowOnUnloadEventListP.call( self, eventP ); if ( continueEvent != false ) continueEvent = self.WindowOnUnload( eventP ); return continueEvent; }; var windowOnResizeEventListP = window.onresize; window.onresize = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); var continueEvent = true; if ( windowOnResizeEventListP ) continueEvent = windowOnResizeEventListP.call( self, eventP ); if ( continueEvent != false ) continueEvent = self.WindowOnResize( eventP ); return continueEvent; }; var windowOnScrollEventListP = window.onscroll; window.onscroll = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); var continueEvent = true; if ( windowOnScrollEventListP ) continueEvent = windowOnScrollEventListP.call( self, eventP ); if ( continueEvent != false ) continueEvent = self.WindowOnScroll( eventP ); return continueEvent; }; } com.chilibytes.ccl.gui.AbstractWindowEvents.prototype._InitMouseEvents = function() { var self = this; // Window on mouse move event var windowOnMouseMoveEventListP = this._currWindowP.onmousemove; this._currWindowP.onmousemove = function( eventP ) { eventP = ( !eventP ? window.event : eventP ); if ( windowOnMouseMoveEventListP ) windowOnMouseMoveEventListP.call( self, eventP ); self.WindowOnMouseMove( eventP ); } // Window on mouse up event 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.gui.AbstractWindowEvents.prototype.WindowOnLoad = function( eventP ) {} com.chilibytes.ccl.gui.AbstractWindowEvents.prototype.WindowOnResize = function( eventP ) {} com.chilibytes.ccl.gui.AbstractWindowEvents.prototype.WindowOnBeforeUnload = function( eventP ) {} com.chilibytes.ccl.gui.AbstractWindowEvents.prototype.WindowOnUnload = function( eventP ) {} com.chilibytes.ccl.gui.AbstractWindowEvents.prototype.WindowOnMouseMove = function( eventP ) {} com.chilibytes.ccl.gui.AbstractWindowEvents.prototype.WindowOnMouseUp = function( eventP ) {} com.chilibytes.ccl.gui.AbstractWindowEvents.prototype.WindowOnScroll = function( eventP ) {} if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.gfx ) com.chilibytes.ccl.net.web.gfx = {}; var Environment = com.chilibytes.ccl.net.web.Environment; com.chilibytes.ccl.net.web.gfx.GFXUtilities = { ObjectOpacitySet: function( objP, opacity ) { var opPerc = parseFloat( opacity / 100 ); var userAgent = Environment.CurrentClientBrowser(); // First set css3 property to the supported browsers if ( userAgent & CB_ENVIRONMENT_BROWSER_IDENT_FF2x || userAgent & CB_ENVIRONMENT_BROWSER_IDENT_OPERA9 ) { objP.style.opacity = opPerc; // CSS3 } else if ( userAgent & CB_ENVIRONMENT_BROWSER_IDENT_IE ) { if ( userAgent & CB_ENVIRONMENT_BROWSER_IDENT_IE8x || userAgent & CB_ENVIRONMENT_BROWSER_IDENT_IE9x ) { // objP.style.opacity = opPerc; // CSS3 var filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity="+opacity+")"; if ( opacity == 100 ) filter = "none"; objP.style.filter = filter; } else { var filter = "Alpha( opacity=" + opacity + ", style=0, finishOpacity=0 )"; if ( opacity == 100 ) filter = "none"; objP.style.filter = filter; } } else if ( userAgent & CB_ENVIRONMENT_BROWSER_IDENT_GECKO ) { objP.style.MozOpacity = opPerc; } else if ( userAgent & CB_ENVIRONMENT_BROWSER_IDENT_KHTML ) { objP.style.KhtmlOpacity = opPerc; objP.style.opacity = opPerc; // CSS3 } else { GFXUtilities.ObjectVisibilitySet( objP, ( opacity > 50 ), false ); } }, ObjectVisibilitySet: function( objP, visible, obtainPlaceholder ) { GFXUtilities.SetObjectVisibility( objP, visible, obtainPlaceholder, "block" ); }, SetInlineObjectVisibility: function( objP, visible, obtainPlaceholder ) { GFXUtilities.SetObjectVisibility( objP, visible, obtainPlaceholder, "inline" ); }, SetObjectVisibility: function( objP, visible, obtainPlaceholder, placeHolder ) { if ( !placeHolder ) placeHolder = "block"; if ( objP ) { objP.style.visibility = ( visible ? "visible" : "hidden" ); if ( obtainPlaceholder != window.undefined && !obtainPlaceholder ) { objP.style.display = ( visible ? placeHolder : "none" ); } } }, MousePositionArrayGet: function( mouseEventP ) { var posA = null; if ( mouseEventP ) { posA = new Array(); posA["x"] = mouseEventP.clientX; posA["y"] = mouseEventP.clientY; } return posA; }, IEBackgroundCacheEnabled: function( enabled ) { if ( Environment.CurrentClientBrowser() & CB_ENVIRONMENT_BROWSER_IDENT_IE && document.execCommand ) { try { document.execCommand( "BackgroundImageCache", false, enabled ); } catch( exception ){}; } } } 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.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; //a number between 0 and 255 var x = 0; //an hex number crcN = crcN ^ (-1); for ( var i = 0, iTop = sourceS.length; i < iTop; i++ ) { n = ( crcN ^ sourceS.charCodeAt( i ) ) & 0xFF; x = "0x" + 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 ); } } 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.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.ajax ) com.chilibytes.ccl.net.web.ajax = {}; com.chilibytes.ccl.net.web.ajax.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 ) { // Mozilla, Opera, Safari, IE7, ... xmlRequestObject = new XMLHttpRequest(); // IE7 does not support mimetype override function if ( xmlRequestObject.overrideMimeType ) { xmlRequestObject.overrideMimeType('text/xml'); } } else if ( window.ActiveXObject ) { // IExplorer... try { xmlRequestObject = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { xmlRequestObject = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) { xmlRequestObject = null; } } } return xmlRequestObject; } } com.chilibytes.ccl.net.web.ajax.XMLHttpRequestFactory.PrecacheObjects(); if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.ajax ) com.chilibytes.ccl.net.web.ajax = {}; var Keys = com.chilibytes.ccl.common.Keys; var Environment = com.chilibytes.ccl.net.web.Environment; var XMLHttpRequestFactory = com.chilibytes.ccl.net.web.ajax.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.net.web.ajax.AJAXConnection = function( parentP ) { this.constructor = com.chilibytes.ccl.net.web.ajax.AJAXConnection; // class variables this.fXMLRequestA = new Array(); this._parentP = parentP; this._userAgent = Environment.CurrentClientBrowser(); this.fConnectionTimeout = null; this.fEventHandlerA = new Array(); } com.chilibytes.ccl.net.web.ajax.AJAXConnection.prototype.XMLRequest = function( xmlURL, eventFunctionP ) { this._XMLRequest( xmlURL, CB_AJAX_CONNECTION_REQUEST_METHOD_GET, null, eventFunctionP, null ); } com.chilibytes.ccl.net.web.ajax.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.net.web.ajax.AJAXConnection.prototype.XMLQueryRequestByGET = function( xmlURL, eventFunctionP, queryString ) { this._XMLRequest( xmlURL, CB_AJAX_CONNECTION_REQUEST_METHOD_GET, queryString, eventFunctionP, "application/x-www-form-urlencoded" ); } com.chilibytes.ccl.net.web.ajax.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.net.web.ajax.AJAXConnection.prototype._XMLRequest = function( xmlURL, requestMethod, queryString, eventFunctionP, contentType ) { var self = this; var objectId = "obj-" + Keys.IntKeyGenerate(); this.fXMLRequestA[objectId] = 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.net.web.ajax.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 ); } XMLHttpRequestFactory.ReleaseInstance( xmlRequestObj ); this.fXMLRequestA[objectId] = null; } } catch ( exceptionP ) { if ( xmlRequestObj ) { xmlRequestObj.abort(); XMLHttpRequestFactory.ReleaseInstance( xmlRequestObj ); } } } com.chilibytes.ccl.net.web.ajax.AJAXConnection.prototype._ConnectionTimeoutControl = function( setNew ) { var self = this; if ( this.fConnectionTimeout ) { window.clearTimeout( this.fConnectionTimeout ); } else if ( setNew ){ this.fConnectionTimeout = window.setTimeout( function() { self._EventConnectionTimeout(); }, CB_AJAX_CONNECTION_CONNECTION_TIMEOUT ); } } com.chilibytes.ccl.net.web.ajax.AJAXConnection.prototype.EventConnectionTimeoutAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAX_CONNECTION_EVENTID_CONNECTION_TIMEOUT, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXConnection.prototype._EventConnectionTimeout = function() { if ( console ) 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"] ); } } com.chilibytes.ccl.net.web.ajax.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.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.ajax ) com.chilibytes.ccl.net.web.ajax = {}; var Keys = com.chilibytes.ccl.common.Keys; var Environment = com.chilibytes.ccl.net.web.Environment; var XMLHttpRequestFactory = com.chilibytes.ccl.net.web.ajax.XMLHttpRequestFactory; 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; var CB_JSON_CONNECTOR_HTTPSTATUS_FILENOTFOUND = 404; var CB_JSON_CONNECTOR_HTTPSTATUS_GATEWAYTIMEOUT = 504; com.chilibytes.ccl.net.web.ajax.JSONConnector = function( parentP ) { this.constructor = com.chilibytes.ccl.net.web.ajax.JSONConnector; // class variables this.fXMLRequestA = new Array(); this.fRequestParameterA = new Array(); this.fParentP = parentP; this.fLastRequestID = null; this.fRequestAutoAbort = false; this.fUserAgent = Environment.CurrentClientBrowser(); } com.chilibytes.ccl.net.web.ajax.JSONConnector.prototype.SetRequestAutoAbort = function( abort ) { this.fRequestAutoAbort = abort; } com.chilibytes.ccl.net.web.ajax.JSONConnector.prototype.RequestObject = function( requestTargetURL, resultEventFunction, errorEventFunction, queryString, sync ) { return this._RequestObject( requestTargetURL, CB_JSON_CONNECTOR_REQUEST_METHOD_POST, queryString, resultEventFunction, errorEventFunction, sync ); } com.chilibytes.ccl.net.web.ajax.JSONConnector.prototype.RequestObjectByGET = function( requestTargetURL, resultEventFunction, errorEventFunction, queryString, sync ) { return this._RequestObject( requestTargetURL, CB_JSON_CONNECTOR_REQUEST_METHOD_GET, queryString, resultEventFunction, errorEventFunction, sync ); } com.chilibytes.ccl.net.web.ajax.JSONConnector.prototype._RequestObject = function( requestTargetURL, requestMethod, queryString, resultEventFunction, errorEventFunction, sync ) { var self = this; // If auto abort, cancel running processes if ( this.fRequestAutoAbort && this.fLastRequestID && this.fXMLRequestA[this.fLastRequestID] ) { this.fXMLRequestA[this.fLastRequestID].abort(); this.fXMLRequestA[this.fLastRequestID] = null; } // If queryString is null, some browser do not specify the content-length value in html header. // Some proxy server generate a voilation message. To resolve this problem, initialize queryString // with a empty string. Then the browser creates the missing content-length entry. if ( !queryString ) { queryString = ''; } // Create new instance var objectId = "obj-" + Keys.IntKeyGenerate(); this.fLastRequestID = objectId; this.fXMLRequestA[objectId] = XMLHttpRequestFactory.GetInstance(); this.fRequestParameterA[objectId] = new Array(); this.fRequestParameterA[objectId]["requestMethod"] = requestMethod; this.fRequestParameterA[objectId]["targetURL"] = requestTargetURL; this.fRequestParameterA[objectId]["resultEvent"] = resultEventFunction; this.fRequestParameterA[objectId]["errorEvent"] = errorEventFunction; this.fRequestParameterA[objectId]["queryString"] = queryString; this.fRequestParameterA[objectId]["sync"] = sync; this.fRequestParameterA[objectId]["retry"] = 0; if ( !this.fXMLRequestA[objectId] ) { alert('Error:\nNo valid XML HTTP request object.\nClass initialization might be failed.'); } else { this.SendRequest( objectId ); } } com.chilibytes.ccl.net.web.ajax.JSONConnector.prototype.SendRequest = function( xmlRequestID ) { var self = this; var requestObj = this.fXMLRequestA[xmlRequestID]; var requestParameter = this.fRequestParameterA[xmlRequestID]; if ( requestObj && requestParameter ) { try { var requestMethod = requestParameter["requestMethod"]; var queryString = requestParameter["queryString"]; var requestTargetURL = requestParameter["targetURL"]; var resultEventFunction = requestParameter["resultEvent"]; var errorEventFunction = requestParameter["errorEvent"]; var sync = requestParameter["sync"]; if ( requestMethod == CB_JSON_CONNECTOR_REQUEST_METHOD_GET && queryString && queryString != "" ) { requestTargetURL += "?"+queryString; queryString = ""; } // Increase retry requestParameter["retry"] = requestParameter["retry"] + 1; requestObj.open( requestMethod, requestTargetURL, !sync ); requestObj.onreadystatechange = function() { self._EventOnReadyStateChange( resultEventFunction, errorEventFunction, xmlRequestID ); }; requestObj.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" ); requestObj.send( queryString ); if ( sync ) { this.PrepareResult( resultEventFunction, errorEventFunction, xmlRequestID ); } } catch( exceptionP ) { requestObj.abort(); } } } com.chilibytes.ccl.net.web.ajax.JSONConnector.prototype.PrepareResult = function( callbackEventP, callbackErrorEventP, xmlRequestID ) { try { var xmlRequestObj = this.fXMLRequestA[xmlRequestID]; if ( xmlRequestObj.readyState == CB_JSON_CONNECTOR_READYSTATE_LOADED ) { if ( xmlRequestObj.status == CB_JSON_CONNECTOR_HTTPSTATUS_CONNECTION_SUCCESSFULLY ) { // On succeeded connection, call result events var jsonObject = eval( '(' + xmlRequestObj.responseText + ')' ); if ( callbackEventP && jsonObject ) { // If a json exception occured, show or call special function if ( jsonObject.JSONException ) { if ( jsonObject.JSONException.Class == "SessionExpiredException" ) { location.href = ( PHX_SESSION_EXPIRATION_REDIRECT == null ? location.href : PHX_SESSION_EXPIRATION_REDIRECT ); } else { alert( "Error:\n" + jsonObject.JSONException.Message ); } } else { callbackEventP.call( this.fParentP, jsonObject ); } } else { var msg = "Error:\nNo document response, callback function not executed."; if ( console ) { console.log( msg ); } else alert( msg ); } } else if ( xmlRequestObj.status == CB_JSON_CONNECTOR_HTTPSTATUS_FILENOTFOUND ) { if ( callbackErrorEventP ) callbackErrorEventP.call( this.fParentP, xmlRequestObj.status ); } else if ( xmlRequestObj.status == CB_JSON_CONNECTOR_HTTPSTATUS_GATEWAYTIMEOUT ) { // Retry to send request if gateway error occurred if ( this.fRequestParameterA[xmlRequestID] && this.fRequestParameterA[xmlRequestID]["retry"] < 5 ) { this.SendRequest( xmlRequestID ); } } XMLHttpRequestFactory.ReleaseInstance( xmlRequestObj ); this.fXMLRequestA[xmlRequestID] = null; } } catch ( exceptionP ) { if ( xmlRequestObj ) { xmlRequestObj.abort(); XMLHttpRequestFactory.ReleaseInstance( xmlRequestObj ); } } } com.chilibytes.ccl.net.web.ajax.JSONConnector.prototype._EventOnReadyStateChange = function( callbackEventP, callbackErrorEventP, objectId ) { this.PrepareResult( callbackEventP, callbackErrorEventP, objectId ); } 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.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(); // Prepare padding if ( strLen % 3 == 1 ) { strValue[strLen] = 0; strValue[strLen+1] = 0; } if ( strLen % 3 == 2 ) { strValue[strLen] = 0; } // Base 64 converting 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 ) { // Line break! standard?! tmpA.push( "\n" ); } i += 3; } // Finish padding if ( strLen % 3 == 1 ) { tmpA[tmpA.length - 1] = "="; tmpA[tmpA.length - 2] = "="; } if ( strLen % 3 == 2 ) { tmpA[tmpA.length - 1] = "="; } // Return joined string return tmpA.join( "" ); }, Decode: function( strValue ) { var tmpA = new Array(); var i = 0; if ( !this._initiated ) this._Init(); // Clear all line breaks and =-charactes strValue = strValue.replace( /\n|\r/g, "" ); strValue = strValue.replace( /=/g, "" ); // Bit-operations 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.security ) com.chilibytes.ccl.security = {}; if ( !com.chilibytes.ccl.security.encryption ) com.chilibytes.ccl.security.encryption = {}; com.chilibytes.ccl.security.encryption.MD5 = { fASCII: "01234567890123456789012345678901 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", fState: this.Array( 4 ), fCount: this.Array( 2 ), fBuffer: this.Array( 64 ), fTransformBuffer: this.Array( 16 ), fDigestBits: this.Array( 16 ), fS11: 7, fS12: 12, fS13: 17, fS14: 22, fS21: 5, fS22: 9, fS23: 14, fS24: 20, fS31: 4, fS32: 11, fS33: 16, fS34: 23, fS41: 6, fS42: 10, fS43: 15, fS44: 21, Array: function( n ) { var a = new Array(); for( i = 0; i < n; i++ ) { a[i]=0; } a.length = n; return a; }, Integer: function( n ) { return n%( 0xffffffff + 1 ); }, SHR: function( a, b ) { a = this.Integer( a ); b = this.Integer( b ); if ( a - 0x80000000 >= 0 ) { a = a%0x80000000; a >>= b; a += 0x40000000 >> ( b-1 ); } else { a>>=b; } return a; }, SHL1: function( a ) { a = a%0x80000000; if ( a&0x40000000 == 0x40000000 ) { a -= 0x40000000; a *= 2; a += 0x80000000; } else { a*=2; } return a; }, SHL: function( a, b ) { a = this.Integer( a ); b = this.Integer( b ); for ( var i=0; i < b; i++ ) { a = this.SHL1( a ); } return a; }, AND: function( a, b ) { a = this.Integer( a ); b = this.Integer( b ); var t1 = (a-0x80000000); var t2 = (b-0x80000000); if ( t1 >=0 ) { if ( t2 >= 0 ) { return ((t1&t2)+0x80000000); } else { return (t1&b); } } else { if ( t2 >= 0 ) { return (a&t2); } else { return (a&b); } } }, OR: function( a, b ) { a = this.Integer( a ); b = this.Integer( b ); var t1 = ( a - 0x80000000 ); var t2 = ( b - 0x80000000 ); if ( t1 >= 0 ) { if ( t2 >= 0 ) { return ( ( t1 | t2 ) + 0x80000000 ); } else { return ( ( t1 | b ) + 0x80000000 ); } } else { if ( t2 >= 0 ) { return ( ( a | t2 ) + 0x80000000 ); } else { return ( a | b ); } } }, XOR: function( a, b ) { a = this.Integer( a ); b = this.Integer( b ); var t1 = ( a-0x80000000 ); var t2 = ( b-0x80000000 ); if ( t1 >= 0 ) { if ( t2 >= 0 ) { return ( t1^t2 ); } else { return ( ( t1^b ) + 0x80000000 ); } } else { if ( t2 >= 0 ) { return (( a^t2 ) + 0x80000000 ); } else { return ( a^b ); } } }, NOT: function( a ) { a = this.Integer( a ); return ( 0xffffffff - a ); }, F: function( x, y, z) { return this.OR( this.AND( x, y ), this.AND( this.NOT( x ), z ) ); }, G: function( x, y, z ) { return this.OR( this.AND( x, z ), this.AND( y, this.NOT( z ) ) ); }, H: function( x, y, z ) { return this.XOR( this.XOR( x, y ), z ); }, I: function( x, y, z ) { return this.XOR( y, this.OR( x, this.NOT( z ) ) ); }, RotateLeft: function( a, n ) { return this.OR( this.SHL( a, n ),( this.SHR( a,( 32 - n ) ) ) ); }, FF: function( a, b, c, d, x, s, ac ) { a = a + this.F( b, c, d ) + x + ac; a = this.RotateLeft( a, s ); a = a + b; return a; }, GG: function( a, b, c, d, x, s, ac ) { a = a + this.G( b, c, d ) + x + ac; a = this.RotateLeft( a, s ); a = a + b; return a; }, HH: function( a, b, c, d, x, s, ac ) { a = a + this.H( b, c, d ) + x + ac; a = this.RotateLeft( a, s ); a = a + b; return a; }, II: function( a, b, c, d, x, s, ac ) { a = a + this.I( b, c, d ) + x + ac; a = this.RotateLeft( a, s ); a = a + b; return a; }, Transform: function( buf, offset ) { var a = 0; var b = 0; var c = 0; var d = 0; var x = this.fTransformBuffer; a = this.fState[0]; b = this.fState[1]; c = this.fState[2]; d = this.fState[3]; for (i = 0; i < 16; i++) { x[i] = this.AND( buf[i*4+offset], 0xff ); for ( j = 1; j < 4; j++ ) { x[i] += this.SHL( this.AND( buf[i*4+j+offset] ,0xff ), j * 8 ); } } a = this.FF ( a, b, c, d, x[ 0], this.fS11, 0xd76aa478); d = this.FF ( d, a, b, c, x[ 1], this.fS12, 0xe8c7b756); c = this.FF ( c, d, a, b, x[ 2], this.fS13, 0x242070db); b = this.FF ( b, c, d, a, x[ 3], this.fS14, 0xc1bdceee); a = this.FF ( a, b, c, d, x[ 4], this.fS11, 0xf57c0faf); d = this.FF ( d, a, b, c, x[ 5], this.fS12, 0x4787c62a); c = this.FF ( c, d, a, b, x[ 6], this.fS13, 0xa8304613); b = this.FF ( b, c, d, a, x[ 7], this.fS14, 0xfd469501); a = this.FF ( a, b, c, d, x[ 8], this.fS11, 0x698098d8); d = this.FF ( d, a, b, c, x[ 9], this.fS12, 0x8b44f7af); c = this.FF ( c, d, a, b, x[10], this.fS13, 0xffff5bb1); b = this.FF ( b, c, d, a, x[11], this.fS14, 0x895cd7be); a = this.FF ( a, b, c, d, x[12], this.fS11, 0x6b901122); d = this.FF ( d, a, b, c, x[13], this.fS12, 0xfd987193); c = this.FF ( c, d, a, b, x[14], this.fS13, 0xa679438e); b = this.FF ( b, c, d, a, x[15], this.fS14, 0x49b40821); a = this.GG ( a, b, c, d, x[ 1], this.fS21, 0xf61e2562); d = this.GG ( d, a, b, c, x[ 6], this.fS22, 0xc040b340); c = this.GG ( c, d, a, b, x[11], this.fS23, 0x265e5a51); b = this.GG ( b, c, d, a, x[ 0], this.fS24, 0xe9b6c7aa); a = this.GG ( a, b, c, d, x[ 5], this.fS21, 0xd62f105d); d = this.GG ( d, a, b, c, x[10], this.fS22, 0x2441453); c = this.GG ( c, d, a, b, x[15], this.fS23, 0xd8a1e681); b = this.GG ( b, c, d, a, x[ 4], this.fS24, 0xe7d3fbc8); a = this.GG ( a, b, c, d, x[ 9], this.fS21, 0x21e1cde6); d = this.GG ( d, a, b, c, x[14], this.fS22, 0xc33707d6); c = this.GG ( c, d, a, b, x[ 3], this.fS23, 0xf4d50d87); b = this.GG ( b, c, d, a, x[ 8], this.fS24, 0x455a14ed); a = this.GG ( a, b, c, d, x[13], this.fS21, 0xa9e3e905); d = this.GG ( d, a, b, c, x[ 2], this.fS22, 0xfcefa3f8); c = this.GG ( c, d, a, b, x[ 7], this.fS23, 0x676f02d9); b = this.GG ( b, c, d, a, x[12], this.fS24, 0x8d2a4c8a); a = this.HH ( a, b, c, d, x[ 5], this.fS31, 0xfffa3942); d = this.HH ( d, a, b, c, x[ 8], this.fS32, 0x8771f681); c = this.HH ( c, d, a, b, x[11], this.fS33, 0x6d9d6122); b = this.HH ( b, c, d, a, x[14], this.fS34, 0xfde5380c); a = this.HH ( a, b, c, d, x[ 1], this.fS31, 0xa4beea44); d = this.HH ( d, a, b, c, x[ 4], this.fS32, 0x4bdecfa9); c = this.HH ( c, d, a, b, x[ 7], this.fS33, 0xf6bb4b60); b = this.HH ( b, c, d, a, x[10], this.fS34, 0xbebfbc70); a = this.HH ( a, b, c, d, x[13], this.fS31, 0x289b7ec6); d = this.HH ( d, a, b, c, x[ 0], this.fS32, 0xeaa127fa); c = this.HH ( c, d, a, b, x[ 3], this.fS33, 0xd4ef3085); b = this.HH ( b, c, d, a, x[ 6], this.fS34, 0x4881d05); a = this.HH ( a, b, c, d, x[ 9], this.fS31, 0xd9d4d039); d = this.HH ( d, a, b, c, x[12], this.fS32, 0xe6db99e5); c = this.HH ( c, d, a, b, x[15], this.fS33, 0x1fa27cf8); b = this.HH ( b, c, d, a, x[ 2], this.fS34, 0xc4ac5665); a = this.II ( a, b, c, d, x[ 0], this.fS41, 0xf4292244); d = this.II ( d, a, b, c, x[ 7], this.fS42, 0x432aff97); c = this.II ( c, d, a, b, x[14], this.fS43, 0xab9423a7); b = this.II ( b, c, d, a, x[ 5], this.fS44, 0xfc93a039); a = this.II ( a, b, c, d, x[12], this.fS41, 0x655b59c3); d = this.II ( d, a, b, c, x[ 3], this.fS42, 0x8f0ccc92); c = this.II ( c, d, a, b, x[10], this.fS43, 0xffeff47d); b = this.II ( b, c, d, a, x[ 1], this.fS44, 0x85845dd1); a = this.II ( a, b, c, d, x[ 8], this.fS41, 0x6fa87e4f); d = this.II ( d, a, b, c, x[15], this.fS42, 0xfe2ce6e0); c = this.II ( c, d, a, b, x[ 6], this.fS43, 0xa3014314); b = this.II ( b, c, d, a, x[13], this.fS44, 0x4e0811a1); a = this.II ( a, b, c, d, x[ 4], this.fS41, 0xf7537e82); d = this.II ( d, a, b, c, x[11], this.fS42, 0xbd3af235); c = this.II ( c, d, a, b, x[ 2], this.fS43, 0x2ad7d2bb); b = this.II ( b, c, d, a, x[ 9], this.fS44, 0xeb86d391); this.fState[0] +=a; this.fState[1] +=b; this.fState[2] +=c; this.fState[3] +=d; }, InitMD5: function () { this.fCount[0] = this.fCount[1] = 0; this.fState[0] = 0x67452301; this.fState[1] = 0xefcdab89; this.fState[2] = 0x98badcfe; this.fState[3] = 0x10325476; for ( i = 0; i < this.fDigestBits.length; i++ ) { this.fDigestBits[i] = 0; } }, Update: function( b ) { var index; var i; index = this.AND( this.SHR( this.fCount[0], 3 ), 0x3f ); if ( this.fCount[0] < 0xffffffff - 7 ) { this.fCount[0] += 8; } else { this.fCount[1]++; this.fCount[0] -= 0xffffffff+1; this.fCount[0]+=8; } this.fBuffer[index] = this.AND( b, 0xff ); if ( index >= 63 ) { this.Transform( this.fBuffer, 0 ); } }, Finish: function() { var bits = this.Array( 8 ); var padding; var i=0; var index=0; var padLen=0; for ( i = 0; i < 4; i++ ) { bits[i] = this.AND( this.SHR( this.fCount[0], (i * 8) ), 0xff ); } for ( i = 0; i < 4; i++ ) { bits[i+4] = this.AND( this.SHR( this.fCount[1], (i * 8) ), 0xff ); } index = this.AND( this.SHR( this.fCount[0], 3), 0x3f ); padLen = ( index < 56 ) ? ( 56 - index ) : ( 120 - index ); padding = this.Array(64); padding[0] = 0x80; for ( i=0; i < padLen; i++ ) { this.Update( padding[i] ); } for ( i=0; i<8; i++ ) { this.Update( bits[i] ); } for ( i = 0; i < 4; i++ ) { for ( j = 0; j < 4; j++ ) { this.fDigestBits[i*4+j] = this.AND( this.SHR( this.fState[i], ( j * 8 ) ), 0xff ); } } }, Hexa: function( n ) { var hexa_h = "0123456789abcdef"; var hexa_c = ""; var hexa_m = n; for ( hexa_i = 0; hexa_i < 8; hexa_i++ ) { hexa_c = hexa_h.charAt( Math.abs( hexa_m ) % 16 ) + hexa_c; hexa_m = Math.floor( hexa_m / 16 ); } return hexa_c; }, Encode: function( nachricht ) { var l; var s; var k; var ka; var kb; var kc; var kd; this.InitMD5(); for ( k=0; k < nachricht.length; k++ ) { l = nachricht.charAt( k ); this.Update( this.fASCII.lastIndexOf( l ) ); } this.Finish(); ka = kb = kc = kd = 0; for ( i=0; i<4; i++ ) { ka += this.SHL( this.fDigestBits[15-i], (i*8) ); } for ( i=4; i<8; i++ ) { kb += this.SHL( this.fDigestBits[15-i], ((i-4) * 8 ) ); } for ( i=8; i<12; i++ ) { kc += this.SHL( this.fDigestBits[15-i], ((i-8) *8 ) ); } for ( i=12; i<16; i++ ) { kd += this.SHL( this.fDigestBits[15-i], ( (i-12) * 8 ) ); } s = this.Hexa( kd ) + this.Hexa( kc ) + this.Hexa( kb ) + this.Hexa( ka ); return s; } } 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.ArrayUtilities = { Serialize: function( sourceA, encodeEntities ) { var serializeString = ""; var total = 0; for ( var key in sourceA ) { ++ total; var currValue = ( encodeEntities == true ? encodeURI( String(sourceA[key]) ) : String(sourceA[key]) ); serializeString = serializeString + "s:" + String(key).length + ":\"" + String(key) + "\";s:" + currValue.length + ":\"" + currValue + "\";"; } serializeString = "a:" + total + ":{" + serializeString + "}"; return serializeString; }, MergeAssocArrays: function( array1, array2 ) { var mergedA = array1; for ( var key in array2 ) { mergedA[key] = array2[key]; } return mergedA; } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.ajax ) com.chilibytes.ccl.net.web.ajax = {}; var AJAXConnection = com.chilibytes.ccl.net.web.ajax.AJAXConnection; var JSONConnector = com.chilibytes.ccl.net.web.ajax.JSONConnector; var Base64 = com.chilibytes.ccl.common.Base64; var MD5 = com.chilibytes.ccl.security.encryption.MD5; var ArrayUtilities = com.chilibytes.ccl.common.ArrayUtilities; 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_SSO_PWREQUEST = 0x005; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_NAVIGATION_ITEMS = 0x010; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_CONTENT_ITEMS = 0x020; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_JS_OBJECT_META_CACHE = 0x100; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_JSON_CALLBACK = 0x200; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_JSON_QUERY = 0x400; var CB_AJAXCOMMONINTERFACE_CONTROL_MODE_PASSWORD_CHANGE = 0x500; 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_SSOPWREQUEST = "eventSSOPWRequest"; var CB_AJAXCOMMONINTERFACE_EVENTID_SSOWRITEREQUEST = "eventSSOWrite"; var CB_AJAXCOMMONINTERFACE_EVENTID_SSOISAUTHORIZED = "eventSSOIsAuthorized"; var CB_AJAXCOMMONINTERFACE_EVENTID_CONNECTION_TIMEOUT = "eventConnTimeout"; var CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEREQUEST = "eventJSMetaCache"; var CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEERROR = "eventJSMetaCacheError"; var CB_AJAXCOMMONINTERFACE_EVENTID_JSONCACHEFILE = "eventJSONCacheFile"; var CB_AJAXCOMMONINTERFACE_EVENTID_JSONCALLBACK = "eventJSONCallback"; var CB_AJAXCOMMONINTERFACE_EVENTID_LOCALIZATION_CHANGELANGUAGEREQUEST = "eventLocChangeLang"; com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface = function() { this.constructor = com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface; // class variables this.fAjaxConnection = new AJAXConnection( this ); this.fAjaxConnection.EventConnectionTimeoutAttach( this, this._EventOnConnectionTimeout ) this.fJSONConnector = new JSONConnector( this ); this.fAjaxInterfaceURL = PHX_NET_WEB_AJAX_INTERFACE; this.fEventHandlerA = new Array(); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.SetInterfaceURL = function( interfaceURL ) { this.fAjaxInterfaceURL = interfaceURL; } com.chilibytes.ccl.net.web.ajax.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.net.web.ajax.AJAXCommonInterface.prototype.EventNavigationMenuRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_NAVIGATIONMENUREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventConnectionTimeoutAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_CONNECTION_TIMEOUT, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventContentRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_CONTENTREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventSSOLoginRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGINREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventSSOLogoutRequestAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventSSODataWriteResultAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOWRITEREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventSSOPWRequestResultAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_PWREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventSSOIsAuthorizedResultAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_SSOISAUTHORIZED, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.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, this._EventNavigationMenuRequest, null, query ); } } com.chilibytes.ccl.net.web.ajax.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.net.web.ajax.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.net.web.ajax.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.net.web.ajax.AJAXCommonInterface.prototype._EventOnConnectionTimeout = function() { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_CONNECTION_TIMEOUT] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_CONNECTION_TIMEOUT]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_CONNECTION_TIMEOUT]["parent"] ); } } com.chilibytes.ccl.net.web.ajax.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.net.web.ajax.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.net.web.ajax.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.net.web.ajax.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.net.web.ajax.AJAXCommonInterface.prototype.SSOLogout = function() { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_LOGOUT; if ( this.fJSONConnector != null ) { this.fJSONConnector.RequestObject( this.fAjaxInterfaceURL, this._EventSSOLogoutRequest, null, query ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype._EventSSOLogoutRequest = function( jsonObject ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_SSOLOGOUTREQUEST]["parent"], jsonObject ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.SSOPWRequest = function( formFieldValueArray ) { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_PWREQUEST; if ( this.fAjaxConnection != null ) { this.fAjaxConnection.XMLFormRequest( this.fAjaxInterfaceURL, this._EventSSOPWRequest, query, formFieldValueArray ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype._EventSSOPWRequest = function( xmlObject, xmlStructure ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_PWREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_PWREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_PWREQUEST]["parent"], xmlObject, xmlStructure ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.SSODataFieldWrite = function( fieldName, dataValue ) { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_SSO_DATA_WRITE + "&ssoDataField=" + encodeURIComponent( Base64.Encode( fieldName ) ) + "&ssoDataValue=" + encodeURIComponent( Base64.Encode( dataValue ) ); if ( this.fAjaxConnection != null ) { this.fAjaxConnection.XMLQueryRequest( this.fAjaxInterfaceURL, this._EventSSODataFielWriteRequest, query ); } } com.chilibytes.ccl.net.web.ajax.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 ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventJavascriptMetaCacheResultAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEREQUEST, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventJavascriptMetaCacheErrorAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEERROR, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype._EventJavascriptMetaCacheRequest = function( jsonObject ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEREQUEST] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEREQUEST]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEREQUEST]["parent"], jsonObject ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype._EventJavascriptMetaCacheError = function( jsonObject ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEERROR] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEERROR]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JAVASCRIPTMETACACHEERROR]["parent"], jsonObject ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.RequestJavascriptMetaCache = function() { // TODO: Replace hard coded path with global constants //var url = "bin/.phxcache/javascriptmetacache." + MD5.Encode( Environment.CurrentURL( true ) ) + ".cache.php"; var url = "bin/.phxsession/" + Environment.GetCookie( PHX_SESSION_IDENTIFIER_NAME ) + "/javascriptmetacache." + MD5.Encode( Environment.CurrentURL( true ) ) + ".cache.php"; if ( this.fJSONConnector != null ) { this.fJSONConnector.RequestObjectByGET( url, this._EventJavascriptMetaCacheRequest, this._EventJavascriptMetaCacheError ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.RequestJSONCacheFile = function( fClassname, fPagekKey ) { // TODO: Replace hard coded path with global constants var url = "bin/.phxcache/" + fClassname.toLowerCase() + "." + fPagekKey + ".cache"; if ( this.fJSONConnector != null ) { this.fJSONConnector.RequestObjectByGET( url, this.EventJSONCacheFileRequest ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventJSONCacheFileAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_JSONCACHEFILE, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventJSONCacheFileRequest = function( jsonObject ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JSONCACHEFILE] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JSONCACHEFILE]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JSONCACHEFILE]["parent"], jsonObject ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.EventJSONCallbackAttach = function( parentP, eventFuncP ) { this._EventAttach( CB_AJAXCOMMONINTERFACE_EVENTID_JSONCALLBACK, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype._EventJSONCallbackRequest = function( jsonObject ) { if ( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JSONCALLBACK] ) { this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JSONCALLBACK]["event"].call( this.fEventHandlerA[CB_AJAXCOMMONINTERFACE_EVENTID_JSONCALLBACK]["parent"], jsonObject ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.RequestJSONCallback = function( ns, functionName, parameterA, autoAbort ) { var parameterString = encodeURIComponent( Base64.Encode( ArrayUtilities.Serialize( parameterA, true ) ) ); var namespaceString = encodeURIComponent( Base64.Encode( ns ) ); var functionString = encodeURIComponent( Base64.Encode( functionName ) ); var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_JSON_CALLBACK + "&namespace=" + namespaceString + "&function=" + functionString + "¶meter=" + parameterString; if ( this.fJSONConnector != null ) { this.fJSONConnector.SetRequestAutoAbort( ( autoAbort == true ) ); this.fJSONConnector.RequestObject( this.fAjaxInterfaceURL, this._EventJSONCallbackRequest, null, query ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.RequestJSONQuery = function( ns, functionName, parameterA, sync ) { var namespaceString = encodeURIComponent( Base64.Encode( ns ) ); var functionString = encodeURIComponent( Base64.Encode( functionName ) ); var parameterString = encodeURIComponent( Base64.Encode( ArrayUtilities.Serialize( parameterA, true ) ) ); var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_JSON_QUERY + "&namespace=" + namespaceString + "&function=" + functionString + "¶meter=" + parameterString; if ( this.fJSONConnector != null ) { return this.fJSONConnector.RequestObject( this.fAjaxInterfaceURL, this._EventJSONCallbackRequest, null, query, sync ); } } com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface.prototype.ChangeUserPassword = function( passwordCurrent, passwordNew, passwordNewConfirm ) { var query = "mode=" + CB_AJAXCOMMONINTERFACE_CONTROL_MODE_PASSWORD_CHANGE; query += "&pwc=" + Base64.Encode( passwordCurrent ); query += "&pwn=" + Base64.Encode( passwordNew ); query += "&pwnc=" + Base64.Encode( passwordNewConfirm ); if ( this.fJSONConnector != null ) { return this.fJSONConnector.RequestObject( this.fAjaxInterfaceURL, this._EventJSONCallbackRequest, null, query ); } } com.chilibytes.ccl.gui.ControlEventHandler = function() { // Constructor this.constructor = com.chilibytes.ccl.gui.ControlEventHandler; this.fEventHandlerA = new Array(); } com.chilibytes.ccl.gui.ControlEventHandler.prototype.AttachNewEvent = function( eventKey, callbackObject, callbackMethod ) { if ( callbackObject && callbackMethod ) { var eventAlreadyAttached = false; if ( !this.fEventHandlerA[eventKey] ) { this.fEventHandlerA[eventKey] = new Array(); } else { for( var i=0; i 0 && classDefinition ) { classDefinition = classDefinition[nsSplit.shift()]; } return classDefinition; }, GetQueryParameter: function( paramName ) { paramName = paramName.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+paramName+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.ajax ) com.chilibytes.ccl.net.web.ajax = {}; var PHX_JAVASCRIPTMETACACHE_EVENT_ID_LOADED = "FireEventIsLoaded"; var AJAXCommonInterface = com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface; var ControlEventHandler = com.chilibytes.ccl.gui.ControlEventHandler; var JavascriptUtilities = com.chilibytes.ccl.common.JavascriptUtilities; com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController = function() { // Constructor this.constructor = com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController; // Properties this.fControlEventHandler = new ControlEventHandler(); this.fJSMetaCacheA = null; this.fCacheNotAvailable = false; this.fSingletonInstanceA = new Array(); this.fInstanceA = new Array(); this.fAjaxCommonInterface = new AJAXCommonInterface(); this.fEventCreateOfInstanceMap = new Array(); } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.fCtrlInstance = null; com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.prototype.InitializeCache = function() { this.fJSMetaCacheA = null; if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.EventJavascriptMetaCacheResultAttach( this, this.EventJavascriptMetaCacheAvailable ); this.fAjaxCommonInterface.EventJavascriptMetaCacheErrorAttach( this, this.EventJavascriptMetaCacheError ); this.fAjaxCommonInterface.RequestJavascriptMetaCache(); } } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.prototype.IsLoaded = function() { return ( this.fJSMetaCacheA != null || this.fCacheNotAvailable ); } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.prototype.EventLoadedAttach = function( parentP, eventFuncP ) { this.fControlEventHandler.AttachNewEvent( PHX_JAVASCRIPTMETACACHE_EVENT_ID_LOADED, parentP, eventFuncP ); } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.prototype.EventOnInstanceCreatedAttach = function( parentP, eventFuncP, instanceID ) { if ( !this.fEventCreateOfInstanceMap[instanceID] ) this.fEventCreateOfInstanceMap[instanceID] = new Array(); var eventInfo = new Object(); eventInfo.Parent = parentP; eventInfo.Function = eventFuncP; this.fEventCreateOfInstanceMap[instanceID].push( eventInfo ); } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.GetInstance = function() { if ( com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.fCtrlInstance == null ) { com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.fCtrlInstance = new com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController(); } return com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.fCtrlInstance; } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.prototype.EventJavascriptMetaCacheError = function( errorNumber ) { if ( errorNumber == "404" ) { this.fCacheNotAvailable = true; this.fControlEventHandler.FireEvent( PHX_JAVASCRIPTMETACACHE_EVENT_ID_LOADED ); } } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.prototype.EventJavascriptMetaCacheAvailable = function( jsonObjectA ) { this.fJSMetaCacheA = jsonObjectA; this.InitializeInstances(); this.fControlEventHandler.FireEvent( PHX_JAVASCRIPTMETACACHE_EVENT_ID_LOADED ); } com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController.prototype.EventOnInstanceCreated = function( instanceID ) { if ( instanceID && this.fEventCreateOfInstanceMap[instanceID] ) { for( var i=0; i 0 ) pageLoader = instanceA[0]; } catch( exceptionP ) { if (console) console.log( exceptionP ); } return pageLoader; } com.chilibytes.ccl.gui.PageLoader.prototype.SetVisible = function( visible ) { GFXUtilities.ObjectVisibilitySet( this.GetParent(), visible, false ); } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.css ) com.chilibytes.ccl.net.web.css = {}; com.chilibytes.ccl.net.web.css.CSSUtilities = { CSSAttributeGet: function( obj, attr, scaleUnit ) { var obj; var attr; var scaleUnit; var retVal = null; if ( obj ) { // Mozilla, Opera if ( obj.ownerDocument.defaultView ) { retVal = obj.ownerDocument.defaultView.getComputedStyle( obj, "" ).getPropertyValue( attr ); } else if( obj.currentStyle ) { attr = CSSUtilities._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 ); } } }, HasClassNameSuffix: function( objP, suffix ) { return ( objP.className.indexOf( suffix ) >= 0 ); }, _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.gui ) com.chilibytes.ccl.gui = {}; var Environment = com.chilibytes.ccl.net.web.Environment; com.chilibytes.ccl.gui.AbstractControlEvents = function( controlP ) { // Constructor this.constructor = com.chilibytes.ccl.gui.AbstractControlEvents; // Init this._InitControlEvents( controlP ); } com.chilibytes.ccl.gui.AbstractControlEvents.prototype._InitControlEvents = function( controlP ) { var self = this; // Event on mouse over 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; } // Event on mouse out 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; } // Event on mouse click 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; } // Event on key up 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; } // Event on key down 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; } // Event on focus lost 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.gui.AbstractControlEvents.prototype.OnMouseOver = function( eventP ) {} com.chilibytes.ccl.gui.AbstractControlEvents.prototype.OnMouseOut = function( eventP ) {} com.chilibytes.ccl.gui.AbstractControlEvents.prototype.OnClick = function( eventP ) {} com.chilibytes.ccl.gui.AbstractControlEvents.prototype.OnKeyUp = function( eventP ) {} com.chilibytes.ccl.gui.AbstractControlEvents.prototype.OnKeyDown = function( eventP ) {} com.chilibytes.ccl.gui.AbstractControlEvents.prototype.OnLostFocus = function( eventP ) {} if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.gui ) com.chilibytes.ccl.gui = {}; if ( !com.chilibytes.ccl.gui.menu ) com.chilibytes.ccl.gui.menu = {}; var Environment = com.chilibytes.ccl.net.web.Environment; var CSSUtilities = com.chilibytes.ccl.net.web.css.CSSUtilities; var AbstractControlEvents = com.chilibytes.ccl.gui.AbstractControlEvents; com.chilibytes.ccl.gui.menu.MenuItem = function( domObjID ) { // Constructor this.constructor = com.chilibytes.ccl.gui.menu.MenuItem; // Init required object this.fObjP = document.getElementById( domObjID ); // Super class AbstractControlEvents.call( this, this.fObjP ); // Class variables 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 = AbstractControlEvents.prototype; com.chilibytes.ccl.gui.menu.MenuItem.prototype = new _menuItemInheritP(); com.chilibytes.ccl.gui.menu.MenuItem.prototype.ParentGet = function() { return this.fParent; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.ParentSet = function( value ) { this.fParent = value; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.DisableItemRefreshingGet = function() { return this.fDisableItemRefreshing; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.DisableItemRefreshingSet = function( value ) { this.fDisableItemRefreshing = value; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.AlternativeLabelSet = function( value ) { this.fAlternativeLabelA["alternative"] = value; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.IDGet = function() { return this.fObjP.id; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.HREFSet = function( targetHref ) { this.fHref = targetHref; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.HREFGet = function() { return this.fHref; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.HREFCheckEnabled = function( value ) { this.fHREFCheckEnabled = value; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.TargetSet = function( target ) { this.fTarget = target; this.fHREFOnLoadChecked = false; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.TargetGet = function() { return this.fTarget; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.IDGet = function() { return this.fObjP.id; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.SubMenuSet = function( subMenuID ) { this.fSubMenuID = subMenuID; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.UserDataSet = function( indexKey, value ) { this.fUserdataA[indexKey] = value; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.UserDataGet = function( indexKey ) { return ( this.fUserdataA[indexKey] ? this.fUserdataA[indexKey] : null ); } com.chilibytes.ccl.gui.menu.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.gui.menu.MenuItem.prototype.IsClicked = function() { return this.fIsClicked; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.SelectedImageSet = function( imgId, imgSrc ) { this.SelectedImageAdd( imgId, imgSrc, true ); } com.chilibytes.ccl.gui.menu.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.gui.menu.MenuItem.prototype.CSSHighlightingEnable = function( enableCSS ) { this.fCssHighlighting = enableCSS; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.LinkControl = function( enabled ) { this.fLinkControl = enabled; } com.chilibytes.ccl.gui.menu.MenuItem.prototype.SwapImageOnLoad = function( enabled ) { this.fImageSwapOnLoad = enabled; } com.chilibytes.ccl.gui.menu.MenuItem.prototype._HighlightControl = function() { var highlighted = false; if ( this.fObjP ) { // Highlighting with css if ( this.fCssHighlighting ) { var cssClass = this.fCssClass; if ( this.fIsClicked ) { cssClass += "__selected"; highlighted = true; } this.fObjP.className = cssClass; } // Highlighting with image 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.gui.menu.MenuItem.prototype._SubMenuControl = function() { if ( this.fSubMenuID ) { var subMenuObj = document.getElementById( this.fSubMenuID ); if ( subMenuObj ) { if ( this.fIsClicked ) { CSSUtilities.ClassNameSuffixAdd( subMenuObj, "__visible" ); } else { CSSUtilities.ClassNameSuffixRemove( subMenuObj, "__visible" ); } } } } com.chilibytes.ccl.gui.menu.MenuItem.prototype.OnClick = function( eventP ) { this.Activate(); } com.chilibytes.ccl.gui.menu.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.gui.menu.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.gui.menu.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.gui.menu.MenuItem.prototype.Update = function() { var targetObj = document.getElementById( this.fTarget ); var currUrl = document.URL; // Use target to determined the state 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.gui.menu.MenuItem.prototype.Invalidate = function() { this.fHREFOnLoadChecked = false; this.Reset(); } com.chilibytes.ccl.gui.menu.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.gui.menu.MenuItem.prototype.Reset = function() { this.fIsClicked = false; if ( this.fObjP.innerHTML ) { this.fObjP.innerHTML = this.fAlternativeLabelA["current"]; } this.Update(); } com.chilibytes.ccl.gui.menu.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.gui.menu.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.gui.menu.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.gui.menu.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.gui.menu.MenuItem.prototype._EventHandlerOnHover = function( hasFocus ) { if ( this.fEventHandlerA["onHover"] ) { this.fEventHandlerA["onHover"]["event"].call( this.fEventHandlerA["onHover"]["parent"], this, hasFocus ); } } com.chilibytes.ccl.gui.menu.MenuItem.prototype._EventHandlerOnClick = function() { if ( this.fEventHandlerA["onClick"] ) { this.fEventHandlerA["onClick"]["event"].call( this.fEventHandlerA["onClick"]["parent"], this ); } } com.chilibytes.ccl.gui.menu.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.gui ) com.chilibytes.ccl.gui = {}; if ( !com.chilibytes.ccl.gui.menu ) com.chilibytes.ccl.gui.menu = {}; // Import common interface var AJAXCommonInterface = com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface; var MenuItem = com.chilibytes.ccl.gui.menu.MenuItem; com.chilibytes.ccl.gui.menu.Menu = function( menuID, ajaxCommonInterfaceURL ) { // Constructor this.constructor = com.chilibytes.ccl.gui.menu.Menu; // Menu identifier this.fMenuID = menuID; // Evenhandler this.fEventHandlerA = new Array(); // Menuitem container this.fMenuItemA = new Array(); // Container to store click history this.fClickHistoryA = new Array(); // AjaxCommonInterface this.fAjaxCommonInterface = new AJAXCommonInterface( ajaxCommonInterfaceURL ); if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.EventNavigationMenuRequestAttach( this, this.EventNavigationMenuRequest ); } } com.chilibytes.ccl.gui.menu.Menu.prototype.IDGet = function() { return this.fMenuID; } com.chilibytes.ccl.gui.menu.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.gui.menu.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.gui.menu.Menu.prototype.Initialize = function() { if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.NavigationMenuRequest( this.IDGet() ); } } com.chilibytes.ccl.gui.menu.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.gui.menu.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.gui.menu.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.gui.menu.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.gui.menu.Menu.prototype.MenuItemOnHoverEvent = function( menuItemObj, hasFocus ) { if ( this.fEventHandlerA["onHover"] ) { this.fEventHandlerA["onHover"]["event"].call( this.fEventHandlerA["onHover"]["parent"], menuItemObj, hasFocus ); } } com.chilibytes.ccl.gui.menu.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.gui.menu.Menu.prototype.MenuItemOnHighlightedEvent = function( menuItemObj ) { if ( this.fEventHandlerA["onHighlighted"] ) { this.fEventHandlerA["onHighlighted"]["event"].call( this.fEventHandlerA["onHighlighted"]["parent"], menuItemObj ); } } com.chilibytes.ccl.gui.menu.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.gui.menu.Menu.prototype.EventNavigationMenuRequest = function( ajaxObject ) { if ( ajaxObject && ajaxObject.menuitems ) { for ( var i=0; i < ajaxObject.menuitems.length; i++ ) { var currObj = ajaxObject.menuitems[i]; // Extend json object with cb_menuitem functionality for ( var classMember in MenuItem.prototype ) { currObj[classMember] = MenuItem.prototype[classMember]; } try { 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 ) { // Exception Handling } } } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.i18n ) com.chilibytes.ccl.i18n = {}; com.chilibytes.ccl.i18n.Localization = function() { // Constructor this.constructor = com.chilibytes.ccl.i18n.Localization; } com.chilibytes.ccl.i18n.Localization.GetInstance = function() { if ( !com.chilibytes.ccl.i18n.Localization.fInstance ) { com.chilibytes.ccl.i18n.Localization.fInstance = new com.chilibytes.ccl.i18n.Localization(); } return com.chilibytes.ccl.i18n.Localization.fInstance; } com.chilibytes.ccl.i18n.Localization.prototype.SetLanguage = function( langCode ) { this.UpdateCookie( langCode ); } com.chilibytes.ccl.i18n.Localization.prototype.UpdateCookie = function( langCode ) { var expires = new Date(); expires.setTime( expires.getTime() + ( PHX_I18N_COOKIE_LIFETIME * 1000 ) ); var cookieValue = PHX_I18N_COOKIE_VARNAME + "=" + langCode + "; expires=" + expires.toGMTString() + "; path=/"; document.cookie = cookieValue; } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.i18n ) com.chilibytes.ccl.i18n = {}; var PageLoader = com.chilibytes.ccl.gui.PageLoader; var Localization = com.chilibytes.ccl.i18n.Localization; var ControlEventHandler = com.chilibytes.ccl.gui.ControlEventHandler; var PHX_ABSTRACTLANGUAGESELECT_EVENT_ID_LANG_UPDATE_SUCCESS = "FireEventLangUpdateSuccess"; com.chilibytes.ccl.i18n.AbstractLanguageSelection = function( parentContainerID ) { // Constructor this.constructor = com.chilibytes.ccl.i18n.AbstractLanguageSelection; // Try to get parent container this.fParentContainer = document.getElementById( parentContainerID ); if ( !this.fParentContainer ) throw "AbstractLanguageSelection: Missing parent container"; this.PageLoader = PageLoader.GetDefaultLoader(); this.fLocalization = Localization.GetInstance(); this.fControlEventHandler = new ControlEventHandler(); } com.chilibytes.ccl.i18n.AbstractLanguageSelection.prototype.ChangeLanguage = function( langCode ) { if ( this.PageLoader ) this.PageLoader.SetVisible( true ); this.fLocalization.SetLanguage( langCode ); this.fControlEventHandler.FireEvent( PHX_ABSTRACTLANGUAGESELECT_EVENT_ID_LANG_UPDATE_SUCCESS ); } com.chilibytes.ccl.i18n.AbstractLanguageSelection.prototype.EventOnConnectionTimeout = function() { if ( this.PageLoader ) { this.PageLoader.SetVisible( false ); } } com.chilibytes.ccl.i18n.AbstractLanguageSelection.prototype.EventLanguageUpdateSuccessAttach = function( parentP, eventFuncP ) { this.fControlEventHandler.AttachNewEvent( PHX_ABSTRACTLANGUAGESELECT_EVENT_ID_LANG_UPDATE_SUCCESS, parentP, eventFuncP ); } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.gui ) com.chilibytes.ccl.gui = {}; var AbstractLanguageSelection = com.chilibytes.ccl.i18n.AbstractLanguageSelection; var GFXUtilities = com.chilibytes.ccl.net.web.gfx.GFXUtilities; var PHX_LANGUAGEFALGSELECT_CONTAINER_ID = "phx_languageflag_select"; com.chilibytes.ccl.gui.LanguageFlagSelection = function() { // Constructor this.constructor = com.chilibytes.ccl.gui.LanguageFlagSelection; AbstractLanguageSelection.call( this, PHX_LANGUAGEFALGSELECT_CONTAINER_ID ); // Init flags this.Initialize(); } var _abstractLanguageSelectionInheritP = function() {}; _abstractLanguageSelectionInheritP.prototype = AbstractLanguageSelection.prototype; com.chilibytes.ccl.gui.LanguageFlagSelection.prototype = new _abstractLanguageSelectionInheritP(); com.chilibytes.ccl.gui.LanguageFlagSelection.prototype.Initialize = function() { var self = this; var anchorA = this.fParentContainer.getElementsByTagName( "a" ); for ( var ix in anchorA ) { if ( typeof( anchorA[ix] ) == "object" ) { if ( anchorA[ix].getAttribute( "lang" ) != "" ) { anchorA[ix].onclick = function( eventP ) { self.ChangeLanguage( this.getAttribute( "lang" ) ); }; } } } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.i18n ) com.chilibytes.ccl.i18n = {}; var LanguageFlagSelection = com.chilibytes.ccl.gui.LanguageFlagSelection; com.chilibytes.ccl.i18n.LanguageSelectFactory = { CreateInstance: function() { var instance = null; if ( document.getElementById( PHX_LANGUAGEFALGSELECT_CONTAINER_ID ) ) { instance = new LanguageFlagSelection(); } return instance; } } 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 = {}; // Import common interface var AJAXCommonInterface = com.chilibytes.ccl.net.web.ajax.AJAXCommonInterface; com.chilibytes.ccl.security.SessionController = function() { // Constructor this.constructor = com.chilibytes.ccl.security.SessionController; // Evenhandler this.fEventHandlerA = new Array(); // AjaxCommonInterface this.fAjaxCommonInterface = new AJAXCommonInterface(); if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.EventSSODataWriteResultAttach( this, this.EventSSODataWriteResult ); } } com.chilibytes.ccl.security.SessionController.prototype.WriteVariable = function( fieldName, value ) { if ( this.fAjaxCommonInterface ) { this.fAjaxCommonInterface.SSOWriteVariable( fieldName, value ); } } com.chilibytes.ccl.security.SessionController.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.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; var AbstractWindowEvents = com.chilibytes.ccl.gui.AbstractWindowEvents; var PageLoader = com.chilibytes.ccl.gui.PageLoader; var JavascriptMetaCacheController = com.chilibytes.ccl.net.web.ajax.JavascriptMetaCacheController; var Menu = com.chilibytes.ccl.gui.menu.Menu; var LanguageSelectFactory = com.chilibytes.ccl.i18n.LanguageSelectFactory; var SessionController = com.chilibytes.ccl.security.SessionController; com.chilibytes.ccl.net.web.HTMLPage = function() { // Constructor this.constructor = com.chilibytes.ccl.net.web.HTMLPage; // Super class AbstractWindowEvents.call( this ); // Class variables this.fJavascriptMetaCache = new JavascriptMetaCacheController.GetInstance(); this.fSessionController = new SessionController(); this.fDefaultPageLoader = null; this.fLanguageSelect = null; } var _cbPageInherit = function() {}; _cbPageInherit.prototype = AbstractWindowEvents.prototype; com.chilibytes.ccl.net.web.HTMLPage.prototype = new _cbPageInherit(); com.chilibytes.ccl.net.web.HTMLPage.prototype.GetSession = function() { return this.fSessionController; } com.chilibytes.ccl.net.web.HTMLPage.prototype.WindowOnLoad = function( eventP ) { if ( this.fJavascriptMetaCache.IsLoaded() ) { this.Initialize(); } else { this.fJavascriptMetaCache.EventLoadedAttach( this, this.Initialize ); this.fJavascriptMetaCache.InitializeCache(); } } com.chilibytes.ccl.net.web.HTMLPage.prototype.Initialize = function() { // Initialize page loader try { var instanceA = this.fJavascriptMetaCache.GetInstancesByClass( "com.chilibytes.ccl.gui.PageLoader" ); if ( instanceA && instanceA.length > 0 ) this.fDefaultPageLoader = instanceA[0]; } catch( exceptionP ) {} // Initialize single sign on this.InitializeSSO(); // Initialize language select this.InitializeLanguageSelect(); } com.chilibytes.ccl.net.web.HTMLPage.prototype.ReloadPage = function( redirectURL ) { if ( this.fDefaultPageLoader ) this.fDefaultPageLoader.SetVisible( true ); if ( redirectURL ) { location.href = redirectURL; } else { location.href = location.href; } } com.chilibytes.ccl.net.web.HTMLPage.prototype.InitializeSSO = function() { // Init sso authentication try { var ssoP = this.fJavascriptMetaCache.GetInstanceByID( PHX_SSO_AUTH_DEFAULT_ID ); if ( ssoP ) { ssoP.EventLoginSuccessAttach( this, this.EventOnSSOLoginSuccess ); ssoP.EventLogoutSuccessAttach( this, this.EventOnSSOLogoutSuccess ); } } catch( e ) { if (console) console.log( e ); } } com.chilibytes.ccl.net.web.HTMLPage.prototype.InitializeLanguageSelect = function() { // try { this.fLanguageSelect = LanguageSelectFactory.CreateInstance(); if ( this.fLanguageSelect ) { this.fLanguageSelect.EventLanguageUpdateSuccessAttach( this, this.ReloadPage ); } } catch ( e ) { if (console) console.log( e ); } } com.chilibytes.ccl.net.web.HTMLPage.prototype.EventOnSSOLoginSuccess = function( eventP, redirectURL ) { this.ReloadPage( redirectURL ); } com.chilibytes.ccl.net.web.HTMLPage.prototype.EventOnSSOLogoutSuccess = function( eventP, redirectURL ) { this.ReloadPage( redirectURL ); } var HTMLPage = new com.chilibytes.ccl.net.web.HTMLPage(); if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.gfx ) com.chilibytes.ccl.net.web.gfx = {}; var GFXUtilities = com.chilibytes.ccl.net.web.gfx.GFXUtilities; var CSSUtilities = com.chilibytes.ccl.net.web.css.CSSUtilities; com.chilibytes.ccl.net.web.gfx.Morphing = function() { // Set construcotr this.constructor = com.chilibytes.ccl.net.web.gfx.Morphing; // Init ie background GFXUtilities.IEBackgroundCacheEnabled( true ); // Internal objects this._objectA = new Array(); // Global this._threadRunning = false; // Scaling properties this._scaleSettings = new Array(); this._scaleSettings["newWidth"] = null; this._scaleSettings["newHeight"] = null; this._scaleSettings["timeStep"] = null; this._scaleSettings["pixelStep"] = null; this._scaleSettings["threadTimeout"] = null; this._scaleSettings["threadLoopCurrentCount"] = 0; this._scaleSettings["threadLoopMaxCount"] = 10000; // Moving properties this._moveSettings = new Array(); this._moveSettings["newLeft"] = null; this._moveSettings["newTop"] = null; this._moveSettings["timeStep"] = null; this._moveSettings["pixelStep"] = null; this._moveSettings["threadTimeout"] = null; this._moveSettings["threadLoopCurrentCount"] = 0; this._moveSettings["threadLoopMaxCount"] = 10000; // Fading this._fadeSettings = new Array(); this._fadeSettings["opacityStart"] = null; this._fadeSettings["opacityEnd"] = null; this._fadeSettings["opacityStep"] = null; this._fadeSettings["timeStep"] = null; this._fadeSettings["duration"] = null; this._fadeSettings["gamma"] = null; this._fadeSettings["displayControl"] = null; this._fadeSettings["threadTimeout"] = null; // Event object var _eventOnOpSuccessA = new Array(); this.EventOnOperationSuccessHandlerAttach = function( parentP, eventFuncP ) { if ( parentP && eventFuncP ) { var objA = new Array(); objA["parent"] = parentP; objA["eventFunc"] = eventFuncP; _eventOnOpSuccessA.push( objA ); } return _eventOnOpSuccessA; } } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.RunningStateGet = function() { return this._threadRunning; } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.ObjectOpacitySet = function( objP, opacity ) { GFXUtilities.ObjectOpacitySet( objP, opacity ); } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.ObjectByIDAdd = function( objectID, adjustWidth, adjustHeight, adjustLeft, adjustTop ) { this.ObjectByReferenceAdd( document.getElementById( objectID ), adjustWidth, adjustHeight, adjustLeft, adjustTop ); } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.ObjectByReferenceAdd = function( objectP, adjustWidth, adjustHeight, adjustLeft, adjustTop ) { if ( !objectP ) { alert( "ERROR Morphing@ObjectAdd: Could not add a null-referenced object" ); } else if ( objectP.id == null || objectP.id == "" ) { alert( "ERROR Morphing@ObjectAdd: Added object has no valid id tag" ); } else { this._objectA[objectP.id] = new Array(); this._objectA[objectP.id]["object"] = objectP; this._objectA[objectP.id]["adjustWidth"] = ( adjustWidth == null ? true : adjustWidth ); this._objectA[objectP.id]["adjustHeight"] = ( adjustHeight == null ? true : adjustHeight ); this._objectA[objectP.id]["adjustLeft"] = ( adjustLeft == null ? true : adjustLeft ); this._objectA[objectP.id]["adjustTop"] = ( adjustTop == null ? true : adjustTop ); } } com.chilibytes.ccl.net.web.gfx.Morphing.prototype._EventOperationSucceeded = function() { var _eventA = this.EventOnOperationSuccessHandlerAttach(); for ( var i in _eventA ) { _eventA[i]["eventFunc"].call( _eventA[i]["parent"] ); } } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.Scale = function( newWidth, newHeight, timeStep, pixelStep ) { this._scaleSettings["newWidth"] = ( newWidth == null ? null : parseInt( newWidth ) ); this._scaleSettings["newHeight"] = ( newHeight == null ? null : parseInt( newHeight ) ); this._scaleSettings["timeStep"] = ( timeStep == null ? 1 : parseInt( timeStep ) ); this._scaleSettings["pixelStep"] = ( pixelStep == null ? 15 : parseInt( pixelStep ) ); this._threadRunning = true; this._scaleSettings["threadLoopCurrentCount"] = 0; this._ScaleThread(); } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.ScaleStop = function() { window.clearTimeout( this._scaleSettings["threadTimeout"] ); this._threadRunning = false; } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.Move = function( newLeft, newTop, timeStep, pixelStep ) { this._moveSettings["newLeft"] = ( newLeft == null ? null : parseInt( newLeft ) ); this._moveSettings["newTop"] = ( newTop == null ? null : parseInt( newTop ) ); this._moveSettings["timeStep"] = ( timeStep == null ? 1 : parseInt( timeStep ) ); this._moveSettings["pixelStep"] = ( pixelStep == null ? 15 : parseInt( pixelStep ) ); this._threadRunning = true; this._moveSettings["threadLoopCurrentCount"] = 0; this._MoveThread(); } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.MoveStop = function() { window.clearTimeout( this._moveSettings["threadTimeout"] ); this._threadRunning = false; } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.Fade = function( opacityStart, opacityEnd, timeStep, duration, gamma, visibleControl, displayControl ) { // Opacity start value this._fadeSettings["opacityStart"] = ( opacityStart = null ? 0 : parseInt( opacityStart ) ); if ( this._fadeSettings["opacityStart"] > 100 ) this._fadeSettings["opacityStart"] = 100; if ( this._fadeSettings["opacityStart"] < 0 ) this._fadeSettings["opacityStart"] = 0; // Opacity end value this._fadeSettings["opacityEnd"] = ( opacityEnd = null ? 100 : parseInt( opacityEnd ) ); if ( this._fadeSettings["opacityEnd"] > 100 ) this._fadeSettings["opacityEnd"] = 100; if ( this._fadeSettings["opacityEnd"] < 0 ) this._fadeSettings["opacityEnd"] = 0; // Opacity current value this._fadeSettings["opacityCurrent"] = this._fadeSettings["opacityStart"]; // Timesteps and other options this._fadeSettings["timeStep"] = ( timeStep == null ? 50 : parseInt( timeStep ) ); this._fadeSettings["duration"] = ( duration == null ? 1000 : parseInt( duration ) ); this._fadeSettings["elapsedTime"] = 0; this._fadeSettings["gamma"] = ( gamma = null ? 1 : parseFloat( gamma ) ); if ( this._fadeSettings["gamma"] > 1000 ) this._fadeSettings["gamma"] = 1000; if ( this._fadeSettings["gamma"] < 0.001 ) this._fadeSettings["gamma"] = 0.001; this._fadeSettings["direction"] = ( this._fadeSettings["opacityStart"] < this._fadeSettings["opacityEnd"] ? "in" : "out" ); this._fadeSettings["displayControl"] = ( displayControl == null ? false : displayControl ); this._fadeSettings["visibleControl"] = ( visibleControl == null ? true : visibleControl ); this._threadRunning = true; this._FadeThread(); } com.chilibytes.ccl.net.web.gfx.Morphing.prototype.FadeStop = function() { window.clearTimeout( this._fadeSettings["threadTimeout"] ); this._threadRunning = false; } com.chilibytes.ccl.net.web.gfx.Morphing.prototype._ObjectPropertiesGet = function( objectP ) { var objPropA = new Array(); if ( objectP != null ) { // Width property (include new width) objPropA["W"] = objectP.offsetWidth; objPropA["nW"] = ( this._scaleSettings["newWidth"] == null ? objPropA["W"] : this._scaleSettings["newWidth"] ); // Height property (include new height) objPropA["H"] = objectP.offsetHeight; objPropA["nH"] = ( this._scaleSettings["newHeight"] == null ? objPropA["H"] : this._scaleSettings["newHeight"] ); // Left property (include new height) objPropA["L"] = objectP.offsetLeft; objPropA["nL"] = ( this._moveSettings["newLeft"] == null ? objPropA["L"] : this._moveSettings["newLeft"] ); // Top property (include new height) objPropA["T"] = objectP.offsetTop; objPropA["nT"] = ( this._moveSettings["newTop"] == null ? objPropA["T"] : this._moveSettings["newTop"] ); // Border properties clockwise (top/right/bottom/left) objPropA["bT"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "border-top-width", "px" ) ); objPropA["bT"] = ( isNaN( objPropA["bT"] ) ? 0 : objPropA["bT"] ); objPropA["bR"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "border-right-width", "px" ) ); objPropA["bR"] = ( isNaN( objPropA["bR"] ) ? 0 : objPropA["bR"] ); objPropA["bB"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "border-bottom-width", "px" ) ); objPropA["bB"] = ( isNaN( objPropA["bB"] ) ? 0 : objPropA["bB"] ); objPropA["bL"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "border-left-width", "px" ) ); objPropA["bL"] = ( isNaN( objPropA["bL"] ) ? 0 : objPropA["bL"] ); // Border properties clockwise (top/right/bottom/left) objPropA["padT"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "padding-top", "px" ) ); objPropA["padT"] = ( isNaN( objPropA["padT"] ) ? 0 : objPropA["padT"] ); objPropA["padR"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "padding-right", "px" ) ); objPropA["padR"] = ( isNaN( objPropA["padR"] ) ? 0 : objPropA["padR"] ); objPropA["padB"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "padding-bottom", "px" ) ); objPropA["padB"] = ( isNaN( objPropA["padB"] ) ? 0 : objPropA["padB"] ); objPropA["padL"] = parseInt( CSSUtilities.CSSAttributeGet( objectP, "padding-left", "px" ) ); objPropA["padL"] = ( isNaN( objPropA["padL"] ) ? 0 : objPropA["padL"] ); } return objPropA; } com.chilibytes.ccl.net.web.gfx.Morphing.prototype._ScaleThread = function() { var self = this; var threadRestart = false; var pixelStep = null; var xOffsetMisc = 0; var yOffsteMisc = 0; if ( this._scaleSettings["threadLoopCurrentCount"] != this._scaleSettings["threadLoopMaxCount"] ) { for ( var objectID in this._objectA ) { if ( this._objectA[objectID]["object"] != null ) { var objPropA = this._ObjectPropertiesGet( this._objectA[objectID]["object"] ); if ( this._objectA[objectID]["adjustWidth"] == true && objPropA["W"] != objPropA["nW"] ) { pixelStep = this._scaleSettings["pixelStep"]; // Shrink object if ( objPropA["W"] > objPropA["nW"] ) { if ( ( objPropA["W"] - pixelStep ) < objPropA["nW"] ) pixelStep = 1; objPropA["W"] = objPropA["W"] - pixelStep; } // Enlarge object else { if ( ( objPropA["W"] + pixelStep ) > objPropA["nW"] ) pixelStep = 1; objPropA["W"] = objPropA["W"] + pixelStep; } xOffsetMisc = ( objPropA["bL"] + objPropA["bR"] + objPropA["padL"] + objPropA["padR"] ); this._objectA[objectID]["object"].style.width = parseInt( objPropA["W"] - xOffsetMisc ) + "px"; // Set flag to restart thread threadRestart = true; } if ( this._objectA[objectID]["adjustHeight"] == true && objPropA["H"] != objPropA["nH"] ) { pixelStep = this._scaleSettings["pixelStep"]; // Shrink object if ( objPropA["H"] > objPropA["nH"] ) { if ( ( objPropA["H"] - pixelStep ) < objPropA["nH"] ) pixelStep = 1; objPropA["H"] = objPropA["H"] - pixelStep; } // Enlarge object else { if ( ( objPropA["H"] + pixelStep ) > objPropA["nH"] ) pixelStep = 1; objPropA["H"] = objPropA["H"] + pixelStep; } yOffsetMisc = ( objPropA["bT"] + objPropA["bB"] + objPropA["padT"] + objPropA["padB"] ); var mergedHeight = parseInt( objPropA["H"] - yOffsetMisc ); if ( mergedHeight >= 0 ) { this._objectA[objectID]["object"].style.height = mergedHeight + "px"; } // Set flag to restart thread threadRestart = true; } } else { alert( "ERROR Morphing@Scaling: Invalid object found" ); } } } // Restart thread to continue scaling, otherwise clear timeout if ( threadRestart == true ) { this._scaleSettings["threadLoopCurrentCount"]++; this._scaleSettings["threadTimeout"] = window.setTimeout( function() { self._ScaleThread(); }, this._scaleSettings["timeStep"] ); } else { window.clearTimeout( this._scaleSettings["threadTimeout"] ); this._EventOperationSucceeded(); this._threadRunning = false; } } com.chilibytes.ccl.net.web.gfx.Morphing.prototype._MoveThread = function() { var self = this; var threadRestart = false; var pixelStep = null; if ( this._moveSettings["threadLoopCurrentCount"] != this._moveSettings["threadLoopMaxCount"] ) { for ( var objectID in this._objectA ) { if ( this._objectA[objectID]["object"] != null ) { var objPropA = this._ObjectPropertiesGet( this._objectA[objectID]["object"] ); if ( this._objectA[objectID]["adjustLeft"] == true && objPropA["L"] != objPropA["nL"] ) { pixelStep = this._moveSettings["pixelStep"]; // Move object if ( objPropA["L"] > objPropA["nL"] ) { if ( ( objPropA["L"] - pixelStep ) < objPropA["nL"] ) pixelStep = 1; objPropA["L"] = objPropA["L"] - pixelStep; } // Enlarge object else { if ( ( objPropA["L"] + pixelStep ) > objPropA["nL"] ) pixelStep = 1; objPropA["L"] = objPropA["L"] + pixelStep; } this._objectA[objectID]["object"].style.left = parseInt( objPropA["L"] ) + "px"; // Set flag to restart thread threadRestart = true; } if ( this._objectA[objectID]["adjustTop"] == true && objPropA["T"] != objPropA["nT"] ) { pixelStep = this._moveSettings["pixelStep"]; // Shrink object if ( objPropA["T"] > objPropA["nT"] ) { if ( ( objPropA["T"] - pixelStep ) < objPropA["nT"] ) pixelStep = 1; objPropA["T"] = objPropA["T"] - pixelStep; } // Enlarge object else { if ( ( objPropA["T"] + pixelStep ) > objPropA["nT"] ) pixelStep = 1; objPropA["T"] = objPropA["T"] + pixelStep; } this._objectA[objectID]["object"].style.top = parseInt( objPropA["T"] ) + "px"; // Set flag to restart thread threadRestart = true; } } else { alert( "ERROR Morphing@Moving: Invalid object found" ); } } } // Restart thread to continue scaling, otherwise clear timeout if ( threadRestart == true ) { this._moveSettings["threadLoopCurrentCount"]++; this._moveSettings["threadTimeout"] = window.setTimeout( function() { self._MoveThread(); }, this._moveSettings["timeStep"] ); } else { window.clearTimeout( this._moveSettings["threadTimeout"] ); this._EventOperationSucceeded(); this._threadRunning = false; } } com.chilibytes.ccl.net.web.gfx.Morphing.prototype._FadeThread = function() { var self = this; var threadRestart = false; var elapsedTime = this._fadeSettings["elapsedTime"]; var gamma = this._fadeSettings["gamma"]; var duration = this._fadeSettings["duration"]; var visState = "visible"; var disState = "block"; for ( objectID in this._objectA ) { if ( this._objectA[objectID]["object"] != null ) { // On unloaded images, restart thread immediately if ( this._objectA[objectID]["object"].tagName == "IMG" && !this._objectA[objectID]["object"].complete ) { threadRestart = true; } else if ( elapsedTime < duration ) { if ( this._fadeSettings["direction"] == "in" ) { opacityValue = 100 * Math.pow( elapsedTime / duration, 1 / gamma ); } else if ( this._fadeSettings["direction"] == "out" ) { opacityValue = 100 - 100 * Math.pow( elapsedTime / duration, 1 / gamma ); } if ( elapsedTime + this._fadeSettings["timeStep"] >= duration ) opacityValue = this._fadeSettings["opacityEnd"]; // Visibility/Display control if ( this._fadeSettings["opacityStart"] == 0 ) { if ( this._fadeSettings["visibleControl"] ) this._objectA[objectID]["object"].style.visibility = visState; if ( this._fadeSettings["displayControl"] ) this._objectA[objectID]["object"].style.display = disState; } GFXUtilities.ObjectOpacitySet( this._objectA[objectID]["object"], opacityValue ); threadRestart = true; } } } // Restart thread to continue fading, otherwise clear timeout if ( threadRestart == true ) { this._fadeSettings["threadTimeout"] = window.setTimeout( function() { self._FadeThread(); }, this._fadeSettings["timeStep"] ); this._fadeSettings["elapsedTime"] += this._fadeSettings["timeStep"]; } else { window.clearTimeout( this._fadeSettings["threadTimeout"] ); if ( this._fadeSettings["opacityEnd"] == 0 ) visState = "hidden"; if ( this._fadeSettings["visibleControl"] ) this._objectA[objectID]["object"].style.visibility = visState; if ( this._fadeSettings["displayControl"] ) this._objectA[objectID]["object"].style.display = disState; this._EventOperationSucceeded(); this._threadRunning = false; } } if ( !window.com ) window.com = {}; if ( !com.chilibytes ) com.chilibytes = {}; if ( !com.chilibytes.ccl ) com.chilibytes.ccl = {}; if ( !com.chilibytes.ccl.net ) com.chilibytes.ccl.net = {}; if ( !com.chilibytes.ccl.net.web ) com.chilibytes.ccl.net.web = {}; if ( !com.chilibytes.ccl.net.web.gfx ) com.chilibytes.ccl.net.web.gfx = {}; var Morphing = com.chilibytes.ccl.net.web.gfx.Morphing; var GFXUtilities = com.chilibytes.ccl.net.web.gfx.GFXUtilities; com.chilibytes.ccl.net.web.gfx.Slideshow = function() { this.constructor = com.chilibytes.ccl.net.web.gfx.Slideshow; // Class variables this._imageSrcA = new Array(); this._nextIX = null; this._morphP = new Morphing(); this._morphXFadingP = null; this._imgTagFrontObj = null; this._imgTagBackObj = null; this._timeoutP = null; this._timeStep = 40; this._loadTimeoutP = null; this._frontVisible = true; this._reloadDelay = null; this._imageDelay = null; } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype.VisibleSet = function( visible ) { } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype.SetFadingTimeStep = function( step ) { this._timeStep = step; } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype.SetFadingGamma = function( gamma ) { this._gamma = gamma; } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype.SetFadingDuration = function( duration ) { this._duration = duration; } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype.ImageAdd = function( imageSource ) { this._imageSrcA.push( imageSource ); } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype.Start = function( initialDelay, imageDelay, imageFrontID, imageBackID ) { var self = this; // Init with index 1 to use the next image this._nextIX = 1; this._frontVisible = true; this._imageDelay = imageDelay; this._imgTagFrontObj = document.getElementById( imageFrontID ); this._imgTagBackObj = document.getElementById( imageBackID ); // Only morph the front to opacity 0 or 100 this._morphP.ObjectByReferenceAdd( this._imgTagFrontObj ); this._morphP.EventOnOperationSuccessHandlerAttach( this, this.EventOnFadingSucceeded ); this._ImageSourceUpdate( imageFrontID, this._imageSrcA[0] ); if ( this._imageSrcA.length > 1 ) { GFXUtilities.ObjectVisibilitySet( this._imgTagBackObj, true, true ); this._ImageSourceUpdate( imageBackID, this._imageSrcA[this._nextIX] ); this._timeoutP = window.setTimeout( function() { self._SlideShowThread(); }, initialDelay ); } } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype.EventOnFadingSucceeded = function() { var self = this; window.clearTimeout( this._timeoutP ); this._timeoutP = window.setTimeout( function() { self._SlideShowThread(); }, this._reloadDelay ); } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype._SlideShowThread = function() { this._reloadDelay = this._imageDelay; var imgHiddenObj = ( this._frontVisible ? this._imgTagBackObj : this._imgTagFrontObj ); var imgVisibleObj = ( this._frontVisible ? this._imgTagFrontObj : this._imgTagBackObj ); if ( this._imgTagFrontObj != null && this._imgTagBackObj != null ) { if ( imgHiddenObj.complete ) { this._morphP.Fade( ( this._frontVisible ? 100 : 0 ), ( this._frontVisible ? 0 : 100 ), this._timeStep, this._duration, this._gamma ); this._nextIX++; if ( this._nextIX >= this._imageSrcA.length ) this._nextIX = 0; this._ImageSourceUpdate( imgVisibleObj.id, this._imageSrcA[this._nextIX] ); this._frontVisible = !this._frontVisible; } else { this._reloadDelay = 2; this.EventOnFadingSucceeded(); } } } com.chilibytes.ccl.net.web.gfx.Slideshow.prototype._ImageSourceUpdate = function( imageObjID, newSource ) { var self = this; if ( !this._morphP.RunningStateGet() ) { var imageObj = document.getElementById( imageObjID ); if ( imageObj ) imageObj.src = newSource; window.clearTimeout( this._loadTimeoutP ); } else { this._loadTimeoutP = window.setTimeout( function() { self._ImageSourceUpdate( imageObjID, newSource ); }, 1 ); } }