/* Copyright © 1998, 2012, Oracle and/or its affiliates.  All rights reserved. */
/* Version 11.1.0.0 */

function ArgumentError(message){this.name="ArgumentError";this.message=message;this.toString=function(){return this.message}}function ApplicationError(message){this.name="ApplicationError";this.message=message;this.toString=function(){return this.message}}var Fail=function(source,message1,message2,droppedFrames){var body="Failed: "+message1+(message2!=null?", "+message2:"");var message=source+" "+body;throw new ApplicationError(message);};
Fail.NotImplemented=function(source){Fail(source,"Not implemented.",null,2)};Fail.Exception=function(source,xe){Fail(source,"Exception: "+xe.message,null,2)};function _ExtendDeepObj(target,key,obj){if(targetObj===obj)return;var targetObj=target[key];if(!IsHash(targetObj))target[key]=targetObj={};for(var objKey in obj){var value=obj[objKey];if(IsHash(value))_ExtendDeepObj(targetObj,objKey,value);else targetObj[objKey]=value}}
function _ExtendDeepList(target,objs){if(target==void 0||!IsHash(target))target={};for(var i=0,n=objs.length,obj;i<n;++i)if(IsHash(obj=objs[i])&&target!==obj)for(var key in obj){var value=obj[key];if(IsHash(value))_ExtendDeepObj(target,key,value);else target[key]=value}return target}function _ExtendFlatList(target,objs){if(target==void 0||!IsHash(target))target={};for(var i=0,n=objs.length,obj;i<n;++i)if(IsHash(obj=objs[i])&&target!==obj)for(var key in obj)target[key]=obj[key];return target}
function Extend(deep){if(deep!==!!deep)return _ExtendFlatList(arguments[0],[].slice.call(arguments,1));if(deep)return _ExtendDeepList(arguments[1],[].slice.call(arguments,2));return _ExtendFlatList(arguments[1],[].slice.call(arguments,2))}function CloneObject(obj){return Extend(true,{},obj)}function CloneHash(obj){var result={};for(var m in obj)result[m]=obj[m];return result}function GetValue(obj,member,def){return typeof obj[member]=="undefined"?def:obj[member]}
function GetNonEmpty(value,def){return value&&value.length?value:def}function RandomInteger(min,max){return min+Math.floor(Math.random()*(max-min+1))}function RandomIndex(length){return Math.floor(Math.random()*length)}function InRange(value,min,max){return value>=min&&value<=max}
function ExtendClass(base){var proto={BaseClass:base};for(var key in base)proto[key]=base[key];for(var i=1,n=arguments.length;i<n;++i){var arg_i=arguments[i];for(var key_i in arg_i)proto[key_i]=arg_i[key_i]}return proto}var EcidSearch={All:1,AnyPart:2,WithOrWithoutPrefix:3,WithoutPrefix:4};
var ContextPart={CreateValue:function(name,caption,useNameAsPrefix,searchable,multiPart){return[name,caption,useNameAsPrefix==void 0?true:useNameAsPrefix,searchable==void 0?true:searchable,multiPart==void 0?false:multiPart]},CreateMeta:function(name){return["MC."+name,name,false,false,false]},HasMultipleParts:function(contextPart){return!!contextPart[4]}};
var HashMap={FromArray:function(arrayObj,value){if(value==void 0)value=true;var map={};for(var i=0,n=arrayObj.length;i<n;++i)map[arrayObj[i]]=value;return map},AddNewItem:function(hashObj,key,value){var doesntExists=hashObj[key]===void 0;if(doesntExists)hashObj[key]=value;return doesntExists},Extend:function(hashObj,source){for(var key in source)hashObj[key]=source[key];return hashObj},AddNewItems:function(hashObj,source){for(var key in source)if(hashObj[key]===void 0)hashObj[key]=source[key]},GetKeys:function(hashObj){var keys=
[];for(var key in hashObj)keys.push(key);return keys},FromKeys:function(hashObj,value){if(value==void 0)value=true;var map={};for(var key in hashObj)map[key]=value;return map},Equals:function(hashObj1,hashObj2){if(hashObj1==null)return hashObj2==null;else if(hashObj2==null)return false;var count=0;var m;for(m in hashObj1)++count;for(m in hashObj2){--count;if(hashObj1[m]!=hashObj2[m])return false}return count==0},FindMembers:function(hashObj,memberNames,neededCount){if(neededCount==void 0)neededCount=
memberNames.length;for(var i=0,n=memberNames.length;i<n;++i)if(typeof hashObj[memberNames[i]]!="undefined")if(--neededCount==0)return true;return false}};var Escape={};Escape.SafeUri_EscapeCharacter="/";Escape.SafeUri_UnsafeCharacters=["<",">",'"',"'","%",";","(",")","&","+"];Escape.SafeUriEscape=function(s){return Escape.__Escape(s,1)};Escape.SafeUriUnEscape=function(s){return Escape.__UnEscape(s,1)};Escape.MyEscape=function(s){return Escape.__Escape(s,0)};
Escape.MyUnEscape=function(s){return Escape.__UnEscape(s,0)};Escape.__Escape=function(s,safe){var snew="";for(var i=0;i<s.length;i++){ss=s.substr(i,1);if(safe==0?Escape.__Normal_Contains(ss):!Escape.__SafeUri_Contains(ss))snew+=ss;else{ss=s.charCodeAt(i);a="0000"+ss.toString(16).toUpperCase();snew+=(safe==0?"$":Escape.SafeUri_EscapeCharacter)+a.substr(a.length-4)}}return snew};
Escape.__UnEscape=function(s,safe){var snew="";var bEscape=false;for(var i=0;i<s.length;i++)if(bEscape){ss=s.substr(i,4);snew+=String.fromCharCode(parseInt("0x"+ss));i+=3;bEscape=false}else{ss=s.substr(i,1);if(ss==(safe==0?"$":Escape.SafeUri_EscapeCharacter))bEscape=true;else snew+=ss}return snew};Escape.__Normal_Contains=function(s){return s>="0"&&s<="9"||s>="a"&&s<="z"||s>="A"&&s<="Z"};
Escape.__SafeUri_Contains=function(s){var l=Escape.SafeUri_UnsafeCharacters.length;for(var i=0;i<l;i++)if(s==Escape.SafeUri_UnsafeCharacters[i])return true;if(s==Escape.SafeUri_EscapeCharacter)return true;return false};function UrlParser(){this.params=new Array;this.safemode=false}UrlParser.prototype.Clone=function(){var url=new UrlParser;url.params=new Array;url.safemode=this.safemode;for(var k in this.params){var v=this.params[k];if(v==null)continue;url.params[k]=this.params[k]}return url};
UrlParser.prototype.Parse=function(){var strArgs;var strArg;var ss=document.location.hash.substring(1);strArgs=ss.split("&");if(strArgs.length==0||strArgs[0]==""){ss=document.location.search.substring(1);strArgs=ss.split("&")}if(strArgs.length>0)if(strArgs[0].toLowerCase().substr(0,3)=="su="){this.safemode=true;strArgs=strArgs[0].substr(3);strArgs=Escape.SafeUriUnEscape(strArgs);strArgs=strArgs.split("&")}for(var i=0;i<strArgs.length;i++){strArg=strArgs[i];if(strArg.length==0)continue;var param=strArg.split("=");
if(param.length==2)this.params[param[0].toLowerCase()]=param[1];else this.params[param[0].toLowerCase()]=""}};UrlParser.prototype.GetSafeMode=function(){return this.safemode};UrlParser.prototype.SetSafeMode=function(k){this.safemode=k};UrlParser.prototype.GetParameter=function(s){return this.params[s.toLowerCase()]};UrlParser.prototype.AddParameter=function(s,v){this.params[s.toLowerCase()]=v};UrlParser.prototype.RemoveParameter=function(s){this.params[s.toLowerCase()]=null};
UrlParser.prototype.ClearParameterList=function(s){this.params=null;this.params=new Array};UrlParser.prototype.BuildParameterList=function(s){var s="";var first=true;for(var k in this.params){var v=this.params[k];if(v==null)continue;if(first==false)s+="&";first=false;if(v.length==0)s+=k;else s+=k+"="+this.params[k]}if(this.safemode)s="su="+Escape.MyEscape(s);return s};
UrlParser.prototype.GetCorrectUrl=function(url){if(!this.safemode)return url;var strArgs;var k=url.indexOf("#");if(k==-1)k=url.indexOf("?");if(k>=0){var paramss=url.substring(k+1);strArgs=paramss.split("&");if(strArgs[0].toLowerCase().substr(0,3)=="su=")return url;var ss=url.substring(0,k+1)+"su="+Escape.SafeUriEscape(paramss);return ss}else return url+"?su="};var SearchExpressionNode={Or:0,And:1,Value:2,ValueStar:3};
var _SearchExpression={CreateToken:function(application,node){return"'"+application+"$"+Escape.MyEscape(node)+"'"},CreateTokenStar:function(application,node,prefixLen){return _SearchExpression.CreateToken(application,node)+(application.length+1+prefixLen)},GetUniqueTokens:function(application,nodes){var hash={};var tokens=[];for(var i=1,n=nodes.length;i<n;++i){var token=_SearchExpression.ToString(application,nodes[i]);if(HashMap.AddNewItem(hash,token,true))tokens.push(token)}return tokens},JoinUniqueNodes:function(application,
nodes,operator,isRoot){var tokens=_SearchExpression.GetUniqueTokens(application,nodes);if(tokens.length>1){var token=tokens.join(operator);return isRoot?token:"("+token+")"}return tokens[0]},ToStringMap:[function(application,nodes,isRoot){return _SearchExpression.JoinUniqueNodes(application,nodes,"-",isRoot)},function(application,nodes,isRoot){return _SearchExpression.JoinUniqueNodes(application,nodes,"+",isRoot)},function(application,nodes){return _SearchExpression.CreateToken(application,nodes[1])},
function(application,nodes){return _SearchExpression.CreateTokenStar(application,nodes[1],nodes[2])}],ToString:function(application,nodes,isRoot){return _SearchExpression.ToStringMap[nodes[0]](application,nodes,isRoot)},TransformTree:function(application,node){var nodeType=node[0];if(nodeType==SearchExpressionNode.ValueStar){var value=node[1];var prefixLen=node[2];if(value.substr(prefixLen)=="*")node=[SearchExpressionNode.Value,value];else node=[SearchExpressionNode.Or,[SearchExpressionNode.Value,
value],[SearchExpressionNode.Value,value.substr(0,prefixLen)+"*"]];nodeType=node[0]}if(nodeType==SearchExpressionNode.Value){var token=Escape.MyEscape(node[1]);return["'"+token+"'",[SearchExpressionNode.Value,application+"$"+token]]}var resultNode=[node[0]];var resultKeys=[];var uniqueKeys={};function addItem(compiledObject){var key=compiledObject[0];if(!uniqueKeys[key]){uniqueKeys[key]=true;resultKeys.push(key);resultNode.push(compiledObject)}}for(var i=1;i<node.length;++i){var compiledObject=_SearchExpression.TransformTree(application,
node[i]);var compiledNode=compiledObject[1];if(compiledNode[0]==nodeType)for(var j=1;j<compiledNode.length;++j)addItem(compiledNode[j]);else addItem(compiledObject)}if(resultNode.length==2)return resultNode[1];var operator=nodeType==SearchExpressionNode.Or?"-":"+";return[resultKeys.join(operator),resultNode]},RemoveTreeLabels:function(labelledTree){var node=labelledTree[1];if(node[0]!=SearchExpressionNode.Value)for(var i=1;i<node.length;++i)node[i]=_SearchExpression.RemoveTreeLabels(node[i]);return node}};
var SearchExpression={CreateTree:function(application,searchExp){var labelledTree=_SearchExpression.TransformTree(application,searchExp);return _SearchExpression.RemoveTreeLabels(labelledTree)},ToString:function(application,searchExp){return _SearchExpression.ToString(application,searchExp,true)}};function SearchExpressionBuilder(nodeType){this.List=[nodeType!=null?nodeType:SearchExpressionNode.Or]}
SearchExpressionBuilder.prototype={AddValue:function(value){this.List.push([SearchExpressionNode.Value,value])},AddPart:function(part){this.List.push([SearchExpressionNode.Value,part[0]+part[1]])},AddPartStar:function(part){if(part[1]=="*")this.AddPart(part);else this.List.push([SearchExpressionNode.ValueStar,part[0]+part[1],part[0].length])},AddPartValue:function(part){this.List.push([SearchExpressionNode.Value,part[1]])},AddParts:function(parts){if(parts.length){var list=[SearchExpressionNode.And];
for(var i=0,n=parts.length;i<n;++i)list.push([SearchExpressionNode.Value,parts[i][0]+parts[i][1]]);this.List.push(list.length==2?list[1]:list)}},AddPartsValue:function(parts){if(parts.length){var list=[SearchExpressionNode.And];for(var i=0,n=parts.length;i<n;++i)list.push([SearchExpressionNode.Value,parts[i][1]]);this.List.push(list.length==2?list[1]:list)}},AddOptionalParts:function(parts){for(var i=0,n=parts.length;i<n;++i)this.List.push([SearchExpressionNode.Value,parts[i][0]+parts[i][1]])},ToObject:function(){return this.List.length>
1?this.List:null}};function SearchExpressionBuilder_Add_MA(searchExp,appNsName){if(!searchExp)return null;if(searchExp.length==2&&(searchExp[0]==SearchExpressionNode.And||searchExp[0]==SearchExpressionNode.Or))searchExp=searchExp[1];var newExpr=[SearchExpressionNode.Value,"MA"+appNsName];if(searchExp[0]==SearchExpressionNode.And)searchExp.push(newExpr);else searchExp=[SearchExpressionNode.And,searchExp,newExpr];return searchExp}var ContextType={NoContext:0,Absolute:1,TopRelative:2,SmartMatch:3};
function PartDescriptor(name,caption,useNameAsPrefix,searchable,multiPart){this.Name=name;this.Caption=caption;this.UseNameAsPrefix=useNameAsPrefix;this.Searchable=searchable;this.MultiPart=multiPart}PartDescriptor.Create=function(part){return new PartDescriptor(part[0],part[1],part[2],part[3],part[4])};function ArrayPad(a,obj,count){while(a.length<count)a.push(obj);return a}function ArrayClone(obj){return[].concat(obj)}
function ArrayIndexOf(a,item,i){i=i||0;var l=a.length;if(i<0)i=l+i;for(;i<l;i++)if(a[i]==item)return i;return-1}
var Url={DecodeLocationSearch:function(searchStr,caseInsensitive){if(searchStr.length==0)return{};return Url.DecodeQuery(searchStr.substring(1),caseInsensitive)},DecodeLocationSearchTokens:function(searchStr){if(searchStr.length==0)return[];return Url.DecodeQueryTokens(searchStr.substring(1))},DecodeQuery:function(queryStr,caseInsensitive){var query={};var tokens=queryStr.split("&");var name;for(var i=0,n=tokens.length;i<n;++i){var token=tokens[i];var eqPos=token.indexOf("=");if(eqPos==-1){name=decodeURIComponent(token);
query[caseInsensitive?name.toLowerCase():name]=""}else{name=decodeURIComponent(token.substr(0,eqPos));query[caseInsensitive?name.toLowerCase():name]=decodeURIComponent(token.substr(eqPos+1))}}return query},DecodeQueryTokens:function(queryStr){var tokens=queryStr.split("&");for(var i=0,n=tokens.length;i<n;++i)tokens[i]=decodeURIComponent(tokens[i]);return tokens},ReplaceLocationHash:function(location,hash){var href=location.href;return href.substr(0,href.length-location.hash.length)+"#n"}};
function Trim(str){return str.replace(/^\s+|\s+$/g,"")}function FindSubString(sPattern,sString,sEnd){var sResult="";if(sString.length==0||sPattern.length==0)return sResult;sString.toLowerCase();sPattern.toLowerCase();var l=sString.length;var ll=sPattern.length;var i=sString.indexOf(sPattern);var j=0;if(i!=-1){if(sEnd.length>0){sEnd.toLowerCase();j=sString.indexOf(sEnd,i);if(j==-1)j=l}else j=l;if(j!=-1)sResult=sString.substr(i+ll,j-i-ll)}sResult.toUpperCase();return sResult}
function NameOf(name){return name!=null?'"'+name+'"':"(null)"}function TypeOf(value){if(value==null)return value===void 0?"undefined":"null";var type=typeof value;if(IsArray(value))return"object Array";if(type!="object"||value.constructor==null)return type;var result=/function\s+([^\(]*)\(/.exec(value.constructor.toString());return type+(result&&result.length>1&&result[1].length>0?" "+result[1]:"")}function IsNullOrString(obj){return obj==null||typeof obj=="string"||obj instanceof String}
function IsNullOrNumber(obj){return obj==null||typeof obj=="number"||obj instanceof Number}function IsNullOrBoolean(obj){return obj==null||typeof obj=="boolean"||obj instanceof Boolean}function IsNullOrRegExp(obj){return obj==null||obj instanceof RegExp}function IsNullOrArray(obj){return obj==null||IsArray(obj)}function IsNullOrInstanceOf(obj,type){return obj==null||obj instanceof type}function IsUndefined(obj){return typeof obj=="undefined"}
function IsString(obj){return typeof obj=="string"||typeof obj=="object"&&obj.constructor===String}function IsNumber(obj){return typeof obj=="number"||typeof obj=="object"&&obj.constructor===Number}function IsBoolean(obj){return typeof obj=="boolean"||typeof obj=="object"&&obj.constructor===Boolean}function IsArray(obj){return typeof obj=="object"&&obj.join!=void 0&&obj.push!=void 0&&obj.length!=void 0}function IsFunction(obj){return typeof obj=="function"||obj!=null&&obj.constructor===Function}
function IsObject(obj){return(typeof obj=="object"||IsFunction(obj))&&obj!=null}function IsInstanceOf(obj,type){return obj instanceof type}function IsHash(obj){return obj!=null&&typeof obj=="object"&&obj.constructor!==String&&obj.constructor!==Number&&obj.constructor!==Boolean&&obj.constructor!==Array&&obj.constructor!==Date}function IsEmpty(obj){return!obj||!obj.length}function IsIE(){return navigator.appName=="Microsoft Internet Explorer"}function IsFF(){return navigator.appName=="Netscape"}
function ForceEval(obj){if(IsIE())if(IsObject(obj)&&IsFunction(obj.eval))if(IsObject(obj.execScript))obj.execScript("null")}function IE_ConvertVBArrayToArray(obj){return obj==null?null:obj["toArray"]()}var _BrowserType={NotDetected:-1,MicrosoftInternetExplorer:0,MozillaFirefox:1,GoogleChrome:2};
var _Browser={Type:_BrowserType.NotDetected,Version:void 0,IE:void 0,FF:void 0,CR:void 0,GetVersionFn:[function(){var agent=navigator.userAgent;var tokenBegin=agent.indexOf("MSIE ");if(tokenBegin!=-1){tokenBegin+=5;var tokenEnd=agent.indexOf(";",tokenBegin);if(tokenEnd!=-1)return Number(agent.substr(tokenBegin,tokenEnd-tokenBegin))}return-1},null,null]};
var Browser={IsIE:function(){if(_Browser.IE!==void 0)return _Browser.IE;if(!!(_Browser.IE=navigator.userAgent.indexOf("MSIE ")!=-1)){_Browser.Type=_BrowserType.MicrosoftInternetExplorer;return true}return false},IsFF:function(){if(_Browser.FF!==void 0)return _Browser.FF;if(!!(_Browser.FF=navigator.userAgent.indexOf("Firefox")!=-1)){_Browser.Type=_BrowserType.MozillaFirefox;return true}},GetVersion:function(){if(_Browser.Version!==void 0)return _Browser.Version;var getVersionFn=_Browser.GetVersionFn[_Browser.Type];
var version=getVersionFn&&getVersionFn()||-1;_Browser.Version=version;return version}};var Time={GetCurrent:function(){return(new Date).getTime()},GetElapsedMs:function(startTime){return(new Date).getTime()-startTime}};function GetElementsByTagName(win,tag){var retValue=win.document.getElementsByTagName(tag);return retValue}
function GetElementsByAttribute(win,attr,value){var ret=[];var all=win.document.getElementsByTagName("*");for(var j=0,jlength=all.length;j<jlength;j++)if(all[j].getAttribute(attr)==value)ret.push(all[j]);return ret}function GetComments(win){var coll=[];var doc=win.document;_GetElementsByNodeType(doc,coll,8);return coll}
function _GetElementsByNodeType(node,coll,type){if(node.nodeType==type)coll.push(node);if(node.hasChildNodes()){var children=node.childNodes;for(var i=0,ilength=children.length;i<ilength;i++)_GetElementsByNodeType(children[i],coll,type)}}
function MatchStyleSheetNames(win,styles,match,fullmatch){try{var _fullmatch=IsBoolean(fullmatch)?fullmatch:true;var styleelements=GetElementsByTagName(win,"link");var _match=0;for(var i=0,ilength=styleelements.length;i<ilength;i++){var _text=styleelements[i].href;if(_text!=""){var _regexp=new RegExp(".*[/|\\\\]([^/|\\\\]*)\\.[css|jsp]");var _result=_text.match(_regexp);if(_result!=null&&_result.length>1)if(_result[1]!=null&&_result[1].length>0)for(var j=0,jlength=styles.length;j<jlength;j++)if(!_fullmatch){var k=
_result[1].indexOf(styles[j]);if(k>-1)_match++}else if(_result[1]==styles[j])_match++}}if(_match>=match)return true}catch(e){throw e;}return false}
function MatchScriptNames(win,scripts,match,fullmatch){try{var _fullmatch=IsBoolean(fullmatch)?fullmatch:true;var scriptelements=GetElementsByTagName(win,"script");var _match=0;for(var i=0,ilength=scriptelements.length;i<ilength;i++){var _text=scriptelements[i].src;if(_text!=""){var _regexp=new RegExp(".*[/|\\\\]([^/|\\\\]*)\\.js");var _result=_text.match(_regexp);if(_result!=null&&_result.length>1)if(_result[1]!=null&&_result[1].length>0)for(var j=0,jlength=scripts.length;j<jlength;j++)if(!_fullmatch){var k=
_result[1].indexOf(scripts[j]);if(k>-1)_match++}else if(_result[1]==scripts[j])_match++}}if(_match>=match)return true}catch(e){throw e;}return false}function MatchVariables(win,variables,match){var _match=0;for(var i=0;i<variables.length;i++)if(typeof win[variables[i]]!="undefined")_match++;if(_match>=match)return true;return false}function MatchWindowNames(win,windownames){for(var i=0,ilength=windownames.length;i<ilength;i++)if(win.name.indexOf(windownames[i])>-1)return true;return false}
function MatchImageNames(win,images,match){var imageelements=GetElementsByTagName(win,"img");var _match=0;for(var i=0,ilength=imageelements.length;i<ilength;i++){var _text=imageelements[i].src;if(_text!=""&&_text.substr(0,5)!="data:"){var _regexp=new RegExp(".*[/|\\\\]([^/|\\\\]*)\\.gif");var _result=_text.match(_regexp);if(_result!=null&&_result.length>1)if(_result[1]!=null&&_result[1].length>0)for(var j=0,jlength=images.length;j<jlength;j++)if(_result[1]==images[j])_match++}}if(_match>=match)return true;
return false}function FindFrameByName(winArray,name){var t=winArray;if(typeof t=="undefined"||t.length==0)return null;for(var i=0;i<t.length;i++)if(typeof t[i].name=="string"&&t[i].name==name)return t[i].document;return null}
function _MatchWindowNames(winArray,windownames,match){var t=winArray;var _match=0;if(typeof t=="undefined"||t.length==0)return false;for(var i=0;i<t.length;i++)for(var j=0;j<windownames.length;j++)if(typeof t[i].name=="string"&&t[i].name==windownames[j])_match++;if(_match>=match)return true;return false}
function GetFrames(coll,win){if((typeof coll).toLowerCase()=="object"){if((typeof win).toLowerCase()=="object");var _win=window.top;if(typeof top!="undefined"){if(top==false)_win=win;if(top==true)_win=win.top}GetSubFrames(coll,_win)}}function GetSubFrames(coll,win){if((typeof coll).toLowerCase()=="object")if((typeof win).toLowerCase()=="object"){coll.push(win);var l=win.length;for(var i=0;i<l;i++)GetSubFrames(coll,win.frames[i])}}
function GetParentWindow(_document){return _document.parentWindow?_document.parentWindow:_document.defaultView}function GetInnerText(_object){return _object.innerText?_object.innerText:_object.textContent?_object.textContent:""}function GetInnerText2(_object){if(_object.firstChild)return _object.firstChild.nodeValue;return""}
function IsHiddenFrame(_window){var bhidden=false;var l=0,r=0,t=0,b=0;try{var pcanvas=null;var mode=_window.document.compatMode;if(mode=="CSS1Compat")pcanvas=_window.document.documentElement;else pcanvas=_window.document.body;if(pcanvas!=null){l=pcanvas.offsetLeft;r=pcanvas.offsetLeft+pcanvas.offsetWidth;t=pcanvas.offsetTop;b=pcanvas.offsetTop+pcanvas.offsetHeight}}catch(e){bhidden=true}if(r*b==0)bhidden=true;return bhidden}
function GetPosition(cell){var ret=0;while(cell){ret++;var temp=cell;temp=cell.previousSibling;cell=temp}return ret}function GetXthSiblingFromChild(pos,header){var ret=null;var i=1;if(header){var child=header.firstChild;if(child)ret=child;while(child&&i<pos){var temp=child.nextSibling;if(temp)i++;child=temp;if(child)ret=child}}return ret}
var Dom={CreateElementWithName:function(doc,tagName,name){var node=doc.createElement(tagName);node.name=name;return node},GetElementById:function(node,id){return node.getElementById(id)},GetElementsByTagName:function(node,tagName){return node.getElementsByTagName(tagName)},GetElementByTagAndClassName:function(node,tagName,className){if(node.getElementsByClassName){var anyTag=tagName=="*";var elements=node.getElementsByClassName(className);for(var i=0,n=elements.length;i<n;++i)if(anyTag||elements.item(i).tagName==
tagName)return elements.item(i)}else{var elements=node.getElementsByTagName(tagName);for(var i=0,n=elements.length;i<n;++i)if(elements.item(i).className==className)return elements.item(i)}return null},IncludeScript:function(doc,src,onReady,timeoutMs){var head=doc.getElementsByTagName("head")[0];var script=doc.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",src);if(onReady){var completed=false;function OnCompleted(result){if(!completed){completed=true;
setTimeout(function(){onReady(result)},100)}}function OnSuccess(){OnCompleted(true)}function OnFailed(){OnCompleted(false)}if(Browser.IsIE())script.onreadystatechange=function(){var readyState=script.readyState;if(readyState=="complete"||readyState=="loaded")OnSuccess()};else script.onload=OnSuccess;if(timeoutMs)setTimeout(OnFailed,timeoutMs)}head.appendChild(script)},MatchElementsAttribute:function(node,tagName,attributeName,values,requiredCount){var hash=HashMap.FromArray(values,true);var matchHash=
{};var matchCount=0;var elements=node.getElementsByTagName(tagName);for(var i=0,n=elements.length;i<n;++i){var value=elements.item(i).getAttribute(attributeName);if(hash[value]&&!matchHash[value]){matchHash[value]=true;++matchCount;if(matchCount>=requiredCount)return true}}return false},MatchElementsMember:function(node,tagName,memberName,values,requiredCount){var hash=HashMap.FromArray(values,true);var matchHash={};var matchCount=0;var elements=node.getElementsByTagName(tagName);for(var i=0,n=elements.length;i<
n;++i){var value=elements.item(i)[memberName];if(hash[value]&&!matchHash[value]){matchHash[value]=true;++matchCount;if(matchCount>=requiredCount)return true}}return false},MatchElementsName:function(node,tagName,values,requiredCount){return Dom.MatchElementsMember(node,tagName,"name",values,requiredCount)},MatchElementsClassName:function(node,tagName,values,requiredCount){return Dom.MatchElementsMember(node,tagName,"className",values,requiredCount)}};function Window(win){this.Native=win}
Window.Unwrap=function(win){return win};Window.TryCall=function(win,name,validator){win=Window.Unwrap(win);try{if(win[name]){var value=win[name].call(win);return validator?validator(value):value}}catch(xe){}return void 0};Window.TryCallWithArguments=function(win,name,args,validator){win=Window.Unwrap(win);try{if(win[name]){var value=win[name].apply(win,args);return validator?validator(value):value}}catch(xe){}return void 0};Window.TryGet=function(win,name){win=Window.Unwrap(win);try{return win[name]}catch(xe){}return void 0};
Window.CloseWindow=function(win){if(Browser.IsIE())win.open("","_parent","");win.close()};Window.Focus=function(win){win.focus()};Window.prototype={TryCall:function(name){return Window.TryCall(this.Native,name)},TryCallWithArguments:function(name,args){return Window.TryCallWithArguments(this.Native,name,args)}};
var RawQuery={DecodeLocationSearch:function(searchStr,lowercaseNames,valueDecoder){if(searchStr.length==0)return{};return RawQuery.DecodeString(searchStr.substring(1),lowercaseNames,valueDecoder)},DecodeString:function(queryStr,lowercaseNames,valueDecoder){var query={};if(queryStr.length>0){var tokens=queryStr.split("&");var name;var value;for(var i=0,n=tokens.length;i<n;++i){var token=tokens[i];var eqPos=token.indexOf("=");if(eqPos==-1){name=decodeURIComponent(token);value=""}else{name=decodeURIComponent(token.substr(0,
eqPos));value=token.substr(eqPos+1)}query[lowercaseNames?name.toLowerCase():name]=valueDecoder?valueDecoder(value):value}}return query}};function ApplicationInfo(name,nsName,version,language,rawContext,rawTags){this.Name=name;this.NsName=nsName;this.Version=version;this.Language=language;this.RawContext=rawContext;this.RawTags=rawTags}ApplicationInfo.ToObject=function(self){return self?[self.Name,self.NsName,self.Version,self.Language,self.RawContext,self.RawTags]:null};
ApplicationInfo.FromObject=function(obj){return obj?new ApplicationInfo(obj[0],obj[1],obj[2],obj[3],obj[4],obj[5]):null};
var _UpkMeta={ApplicationNameFromNsName:function(nsName){if(!nsName)return nsName;var dotPos=nsName.indexOf(".");return dotPos!=-1?nsName.substr(0,dotPos):nsName},CreateInfo:function(ns,rawContext,rawTags){var tokens=ArrayPad(ns==null?[""]:ns.split(";"),null,3);var appNsName=Trim(tokens[0]).toUpperCase();var appName=_UpkMeta.ApplicationNameFromNsName(appNsName);tokens.shift();var version=tokens[0]?Trim(tokens[0]):null;if(!version||/^[0-9@]/.test(version))tokens.shift();else version=null;var language=
tokens[0]?Trim(tokens[0]).replace("_","-").toLowerCase():null;return new ApplicationInfo(appName,appNsName,version,language,rawContext||null,rawTags||null)}};
var UpkMeta={ApplicationNameFromNsName:function(nsName){return _UpkMeta.ApplicationNameFromNsName(nsName)},ApplicationInfoFromLocationSearch:function(search){return UpkMeta.ApplicationInfoFromQuery(RawQuery.DecodeLocationSearch(search))},ApplicationInfoFromQuery:function(query){var ns=null;var cx=null;function _getNamespace(_ns,_member,_value){if(_ns)return _ns;if(_member=="namespace")return _value;if(_member=="namespace-p")return decodeURIComponent(_value);return null}function _getContext(_cx,_member,
_value){if(_cx)return _cx;if(_member=="context")return _value;if(_member=="context-p")return decodeURIComponent(_value);return null}var member,value;for(member in query){if(!/^upk-/.test(member))continue;value=query[member];member=member.substr(4);ns=_getNamespace(ns,member,value);cx=_getContext(cx,member,value);if(ns!=null&&cx!=null)break}if(ns==null||cx==null)for(member in query){value=query[member];ns=_getNamespace(ns,member,value);cx=_getContext(cx,member,value);if(ns!=null&&cx!=null)break}return ns||
cx?_UpkMeta.CreateInfo(ns,cx):null},ApplicationInfoFromWindow:function(win){var ns=null;var rawTags=null;var rawContext=null;try{var hasGetNamespace=!!Window.TryGet(win,"UPK_GetNamespace");var hasGetTags=!!Window.TryGet(win,"UPK_GetTags");var hasGetContext=!!Window.TryGet(win,"UPK_GetContext");function stringValidator(value){if(value==null)return null;return String(value)}ns=hasGetNamespace&&Window.TryCall(win,"UPK_GetNamespace",stringValidator)||null;rawTags=hasGetTags&&Window.TryCall(win,"UPK_GetTags",
stringValidator)||null;if(!ns||!rawTags||!hasGetContext){var doc=win.document;var metaElements=doc.getElementsByTagName("meta");for(var i=0,n=metaElements.length;i<n;++i){var metaName=metaElements[i]["name"];if(/^upk-/.test(metaName))if(ns==null&&metaName=="upk-namespace")ns=metaElements[i]["content"];else if(rawTags==null&&metaName=="upk-tags")rawTags=metaElements[i]["content"];else if(rawContext==null&&metaName=="upk-context")rawContext=metaElements[i]["content"]}}}catch(xe){}return ns||rawTags||
rawContext?_UpkMeta.CreateInfo(ns,rawContext,rawTags):null},_DecodeDelimitedString:function(rawString){var rawValues=rawString.split(";");var values=[];for(var i=0,n=rawValues.length;i<n;++i){var value=rawValues[i];if(value)values.push(decodeURIComponent(value))}return values},_DecodeAndSort:function(rawString){var values=UpkMeta._DecodeDelimitedString(rawString);values.sort();return values},DecodeContext:function(rawContext,enableMultiPart){if(rawContext==null)return null;if(!enableMultiPart)return decodeURIComponent(rawContext);
return UpkMeta._DecodeAndSort(rawContext)},DecodeTags:function(rawTags){if(rawTags==null)return null;return UpkMeta._DecodeAndSort(rawTags)}};var ApplicationFeature={ExactMatch:"X",SmartMatch:"S"};var _Json={Indent:"  "};var Json={EncodeObject:function(obj,indent){try{return JSON.stringify(obj,null,indent?_Json.Indent:null)}catch(xe){if(typeof TypeError=="undefined"||!xe||xe.constructor!==TypeError)throw xe;}},DecodeObject:function(str){if(str!=null)try{return JSON.parse(str)}catch(xe){}}};
function _Json_Emulate(){var xt=/[^",:\{\}\[\] \t\r\n]|"""|"[ \t\r\n]+"]|[\}\]][ \t\r\n]*[:\{\[]|[\{\[][ \t\r\n]*[,:]|[,:][ \t\r\n]*[,:\}\]]/;var xn=/"(?:[^"\\\x00-\x1F]|\\["\\\/bnfrt]|\\u[0-9a-fA-F]{4})*"|null|true|false|-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+\-]?[0-9]+)?/g;var innerException=new Error("");function _u(n){var c=n.toString(16);switch(c.length){case 1:return"\\u000"+c;case 2:return"\\u00"+c;case 3:return"\\u0"+c;case 4:return"\\u"+c}return"?"}var _f=IsFunction;var _c;var _i;(function(){try{if(typeof[].indexOf==
"function"&&[1,2,3,4].indexOf(3)==2){_c=function(a,o){return a.indexOf(o)!=-1};_i=function(a,o){return a.indexOf(o)};return}}catch(ex){}_c=function(a,o){for(var i=0,n=a.length;i<n;++i)if(a[i]===o)return true;return false};_i=function(a,o){for(var i=0,n=a.length;i<n;++i)if(a[i]===o)return i;return-1}})();var ae="????????btn?fr??????????????????";function _q(o){return'"'+String(o).replace(/(["\\])/g,"\\$1").replace(/([\x00-\x1F])/g,function(c){var n=c.charCodeAt(0);var x=ae.charAt(n);return x=="?"?
_u(n):"\\"+x})+'"'}function _2(v){return v<10?"0"+v:v}function _s(o,c,k){var t=typeof o;if(t!="object"){if(t=="string")return _q(o);if(t=="number")return isFinite(o)?String(o):"null";if(t=="boolean")return o?"true":"false";return}if(o===null)return"null";if(o.constructor===String)return _q(o);if(o.constructor===Number)return isFinite(o)?String(o):"null";if(o.constructor===Boolean)return o?"true":"false";if(o.constructor===Date)return"".concat(o.getUTCFullYear(),"-",_2(o.getUTCMonth()),"-",_2(o.getUTCDate()),
"T",_2(o.getUTCHours()),":",_2(o.getUTCMinutes()),":",_2(o.getUTCSeconds()),"Z");if(o.constructor===Function)return;if(_c(c,o))throw innerException;var a=[];c.push(o);if(o.constructor===Array){for(var i=0,n=o.length;i<n;++i){var v1=o[i];if(v1==null||_f(v1))a.push("null");else a.push(_s(v1,c,String(i)))}c.pop();return"["+a.join()+"]"}for(var m in o){var v2=o[m];if(v2==null||_f(v2)){if(v2===null)a.push(_q(m)+":null")}else if((v2=_s(v2,c,m))!=null)a.push(_q(m)+":"+v2)}c.pop();return"{"+a.join()+"}"}
Json.EncodeObject=function(o){if(o==null||_f(o)){if(o===null)return"null";return}try{return _s(o,[],"")}catch(ex){if(ex!==innerException)throw ex;}};Json.DecodeObject=function(s){try{if(s!=null&&!xt.test(s.replace(xn,'""')))return eval("("+s+")")}catch(ex){}}}
function _Json_CheckImplementation(){if(typeof window["JSON"]!="undefined"&&typeof(JSON.stringify&&JSON.parse)!="undefined")try{var xo={a:"",b:0.1,c:null,d:true,e:false,f:new Array([new Object,{g:function(){return 1},h:1},new Function("return 0;"),function(){return 1},1])};var xs='{"a":"","b":0.1,"c":null,"d":true,"e":false,"f":[[{},{"h":1},null,null,1]]}';var sxo=JSON.stringify(xo);if(sxo==xs&&sxo==JSON.stringify(JSON.parse(xs))&&/2345-12-23T12:34:56(?:\.789[0]*)?Z/.test(JSON.stringify(new Date(Date.UTC(2345,
11,23,12,34,56,789)))))return}catch(ex){}_Json_Emulate()}_Json_CheckImplementation();var Html={Escape:function(str){return String(str).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},EscapeAttribute:function(str){return String(str).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}};var ApplicationContextFormat={JsObject:0,JsonString:1,XmlString:2,Internal:3};
ApplicationContextFormat.FromString=function(format,def){if(format=="xml")return ApplicationContextFormat.XmlString;if(format=="json")return ApplicationContextFormat.JsonString;if(format=="object")return ApplicationContextFormat.JsObject;if(format=="internal")return ApplicationContextFormat.Internal;return def};
function ApplicationContext(key,name,nsName,version,language,tagList,parts){this.Key=key||null;this.Name=name||null;this.NsName=nsName||null;this.Version=version||null;this.Language=language||null;this.TagList=tagList||null;this.Parts=parts||null}ApplicationContext.ClassId="OraUpk.ApplicationContext;2";ApplicationContext.FromObject=function(obj){return new ApplicationContext(obj["Key"],obj["Name"],obj["NsName"],obj["Version"],obj["Language"],obj["TagList"],obj["Parts"])};
ApplicationContext.FromJson=function(json){return ApplicationContext.FromObject(Json.DecodeObject(json))};
ApplicationContext.prototype={AddPart:function(name,value){if(value&&value.length)this.Parts.push([name,value])},ToObject:function(){var obj={ClassId:ApplicationContext.ClassId,Key:this.Key,Name:this.Name,NsName:this.NsName,Language:this.Language,Version:this.Version,TagList:this.TagList,Parts:this.Parts};return obj},ToJson:function(){return Json.EncodeObject(this.ToObject())},ToXml:function(appHandler){function tokens_AddPart(container,name,value,caption,useNameAsPrefix,searchable){container.push('<property name="'+
name+'" caption="'+caption+'" usenameasprefix="'+useNameAsPrefix+'" searchable="'+searchable+'">');container.push("<prop_string>"+Html.Escape(value)+"</prop_string>");container.push("</property>")}var tokens=['<?xml version="1.0"?><propertyset>'];var contextInfo=this.Name;if(appHandler){contextInfo+=";V"+appHandler.ContextVersion;var partMap=appHandler.PartMap;var parts=this.Parts;if(parts)for(var i=0,n=parts.length;i<n;++i){var part_i=parts[i];var part_i_name=part_i[0];var partDesc=partMap[part_i_name];
if(/^MC\./.test(part_i_name))contextInfo+=";"+partDesc.Caption+part_i[1];else tokens_AddPart(tokens,part_i[0],part_i[1],partDesc.Caption,partDesc.UseNameAsPrefix,partDesc.Searchable)}}if(this.NsName!=null&&this.NsName.indexOf(".")!=-1)tokens_AddPart(tokens,"MA",this.NsName,"Application Name",true,true);tokens_AddPart(tokens,"MC",contextInfo,"Context Info",true,false);if(this.Version!=null)tokens_AddPart(tokens,"MV",this.Version,"Application Version",true,false);if(this.TagList!=null){var tagList=
this.TagList;for(var i=0,n=tagList.length;i<n;++i)tokens_AddPart(tokens,"MT",tagList[i],"Application Tag",true,true)}tokens.push("</propertyset>");return tokens.join("")}};var ApplicationType={None:0,StandaloneFlag:1,PortalFlag:2,Standalone:1,Portal:2};function ApplicationBase(){}
ApplicationBase.prototype={Key:null,Name:"$UNKNOWN",ConfigDefaults:{IgnoreContext:0,ContentMapType:"",ContentMap:[],GatewayTitle:"Main Player",GatewayLinksTitle:"Linked Resources",GatewayLinks:[],GatewayPages:[],GatewayRememberTab:1},RemoteGateway:false,SupportedFeatures:ApplicationFeature.ExactMatch,ContextType:ContextType.Absolute,ContextDiscovery:false,ContextVersion:0,ContextParts:[ContextPart.CreateValue("C","Context ID")],ContextStdPartsMap:{MA:ContextPart.CreateValue("MA","Application Name")},
PartMap:null,CreatePartsFromValues:function(values){var contextParts=this.ContextParts;var parts=[];if(values){var i,n;for(i=0,n=values.length;i<n;++i){var value=values[i];if(value!=null)if(ContextPart.HasMultipleParts(contextParts[i])){if(value.length!=0)for(var iValue=0;iValue<value.length;++iValue)parts.push([contextParts[i][0],value[iValue]])}else if(value!="")parts.push([contextParts[i][0],value])}}return parts},SearchType:EcidSearch.All,FilterSearchableParts:function(parts){var searchableParts=
[];var partMap=this.PartMap;for(var i=0,n=parts.length;i<n;++i){var part=parts[i];if(partMap[part[0]].Searchable)searchableParts.push(part)}return searchableParts},CreateSearchExpression:function(values){var parts=this.CreatePartsFromValues(values);return parts?this.CreateSearchExpressionFromParts(parts):null},CreateSearchExpressionFromParts:function(parts){parts=this.FilterSearchableParts(parts);var builder=new SearchExpressionBuilder;var searchType=this.SearchType;if(searchType==EcidSearch.All)builder.AddParts(parts);
else if(searchType==EcidSearch.AnyPart)builder.AddOptionalParts(parts);else if(searchType==EcidSearch.WithOrWithoutPrefix){builder.AddParts(parts);builder.AddPartsValue(parts)}else if(searchType==EcidSearch.WithoutPrefix)builder.AddPartsValue(parts);return builder.ToObject()},GetConfigDefaults:function(){return null},Initialize:function(){if(!this.HintOverrideName)this.HintOverrideName=this.Name;if(!this.Key)this.Key=this.Name+":"+this.SupportedFeatures;var partMap={};var i,n,part;var contextParts=
this.ContextParts;for(i=0,n=contextParts.length;i<n;++i){part=contextParts[i];partMap[part[0]]=PartDescriptor.Create(part)}var contextPartsMap=this.ContextStdPartsMap;for(var partName in contextPartsMap){part=contextPartsMap[partName];partMap[part[0]]=PartDescriptor.Create(part)}this.PartMap=partMap}};
var ApplicationMap={Keys:[],Names:[],AppByKey:{},AppsByName:{},Register:function(app){app.Initialize();var appKey=app.Key;ApplicationMap.AppByKey[appKey]=app;ApplicationMap.Keys.push(appKey);var appName=app.Name;var apps=ApplicationMap.AppsByName[appName];if(apps)apps.push(app);else{ApplicationMap.Names.push(appName);ApplicationMap.AppsByName[appName]=[app]}},TryGetApplicationByKey:function(appKey){return ApplicationMap.AppByKey[appKey]||null},TryGetApplicationsByName:function(appName){return ApplicationMap.AppsByName[appName]||
null},TryGetApplication:function(appName){var apps=ApplicationMap.AppsByName[appName]||null;return apps?apps[0]:null},TryGetApplicationDefaults:function(appName){var appHandler=ApplicationMap.TryGetApplication(appName);return appHandler?appHandler.ConfigDefaults:ApplicationBase.prototype.ConfigDefaults},GetApplication:function(appName,featureList){var result;if(featureList){var appKey=ApplicationMap.GetApplicationKey(appName,featureList);result=appKey?ApplicationMap.TryGetApplicationByKey(appKey):
null}else result=ApplicationMap.TryGetApplication(appName);return result},GetApplicationName:function(appKey){if(!appKey)return"";return appKey.split(":")[0]},GetApplicationKey:function(appName,featureList){var apps=ApplicationMap.TryGetApplicationsByName(appName);if(!apps)return null;if(!featureList)return apps[0];for(var appIndex=0;appIndex<apps.length;++appIndex){var app=apps[appIndex];var i;var n=featureList.length;for(i=0;i<n;++i)if(app.SupportedFeatures.indexOf(featureList[i])==-1)break;if(i==
n)return app.Key}return null}};var AgileApplication=function(){ApplicationBase.call(this);this.Name="AGILE";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("C","ContextID")]};AgileApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new AgileApplication);var AgileCnmApplication=function(){ApplicationBase.call(this);this.Name="AGILECNM";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("H","Help")]};
AgileCnmApplication.prototype=ApplicationBase.prototype;ApplicationMap.Register(new AgileCnmApplication);var AppApplication=function(){ApplicationBase.call(this);this.Name="APP";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("C","Context ID",true,true,true)]};AppApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new AppApplication);
var CaunisdApplication=function(){ApplicationBase.call(this);this.Name="CAUNISD";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("H","Help File")]};CaunisdApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new CaunisdApplication);var CitiliteApplication=function(){ApplicationBase.call(this);this.Name="CH005002";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("C","Context ID",false)];this.SearchType=EcidSearch.WithoutPrefix};
CitiliteApplication.prototype=ExtendClass(ApplicationBase.prototype,{Identify:function(frameDesc){var win=frameDesc.NativeWindow;return!!win["GetOndemandContextID"]},GetPartValues:function(frameDesc){var contextId=Window.TryCall(frameDesc.NativeWindow,"GetOndemandContextID");return contextId&&contextId.length?[contextId]:null}});ApplicationMap.Register(new CitiliteApplication);
var ClarityApplication=function(){ApplicationBase.call(this);this.Name="CLARITY";this.ContextVersion=3;this.ContextParts=[ContextPart.CreateValue("T","Topic")];this.SearchType=EcidSearch.WithOrWithoutPrefix};ClarityApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new ClarityApplication);
var FrontApplication=function(){ApplicationBase.call(this);this.Name="FRONT";this.ContextVersion=2;this.ContextParts=[ContextPart.CreateValue("P","ProgramName"),ContextPart.CreateValue("T","TransactionName"),ContextPart.CreateValue("S","ScreenName")]};
FrontApplication.prototype=ExtendClass(ApplicationBase.prototype,{CreateSearchExpressionFromParts:function(parts){parts=this.FilterSearchableParts(parts);var builder=new SearchExpressionBuilder(SearchExpressionNode.And);for(var i=0,n=parts.length;i<n;++i){var part=parts[i];if(part[1]!="*")if(part[0]=="S")builder.AddPartStar(part);else builder.AddPart(part)}return builder.ToObject()},__:void 0});ApplicationMap.Register(new FrontApplication);
function SmartMatch_CompiledConfig(config){this.PartFamily=config["PartFamily"]||{};this.PartLimit=config["PartLimit"]||{};this.TagLimit=config["TagLimit"]||{};this.TagMap=HashMap.FromKeys(this.TagLimit);this.Search=config["Search"]||{}}
var SmartMatch_Utility={FilterLongStrings:function(a,maxlen){var chs=String(a).split("");var str="";var start=0;var sep=0;var prevch=0;for(var i=0;i<chs.length;i++){var c=chs[i];str+=c;if(c=="'"||c=='"')if(sep==0){sep=c;start=str.length}else if(sep==c&&prevch!="\\"){if(str.length-start>maxlen)str=str.substring(0,start-1);sep=0}prevch=c}return str},FilterDigits:function(a){var chs=String(a).split("");var str="";for(i=0;i<chs.length;i++){var c=chs[i];if(SmartMatch_Utility.IsDigit(c))continue;str+=c}return str},
IsLetter:function(c){var code=c.toString().charCodeAt(0);return 65<=code&&code<=90||97<=code&&code<=122||192<=code&&code<=512},IsDigit:function(c){return"0"<=c&&c<="9"},IsLetterOrDigit:function(c){return SmartMatch_Utility.IsLetter(c)||SmartMatch_Utility.IsDigit(c)},ParseWords:function(a){var ret=[];var chs=String(a).split("");var word="";for(i=0;i<chs.length;i++){var c=chs[i];if(SmartMatch_Utility.IsLetterOrDigit(c))word+=c;else if(word.length>0){ret.push(word);word=""}}if(word.length>0)ret.push(word);
return ret},ReplaceWhitespaces:function(a){return a.replace(/&nbsp;/g," ").replace(/\u00a0/g," ")},ParseQName:function(a){return Trim(SmartMatch_Utility.ReplaceWhitespaces(SmartMatch_Utility.FilterDigits(a)))},ParseScript:function(a){var unwrapIEfunctionsRegex=/^function[^(]*\(\)\s*\{\s+([\s\S]*)\s+\}\s*/;var scriptparts=unwrapIEfunctionsRegex.exec(a);if(scriptparts)a=scriptparts[1];return SmartMatch_Utility.FilterDigits(SmartMatch_Utility.FilterLongStrings(a,30))},ParseURL:function(a){var uparts=
[];if(a.toLowerCase().match("javascript:"))uparts[15]=SmartMatch_Utility.ParseScript(unescape(a));else uparts=SmartMatch_Utility.ResolveURL(a);return uparts},ResolveURL:function(a){var absoluteUrlRegex=/^(url:)?(\w+:\/\/)((\w+):?(\w+)?@)?((([^\\\/\?\.:]+))(\.[^\\\/\?:]+)?):?(\d+)?([\/\\]?[^\?#]+)?\??([^#]+)?#?(\w*)/;var relativeUrlRegex=/^([\/\\])?([^\?#]+)?\??([^#]+)?#?(\w*)?/;var uparts=absoluteUrlRegex.exec(a);if(!uparts){uparts=relativeUrlRegex.exec(a);if(!uparts)return uparts;if(uparts[2])uparts[11]=
uparts[2];if(uparts[3])uparts[12]=uparts[3]}else if(uparts[9])uparts[9]=uparts[9].substring(1);if(uparts[11])uparts[11]=uparts[11].split(/[\/\\]/);return uparts},GetParameter:function(params,id,defaultvalue){if(params)if(typeof params[id]!="undefined")return params[id];else if(defaultvalue)return defaultvalue;return-1}};function SmartMatch_CollectorBase(family){this.PartFamily=family;this.DefaultPart=this.PartFamily+"0"}SmartMatch_CollectorBase.prototype={CollectParts:function(builder,text){}};
function SmartMatch_Collector_Simple(family){SmartMatch_CollectorBase.call(this,family)}SmartMatch_Collector_Simple.prototype=ExtendClass(SmartMatch_CollectorBase.prototype,{CollectParts:function(builder,text){if(builder.NeedPart(this.DefaultPart))builder.AddPart(this.DefaultPart,text)}});function SmartMatch_Collector_Word(family){SmartMatch_CollectorBase.call(this,family)}
SmartMatch_Collector_Word.prototype=ExtendClass(SmartMatch_CollectorBase.prototype,{CollectParts:function(builder,text){if(builder.NeedPart(this.DefaultPart)){var wordparts=SmartMatch_Utility.ParseWords(text);for(var k=0;k<wordparts.length;k++)builder.AddPart(this.DefaultPart,wordparts[k])}}});function SmartMatch_Collector_QName(family){SmartMatch_CollectorBase.call(this,family)}
SmartMatch_Collector_QName.prototype=ExtendClass(SmartMatch_CollectorBase.prototype,{CollectParts:function(builder,text){if(builder.NeedPart(this.DefaultPart))builder.AddPart(this.DefaultPart,SmartMatch_Utility.ParseQName(text))}});function SmartMatch_Collector_Script(family){SmartMatch_CollectorBase.call(this,family)}
SmartMatch_Collector_Script.prototype=ExtendClass(SmartMatch_CollectorBase.prototype,{CollectParts:function(builder,text){if(builder.NeedPart(this.DefaultPart))builder.AddPart(this.DefaultPart,SmartMatch_Utility.ParseScript(text))}});function SmartMatch_Collector_URL(family){SmartMatch_CollectorBase.call(this,family);this.PartT=family+"T";this.PartU=family+"U";this.PartV=family+"V";this.PartW=family+"W";this.PartX=family+"X";this.PartZ=family+"Z"}
SmartMatch_Collector_URL.prototype=ExtendClass(SmartMatch_CollectorBase.prototype,{CollectParts:function(builder,text){var config=builder.GetPartFamilyConfig(this.PartFamily);var ppartlimit=GetValue(config,"PathPartCount",10);var paramlimit=GetValue(config,"ParamCount",20);var z=SmartMatch_Utility.ParseURL(text);if(!z)return;if(z[15]&&builder.NeedPart(this.PartZ)){builder.AddPart(this.PartZ,z[15]);return}if(z[8]&&builder.NeedPart(this.PartX))builder.AddPart(this.PartX,z[8]);if(z[9]&&builder.NeedPart(this.PartW))builder.AddPart(this.PartW,
z[9]);var needName=builder.NeedPart(this.PartT);var needNameValue=builder.NeedPart(this.PartU);if(z[12]&&(needName||needNameValue)){var nvPairs=z[12].split("&");if(nvPairs.length<=paramlimit)for(var f=0;f<nvPairs.length;f++){var pair=nvPairs[f].split("=");var pname=SmartMatch_Utility.FilterDigits(pair[0]);if(pname&&pname.length>0){if(needNameValue&&pair.length>1){var pvalue=SmartMatch_Utility.FilterDigits(pair[1]);if(pvalue&&pvalue.length>0)builder.AddPart(this.PartU,pname+"="+pvalue)}if(needName)builder.AddPart(this.PartT,
pname)}}}if(z[11]){var uparts=z[11];var len=z[11].length;var idx=0;for(var i=uparts.length-1;i>=0;i--){uparts[i]=/^([^:;]+)?([:;]\w*)?/.exec(uparts[i])[1];if(/^[\(\)=\$~\!\+\.].*|^.*[\(\)=\$~\!\+\.]$/.test(uparts[i]))continue;if(uparts[i]!=""){if(idx==0){if(len>0&&builder.NeedPart(this.PartV))builder.AddPart(this.PartV,uparts[i])}else{var epName=this.PartFamily+idx;if(builder.NeedPart(epName))builder.AddPart(epName,uparts[i])}idx++;if(idx>=ppartlimit)break}}}}});
var SmartMatch_CollectorMap={GAA:new SmartMatch_Collector_URL("GAA"),GAB:new SmartMatch_Collector_QName("GAB"),GAC:new SmartMatch_Collector_Script("GAC"),GAD:new SmartMatch_Collector_URL("GAD"),GAE:new SmartMatch_Collector_QName("GAE"),GAF:new SmartMatch_Collector_QName("GAF"),GAG:new SmartMatch_Collector_QName("GAG"),GAH:new SmartMatch_Collector_QName("GAH"),GAI:new SmartMatch_Collector_QName("GAI"),GAJ:new SmartMatch_Collector_QName("GAJ"),GAK:new SmartMatch_Collector_QName("GAK"),GAL:new SmartMatch_Collector_QName("GAL"),
GAM:new SmartMatch_Collector_URL("GAM"),GAN:new SmartMatch_Collector_QName("GAN"),GAO:new SmartMatch_Collector_Script("GAO"),GAP:new SmartMatch_Collector_Word("GAP"),GAQ:new SmartMatch_Collector_QName("GAQ"),GAR:new SmartMatch_Collector_QName("GAR"),GAS:new SmartMatch_Collector_Word("GAS"),GAT:new SmartMatch_Collector_Word("GAT"),GAU:new SmartMatch_Collector_Word("GAU"),GAV:new SmartMatch_Collector_Word("GAV"),GAW:new SmartMatch_Collector_QName("GAW"),GAX:new SmartMatch_Collector_QName("GAX"),GBA:new SmartMatch_Collector_Simple("GBA"),
GAY:new SmartMatch_Collector_QName("GAY"),GAZ:new SmartMatch_Collector_QName("GAZ")};function SmartMatch_PartsBuilder(app,ignoreLimits){this.Name=app.Name;var config=app.CompiledConfig;this.IgnoreLimits=!!ignoreLimits;this.PartFamilyConfig=config.PartFamily;this.PartLimit=CloneHash(config.PartLimit);this.TagLimit=config.TagLimit;this.TagMap=config.TagMap;this.Parts=[];this.PartMap={}}
SmartMatch_PartsBuilder.prototype={GetPartFamilyConfig:function(family){return this.PartFamilyConfig[family]||null},NeedTag:function(tagName){return GetValue(this.TagMap,tagName,false)},NeedTags:function(tagName,tagCount){if(this.IgnoreLimits)return true;var limit=GetValue(this.TagLimit,tagName,0);if(limit==-1)return true;return tagCount<=limit},NeedPart:function(name){return this.IgnoreLimits||this.PartLimit[name]!=0},CollectParts:function(partFamily,text){var collector=SmartMatch_CollectorMap[partFamily];
if(collector)collector.CollectParts(this,text)},NormalizeValue:function(str){return str.toLowerCase().replace(/\s\s+/g," ")},AddPart:function(name,value){if(value){value=Trim(value);if(value.length){var add=this.IgnoreLimits;if(add)value=this.NormalizeValue(value);else{var limit=this.PartLimit[name];if(limit!=0){value=this.NormalizeValue(value);if(limit==-1)add=true;else{var nameValue=name+value;if(!this.PartMap[nameValue]){this.PartMap[nameValue]=true;this.PartLimit[name]=limit-1;add=true}}}}if(add)this.Parts.push([name,
value])}}}};var _SmartMatchApplication={BuildContextParts:function(config){var contextParts=[];var partLimit=config.PartLimit;for(var partName in partLimit)contextParts.push(ContextPart.CreateValue(partName,partName));return contextParts}};var SmartMatchApplication=function(){ApplicationBase.call(this);this.SupportedFeatures=ApplicationFeature.SmartMatch};
SmartMatchApplication.prototype=ExtendClass(ApplicationBase.prototype,{ConfigDefaults:Extend({},ApplicationBase.prototype.ConfigDefaults,{MaxSearch:80,MaxHit:200,Threshold:30,MinScore:10}),CreateSearchExpression:function(values){return null},__:void 0});var FusionSmartMatchApplication=function(){SmartMatchApplication.call(this);this.Name="FUSION"};
FusionSmartMatchApplication.prototype=ExtendClass(SmartMatchApplication.prototype,{ConfigDefaults:Extend({},SmartMatchApplication.prototype.ConfigDefaults,{Threshold:75,MinScore:50}),__:void 0});ApplicationMap.Register(new FusionSmartMatchApplication);var FusionApplication=function(){ApplicationBase.call(this);this.Name="FUSION";this.ContextParts=[ContextPart.CreateValue("C","Context ID",true,true,true)]};FusionApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new FusionApplication);
var HyperionApplication=function(){ApplicationBase.call(this);this.Name="HYPERION";this.ContextVersion=2;this.ContextParts=[ContextPart.CreateValue("H","Help"),ContextPart.CreateMeta("M")];this.topWin=null};HyperionApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new HyperionApplication);var JdeWorldApplication=function(){ApplicationBase.call(this);this.Name="JDEWORLD"};JdeWorldApplication.prototype=ApplicationBase.prototype;ApplicationMap.Register(new JdeWorldApplication);
var KpathApplication=function(){ApplicationBase.call(this);this.Name="KPATH";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("H","Help")]};KpathApplication.prototype=ApplicationBase.prototype;ApplicationMap.Register(new KpathApplication);var Mscrm3Application=function(){ApplicationBase.call(this);this.Name="MSCRM3";this.ContextVersion=1};Mscrm3Application.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new Mscrm3Application);
var OracleApplication=function(){ApplicationBase.call(this);this.Name="ORACLE";this.ContextVersion=2;this.ContextParts=[ContextPart.CreateValue("C","ContextID")];this.SearchType=EcidSearch.WithOrWithoutPrefix};OracleApplication.prototype=ExtendClass(ApplicationBase.prototype,{ConfigDefaults:Extend({},ApplicationBase.prototype.ConfigDefaults,{ORACLE_Version:"R12"}),__:void 0});ApplicationMap.Register(new OracleApplication);
var OracleTMApplication=function(){ApplicationBase.call(this);this.Name="ORACLETM";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("H","Help"),ContextPart.CreateValue("S","Search"),ContextPart.CreateValue("A","ActiveTab")]};OracleTMApplication.prototype=ExtendClass(ApplicationBase.prototype,{});ApplicationMap.Register(new OracleTMApplication);
var PsentoneApplication=function(){ApplicationBase.call(this);this.Name="PSENTONE";this.ContextVersion=2;this.ContextParts=[ContextPart.CreateValue("C","ContextID"),ContextPart.CreateValue("P","PreContextID"),ContextPart.CreateValue("W","WideContextID")]};PsentoneApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new PsentoneApplication);
var Pst8Application=function(){ApplicationBase.call(this);this.Name="PST8";this.ContextVersion=4;this.ContextParts=[ContextPart.CreateValue("P","Page"),ContextPart.CreateMeta("M")]};
Pst8Application.prototype=ExtendClass(ApplicationBase.prototype,{CreateSearchExpressionFromParts:function(parts){var builder=new SearchExpressionBuilder;if(parts.length>=1){var contextid=parts[0][1];var prefix=parts[0][0];var bSearch=false;var sSearch="[SEARCH]";var isNumber=parseInt(contextid);if(!isNaN(isNumber))if(isNumber.toString()==contextid)bSearch=true;if(contextid=="(search)")bSearch=true;if(contextid!="")builder.AddValue(prefix+contextid);if(bSearch)builder.AddValue(prefix+sSearch)}return builder.ToObject()},
__:void 0});ApplicationMap.Register(new Pst8Application);var PrimaP6Application=function(){ApplicationBase.call(this);this.Name="PRIMAP6";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("H","Help")];this.ContextType=ContextType.TopRelative;this.ContextDiscovery=true};PrimaP6Application.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new PrimaP6Application);var SapnwepApplication=function(){SmartMatchApplication.call(this);this.Name="SAPNWEP"};
SapnwepApplication.prototype=ExtendClass(SmartMatchApplication.prototype,{ConfigDefaults:Extend({},SmartMatchApplication.prototype.ConfigDefaults,{}),__:void 0});ApplicationMap.Register(new SapnwepApplication);
var SapnwepExactMatchApplication=function(){ApplicationBase.call(this);this.Name="SAPNWEP";this.HintOverrideName="FRONT";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("I","Iview Name"),ContextPart.CreateMeta("F","Process Step")];this.sContextIView=null;this.sContextFChart=null;this.language=null;this.ClassArray1=["urRMStep urRMStepAct","urRMStep urRMStepStdSel","urRMStep urRMRoundTripSel"]};
SapnwepExactMatchApplication.prototype=ExtendClass(ApplicationBase.prototype,{GetContextID:function(win){var window2Top=win.top;if(typeof window2Top!="undefined"){if(typeof window2Top["workArea"]!="undefined"&&window2Top["workArea"]){var vWork=window2Top["workArea"];if(typeof vWork["iviewId"]!="undefined"&&vWork["iviewId"]){var vId=vWork["iviewId"];var n=vId.lastIndexOf("/");if(n>0){this.sContextIView=vId.substr(n+1,vId.length-n-1);return}}}for(var i=0;i<window2Top.frames.length;i++){var frameDesktop=
window2Top.frames[i];if(typeof frameDesktop!="undefined"&&frameDesktop)if(typeof frameDesktop.document!="unknown")if(typeof frameDesktop["pageSupport"]!="undefined"&&frameDesktop["pageSupport"]){var vPage=frameDesktop["pageSupport"];if(typeof vPage["workArea"]!="undefined"&&vPage["workArea"]){var vWork=vPage["workArea"];if(typeof vWork["id"]!="undefined"&&vWork["id"]){var vId=vWork["id"];var n=vId.lastIndexOf("/");if(n>0){this.sContextIView=vId.substr(n+1,vId.length-n-1);if(typeof frameDesktop.frames!=
"undefined")for(var j=0;j<frameDesktop.frames.length;j++)if(Utility.AccessGranted(frameDesktop[j])){var collTD=frameDesktop[j].document.getElementsByTagName("TD");for(var k=0;k<collTD.length;k++)for(var m=0,mLength=this.ClassArray1.length;m<mLength;m++)if(collTD[k].className.length>0&&collTD[k].className==this.ClassArray1[m]){this.sContextFChart=Utility.Dom.GetInnerText(collTD[k]);break}}}}}}}}},GetLanguage:function(win){if(typeof win=="object"&&win!=null){var window2Top=win.top;if(typeof window2Top!=
"undefined"){if(typeof window2Top["ur_language"]!="undefined"&&window2Top["ur_language"].length>0){var sLanguage=window2Top["ur_language"];if(sLanguage.length>0){if(sLanguage.length>2)sLanguage=sLanguage.substr(0,2);this.language=sLanguage.toUpperCase();return}}for(var i=0;i<window2Top.frames.length;i++){var frameDesktop=window2Top.frames[i];if(typeof frameDesktop!="undefined"&&frameDesktop!=null)if(typeof frameDesktop.document!="unknown")if(typeof frameDesktop["ur_language"]!="undefined"&&frameDesktop["ur_language"].length>
0){var sLanguage=frameDesktop["ur_language"];if(sLanguage.length>0){if(sLanguage.length>2)sLanguage=sLanguage.substr(0,2);this.language=sLanguage.toUpperCase();break}}}}}},__:void 0});ApplicationMap.Register(new SapnwepExactMatchApplication);var Siebel7ActiveX_GetECID;
var Siebel7Application=function(){ApplicationBase.call(this);this.Name="SIEBEL7";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("S","Screen"),ContextPart.CreateValue("V","View"),ContextPart.CreateValue("A","Applet"),ContextPart.CreateValue("T","Type")];this.RemoteGateway=true};
Siebel7Application.prototype=ExtendClass(ApplicationBase.prototype,{ConfigDefaults:Extend({},ApplicationBase.prototype.ConfigDefaults,{SIEBEL7_Direct:1}),CreateSearchExpressionFromParts:function(parts){var partHash={S:{},V:{},A:{},T:{}};for(var i=0,n=parts.length;i<n;++i){var part=parts[i];var name=part[0];var value=part[1];partHash[name][value]=true}var S_values=HashMap.GetKeys(partHash["S"]);var V_values=HashMap.GetKeys(partHash["V"]);var A_values=HashMap.GetKeys(partHash["A"]);var searchExp=[SearchExpressionNode.And];
function createValueAnd(partName,partValues){if(partValues.length==1)return[SearchExpressionNode.Value,partName+partValues[0]];var obj=[SearchExpressionNode.And];for(var i=0,n=partValues.length;i<n;++i)obj.push([SearchExpressionNode.Value,partName+partValues[i]]);return obj}if(A_values.length)searchExp.push(createValueAnd("A",A_values));else if(S_values.length&&V_values.length==0)searchExp.push(createValueAnd("S",S_values));else if(V_values.length)searchExp.push(createValueAnd("V",V_values));return searchExp.length>
1?searchExp:null},GetParts:function(frameDesc){var win=frameDesc.NativeWindow;var topWin=Recognition.GetTreeTopWindow(frameDesc);if(topWin["IsOpenUI"]&&topWin["IsOpenUI"]())this.isOpenUI=true;if(!this.isOpenUI)if(topWin["SWEIsHighInteract"]||false)return this._GetPartsHighInteract(frameDesc);if(this.isOpenUI)return this._GetPartsOpenUI(win);var context=this._GetContext(win,topWin);var parts=[];if(context){var i,n;for(i=0,n=context.views.length;i<n;++i)parts.push(["V",context.views[i]]);for(i=0,n=
context.applets.length;i<n;++i)parts.push(["A",context.applets[i]])}return parts.length?parts:null},GetFrameName:function(){return this.FrameName},IsCalendar:function(){return this.isCalendar},GetCalendarBuildNumber:function(){var ret="-1";var url=win.location.href;var k=url.indexOf("/scripts/SSCalJSWrapperUI.htm");if(k>-1){var l=url.lastIndexOf("/",k-2);if(l>-1){var num=url.substr(l+1,k-l-1);if(num==parseInt(num))return num.toString()}}return ret},_GetContext:function(win,topWin){var result={applets:[],
views:[]};var documentwithforms=null;if(topWin["_sweclient"]&&topWin["_sweclient"]["_sweview"])documentwithforms=topWin["_sweclient"]["_sweview"].document;else if(topWin["_sweclient"]&&topWin["_sweclient"]["_swecontent"]&&topWin["_sweclient"]["_swecontent"]["_sweview"])documentwithforms=topWin["_sweclient"]["_swecontent"]["_sweview"].document;else if(topWin.length==0)documentwithforms=win.document;if(!documentwithforms)return null;var forms=documentwithforms.forms;if(typeof forms!="undefined"&&forms.length>
0){var a=documentwithforms.getElementsByName("SWEApplet");if(typeof a!="undefined"&&a.length>0&&a.length<=forms.length)for(var i=0;i<a.length;i++)result.applets.push(a[i].value);var v=documentwithforms.getElementsByName("SWEView");if(typeof v!="undefined"&&v.length>0&&v.length<=forms.length)for(var j=0;j<v.length;j++)result.views.push(v[j].value)}var z={};for(var n=0;n<result.applets.length;n++)if(result.applets[n].length>0)z[result.applets[n]]=result.applets[n];result.applets=[];for(i in z)result.applets.push(z[i]);
z={};for(var m=0;m<result.views.length;m++)if(result.views[m].length>0)z[result.views[m]]=result.views[m];result.views=[];for(j in z)result.views.push(z[j]);return result},_GetPartsOpenUI:function(win){var parts=[];parts.push(["T","OpenUI"]);var mainview=null,view=null;if(win["SiebelApp"]&&win["SiebelApp"]["S_App"]&&win["SiebelApp"]["S_App"]["GetMainView"]){mainview=win["SiebelApp"]["S_App"]["GetMainView"]();view=mainview["GetName"]()}var _view=view.toUpperCase();_view=_view.replace(/ /g,"_");_view=
_view.replace(/\/\//g,"_");if(this.IsCalendarView(view)){parts.push(["V",_view]);return parts}if(this.IsHomePage(win)){if(this.IsSitemap(win)){parts.push(["S","[SITEMAP]"]);return parts}parts.push(["V",_view]);return parts}parts.push(["V",_view]);if(win["SWEApplets"]){var z=win["SWEApplets"];for(var i=0;i<z.length;i++)if(z[i]["ViewName"]==view){var applet=z[i]["Name"];var add=false;if(mainview&&mainview["GetAppletMap"]){var appletmap=mainview["GetAppletMap"]();for(var j in appletmap)if(j==applet){add=
true;break}}if(add){var _applet=applet.toUpperCase();_applet=_applet.replace(/ /g,"_");_applet=_applet.replace(/\/\//g,"");parts.push(["A",_applet])}}}return parts},IsHomePage:function(win){var tds=win.document.getElementsByTagName("TD");var tdsapplet=[];for(var i=0;i<tds.length;i++)if(tds[i].className=="AppletMenu"){var children1=tds[i].children;for(var k=0;k<children1.length;k++)if(children1[k].className=="miniBtnUICTop"){var children2=children1[k].children;for(var n=0;n<children2.length;n++)if(children2[n].className==
"miniBtnUIC")tdsapplet.push(children2[n])}}return!(tdsapplet.length>0)},IsSitemap:function(win){var retValue=false;var spans=win.document.getElementsByTagName("SPAN");for(var i=0;i<spans.length;i++){var cl=spans[i].className;if(cl=="screenName1"||cl=="screenName2"||cl=="viewName"){retValue=true;break}}return retValue},IsCalendarView:function(view){if(view=="HI Activity Calendar View")return true;return false},_GetPartsHighInteract:function(frameDesc){var axEcid=Siebel7ActiveX_GetECID();if(!axEcid)return null;
var parts=[];var ecidParts=axEcid.split("'");for(var i=0,n=ecidParts.length;i<n;++i){var ecidPart=ecidParts[i];if(ecidPart.length>9&&/^SIEBEL7\$/.test(ecidPart))parts.push([ecidPart.substr(8,1),ecidPart.substr(9)])}try{var appFrames=Recognition.GetApplicationFrames(frameDesc);var topWindow=appFrames[0].NativeWindow;var explorerview=null;if(topWindow&&topWindow["_swe"]&&topWindow["_swe"]["_sweapp"]&&topWindow["_swe"]["_sweapp"]["S_App"])if(topWindow["_swe"]["_sweapp"]["S_App"]["GetMainView"]()){var viewname=
topWindow["_swe"]["_sweapp"]["S_App"]["GetMainView"]()["GetName"]();if(viewname)if(viewname&&viewname.indexOf("Explorer View")!=-1)explorerview=true}if(explorerview){var treeApplet=this.GetTreeApplet(frameDesc);if(treeApplet.length>0)for(var i=0;i<treeApplet.length;i++)parts.push(["A",treeApplet[i]])}}catch(e){Trace("App.SIEBEL7.GetPartsHighInteract exception",e)}return parts.length?parts:null},GetTreeApplet:function(frameDesc){var appFrames=Recognition.GetApplicationFrames(frameDesc);var _array=
[];for(var appFrame_i=0;appFrame_i<appFrames.length;++appFrame_i){var frameDesc_i=appFrames[appFrame_i];var win=frameDesc_i.NativeWindow;if(!win)continue;var winName=win.name;var parentWin=Recognition.GetTreeParentWindow(frameDesc_i);var parentName=parentWin.name;if(winName.indexOf("Applet")!=-1&&parentName.indexOf("_svf")!=-1)_array.push(win)}var tree=[];if(_array.length>0)for(var i=0;i<_array.length;i++){var temptree=[];var btreeframe=false;var _win=_array[i];var divs=_win.document.getElementsByTagName("DIV");
for(var j=0;j<divs.length;j++){var el=divs[j];var id=el.getAttribute("id");if(id.indexOf("s_S_A")!=-1){var ocl=el.getAttribute("onclick").toString();if(ocl){var ha="HandleAppletClick";if(ocl.indexOf(ha)!=-1){var applet=FindSubString('HandleAppletClick("',ocl,'")');var _applet=applet.toUpperCase();_applet=_applet.replace(/ /g,"_");_applet=_applet.replace(/\/\//g,"");temptree.push(_applet)}}}else if(id.indexOf("axtreectrl")!=-1)btreeframe=true}if(btreeframe)for(var k=0;k<temptree.length;k++)tree.push(temptree[k])}return tree},
__:void 0});ApplicationMap.Register(new Siebel7Application);var SiebelODApplication=function(){ApplicationBase.call(this);this.Name="SIEBELOD";this.ContextVersion=1;this.ContextParts=[ContextPart.CreateValue("V","View")]};SiebelODApplication.prototype=ExtendClass(ApplicationBase.prototype,{__:void 0});ApplicationMap.Register(new SiebelODApplication);var StateStrApplication=function(){ApplicationBase.call(this);this.Name="STATESTR"};
StateStrApplication.prototype=ExtendClass(ApplicationBase.prototype,{CreateSearchExpression:function(values){var value=values[0];var prefix=this.ContextParts[0][0];var builder=new SearchExpressionBuilder;builder.AddValue(value);builder.AddValue(prefix+value);builder.AddValue(prefix+prefix+value);return builder.ToObject()}});ApplicationMap.Register(new StateStrApplication);var StdHtmlApplication=function(){SmartMatchApplication.call(this);this.Name="STDHTML"};
StdHtmlApplication.prototype=ExtendClass(SmartMatchApplication.prototype,{__:void 0});ApplicationMap.Register(new StdHtmlApplication);var Gkod_Undefined;if(window.Gkod===Gkod_Undefined)Gkod={};if(Gkod.Helper===Gkod_Undefined)Gkod.Helper={};
if(Gkod.Helper.$Component===Gkod_Undefined){Gkod.Helper.$Component={};Gkod.Helper.$ComponentLoading=null;Gkod.Helper.LoadComponent=function(c){var _c;if(Gkod.Helper.$ComponentLoading!==null){_c=Gkod.Helper.$Component[Gkod.Helper.$ComponentLoading];if(_c!==Gkod_Undefined&&_c.loading)Gkod.Trace.Error("Gkod.Helper.LoadComponent, unfinished load detected, ["+Gkod.Helper.$ComponentLoading+"], now loading ["+c+"]")}_c=Gkod.Helper.$Component[c];if(_c!==Gkod_Undefined){if(!_c.loading)return false;Gkod.Trace.Error("Gkod.Helper.LoadComponent, unfinished load detected, reloading component ["+
c+"]")}Gkod.Helper.$ComponentLoading=c;Gkod.Helper.$Component[c]={loading:true,time:(new Date).getTime(),elapsed:0};Gkod.Trace.Write(c+" loading...");return true};Gkod.Helper.ComponentLoaded=function(c){if(c===Gkod_Undefined)c=Gkod.Helper.$ComponentLoading;var _c;if(c!==null&&c!==Gkod_Undefined)_c=Gkod.Helper.$Component[c];if(_c===Gkod_Undefined){Gkod.Trace.Error("Gkod.Helper.ComponentLoaded, wrong call: component not loaded ["+c+"]");Gkod.Helper.LoadComponent(c);_c=Gkod.Helper.$Component[c]}else if(!_c.loading)Gkod.Trace.Error("Gkod.Helper.ComponentLoaded, wrong call: component already loaded ["+
c+"]");_c.loading=false;_c.elapsed=(new Date).getTime()-_c.time;Gkod.Helper.$ComponentLoading=null;Gkod.Trace.Write(c+" loaded in "+_c.elapsed+" ms")}}Gkod_Helper_Debug=false;Gkod_Helper_Checks=false;Gkod.Helper.IE=navigator.userAgent.indexOf("MSIE ")>-1;Gkod.Helper.IE7=navigator.userAgent.indexOf("MSIE 7")>-1;Gkod.Helper.Check=Gkod_Helper_Checks?function(v,e){if(!!v)return true;Gkod.Trace.Error("Check failed, "+e);return false}:function(v){return!!v};
Gkod.Helper.Ensure=function(v,e){if(this.Check(v,e))return true;throw"EnsureFail"+(e!==Gkod_Undefined?"("+e+")":"");};Gkod.Helper.Exception=function(e,s){Gkod.Trace.Error(s+(s!==Gkod_Undefined?", ":"")+"Exception: "+(e.message||String(e)))};Gkod.Helper.TryCall=function(f,n){if(!Gkod.Helper.IsArray(f)){try{f.call();return true}catch(e){if(n)Gkod.Helper.Exception(e,n)}return false}for(var i=0;i<f.length;++i)try{f.call();return true}catch(e){if(n)Gkod.Helper.Exception(e,n)}return false};
Gkod.Helper.GetException=function(e){return e.message||String(e)};Gkod.Helper.Is=function(o,t){return o===Gkod_Undefined||o===null?o===t:o.constructor===t};Gkod.Helper.IsNull=function(o){return o===Gkod_Undefined||o===null};Gkod.Helper.IsEmpty=function(o){return o===Gkod_Undefined||o===null||o.length!==Gkod_Undefined&&o.length==0};Gkod.Helper.IsFunction=function(o){return typeof o=="function"};Gkod.Helper.IsWindow=function(o){return typeof o=="object"&&o.constructor==Window};
Gkod.Helper.IsObject=function(o){return typeof o=="object"};Gkod.Helper.IsArray=function(o){return typeof o=="object"&&o.join!==Gkod_Undefined&&o.push!==Gkod_Undefined&&o.length!==Gkod_Undefined};Gkod.Helper.IsString=function(o){return typeof o=="string"||typeof o=="object"&&o.constructor==String};Gkod.Helper.IsNumber=function(o){return typeof o=="number"||typeof o=="object"&&o.constructor==Number};Gkod.Helper.IsBoolean=function(o){return typeof o=="boolean"||typeof o=="object"&&o.constructor==Boolean};
Gkod.Helper.IsHashObject=function(o){return typeof o=="object"&&o.constructor!=String&&o.constructor!=Number&&o.constructor!=Boolean};Gkod.Helper.Nop=function(){};Gkod.Helper.EnsureMember=function(o,m,v){var undefined;if(o[m]===undefined)o[m]=v};Gkod.Helper.Override=function(d,s){var undefined;if(s===undefined||s===null)return d;for(var m in s)d[m]=s[m];return d};Gkod.Helper.Merge=function(d,s){var undefined;if(s===undefined||s===null)return d;for(var m in s)if(d[m]===undefined)d[m]=s[m];return d};
Gkod.Helper.Extend=function(d,s){var undefined;if(d===undefined||d===null)d={};for(var m in s){var $m=s[m];d[m]=Gkod.Helper.IsHashObject($m)?Gkod.Helper.Extend(d[m],$m):$m}return d};
Gkod.Helper.Clone=function(v){try{var undefined;var t=typeof v;if(t!="object"){if(t=="string")return String(v);if(t=="number")return Number(v);if(t=="boolean")return Boolean(v);if(t=="function"||t=="undefined")return v}if(v===null||v.attachEvent||v.QueryInterface||v.constructor===undefined)return v;if(v.constructor===String)return String(v);if(v.constructor===Number)return Number(v);if(v.constructor===Boolean)return Boolean(v);if(v.constructor===RegExp)return RegExp(v);if(v.constructor===Function)return v;
var undefined;var b=v.constructor===Array||v.push&&v.pop&&v.splice?[]:{};if(b.__proto__!==v.__proto__)b.__proto__=v.__proto__;if(b.prototype!==v.prototype)b.prototype=v.prototype;for(var m in v)b[m]=v[m];return b}catch(e){}return v};
Gkod.Helper._DeepClone=function(a){try{var undefined;var b=a.constructor===Array||a.push&&a.pop&&a.splice?[]:{};if(b.__proto__!==a.__proto__)b.__proto__=a.__proto__;if(b.prototype!==a.prototype)b.prototype=a.prototype;for(var m in a)try{var v=a[m];var t=typeof v;if(t!="object"){if(t=="string"){b[m]=String(v);continue}if(t=="number"){b[m]=Number(v);continue}if(t=="boolean"){b[m]=Boolean(v);continue}if(t=="function"||t=="undefined"){b[m]=v;continue}}if(v===null||v.attachEvent||v.QueryInterface||v.constructor===
undefined){b[m]=v;continue}if(v.constructor===String){b[m]=String(v);continue}if(v.constructor===Number){b[m]=Number(v);continue}if(v.constructor===Boolean){b[m]=Boolean(v);continue}if(v.constructor===RegExp){b[m]=RegExp(v);continue}if(v.constructor===Function){b[m]=v;continue}b[m]=Gkod.Helper._DeepClone(v)}catch(e){b[m]=v}return b}catch(e){}return a};Gkod.Helper.DeepClone=function(a){return Gkod.Helper._DeepClone({_:a})._};
Gkod.Helper.Equals=function(a,b){if(a===b)return true;if(a==null||b==null)return false;var t=typeof a;if(t=="undefined"||typeof b=="undefined")return false;if(a.QueryInterface)return false;if(t!=typeof b)return a==b;if(t!="object"){if(t=="string"||t=="number"||t=="boolean")return a==b;if(t=="function")if(String(a)!=String(b))return false}else{var c=a.constructor;if(c!==b.constructor)return false;if(c===String||c===Number||c===Boolean||c===RegExp)return a==b;if(c===Function){if(String(a)!=String(b))return false}else if(c===
Array||a.push&&a.pop&&a.splice)if(a.length!=b.length)return false}var undefined;var x={};for(var m in a){x[m]=true;if(a[m]!==undefined&&b[m]===undefined||!Gkod.Helper.Equals(a[m],b[m]))return false}for(var m in b)if(!x[m])return false;return true};Gkod.Helper.SerializeString=function(s){var undefined;if(s===undefined||s===null)return'""';return'"'+String(s).replace(/(["\\])/g,"\\$1").replace(/\r\n|\n|\r/g,"\\n").replace("</","<\\/")+'"'};
Gkod.Helper.Serialize=function(v,maxdepth,depth){var undefined;if(v===undefined||v===null)return"null";if(Gkod.Helper.IsString(v))return'"'+v.replace(/(["\\])/g,"\\$1").replace(/\r\n|\n|\r/g,"\\n").replace("</","<\\/")+'"';if(Gkod.Helper.IsNumber(v))return String(v);if(Gkod.Helper.IsBoolean(v))return v?"true":"false";if(Gkod.Helper.IsFunction(v))return v;if(v.attachEvent||v.QueryInterface)return"null";if(maxdepth===undefined)maxdepth=20;if(maxdepth>0)depth=depth>0?depth+1:1;if(Gkod.Helper.IsArray(v)){if(depth>
maxdepth)return"[]";var a=[];for(var i=0,n=v.length;i<n;++i)try{a.push(Gkod.Helper.Serialize(v[i],maxdepth,depth))}catch(_e){}return"["+a.join()+"]"}if(Gkod.Helper.IsObject(v)){if(depth>maxdepth)return"{}";var a=[];for(var m in v)try{a.push(Gkod.Helper.SerializeString(m)+":"+Gkod.Helper.Serialize(v[m],maxdepth,depth))}catch(_e){}return"{"+a.join()+"}"}return"null"};Gkod.Helper.Get=function(o,d){var undefined;return o===undefined?d:o};
Gkod.Helper.GetNonNull=function(o,d){return Gkod.Helper.IsNull(o)?d:o};Gkod.Helper.GetNonEmpty=function(o,d){return Gkod.Helper.IsEmpty(o)?d:o};Gkod.Helper.CaseInsensitiveCompare=function(a,b){var la=a.toLowerCase();var lb=b.toLowerCase();return la<lb?-1:la==lb?a<b?-1:a==b?0:1:1};Gkod.Helper.SortMap=function(map,compareFn){var a=new Array;for(var m in map)a.push(m);a.sort(compareFn);var r=new Object;for(var i=0;i<a.length;++i)r[a[i]]=map[a[i]];return r};Gkod.Helper.GetTime=function(){return(new Date).getTime()};
Gkod.Helper.GetElapsed=function(t){return(new Date).getTime()-t};Gkod.Helper.PostfixFilename=function(s,x){var _s=String(s);var r=_s.replace(/\.([^\/]*)$/,x+".$1");if(r==_s)r+=x;return r};Gkod.Helper.Trim=function(s){var _s=String(s);return _s.replace(/^\s+|\s+$/g,"")};Gkod.Helper.LeftTrim=function(s){var _s=String(s);return _s.replace(/^\s+/g,"")};Gkod.Helper.RightTrim=function(s){var _s=String(s);return _s.replace(/\s+$/g,"")};
Gkod.Helper.Strip=function(s){var _s=String(s);return _s.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")};Gkod.Helper.EscapeRegExp=function(s){return String(s).replace(/([\^\$\.\*\+\?\|\(\)\[\]\{\}\\])/g,"\\$1")};Gkod.Helper.EscapeHtml=function(s){if(s===null)return"";return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};
Gkod.Helper.FormatHtml=function(fmt,arg){var undefined;var s="";arg=arg||new Object;var a=String(fmt).match(/[^\n\{<]+|<[\/]?(?:[biu]|h[1-6]|br)[\/]?>|[<\n]|\{(?:[0-9A-Z_]+\})?/g);if(a)for(var i=0,n=a.length;i<n;++i){var $i=a[i];var $c=$i.charAt(0);if($c=="{"&&$i.length>1){var v=arg[$i.substr(1,$i.length-2)];if(v!==undefined)s+=String(v)}else if($c=="<"&&$i.length>1)s+=$i;else if($c=="\n")s+="<br/>";else s+=Gkod.Helper.EscapeHtml($i)}return s};Gkod.Helper._fsrx=/[^\{]+|\{(?:[0-9A-Za-z_]+\})?/g;
Gkod.Helper.FormatString=function(format,args){if(format==null)return null;var r="";var a=String(format).match(this._fsrx);if(a)for(var i=0,n=a.length;i<n;++i){var t=a[i];if(t.charAt(0)!="{"||t.length==1)r+=t;else if(args){var v=args[t.substr(1,t.length-2)];if(v!=null)r+=String(v)}}return r};Gkod.Helper.Padz=function(s,l,c){var undefined;if(l===undefined)l=2;if(c===undefined)c="0";s=String(s);if(s.length>=l)return s;var cc="";for(var i=s.length;i<l;++i)cc+=c;return cc+s};
Gkod.Helper.Fill=function(s,l,c){var undefined;if(l===undefined)l=2;if(c===undefined)c=" ";s=String(s);if(s.length>=l)return s;var cc="";for(var i=s.length;i<l;++i)cc+=c;return s+cc};Gkod.Helper.GetLines=function(s){var _s=String(s);var a=_s.match(/[^\n\r]+|\r\n|\n|\r/g);var r=[];if(!a)return r;for(var i=0,n=a.length;i<n;++i){var $i=a[i];if($i.length==0){r.push("");continue}var c=$i[0];if(c=="\n"||c=="\r")continue;r.push($i)}return r};
Gkod.Helper.FilterLines=function(lines,m){var r=[];for(var i=0,n=lines.length;i<n;++i){var $i=lines[i];if($i.match(m))r.push($i)}return r};Gkod.Helper.GetVersion=function(text,d){var undefined;if(d===undefined)d=null;var a=text.match(/<\!--Version\s+([0-9\.]+)--\>/i);return a&&a.length==2?a[1]:d};Gkod.Helper.$uid={};
Gkod.Helper.UniqueId=function(p){var undefined;var k=p===undefined?"__uid__":p;var v;if(Gkod.Helper.$uid[k]===undefined)v=Gkod.Helper.$uid[k]=1;else v=++Gkod.Helper.$uid[k];return p===undefined?v:p+v};Gkod.Helper.GetInRange=function(n,l,h){if(n<l)return l;if(n>h)return h;return n};Gkod.Helper.GetInCircularRange=function(n,l,h){if(n<l)return h;if(n>h)return l;return n};Gkod.Helper.Join=function(a,c){return a===Gkod_Undefined||a===null?"":a.join(c)};
Gkod.Helper.Contains=function(a,item){for(var i=0,n=a.length;i<n;++i)if(a[i]==item)return true;return false};Gkod.Helper.IndexOf=function(a,item,i){i=i||0;var l=a.length;if(i<0)i=l+i;for(;i<l;i++)if(a[i]==item)return i;return-1};Gkod.Helper.GetOption=function(v,a,d){if(Gkod.Helper.IndexOf(a,v)!=-1)return v;var undefined;if(d!==undefined)return d;return a&&a.length>0?a[0]:null};Gkod.Helper.GetKeys=function(o){var a=[];for(var m in o)a.push(m);return a};
Gkod.Helper.GetValues=function(o){var a=[];for(var m in o)a.push(o[m]);return a};Gkod.Helper.CombineUrl=function(u,s){var w=(String(u).replace(/(:?[^\/]+)(?:#[\s\S]*)?$/,"")+String(s)).replace("/./","/");var x;while((x=w.replace(/\/[\.]?[^\/\.][^\/]*\/\.\.[\/]/,"/"))!=w)w=x;return w};Gkod.Helper.StopPropagation=function(e){e=e||window.event;if(!e)return;if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true};
Gkod.Helper.RenderMouseHover=function(c){var undefined;if(c===undefined)c="active";return" onmouseover=\"Gkod.Helper.Dom.AddClassName(this,'"+c+"')\" onmouseout=\"Gkod.Helper.Dom.RemoveClassName(this,'"+c+"')\" "};Gkod.Helper.RenderComment=function(body){var s='<div style="float:right;width:0px;overflow:'+(Gkod.Helper.IE7?"hidden":"visible")+'">'+'<div style="position:relative;text-align:left">'+body+"</div>"+"</div>";return s};Gkod.Helper.IsApplicationNameEx=function(n){return/^[_A-Za-z0-9\-]{1,8}(?:\/[_A-Za-z0-9\-]{1,8})?$/.test(n)};
Gkod.Helper.Dom={};Gkod.Helper.Dom.E=function(id,n){var undefined;if(n===undefined)n=document;n=n.getElementById(id);if(!!n)return n;throw'Gkod.Helper.Dom.E, missing id="'+id+'"';};Gkod.Helper.Dom.EA=function(ids,n){var undefined;if(n===undefined)n=document;var a=ids.split(",");var na=[];for(var i=0,ni=a.length;i<ni;++i){var $n=n.getElementById(a[i]);if($n)na.push($n)}return na};Gkod.Helper.Dom.RemoveNode=function(n){if(!n||!n.parentNode)return;n.parentNode.removeChild(n)};
Gkod.Helper.Dom.Get=function(id,n){var undefined;if(n===undefined)n=document;return n.getElementById(id)};
Gkod.Helper.Dom.GetElements=function(n,t,c){var undefined;n=n||document;if(c!==undefined&&n.getElementsByClassName){var l=n.getElementsByClassName(c);if(t===undefined)return l;t=t.toUpperCase();var a=[];for(var i=0;i<l.length;++i)if(l[i].tagName==t)a.push(l[i]);return a}if(t!==undefined){var l=n.getElementsByTagName(t);if(c===undefined)return l;var a=[];var x=new RegExp("(^|\\s)"+c+"(\\s|$)");for(var i=0;i<l.length;++i)if(l[i].className==c||x.test(l[i].className))a.push(l[i]);return a}return null};
Gkod.Helper.Dom.GetBoundingRect=function(n){var r={left:0,top:0,right:0,bottom:0};if(!n||!n.getBoundingClientRect)return r;return n.getBoundingClientRect()};Gkod.Helper.Dom.GetTextContent=function(n){return n.innerText||n.textContent};Gkod.Helper.Dom.SetTextContent=function(n,v){if(n.innerText===Gkod_Undefined)n.textContent=v;else n.innerText=v};Gkod.Helper.Dom.SetStyle=function(n,s,v){n.style[s]=v};
Gkod.Helper.Dom.HasClassName=function(n,c){var cc=n.className;return cc.length>0&&(cc==c||(new RegExp("(^|\\s)"+c+"(\\s|$)")).test(cc))};Gkod.Helper.Dom.AddClassName=function(n,c,add){if(add===false)return Gkod.Helper.Dom.RemoveClassName(n,c);if(Gkod.Helper.Dom.HasClassName(n,c))return;n.className+=(n.className?" ":"")+c};Gkod.Helper.Dom.RemoveClassName=function(n,c){n.className=Gkod.Helper.Trim(n.className.replace(new RegExp("(^|\\s+)"+c+"(\\s+|$)")," "))};
Gkod.Helper.Dom.WriteLine=function(n,v){n.innerHTML+=v+"<br />"};
Gkod.Helper.Dom.Focus=function(n,ids){if(n===null)n=document;var undefined;var a=ids===undefined?[n]:Gkod.Helper.Dom.EA(ids,n);for(var i=0,ni=a.length;i<ni;++i){var $n=a[i];var na;if($n.tagName&&"INPUT,SELECT,TEXTAREA,A".indexOf($n.tagName)>=0)na=[$n];else{na=$n.getElementsByTagName("FORM");if(!na||na.length==0){na=$n.getElementsByTagName("INPUT");if(!na||na.length==0){na=$n.getElementsByTagName("SELECT");if(!na||na.length==0){na=$n.getElementsByTagName("TEXTAREA");if(!na||na.length==0)na=$n.getElementsByTagName("A")}}}}if(na&&
na.length>0){var $na=na[0];if($na.tagName=="FORM"){var found=false;for(var j=0;j<$na.length;++j){var $e=$na.elements[j];if($e.type=="hidden")continue;$na=$e;found=true;break}if(!found)$na=null}if($na){$na.focus();if($na.tagName=="INPUT"||$na.tagName=="TEXTAREA")$na.select();return}}}};Gkod.Helper.Dom.SetValue=function(n,v){n.value=v};Gkod.Helper.Dom.IsVisible=function(n){return n.style.display!="none"};
Gkod.Helper.Dom.Toggle=function(n,s){if(n===null)n=document;var a,i,ni;a=s.split(",");for(i=0,ni=a.length;i<ni;++i){var $i=a[i];if($i.length==0)continue;var $n=n.getElementById($i);if($n)$n.style.display=$n.style.display=="none"?"":"none"}};
Gkod.Helper.Dom.Show=function(n,s,b){var undefined;if(b===undefined)b=true;if(n===null)n=document;var show=!!b?"":"none";var a,i,ni;a=s.split(",");for(i=0,ni=a.length;i<ni;++i){var $i=a[i];if($i.length==0)continue;var $n=n.getElementById($i);if($n)$n.style.display=show}};Gkod.Helper.Dom.Hide=function(n,s){return Gkod.Helper.Dom.Show(n,s,false)};Gkod.Helper.Dom.ShowHide=function(n,s,h,mf){Gkod.Helper.Dom.Show(n,h,false);Gkod.Helper.Dom.Show(n,s,true);if(!mf)this.Focus(n,s)};
Gkod.Helper.Url=function(p){this.p=String(p);var a=this.p.match(/^[^\?#&]*|[\?&][^\?#&=]*|=[^\?#&]*|#.*$/g);this.url=a.length>0?a[0]:"";this.fragment=a.length>1&&a[a.length-1].charAt(0)=="#"?a.pop().substr(1):null;this.query={};for(var i=1,n=a.length;i<n;++i){var ai=a[i++];if(i<n&&a[i].charAt(0)==="="){this.query[ai.substr(1)]=decodeURIComponent(a[i].substr(1));continue}this.query[ai.substr(1)]="";--i}};Gkod.Helper.Url.prototype.toString=function(){return this.p};
Gkod.Helper.Url.prototype.GetUrl=function(){return this.url};Gkod.Helper.Url.prototype.GetQuery=function(){return this.query};Gkod.Helper.Url.prototype.GetFragment=function(){return this.fragment};Gkod.Helper.Url.prototype.GetParam=function(p,d){var undefined;var r=this.query[p];return r===undefined?d:r};Gkod.Helper.Url.prototype.Safe_GetParam=function(p,l,d){var undefined;var r=this.query[p];if(r===undefined)return d;r=r.replace(/[<'">]/g,"");if(l!==undefined&&r.length>l)r=r.substr(0,l);return r};
Gkod.Helper.Url.GetDomain=function(u){var a=String(u).match(/:\/\/+([^\/:]+)(?::[^\/]+)?\//);if(!a||a.length!=2)return null;return a[1]};
Gkod.Helper.AjaxRequest=function(url,options){var undefined;if(options===undefined)options={};if(options.method)options.method.toUpperCase();this.id=Gkod.Helper.UniqueId("ax");this.url=url;this.options=options;this.contentType=options.contentType?options.contentType:"application/x-www-form-urlencoded";this.parameters=options.parameters;this.method=Gkod.Helper.GetOption(options.method,["GET","POST","HEAD"]);this.queryParams=Gkod.Helper.AjaxRequest.$CreateQueryString(options.parameters);if(this.method!=
"POST"&&this.queryParams.length>0)this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryParams;this.body=this.method=="POST"?this.queryParams:null;this.asynchronous=!!this.options.asynchronous;this.request=null;this.aborted=false;this.$completed=false;if(window.XMLHttpRequest)this.request=new XMLHttpRequest;else if(window.ActiveXObject&&!(this.request=new ActiveXObject("Msxml2.XMLHTTP")))this.request=new ActiveXObject("Microsoft.XMLHTTP");if(!this.request)throw"Gkod.Helper.AjaxRequest, no transport";
this.$DoRequest()};Gkod.Helper.AjaxRequest.States=["Unsent","Opened","HeadersReceived","Loading","Done"];Gkod.Helper.AjaxRequest.$CreateQueryString=function(params){var undefined;if(params===undefined)params={};var a=[];params._=(new Date).getTime();for(var key in params){var value=params[key];a.push(value===undefined?key:key+"="+encodeURIComponent(String(value)))}return a.join("&")};
Gkod.Helper.AjaxRequest.prototype.$OnReadyStateChange=function(){if(this.$completed)return;var rs=this.request.readyState;var state=Gkod.Helper.AjaxRequest.States[rs];if(rs==4)this.$completed=true;try{(this.options["On"+state]||Gkod.Helper.Nop)(this)}catch(e){this.$OnException(e)}if(this.$completed){this.request.onreadystatechange=function(){};try{(this.options["On"+(this.Success()?"Success":"Failure")]||Gkod.Helper.Nop)(this)}catch(e){this.$OnException(e)}}};
Gkod.Helper.AjaxRequest.prototype.$DoRequest=function(){try{var myself=this;this.request.onreadystatechange=function(){myself.$OnReadyStateChange()};this.request.open(this.method,this.url,this.asynchronous);this.$SetHeaders();this.request.send(this.body);if(!this.asynchronous)myself.$OnReadyStateChange()}catch(e){this.$OnException(e)}};
Gkod.Helper.AjaxRequest.prototype.$SetHeaders=function(){var header={Accept:"text/plain, text/javascript, text/html, text/xml, application/xml, */*"};if(this.method=="POST"){if(!!this.contentType)header["Content-type"]=this.contentType+"; charset=UTF-8";if(this.request.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)header["Connection"]="close"}if(!!this.options.header)for(var m in this.options.header)header[m]=this.options.header[m];for(var m in header)this.request.setRequestHeader(m,
header[m])};Gkod.Helper.AjaxRequest.prototype.Abort=function(){if(!this.$completed)this.request.abort()};Gkod.Helper.AjaxRequest.prototype.Success=function(){var s=this.GetStatus();return!s||s>=200&&s<300};Gkod.Helper.AjaxRequest.prototype.GetStatus=function(){try{return this.request.status||0}catch(e){return 0}};Gkod.Helper.AjaxRequest.prototype.EvalResponse=function(){try{return eval(this.request.responseText||"")}catch(e){this.$OnException(e)}};
Gkod.Helper.AjaxRequest.prototype.GetResponseHeader=function(name){try{return this.request.getResponseHeader(name)||null}catch(e){return null}};Gkod.Helper.AjaxRequest.prototype.GetResponseText=function(){return this.Success()?this.request.responseText:null};Gkod.Helper.AjaxRequest.prototype.GetResponseXML=function(){return this.Success()?this.request.responseXML:null};Gkod.Helper.AjaxRequest.prototype.$OnException=function(e){if(this.options.OnException)this.options.OnException(this,e)};
Gkod.Helper.PingUrl=function(url,options){var o=Gkod.Helper.Override({},options);o.method="HEAD";o.asynchronous=false;return(new Gkod.Helper.AjaxRequest(url,o)).Success()};Gkod.Helper.Load=function(url,options){var o=Gkod.Helper.Override({},options);o.asynchronous=false;return new Gkod.Helper.AjaxRequest(url,o)};Gkod.Helper.LoadText=function(url,options){return Gkod.Helper.Load(url,options).GetResponseText()};Gkod.Helper.LoadXml=function(url,options){return Gkod.Helper.Load(url,options).GetResponseXML()};
Gkod.Helper.LoadJson=function(url,options){var __t=Gkod.Helper.LoadText(url,options);if(__t===null)return null;return function(){try{return eval("(function(){return "+__t+"}).call()")}catch(e){Gkod.Helper.Exception(e,"Gkod.Helper.LoadJson: "+url);return null}}.call()};
Gkod.Helper.LoadScript=function(url,options){var __t=Gkod.Helper.LoadText(url,options);if(__t==null)return false;var ok=true;(function(){try{eval(__t)}catch(e){ok=false;Gkod.Helper.Exception(e,"Gkod.Helper.LoadScript: "+url)}}).call();return ok};
Gkod.Helper.AsyncPingUrl=function(url,process,options){var undefined;var o=Gkod.Helper.Override({},options);var onDone=o.OnDone;o.method="HEAD";o.asynchronous=true;o.OnDone=function(arq){try{if(onDone!==undefined)onDone.call(arq,arq)}catch(e){}if(process!==undefined)process.call(arq,arq.Success(),arq)};return new Gkod.Helper.AjaxRequest(url,o)};
Gkod.Helper.AsyncLoad=function(url,process,options){var undefined;var o=Gkod.Helper.Override({},options);var onDone=o.OnDone;o.asynchronous=true;o.OnDone=function(arq){try{if(onDone!==undefined)onDone.call(arq,arq)}catch(e){}if(process!==undefined)process.call(arq,arq.Success()?arq.request.responseText:null,arq)};return new Gkod.Helper.AjaxRequest(url,o)};Gkod.Helper.Cache=function(){this.c=new Object};Gkod.Helper.Cache.prototype.Set=function(n,v){this.c[n]=v};
Gkod.Helper.Cache.prototype.Get=function(n,dv){var undefined;var v=this.c[n];return v===undefined?dv:v};Gkod.Helper.Cache.prototype.Clear=function(){this.c=new Object};Gkod.Helper._GetTextContent=function(node){var undefined;if(node.textConent!==undefined)return node.textContent;var c=node.childNodes;var t="";for(var i=0,n=c.length;i<n;++i){var $i=c[i];if($i.nodeType==1)t+=Gkod.Helper._GetTextContent($i);else if($i.nodeType==3)t+=$i.nodeValue;else if($i.nodeType==4)t+=$i.data}return t};
Gkod.Helper.GetXmlResourceUrl=function(url,lang){url=url||"";var rclang=lang&&lang!=""?lang.toLowerCase()+".":"";var rcs=(url==""||/[\/]$/.test(url)?"":".")+rclang+"resources.xml";return url.replace(/(?:\.[^\.\/]*)?$/,rcs)};
Gkod.Helper.LoadXmlResource=function(url,lang){lang=lang||"";var rsu=Gkod.Helper.GetXmlResourceUrl(url,lang);var xrc=Gkod.Helper.LoadXml(rsu);var rc=new Object;if(xrc){var erg=xrc.getElementsByTagName("resource");for(var i=0,n=erg.length;i<n;++i){var $i=erg[i];var a=$i.attributes[0].nodeValue;if(!a)continue;rc[a]=Gkod.Helper.Trim(Gkod.Helper._GetTextContent($i))}}return rc};Gkod.Helper._RM_cache=new Gkod.Helper.Cache;Gkod.Helper._RM_rx=/[^\{]+|\{(?:rc:[^\}]+\})?/g;
Gkod.Helper._RM={_LoadResourceObject:function(url,lang,loadNeutral){var undefined;var rmc=Gkod.Helper._RM_cache;lang=lang||"";var la=new Array(lang);if(loadNeutral&&lang!="")la.push("");var rc=new Object;while(la.length>0){var l=la.shift();var n=url+"?"+l;var c=rmc.Get(n);if(c===undefined){c=Gkod.Helper.LoadXmlResource(url,l);if(!c)c=new Object;rmc.Set(n,c)}Gkod.Helper.Merge(rc,c)}return rc},_BindString:function(stack,rc,rcl,rci,m,v,ri){var undefined;if(rc[m]!==undefined)return rc[m];var nonbase=
v===undefined;if(nonbase){for(var i=0;i<stack.length;++i)if(stack[i]==m){rc[m]="";return""}ri=rci[m];if(ri!==undefined)v=rcl[ri][m];if(v===undefined){rc[m]="";return""}stack.push(m)}var vb=null;var vp=null;var r="";var a=v.match(Gkod.Helper._RM_rx);if(a)for(var i=0,n=a.length;i<n;++i){var t=a[i];if(t.charAt(0)!="{"||t.length==1)r+=t;else{var x=t.substr(4,t.length-5);if(x=="base"){if(vb==null){vb="";var bi=ri;while(bi>0){--bi;var bs=rcl[bi][m];if(bs!==undefined){vb=this._BindString(stack,rc,rcl,rci,
m,bs,bi);break}}}r+=vb}else if(x=="parent"){if(vp==null){vp="";var p=m.lastIndexOf(".");if(p>=0)vp=this._BindString(stack,rc,rcl,rci,m.substring(0,p))}r+=vp}else{var c0=x.charAt(0);if(c0.toUpperCase()!=c0)r+="(Invalid:"+t+")";else r+=this._BindString(stack,rc,rcl,rci,x)}}}if(nonbase){rc[m]=r;stack.pop()}return r},_BindResources:function(rcl,def){var undefined;var rc=new Object;for(var a in def)rc[a]=def[a];var rci=new Object;for(var i=rcl.length;i>=0;--i){var rcn=rcl[i];for(var m in rcn){if(rc[m]!==
undefined)continue;var v=rcn[m];if(rcn[m].indexOf("{rc:")<0)rc[m]=v;else if(rci[m]===undefined)rci[m]=i}}var empty=new Array;for(var m in rci)this._BindString(empty,rc,rcl,rci,m);return rc},_LoadResources:function(that,lang){var rcl=that.parent?this._LoadResources(that.parent.that,lang):new Array;var rcn=new Object;for(var i=0,n=that.rcs.length;i<n;++i)Gkod.Helper.Override(rcn,this._LoadResourceObject(that.rcs[i],lang,"en",true));rcl.push(rcn);return rcl},AttachResource:function(that,url){var index=
Gkod.Helper.IndexOf(that.rcs,url);if(index!=-1)that.rcs.splice(index,1);that.rcs.push(url)},LoadResources:function(that,lang,def){lang=lang?lang.toUpperCase():"";if(that.lang==lang)return that.rco;var rc=this._BindResources(this._LoadResources(that,lang),def);that.lang=lang;that.rco=rc;return rc}};
Gkod.Helper.CreateResourceManager=function(parent){var undefined;var that=new Object;that.parent=parent||null;that.lang=null;that.rco=new Object;that.rcs=new Array;var rm=Gkod.Helper._RM;var rmo=function(id,d){var v=that.rco[id];return v===undefined?d===undefined?"Undefined:"+id:d:v};rmo.AttachResource=function(url){rm.AttachResource(that,url)};rmo.LoadResources=function(lang,def){rm.LoadResources(that,lang,def)};rmo.GetStrings=function(){return that.rco};rmo.that=that;return rmo};
Gkod.Helper.GetResourceUrl=function(url,lang){var llang=lang.toLowerCase();var rcurl=url.replace(/\.([^\.\/]*)$/,"."+llang+".$1");if(rcurl==url)rcurl+="."+llang;return rcurl};Gkod.Helper.GetResources=function(urls,lang){var rc=Gkod.Helper.CreateResourceManager();urls=Gkod.Helper.IsEmpty(urls)?[""]:Gkod.Helper.IsArray(urls)?urls:[""+urls];for(var i=0,n=urls.length;i<n;++i)rc.AttachResource(urls[i]);rc.LoadResources(lang);return rc};
Gkod.Helper.$LoadResourceScript=function(url){var text=Gkod.Helper.LoadText(url);if(text===null)return null;var rc=function(){var Resource={};try{eval(text)||""}catch(e){Gkod.Helper.Exception(e,"Gkod.Helper.$LoadResourceScript: "+url)}return Resource}.call();return rc};
Gkod.Helper.$Palette=function(id,content,options){var undefined;this.id=id;this.content=content;this.width=options!==undefined&&options.width!==undefined?options.width:0;this.left=options!==undefined&&options.left!==undefined?options.left:0;this.top=options!==undefined&&options.top!==undefined?options.top:0;this.Show()};
Gkod.Helper.$Palette.prototype.Show=function(){var pn=Gkod.Helper.Dom.Get("gkod_$xpalette");var p=Gkod.Helper.$PaletteObj;if(pn!==null&&p!==null&&p.id==this.id)return;if(p!==null)p.Hide();var tn=Gkod.Helper.Dom.Get(this.id);if(!tn)return;var width=this.width>0?this.width:tn.clientWidth+20;n=document.createElement("div");n.id="gkod_$xpalette";n.innerHTML='<div style="position:relative;left:0px;top:0px;width:0px;overflow:visible"><div class="xpalette" style="position:absolute;left:'+this.left+"px;top:"+
this.top+"px;width:"+width+'px">'+this.content+"</div></div>";tn.parentNode.insertBefore(n,null);Gkod.Helper.$PaletteObj=this;var id=this.id;setTimeout(function(){document.onclick=function(){Gkod.Helper.HidePalette(id);document.onclick=null}},10)};Gkod.Helper.$Palette.prototype.Hide=function(){var p=Gkod.Helper.$PaletteObj;if(p===null||p.id!=this.id)return;Gkod.Helper.$PaletteObj=null;Gkod.Helper.Dom.RemoveNode(Gkod.Helper.Dom.Get("gkod_$xpalette"));document.onclick=null};
Gkod.Helper.$PaletteObj=null;Gkod.Helper.ShowPalette=function(id,content,options){new Gkod.Helper.$Palette(id,content,options)};Gkod.Helper.HidePalette=function(id){var p=Gkod.Helper.$PaletteObj;if(p===null||p.id!=id)return;p.Hide()};
Gkod.Helper.SmoothActivation=function(options){var undefined;if(options===undefined)options={};this.cid=null;this.aid=null;this.did=null;this.atimer=-1;this.dtimer=-1;this.atime=options.atime===undefined?50:options.atime;this.dtime=options.dtime===undefined?this.atime:options.dtime;this.fna=options.Activate===undefined?Gkod.Helper.Nop:options.Activate;this.fnd=options.Deactivate===undefined?Gkod.Helper.Nop:options.Deactivate};
Gkod.Helper.SmoothActivation.prototype.Activate=function(id){if(this.aid==id)return;if(this.did==id)return this.$CancelDeactivate();if(this.cid==id)return;if(!!this.cid)this.Deactivate(this.cid);if(!!this.aid)this.$CancelActivate();var _this=this;this.aid=id;this.atimer=setTimeout(function(){_this.$ActivateTimer()},this.atime)};
Gkod.Helper.SmoothActivation.prototype.Deactivate=function(id){if(this.did==id)return;if(this.aid==id)return this.$CancelActivate();if(this.cid!=id||!!this.aid)return;var _this=this;this.did=id;this.dtimer=setTimeout(function(){_this.$DeactivateTimer()},this.dtime)};Gkod.Helper.SmoothActivation.prototype.Cancel=function(){this.$CancelActivate();this.$CancelDeactivate()};
Gkod.Helper.SmoothActivation.prototype.Commit=function(){var did=this.did;this.$CancelActivate();this.$CancelDeactivate();try{did&&this.fnd.call(this,did)}catch(e){Gkod.Helper.Exception(e,"Gkod.Helper.SmoothActivation.Commit")}};Gkod.Helper.SmoothActivation.prototype.$CancelActivate=function(){if(this.atimer>=0)clearTimeout(this.atimer);this.aid=null;this.atimer=-1};
Gkod.Helper.SmoothActivation.prototype.$CancelDeactivate=function(){if(this.dtimer>=0)clearTimeout(this.dtimer);this.did=null;this.dtimer=-1};
Gkod.Helper.SmoothActivation.prototype.$ActivateTimer=function(){if(this.did!==null){clearTimeout(this.dtimer);this.$DeactivateTimer()}if(this.cid!==null){try{this.fnd.call(this,this.cid)}catch(e){Gkod.Helper.Exception(e,"Gkod.Helper.SmoothActivation.$ActivateTimer, deactivate callback")}this.cid=null}try{this.fna.call(this,this.aid)}catch(e){Gkod.Helper.Exception(e,"Gkod.Helper.SmoothActivation.$ActivateTimer, activate callback")}this.cid=this.aid;this.aid=null;this.atimer=-1};
Gkod.Helper.SmoothActivation.prototype.$DeactivateTimer=function(){if(this.cid!=this.did)return Gkod.Trace.Write("Gkod.Helper.SmoothActivation.$DeactivateTimer.Ignore");try{this.fnd.call(this,this.did)}catch(e){Gkod.Helper.Exception(e,"Gkod.Helper.SmoothActivation.$DeactivateTimer, deactivate callback")}this.cid=null;this.did=null;this.dtimer=-1};
var UniqueId={_uid:{},Next:function(label){var k=label==void 0?"__uid__":label;var v;if(UniqueId._uid[k]===void 0)v=UniqueId._uid[k]=1;else v=++UniqueId._uid[k];return label==void 0?v:label+v},Reset:function(label){var k=label==void 0?"__uid__":label;var v=UniqueId._uid[k]||0;UniqueId._uid[k]=0;return label==void 0?v:label+v}};
function AjaxRequest(url,options){this.url=url;var o=options||{};this.options=o;this.method=o.method?o.method.toUpperCase():"GET";this.asynchronous=!!o.asynchronous;this.contentType=o.contentType||"application/x-www-form-urlencoded";this.parameters=HashMap.Extend({},o.parameters||{});if(o.forceGet)this.parameters["_"]=(new Date).getTime();this.id=UniqueId.Next("AjaxRequest");this.queryParams=AjaxRequest.$CreateQueryString(this.parameters);if(this.method!="POST"&&this.queryParams.length>0)this.url+=
(this.url.indexOf("?")>=0?"&":"?")+this.queryParams;this.body=this.method=="POST"?this.queryParams:null;this.request=null;this.aborted=false;this.$completed=false;if(window.XMLHttpRequest)this.request=new XMLHttpRequest;else if(window["ActiveXObject"]&&!(this.request=new ActiveXObject("Msxml2.XMLHTTP")))this.request=new ActiveXObject("Microsoft.XMLHTTP");if(!this.request)throw new Error("AjaxRequest, no transport");this.$DoRequest()}
AjaxRequest.PingUrl=function(url,options){var o=options||{};o.method="HEAD";o.asynchronous=false;return(new AjaxRequest(url,o)).Success()};AjaxRequest.Load=function(url,options){var o=options||{};o.asynchronous=false;return new AjaxRequest(url,o)};AjaxRequest.LoadText=function(url,options){return AjaxRequest.Load(url,options).GetResponseText()};AjaxRequest.LoadXml=function(url,options){return AjaxRequest.Load(url,options).GetResponseXML()};
AjaxRequest.LoadJson=function(url,options){var json=AjaxRequest.Load(url,options).GetResponseText();return Json.DecodeObject(json)};AjaxRequest.States=["Unsent","Opened","HeadersReceived","Loading","Done"];AjaxRequest.Nop=function(){};AjaxRequest.$CreateQueryString=function(params){if(params==void 0)params={};var a=[];for(var key in params){var value=params[key];a.push(value==void 0?key:key+"="+encodeURIComponent(String(value)))}return a.join("&")};
AjaxRequest.prototype.$OnReadyStateChange=function(){if(this.$completed)return;var rs=this.request.readyState;var state=AjaxRequest.States[rs];if(rs==4)this.$completed=true;try{var onState=this.options["On"+state];if(onState)onState(this)}catch(e){if(this.options.OnException)this.options.OnException(this,e);else Fail("AjaxRequest.$OnReadyStateChange",e)}if(this.$completed){this.request.onreadystatechange=function(){};try{var onCompleted=this.options["On"+(this.Success()?"Success":"Failure")];if(onCompleted)onCompleted(this)}catch(e){if(this.options.OnException)this.options.OnException(this,
e);else Fail("AjaxRequest.$OnReadyStateChange","IE memory leak code",e)}}};AjaxRequest.prototype.$DoRequest=function(){try{var myself=this;this.request.onreadystatechange=function(){myself.$OnReadyStateChange()};this.request.open(this.method,this.url,this.asynchronous);this.$SetHeaders();this.request.send(this.body);if(!this.asynchronous)myself.$OnReadyStateChange()}catch(e){if(this.options.OnException)this.options.OnException(this,e);else Fail("AjaxRequest.$DoRequest",e)}};
AjaxRequest.prototype.$SetHeaders=function(){var header={Accept:"text/plain, text/javascript, text/html, text/xml, application/xml, */*"};if(this.method=="POST"){if(!!this.contentType)header["Content-type"]=this.contentType+"; charset=UTF-8";if(this.request.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)header["Connection"]="close"}if(!!this.options.header)for(var m in this.options.header)header[m]=this.options.header[m];for(var m in header)this.request.setRequestHeader(m,
header[m])};AjaxRequest.prototype.Abort=function(){if(!this.$completed)this.request.abort()};AjaxRequest.prototype.Success=function(){var s=this.GetStatus();return!s||s>=200&&s<300};AjaxRequest.prototype.GetStatus=function(){try{return this.request.status||0}catch(e){return 0}};AjaxRequest.prototype.GetResponseHeader=function(name){try{return this.request.getResponseHeader(name)||null}catch(e){return null}};
AjaxRequest.prototype.GetResponseText=function(){return this.Success()?this.request.responseText:null};AjaxRequest.prototype.GetResponseXML=function(){return this.Success()?this.request.responseXML:null};function ConfigNode(node,key){this.Node=node;this.Key=key}ConfigNode.FindPath=function(node,nameList){if(!node)return void 0;for(var i=0,n=nameList.length;i<n;++i)if((node=node[nameList[i]])===void 0)return void 0;return node};
ConfigNode.FindKey=function(node,key){return key&&key.length?ConfigNode.FindPath(node,key.split(".")):node};ConfigNode.CreatePath=function(node,nameList){for(var i=0,n=nameList.length;i<n;++i){var next=node[nameList[i]];if(next===void 0){while(i<n){node[nameList[i]]=next={};node=next;++i}return node}node=next}return node};ConfigNode.CreateKey=function(node,key){return ConfigNode.CreatePath(node,key.split("."))};
ConfigNode.prototype={GetRoot:function(){return this.Node},CreateKey:function(key){return new ConfigNode(ConfigNode.CreateKey(this.Node,key),this.GetAbsoluteKey(key))},OpenKey:function(key){var node=ConfigNode.FindKey(this.Node,key);return new ConfigNode(node,this.GetAbsoluteKey(key))},TryOpenKey:function(key){var node=ConfigNode.FindKey(this.Node,key);return node?new ConfigNode(node,this.GetAbsoluteKey(key)):null},GetValue:function(name){return this.Node[name]},TryGetValue:function(name,defaultValue){var value=
this.Node[name];return value===void 0?defaultValue:value},GetValueByKey:function(key){var value=ConfigNode.FindKey(this.Node,key);return value},TryGetValueByKey:function(key,defaultValue){var value=ConfigNode.FindKey(this.Node,key);return value===void 0?defaultValue:value},GetAbsoluteKey:function(key){return this.Key?this.Key+(key?"."+key:""):key},Extend:function(node){if(this.Node==null)this.Node={};Extend(true,this.Node,node)},Delete:function(name){delete this.Node[name]}};
function Config(data,defaults,loaded){this.Urls=[];this.Data=data||{};this.Defaults=defaults||{};this.Loaded=loaded||false}Config.prototype.AddData=function(url,defaults){this.Urls.push(url);if(defaults)Extend(true,this.Defaults,defaults)};Config.prototype.AddDefaults=function(defaults){Extend(true,this.Defaults,defaults)};
Config.prototype.Load=function(forceLoad){this.Data={};this.Loaded=false;var options=forceLoad?{forceGet:true}:null;Extend(true,this.Data,this.Defaults);for(var i=0,n=this.Urls.length;i<n;++i){var url=this.Urls[i];var obj=AjaxRequest.LoadJson(url,options);if(obj)Extend(true,this.Data,obj)}this.Loaded=true};Config.prototype.GetValue=function(key){return ConfigNode.FindKey(this.Data,key)};
Config.prototype.GetKeys=function(key){var node=ConfigNode.FindKey(this.Data,key);return node?HashMap.GetKeys(node):[]};var LRC={};LRC["en.APP._SMARTHELP_"]="SmartHelp";LRC["de.APP._SMARTHELP_"]="SmartHelp";LRC["es.APP._SMARTHELP_"]="Ayuda Inteligente";LRC["fr.APP._SMARTHELP_"]="SmartHelp";LRC["ja.APP._SMARTHELP_"]="SmartHelp";LRC["nl.APP._SMARTHELP_"]="SmartHelp";var url=new Gkod.Helper.Url(document.URL);GkodConfig={};GkodConfig.AppVersion="11.1.0.0";GkodConfig.Copyright=null;GkodConfig.Title=null;
GkodConfig.Page={};GkodConfig.LoadSuccess=false;GkodConfig.DefaultLanguage="en";GkodConfig.CurrentLanguage=url.Safe_GetParam("LangID",50,"en");GkodConfig.KPLaunch=url.Safe_GetParam("KPLaunch",6,false);GkodConfig.PackageUrl=url.Safe_GetParam("PackageURL",250,null);GkodConfig.LastModifiedBy=url.Safe_GetParam("Username",60,null);GkodConfig.LastModified=0;GkodConfig.UserMap={};GkodConfig.Languages={en:"English"};GkodConfig.PublishData=null;GkodConfig.TestData=null;GkodConfig.AppData=null;
GkodConfig.AppList=null;GkodConfig.ToggleHelp=false;GkodConfig.EnableComments=false;GkodConfig.Standalone=false;GkodConfig.AlwaysShowAdvanced=false;GkodConfig._TemplateMap=null;GkodConfig._PageUpdateFn=null;GkodConfig._PageUpdateTID=null;GkodConfig.SmartHelpEnabledApps={AGILE:true,AGILECNM:true,APP:true,CAUNISD:true,CLARITY:true,FRONT:true,FUSION:true,HYPERION:true,KPATH:true,ORACLE:true,ORACLETM:true,PRIMAP6:true,PSENTONE:true,PST8:true,SAPNWEP:true,SIEBEL7:true,SIEBELOD:true,STDHTML:true};
GkodConfig.Template=function(){this.sections={};this.section=null};GkodConfig.Template.prototype.AddSection=function(name){this.section=this.sections[name];if(this.section===void 0){this.section=new Array;this.sections[name]=this.section}};GkodConfig.Template.prototype.AddVariable=function(name,type,flags){if(name===void 0)return;if(!this.section)this.AddSection("");var o={};o.name=name;o.type=type;o.flags=flags;this.section.push(o)};GkodConfig.TemplateMap=function(){this.map={}};
GkodConfig.TemplateMap.prototype.Add=function(name,template){this.map[name]=template};GkodConfig.TemplateMap.prototype.Get=function(name){return this.map[name]===void 0?null:this.map[name]};GkodConfig.ResetAuthors=function(){GkodConfig.UserMap={}};GkodConfig.AddAuthor=function(author,modifyTime){if(!author)return;GkodConfig.UserMap[author]=author;if(modifyTime&&(!GkodConfig.LastModifiedBy||GkodConfig.LastModified<modifyTime)){GkodConfig.LastModified=modifyTime;GkodConfig.LastModifiedBy=author}};
GkodConfig.SortAuthors=function(){GkodConfig.UserMap=Gkod.Helper.SortMap(GkodConfig.UserMap,Gkod.Helper.CaseInsensitiveCompare)};GkodConfig.IsSupportedBrowser=function(){var _browser=navigator.userAgent.match(/(MSIE|Firefox)[ \/](\d\.\d)/);if(_browser){if(_browser[1]==="MSIE"&&_browser[2]>=7)return true;if(_browser[1]==="Firefox"&&_browser[2]>=3.5)return true}return false};GkodConfig._UrlCache={};
GkodConfig.GetHelpURL=function(){var url=encodeURI("../../iashelp-"+GkodConfig.CurrentLanguage+"/toc.html");if(GkodConfig._UrlCache[url]===void 0)GkodConfig._UrlCache[url]=Gkod.Helper.PingUrl(url);return GkodConfig._UrlCache[url]?url:null};GkodConfig.GetApplicationName=function(id){if(!id)return Gkrc("Config.Title.Unknown");var localizedTitle=LRC[GkodConfig.CurrentLanguage+".APP."+id];if(localizedTitle!=null)return localizedTitle;return GkodConfig.AppList[id]?GkodConfig.AppList[id].Title:id};
GkodConfig.IsSmartHelpApplication=function(appName){return appName=="_SMARTHELP_"};GkodConfig.GetApplicationKey=function(appName){return GkodConfig.IsSmartHelpApplication(appName)?"SmartHelp":"Applications."+appName};GkodConfig.GetApplicationDefaults=function(appName){if(!GkodConfig.IsSmartHelpApplication(appName))return ApplicationMap.TryGetApplicationDefaults(appName);var obj=ConfigDefaults["SmartHelp"];obj["ContentMap"]=GkodConfig.CreateDefaultSmartHelpContentMap();return obj};
GkodConfig.DateFromTime=function(time){return time?new Date(time):null};GkodConfig.CreateDefaultSmartHelpContentMap=function(){var contentMap=[];var apps=GkodConfig.PublishData.TryGetValue("Applications",{});for(var appId in apps){var app=apps[appId];if(app["Published"]&&GkodConfig.SmartHelpEnabledApps[appId])contentMap.push({Application:appId,Language:"*",Url:"../"})}return contentMap};GkodConfig.$Comment=function(id,name,comment,time,by){this.id=id;this.name=name};
GkodConfig.$Comment.prototype.BuildButtons=function(){var has=GkodConfig.Page.comments[this.name]!==void 0;var id=this.id;var name=this.name;var s="";s+='<span id="has_comment_'+id+'"'+(has?"":' style="display:none"')+">"+'<a class="editnote'+(name==""?"_large":"")+'" href="#" '+"onclick=\"Gkod.Helper.StopPropagation(event);GkodConfig.Page.Comment_Change('"+id+"','"+name+"');return false\">"+'<img src="addnote_icon.gif" alt="'+Gkrc("Config.Action.EditNote")+'" title="'+Gkrc("Config.Action.EditNote")+
'"/>'+"</a>"+'<a class="deletenote" href="#" '+'onclick="Gkod.Helper.StopPropagation(event);'+"GkodConfig.Page.Comment_Delete('"+id+"','"+name+"');"+'return false">'+'<img src="deletenote_icon.gif" alt="'+Gkrc("Config.Action.DeleteNote")+'" title="'+Gkrc("Config.Action.DeleteNote")+'"/>'+"</a>"+"</span>"+'<span id="no_comment_'+id+'"'+(has?' style="display:none"':"")+">"+'<a class="addnote'+(name==""?"_large":"")+'" href="#" '+"onclick=\"Gkod.Helper.StopPropagation(event);GkodConfig.Page.Comment_Change('"+
id+"','"+name+"');return false\">"+'<img src="addnote_icon.gif" alt="'+Gkrc("Config.Action.AddNote")+'" title="'+Gkrc("Config.Action.AddNote")+'"/>'+"</a>"+"</span>";return s};GkodConfig.$Comment.prototype.Build=function(){return'<div id="'+this.id+'_cb">'+GkodConfig.Page.RenderComment(this.id,this.name)+"</div>"};
GkodConfig.$Variable=function(rc,id,name,type,flags){var na=name.split("[",2);this.rc=rc;this.varname=na[0];this.varcond=na.length>1&&na[1].charAt(na[1].length-1)=="]"?na[1].substr(0,na[1].length-1):null;this.explainArgs=flags&&flags.explainArgs||null;this.rc_Name=rc("CT.Variable."+name+".Title",this.varcond!==null?rc("CT.Variable."+this.varname+".Title",this.varname):this.varname);this.id=id;this.sid=null;this.name=name;this.type=type;this.flags=flags;this.dob=null;this.required=!!(flags&&flags.required);
this.advanced=!!(flags&&flags.advanced);this.buttons=flags&&flags.buttons&&[].concat(flags.buttons)||null;this.valid=true;this.modified=false;this.cansave=true;this.canreset=false;this.variables=null;this.comment=new GkodConfig.$Comment(this.id+"_cc",this.name);this.hidden=false;this.visible=!this.advanced&&this.Enabled();this.onChanged=flags&&flags.onChanged||null;this.SetExplainAlt(flags&&flags.explainAlt||null)};
GkodConfig.$Variable.prototype.SetTitleAlt=function(alt){this.explainAlt=alt||null;var x=alt?"."+alt:"";var r=this.rc("CT.Variable."+this.name+".Title"+x,null)||this.varcond&&this.rc("CT.Variable."+this.varname+".Title"+x,null);if(!r&&x!="")r=this.rc("CT.Variable."+this.name+".Title",null)||this.varcond&&this.rc("CT.Variable."+this.varname+".Title",null);this.rc_Name=r};
GkodConfig.$Variable.prototype.SetExplainAlt=function(alt){this.explainAlt=alt||null;var x=alt?"."+alt:"";var r=this.rc("CT.Variable."+this.name+".Explain"+x,null)||this.varcond&&this.rc("CT.Variable."+this.varname+".Explain"+x,null);if(!r&&x!="")r=this.rc("CT.Variable."+this.name+".Explain",null)||this.varcond&&this.rc("CT.Variable."+this.varname+".Explain",null);this.rc_Help=r};GkodConfig.$Variable.prototype.AddItem=function(){(this.type.AddItem||Gkod.Helper.Nop).call(this.type,this)};
GkodConfig.$Variable.prototype.DeleteItem=function(ix){(this.type.DeleteItem||Gkod.Helper.Nop).call(this.type,this,ix)};GkodConfig.$Variable.prototype.UndeleteItem=function(ix){(this.type.UndeleteItem||Gkod.Helper.Nop).call(this.type,this,ix)};GkodConfig.$Variable.prototype.MoveItemUp=function(ix){(this.type.MoveItemUp||Gkod.Helper.Nop).call(this.type,this,ix)};GkodConfig.$Variable.prototype.MoveItemDown=function(ix){(this.type.MoveItemDown||Gkod.Helper.Nop).call(this.type,this,ix)};
GkodConfig.$Variable.prototype.Extract=function(vs){if(vs[this.name]!==void 0)return vs[this.name];if(vs[this.varname]===void 0)return this.type.New();if(!this.varcond)return vs[this.varname];var ca=this.varcond.split("=",2);if(Gkod.Helper.Equals(vs[ca[0]],ca.length==2?ca[1]:""))return vs[this.varname];return this.type.New()};
GkodConfig.$Variable.prototype.Enabled=function(){if(this.hidden)return false;if(!this.varcond)return true;if(!this.variables)return false;var ca=this.varcond.split("=",2);return Gkod.Helper.Equals(this.variables[ca[0]],ca.length==2?ca[1]:"")};
GkodConfig.$Variable.prototype.Assign=function(v){this.value=v;if(!this.Enabled())return Gkod.Trace.Write("GkodConfig.$Variable.Assign: Cannot assign "+this.name);var old_v=this.variables[this.varname];this.variables[this.varname]=v;this.dob=this.type.DecompileObject(this.value);if(this.onChanged)this.onChanged.call(this,v)};
GkodConfig.$Variable.prototype.Bind=function(vs){if(vs===void 0)vs=this.variables;else this.variables=vs;this.value=this.Extract(vs);this.dob=this.type.DecompileObject(this.value);this.visible=!this.advanced&&this.Enabled()};
GkodConfig.$Variable.prototype.Build=function(ix){var id_z=this.id+"_z";var id_u=this.id+"_u";var id_v=this.id+"_v";var id_n=this.id+"_n";var id_h=this.id+"_h";var id_hh=this.id+"_hh";var hasHelp=false;var toggleHelp=GkodConfig.ToggleHelp&&hasHelp;var helpVisible=true;var button_s="";if(this.buttons){button_s='<div class="varbuild_buttons" style="padding-top:5px">'+'<table width="100%" cellspacing="0" cellpadding="0">'+"<tr><td>";for(var i=0;i<this.buttons.length;++i)button_s+='<a class="sbutton" href="#"'+
" onclick=\"GkodConfig.Page.Variable_ButtonClick('"+this.id+"',"+i+');return false">'+Gkod.Helper.FormatHtml(this.buttons[i].title)+"</a>";button_s+="</td></tr></table></div>"}try{var s='<div class="sectionitem">'+'<table width="100%" cellspacing="0" cellpadding="0">'+"<tbody><tr>"+'<td class="varname" width="70%">'+Gkod.Helper.EscapeHtml(this.rc_Name)+(this.required?"*":"")+"</td>"+'<td class="notes_heading" width="30%">'+(GkodConfig.EnableComments?Html.Escape(Gkrc("Config.Title.Notes"))+'<span class="comment_buttons">'+
this.comment.BuildButtons()+"</span>":"&nbsp;")+"</td>"+"</tr>"+"<tr>"+'<td class="vr">'+'<div id="vr_'+this.id+'"></div>'+'<div class="varmodify"><div class="varvalue">'+'<div id="'+id_n+'" class="varerror" style="display:none"></div>'+'<div id="'+id_v+'" class="edit">'+(this.type.rc.RowLayout?this.type.RenderControl({va:this,id:this.id,dob:this.dob}):'<table width="100%" cellspacing="0" cellpadding="0">'+'<tr><td class="varrowlabel odd"></td><td class="varcontrol">'+this.type.RenderControl({va:this,
id:this.id,dob:this.dob})+"</td></tr>"+"</table>")+"</div>"+button_s+"</div>"+"</div>"+"</td>"+'<td width="220" class="list_cell">'+"<div>"+(GkodConfig.EnableComments?this.comment.Build():"&nbsp;")+"</div>"+"</td>"+"</tr></tbody></table>"+"</div>"}catch(e){Fail("$Variable.Build",e,this.name)}return s};
GkodConfig.$Variable.prototype.Validate=function(ignore,sync){var vv=this.type.Validate({va:this,id:this.id},true,ignore,sync);if(!ignore){var n=Gkod.Helper.Dom.E(this.id+"_n");if(vv[0]===true||vv[0]===false){n.style.display="none";n.parentNode.className=""}else{n.innerHTML=vv[0];n.style.display="";n.parentNode.className="errormark"}}return vv};GkodConfig.$Variable.prototype.Dispatch=function(action){return this.type.Dispatch&&this.type.Dispatch({va:this,id:this.id,dob:this.dob},action)};
GkodConfig.$Section=function(name,rc,flags){this.id=Gkod.Helper.UniqueId("ie");this.name=name;this.rc=rc&&rc.Title||null;this.rc_Show=rc&&rc.Show||Gkrc("Config.Action.Show");this.rc_Hidden=rc&&rc.Hidden||Gkrc("Config.Explain.HiddenSection");this.list=[];this.onCheckEnabled=flags&&flags.onCheckEnabled||null;this.onCheckVisible=flags&&flags.onCheckVisible||null;this.onShow=flags&&flags.onShow||null;this.advanced=true;this.visible=true;this.enabled=true};
GkodConfig.$Section.prototype.Add=function(va){if(!va.advanced)this.advanced=false;va.sid=this.id;this.list.push(va)};GkodConfig.$Section.prototype.BindPage=function(pg){this.enabled=this.onCheckEnabled?this.onCheckEnabled.call(pg,pg.variables):true;this.visible=this.enabled&&(this.onCheckVisible?this.onCheckVisible.call(pg,pg.variables):true);for(var i=0,n=this.list.length;i<n;++i){var va=this.list[i];va.hidden=!this.visible;va.Bind(pg.variables)}};
GkodConfig.$Section.prototype.Build=function(pg){var s='<div id="s_'+this.id+'" class="app_listsection"'+(!this.enabled||this.advanced?' style="display:none"':"")+">";if(this.enabled){s+=(this.rc?'<div class="app_subsection">'+Gkod.Helper.EscapeHtml(this.rc)+"</div>":"")+'<div class="app_list">';if(this.visible){var index=0;for(var i=0,n=this.list.length;i<n;++i){var va=this.list[i];s+='<div id="v_'+va.id+'" class="'+(va.advanced?" advanced":"")+(va.modified?" modified":"")+'"'+(va.visible?"":' style="display:none"')+
">"+va.Build(i)+"</div>";if(va.visible)++index}}else s+='<div id="sv_'+this.id+'" class="sectioncell">'+'<div class="sectionitem">'+'<div class="sectionhidden">'+Gkod.Helper.FormatHtml(this.rc_Hidden)+"</div>"+"<div>"+(this.onShow?'<span id="svw_'+this.id+'" class="working" style="display:none">&nbsp;'+"</span>"+'<a id="svs_'+this.id+'" class="sbutton" href="#" '+"onclick=\"GkodConfig.Page.Section_Show('"+this.name+"');return false\">"+Gkod.Helper.EscapeHtml(this.rc_Show)+"</a>":"")+"</div>"+"</div>";
s+="</div>"}s+="</div>";return s};GkodConfig.EditedBy_Id=Gkod.Helper.UniqueId("eby");GkodConfig.EditedBy=null;GkodConfig.GetEditedBy=function(){var n=Gkod.Helper.Dom.Get(GkodConfig.EditedBy_Id+"_i");if(!n||!n.value)return"";if(!GkodConfig.UserMap[n.value]){GkodConfig.UserMap[n.value]=n.value;GkodConfig.UserMap=Gkod.Helper.SortMap(GkodConfig.UserMap,Gkod.Helper.CaseInsensitiveCompare)}return n.value};Gkrc=Gkod.Helper.CreateResourceManager();Gkrc.AttachResource("config.js");
GkodConfig.LoadLanguage=function(lang){if(!GkodConfig.Title){Gkrc.LoadResources("en");GkodConfig.Title=Gkrc("Config.Title")}if(lang===void 0)lang=GkodConfig.CurrentLanguage;if(GkodConfig.Languages[lang]===void 0)lang="en";Gkrc.LoadResources(lang);if(GkodConfig.DefaultResource)GkodConfig.DefaultResource.LoadResources(lang);GkodConfig.CurrentLanguage=lang;document.title=Gkrc("Config.Title")};var ConfigDefaults={SmartHelp:{HelpKey:"F9",ContentMap:[]}};
var _ConfigData={ContentUrl:null,Root:null,RootLoaded:false,PublishDataLoaded:false,_Cache:null,Reset:function(){_ConfigData.ContentUrl=null;_ConfigData.Root=new ConfigNode({});_ConfigData.RootLoaded=false;_ConfigData.PublishDataLoaded=false;_ConfigData._Cache={}},Load:function(url){var data=AjaxRequest.LoadJson(_ConfigData.ContentUrl+url);return data},LoadAndCache:function(url){var data=_ConfigData._Cache[url];if(data===void 0){data=_ConfigData.Load(url);_ConfigData._Cache[url]=data||null}return data}};
var ConfigData={GetPublishDataLocation:function(){return"publishdata.json.js"},GetRootConfigDataLocation:function(){return"stdhemi/configdata.json.js"},GetApplicationConfigDataLocation:function(appName){return appName.toLowerCase()+"/hemi/configdata.json.js"},GetApplicationKey:function(appName){return"Applications."+appName},SetContentUrl:function(contentUrl){_ConfigData.Reset();_ConfigData.ContentUrl=contentUrl},LoadPublishData:function(){return _ConfigData.Load(ConfigData.GetPublishDataLocation())},
LoadRootConfigData:function(){return _ConfigData.Load(ConfigData.GetRootConfigDataLocation())},LoadApplicationConfigData:function(appName){return _ConfigData.Load(ConfigData.GetApplicationConfigDataLocation(appName))},GetValueByKey:function(key){var value=_ConfigData.Root.TryGetValueByKey(key);if(value===void 0){var configNode=ConfigData.OpenKey(key);return configNode?configNode.Node:void 0}return value},OpenKey:function(key){return _ConfigData.Root.TryOpenKey(key)||ConfigData._LoadKey(key)},GetApplicationDefaults:function(appName){var appHandler=
ApplicationMap.GetApplication(appName);return appHandler?appHandler.ConfigDefaults:ApplicationBase.prototype.ConfigDefaults},GetApplicationConfig:function(appName,url){var configNode=_ConfigData.Root.TryOpenKey(ConfigData.GetApplicationKey(appName))||ConfigData._LoadAndCacheApplicationConfig(appName,url);return configNode},GetApplicationList:function(){var appHash=ConfigData.GetValueByKey("PublishData.Applications");if(appHash)return HashMap.GetKeys(appHash);return[]},GetDisabledApplicationList:function(){var apps=
[];var appHash=ConfigData.GetValueByKey("PublishData.Applications");if(appHash)for(var appName in appHash){var appInfo=appHash[appName];var enabled=appInfo["Enabled"];if(enabled!==void 0&&!enabled)apps.push(appName)}return apps},GetSmartHelpApplicationList:function(){var uList=[];var uHash={};var appHash=ConfigData.GetValueByKey("PublishData.Applications");if(appHash)for(var appName in appHash){var appInfo=appHash[appName];if(appInfo["Published"]&&appInfo["Enabled"]&&HashMap.AddNewItem(uHash,appName,
true))uList.push(appName)}var contentMap=ConfigData.GetValueByKey("SmartHelp.ContentMap");if(contentMap&&contentMap.length)for(var i=0,n=contentMap.length;i<n;++i){var mapping=contentMap[i];var appName=mapping["Application"];if(appName&&HashMap.AddNewItem(uHash,appName,true))uList.push(appName)}return uList},Reset:function(){_ConfigData.Reset()},_LoadKey:function(key){if(/^Applications\./.test(key)){var nameList=key.split(".");var appName=nameList[1];ConfigData._LoadAndCacheApplicationConfig(appName)}else if(/^SmartHelp(?:\..+)?$/.test(key))ConfigData._LoadAndCacheRootConfig();
else if(/^PublishData(?:\..+)?$/.test(key))ConfigData._LoadAndCachePublishData();else return null;var configNode=_ConfigData.Root.TryOpenKey(key);return configNode},_LoadAndCachePublishData:function(){ConfigData._LoadAndCacheRootConfig();if(_ConfigData.PublishDataLoaded)return true;_ConfigData.PublishDataLoaded=true;var data=_ConfigData.LoadAndCache(ConfigData.GetPublishDataLocation());if(data)_ConfigData.Root.CreateKey("PublishData").Extend(data)},_LoadAndCacheRootConfig:function(){if(_ConfigData.RootLoaded)return true;
_ConfigData.RootLoaded=true;var configNode=_ConfigData.Root;configNode.Extend(ConfigDefaults);var data=_ConfigData.LoadAndCache(ConfigData.GetRootConfigDataLocation());if(data){_ConfigData.PublishDataLoaded=true;configNode.Extend(data);configNode.Delete("Info")}},_LoadAndCacheApplicationConfig:function(appName,url){var configKey=ConfigData.GetApplicationKey(appName);var configNode=_ConfigData.Root.CreateKey(configKey);var appHandler=ApplicationMap.GetApplication(appName);var configDefaults=appHandler?
appHandler.ConfigDefaults:ApplicationBase.prototype.ConfigDefaults;configNode.Extend(configDefaults);url=url!=null?url+"configdata.json.js":ConfigData.GetApplicationConfigDataLocation(appName);var data=_ConfigData.LoadAndCache(url);if(data){var node=ConfigNode.FindKey(data,configKey);if(node)configNode.Extend(node)}return configNode}};GkodConfig.LoadLatestConfigContent=function(url){return AjaxRequest.LoadText(url,{forceGet:true})};
GkodConfig.LoadLatestConfig=function(url){var data=AjaxRequest.LoadJson(url,{forceGet:true});return data?new ConfigNode(data):null};
GkodConfig.LoadConfigFiles=function(appMap){GkodConfig.ResetAuthors();for(var appId in appMap){var appObject=appMap[appId];if(appObject.Processed)continue;appObject.TemplateContent=appObject.Template&&(appObject.Detect||appObject.Published)?AjaxRequest.LoadText(appObject.Template):null;appObject.CanEdit=!!appObject.TemplateContent;if(appObject.Detect)appObject.Published=appObject.CanEdit;GkodConfig._LoadConfigContent(appObject);appObject.Processed=true}GkodConfig.SortAuthors()};
GkodConfig._LoadConfigContent=function(co){if(!co.Published)return;co.ConfigContent=co.Location&&GkodConfig.LoadLatestConfigContent(co.Location)||null;co.ConfigJson=Json.DecodeObject(co.ConfigContent||"null");co.ConfigRoot=new ConfigNode(co.ConfigJson||{});co.ConfigKey=GkodConfig.GetApplicationKey(co.Id);co.ConfigDefaults=GkodConfig.GetApplicationDefaults(co.Id);var configData=co.ConfigContent?co.ConfigRoot.TryGetValueByKey(co.ConfigKey,{}):{};co.ConfigData=Extend(true,{},co.ConfigDefaults,configData);
GkodConfig._LoadInfo(co);co.HasErrors=false;co.ErrorMessage=null};
GkodConfig._LoadInfo=function(co){var infoNode=co.ConfigRoot.TryOpenKey("Info")||new ConfigNode({});co.Version=infoNode.TryGetValue("ProductVersion",GkodConfig.AppVersion);co.VersionCounter=infoNode.TryGetValue("FileVersion",0);co.LastModified=GkodConfig.DateFromTime(infoNode.TryGetValue("FileTime",null));co.LastModifiedBy=infoNode.TryGetValue("Author",null);GkodConfig.AddAuthor(infoNode.TryGetValue("Author"),infoNode.TryGetValue("FileTime",0));GkodConfig._LoadNotes(co)};
GkodConfig._LoadNotes=function(co){co.Comments={};var notes=co.ConfigRoot.TryGetValueByKey("Info.Notes");if(notes){var configKeyDot=co.ConfigKey+".";for(var key in notes){var note=notes[key];var name;if(key.indexOf(configKeyDot)==0)name=key.substr(configKeyDot.length);else if(key==co.ConfigKey)name="";else continue;co.Comments[name]={By:note["Author"],Time:note["Time"],Comment:note["Note"]};GkodConfig.AddAuthor(note["Author"])}}};
GkodConfig.RenderHead=function(subtitle,action,buttons,showlanguagebar){var abuttons=[];if(buttons)abuttons.push(buttons);var helpLink="http://www.oracle.com/technetwork/middleware/upk/documentation/upk-094979.html";var helpText='<div id="help"><p>'+Gkrc("Config.Explain.Help")+'</p><p><a target="_blank" href="'+helpLink+'">'+Gkrc("Config.Explain.HelpLink")+"</a></p></div>";abuttons.push('<a href="#" onclick="GkodConfig.InjectHelp(); return false;">'+Gkrc("Config.Action.ShowDocumentation")+"</a>");
var s="";s+='<div id="page_banner">'+'<div id="page_head">'+'<div id="page_title">'+Gkod.Helper.EscapeHtml(Gkrc("Config.Title"))+"</div>"+'<div id="page_user">'+GkodConfig.RenderUserPane()+"</div>"+(showlanguagebar?'<div id="page_language">'+GkodConfig.RenderLanguageBar()+"</div>":"")+"</div>"+'<table id="page_navbar" width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"><tr><td>'+(subtitle?'<span id="page_subtitle">'+subtitle+"</span>":"")+'&nbsp;<span id="page_modified" style="display:none">['+
Gkrc("Config.Message.Modified")+"]</span>"+"</td><td>"+'<span id="page_menu">'+abuttons.join(" | ")+"</span>"+"</td></tr></table>"+"</div>"+'<div id="helparea" style="display: none">'+helpText+"</div>"+(action?'<div id="page_action">'+action+"</div>":"");return s};
GkodConfig.RenderUserPane=function(){var modifiedBy=GkodConfig.LastModifiedBy||"";if(Gkod.Helper.Dom.Get(GkodConfig.EditedBy_Id+"_i"))modifiedBy=GkodConfig.GetEditedBy();GkodConfig.EditedBy=new GkodConfig.TypeIn({Width:150},GkodConfig.UserMap,modifiedBy,null,GkodConfig.KPLaunch);var dob=GkodConfig.EditedBy.DecompileObject(modifiedBy);var s='<span id="ubar">'+'<label for="'+GkodConfig.EditedBy_Id+'">'+Gkod.Helper.FormatHtml(Gkrc("Config.Title.EditedBy"))+"</label>"+GkodConfig.EditedBy.RenderControl({id:GkodConfig.EditedBy_Id,
dob:dob})+"</span>";return s};
GkodConfig.RenderLanguageBar=function(){var s='<div id="langhead">'+'<label for="lsel">'+Gkod.Helper.FormatHtml(Gkrc("Config.Title.SelectLanguage"))+"</label><br/>"+'<select class="control" id="lsel" '+'onchange="GkodConfig.InjectMenu('+"getElementById('lsel').options[getElementById('lsel').selectedIndex].value"+')">';for(var m in GkodConfig.Languages){var $m=GkodConfig.Languages[m];s+='<option value="'+m+'"'+(m==GkodConfig.CurrentLanguage?" selected":"")+">"+$m+"</option>"}s+="</select>"+"</div>";
return s};
GkodConfig.RenderAppPalette=function(list,title,emptyMsg){var empty=Gkod.Helper.IsEmpty(list);if(empty&&Gkod.Helper.IsNull(emptyMsg))return"";var body="";if(empty)body+='<tr class="odd">'+'<td colspan="3">'+'<div class="app_empty">'+emptyMsg+"</div>"+"</td>"+"</tr>";else{var row=1;for(var i=0,n=list.length;i<n;++i){var $i=list[i];if(!$i.Published||!$i.CanEdit)continue;row++;var appTitle=GkodConfig.GetApplicationName($i.Id);body+='<tr class="'+(row%2?"even":"odd")+'">'+'<td class="list_cell">'+($i.CanEdit?
'<a class="app_name" href="#" '+"onclick=\"GkodConfig.ConfigPage_Application('"+$i.Id+"');return false\">"+Gkod.Helper.EscapeHtml(appTitle)+"</a>":'<span class="noneditable">'+Gkod.Helper.EscapeHtml(appTitle)+"</span>")+($i.HasErrors?'<div class="error"><b>'+Gkod.Helper.FormatHtml(Gkrc("Config.Message.JavaScriptErrorInfo"),{ERROR:$i.ErrorMessage})+"</b></div>":"")+($i.Config&&$i.Config.ApplicationName&&$i.Config.ApplicationName!=$i.Id?'<div class="error"><b>'+Gkod.Helper.FormatHtml(Gkrc("Config.Message.ApplicationErrorInfo"),
{NAME:GkodConfig.GetApplicationName($i.Config.ApplicationName)})+"</b></div>":"")+"</td>"+'<td class="list_cell">'+'<div class="app_info">'+GkodConfig._RenderAppInfo($i)+"</div></td>"+'<td class="list_cell">'+GkodConfig._RenderAppComment($i)+"</td>"+"</tr>"}}var s='<div class="application_list">'+'<table cellspacing="0" cellpadding="0" border="0">'+"<thead><tr>"+'<td class="column_title" width="25%">'+Gkod.Helper.EscapeHtml(title)+"</td>"+'<td class="column_title" width="45%">'+Gkrc("Config.Title.Description")+
"</td>"+'<td class="column_title" width="30%">'+Gkrc("Config.Title.Notes")+"</td>"+"</tr></thead>"+"<tbody>"+body+"</tbody>"+"</table>"+"</div>";return s};GkodConfig._RenderAppComment=function(app){if(!app.Comments||!app.Comments[""])return'<div style="width:1px;overflow:hidden">&nbsp;</div>';var c=app.Comments[""];return GkodConfig._RenderComment(null,c.Comment,c.By,c.Time)};
GkodConfig._RenderComment=function(name,comment,by,time,head,onclick,footer,eid){if(by=="")by=Gkrc("Config.Name.Somebody");var comment_by=by?Gkod.Helper.EscapeHtml(by):"";var comment_time=time?(new Date(time)).toLocaleDateString():"";var comment_date=time?(new Date(time)).toLocaleDateString():"";var active=!!onclick||!(time>0);var messageHead=time?Gkrc("Config.Message.SomebodyWroteOn"):Gkrc("Config.Message.SomebodySays");if(name==="")messageHead=Gkod.Helper.Strip(messageHead);var s='<div class="comment_box">'+
(head?head:"")+'<div class="comment_byline">'+Gkod.Helper.FormatHtml(messageHead,{PERSON:'<span class="person">'+comment_by+"</span>",DATE:comment_date})+"</div>"+'<div class="comment_text">'+(eid?'<textarea id="'+eid+'"'+(name==""?' class="large"':"")+' rows="6">'+Gkod.Helper.EscapeHtml(comment)+"</textarea>":Gkod.Helper.FormatHtml(comment))+"</div>"+(footer&&eid?'<div class="comment_foot">'+footer+"</div>":"")+"</div>";return s};
GkodConfig._RenderAppInfo=function(app){if(!app.CanEdit)return Gkrc("Config.Message.NotEditable");if(!app.LastModified)return Gkrc("Config.Message.NotConfigured");var s=Gkod.Helper.FormatHtml(app.LastModifiedBy?Gkrc("Config.Message.LastModifiedByOn"):Gkrc("Config.Message.LastModifiedOn"),{PERSON:"<b>"+(app.LastModifiedBy?app.LastModifiedBy:Gkrc("Config.Message.Unknown"))+"</b>",TIME:app.LastModified.toLocaleTimeString(),DATE:app.LastModified.toLocaleDateString()});return s};
GkodConfig.RenderItemButton=function(id,ix,imgsrc,tooltip,onclick){return"<a onfocus=\"GkodConfig.Page.Variable_OnFocus('"+id+"')\" "+"onblur=\"GkodConfig.Page.Variable_OnBlur('"+id+"')\" "+'class="sbutton" href="#" '+'onclick="'+onclick+'">'+'<img src="'+imgsrc+'" alt="'+tooltip+'" title="'+tooltip+'"/>'+"</a>"};GkodConfig.RenderMoveItemUpButton=function(id,ix){return GkodConfig.RenderItemButton(id,ix,"shuttlereorderup_ena.png",Gkrc("Config.Action.Up"),"GkodConfig.Page.MoveItemUp('"+id+"',"+ix+");return false")};
GkodConfig.RenderMoveItemDownButton=function(id,ix){return GkodConfig.RenderItemButton(id,ix,"shuttlereorderdown_ena.png",Gkrc("Config.Action.Down"),"GkodConfig.Page.MoveItemDown('"+id+"',"+ix+");return false")};GkodConfig.RenderDeleteItemButton=function(id,ix){return GkodConfig.RenderItemButton(id,ix,"delete_ena.png",Gkrc("Config.Action.Delete"),"GkodConfig.Page.DeleteItem('"+id+"',"+ix+");return false")};
GkodConfig.RenderUndoDeleteItemButton=function(id,ix){return GkodConfig.RenderItemButton(id,ix,"undo_ena.png",Gkrc("Config.Action.Undo"),"GkodConfig.Page.UndeleteItem('"+id+"',"+ix+");return false")};
GkodConfig.RenderAddItemButton=function(vaid,ctxid){return"<a onfocus=\"GkodConfig.Page.Variable_OnFocus('"+vaid+"')\" "+"onblur=\"GkodConfig.Page.Variable_OnBlur('"+vaid+"')\" "+'class="sbutton" href="#" onclick="GkodConfig.Page.AddItem(\''+ctxid+"');return false\">"+'<img src="add_ena.png" alt="'+Gkrc("Config.Action.NewRow")+'" title="'+Gkrc("Config.Action.NewRow")+'"/>'+"</a>"};GkodConfig.CreatePublishData=function(appdata){Fail.NotImplemented("GkodConfig.CreatePublishData")};
GkodConfig.CreatePublishDataConfig=function(appdata){return new ConfigNode(GkodConfig.CreatePublishData(appdata))};
GkodConfig._EnsureAppDefaults=function(list){for(var m in list){var $m=list[m];var a=m.toLowerCase().split("/");if($m.Id===void 0)$m.Id=m;if($m.Title===void 0)$m.Title=m;if($m.Template===void 0)$m.Template=$m.Location===void 0?"../../"+a[0]+"/hemi/configdata-ct.js":Gkod.Helper.PostfixFilename($m.Location,"-ct");if($m.Location===void 0)$m.Location="../../"+a[0]+"/hemi/"+(a.length>1?a[1]+"_":"")+"configdata.json.js"}};
GkodConfig._EnsureFields=function(list,name,value){for(var m in list)list[m][name]=value};GkodConfig._CreateDetectionMap=function(applicationMap){var r={};for(var m in applicationMap){r[m]={};r[m].Detect=true}return r};GkodConfig._OverrideAppList=function(apps,list){for(var m in list){if(apps[m]===void 0)apps[m]={};Gkod.Helper.Override(apps[m],list[m])}};
GkodConfig._SortApplicationsByTitle=function(apps){var keyToName={};var sortKeys=[];var appName;var k=0;for(appName in apps){var app=apps[appName];var key=(app["Title"]||"")+" ~~~ "+ ++k;sortKeys.push(key);keyToName[key]=appName}sortKeys.sort();var sortedApps={};for(var i=0,n=sortKeys.length;i<n;++i){appName=keyToName[sortKeys[i]];sortedApps[appName]=apps[appName]}return sortedApps};
GkodConfig.LoadData=function(){if(GkodConfig.LoadSuccess)return true;try{var appcfg=GkodConfig.LoadLatestConfig("appdata.json.js");if(!appcfg)return false;var pubcfg=GkodConfig.LoadLatestConfig("../../publishdata.json.js")||GkodConfig.CreatePublishDataConfig(appcfg);GkodConfig.AppData=appcfg;GkodConfig.PublishData=pubcfg;GkodConfig.LoadSuccess=true;GkodConfig.Copyright=appcfg.GetValue("Copyright");GkodConfig.Languages=appcfg.GetValue("Languages");if(GkodConfig.Languages[pubcfg.TryGetValue("PlayerLanguage")])GkodConfig.CurrentLanguage=
pubcfg.TryGetValue("PlayerLanguage");else if(GkodConfig.Languages[pubcfg.TryGetValue("DefaultLanguage")])GkodConfig.CurrentLanguage=pubcfg.TryGetValue("DefaultLanguage");else if(GkodConfig.Languages[appcfg.GetValue("DefaultLanguage")])GkodConfig.CurrentLanguage=appcfg.GetValue("DefaultLanguage");else GkodConfig.CurrentLanguage="en";GkodConfig.DefaultTemplate=AjaxRequest.LoadText("default-ct.js")||"";GkodConfig.DefaultResource=Gkod.Helper.CreateResourceManager(Gkrc);GkodConfig.DefaultResource.AttachResource("default-ct.js");
var configure={General:[],Applications:[]};var configureNode=new ConfigNode(configure);var publishedApps=Extend(true,{},pubcfg.TryGetValue("Applications")||GkodConfig._CreateDetectionMap(appcfg.GetValueByKey("Configure.Applications")));var generalSection=appcfg.TryGetValueByKey("Configure.General",{});var applicationsSection=appcfg.TryGetValueByKey("Configure.Applications",{});GkodConfig._EnsureAppDefaults(generalSection);GkodConfig._EnsureAppDefaults(applicationsSection);GkodConfig._EnsureAppDefaults(publishedApps);
GkodConfig._EnsureFields(generalSection,"Section","General");GkodConfig._EnsureFields(applicationsSection,"Section","Applications");GkodConfig._EnsureFields(publishedApps,"Section","Applications");GkodConfig._EnsureFields(publishedApps,"Licensed",true);var apps={};GkodConfig._OverrideAppList(apps,generalSection);GkodConfig._OverrideAppList(apps,applicationsSection);GkodConfig._OverrideAppList(apps,publishedApps);GkodConfig.LoadConfigFiles(apps);GkodConfig.AppList=GkodConfig._SortApplicationsByTitle(apps);
for(var appId in GkodConfig.AppList){var app=GkodConfig.AppList[appId];if(!app.Published||configure[app.Section]===void 0)continue;configure[app.Section].push(app)}GkodConfig.Configure=configure;GkodConfig.EnableComments=true}catch(xe){Fail.Exception("GkodConfig.LoadData",xe)}};
GkodConfig.LoadTestData=function(){if(GkodConfig.LoadSuccess)return true;try{var testcfg=GkodConfig.LoadLatestConfig("testdata.json.js");if(!testcfg)return false;GkodConfig.TestData=testcfg;GkodConfig.LoadSuccess=true;GkodConfig.Copyright=testcfg.GetValue("Copyright");GkodConfig.Languages=Gkod.Helper.Get(testcfg.GetValue("Languages"),GkodConfig.Languages);GkodConfig.DefaultLanguage=Gkod.Helper.Get(testcfg.GetValue("DefaultLanguage"),GkodConfig.DefaultLanguage);GkodConfig.CurrentLanguage=GkodConfig.DefaultLanguage;
if(!GkodConfig.Languages[GkodConfig.CurrentLanguage])GkodConfig.CurrentLanguage="en";GkodConfig.DefaultTemplate=AjaxRequest.LoadText("default-ct.js")||"";GkodConfig.DefaultResource=Gkod.Helper.CreateResourceManager(Gkrc);GkodConfig.DefaultResource.AttachResource("default-ct.js");var apps={$TEST:{Id:"$TEST",Key:"Test",Title:"Test",Location:null,Template:"test-ct.js",Section:"Test",Licensed:true,Published:true}};GkodConfig.LoadConfigFiles(apps);GkodConfig.AppList=apps;GkodConfig.EnableComments=false;
GkodConfig.Standalone=true}catch(e){Fail("GkodConfig.LoadTestData",e)}};GkodConfig.InjectHelp=function(){Gkod.Helper.Dom.Toggle(document,"helparea")};GkodConfig.InjectConfigPage=function(app){GkodConfig.DelayedPageUpdate(GkodConfig.InjectLoading);GkodConfig.Page=GkodConfig.CreatePage(app);GkodConfig.Page._Reload()};GkodConfig.InjectLoading=function(){Gkod.Helper.Dom.E("page").innerHTML='<div id="title">'+Gkod.Helper.EscapeHtml(Gkrc("Config.Message.Loading"))+"</div>"};
GkodConfig.InjectMenu=function(lang){GkodConfig.LoadData();GkodConfig.LoadLanguage(lang);GkodConfig.DelayedPageUpdate(GkodConfig.InjectLoading);GkodConfig.InjectMainMenu()};GkodConfig.InjectTest=function(lang){GkodConfig.LoadTestData();GkodConfig.LoadLanguage(lang);GkodConfig.DelayedPageUpdate(GkodConfig.InjectLoading);if(GkodConfig.AppList)GkodConfig.InjectConfigPage(GkodConfig.AppList["$TEST"]);else GkodConfig.InjectMainMenu()};
GkodConfig.InjectMainMenu=function(){GkodConfig.CancelPageUpdate();try{var s=GkodConfig.RenderHead("","","",1);var cfg=GkodConfig.Configure;if(cfg)s+='<div id="page_body">'+'<div id="page_dlg">'+GkodConfig.RenderAppPalette(cfg.Locations,Gkrc("Config.LocationsSection"))+GkodConfig.RenderAppPalette(cfg.Applications,Gkrc("Config.ApplicationSection"))+GkodConfig.RenderAppPalette(cfg.General,Gkrc("Config.GeneralSection"))+"</div>"+"</div>";else s+='<div id="page_body">'+'<div id="page_dlg">'+'<div id="dlgerror">'+
'<div id="dlgerrorbody">'+'<div id="dlgerrortitle">'+Gkrc("Config.Message.NothingToConfigure")+"</div>"+"</div>"+"</div>"+"</div>"+"</div>";Gkod.Helper.Dom.E("page").innerHTML=s}catch(e){Fail("GkodConfig.InjectMainMenu failed",e)}};
GkodConfig.ConfigPage=function(rc,app){var al=app.Location;if(!al)al="config.js";var a=al.match(/([^\/]+)$/);var filename=a[1];this.rc=rc;this.app=app;this.title=GkodConfig.GetApplicationName(app.Id);this.name=app.Id;this.key=app.ConfigKey;this.location=al;this.hasRequired=false;this.advancedCount=0;this.visibleAdvanced=0;this.section=null;this.sectionList=[];this.sectionMap={};this.has$vn={};this.va$name={};this.va$id={};this.ca$vn={};this.filename=filename;this.saverScripts=["saveit.odph","saveit.php",
"saveit.asp","saveit.jsp"];this.currentScript=0;this.lastScript=0;this.tryScript=null;this.containsError=false;this.configError=null;this.cdefaults={};this.variables={};this.original={};this.config={};this.comment=new GkodConfig.$Comment("page_cc","");this.modified=false;this.canreset=false;this.commentChanged=false;this.currentVersion=null;this.currentModifiedBy=null;this.autoCheck=false;this.configVisible=false;var self=this;this.smoothvalidation=new Gkod.Helper.SmoothActivation({atime:100,dtime:200,
Deactivate:function(id){self.Variable_Deactivate(id)}})};GkodConfig.ConfigPage.prototype.CloneDefaults=function(){var defaults={};if(this.app.ConfigDefaults)Extend(true,defaults,this.app.ConfigDefaults);if(this.app.TemplateDefaults)Extend(true,defaults,this.app.TemplateDefaults);return defaults};GkodConfig.ConfigPage.prototype.SetModified=function(modified){if(this.modified==modified)return;this.modified=modified;Gkod.Helper.Dom.Show(null,"page_modified",modified)};
GkodConfig.ConfigPage.prototype.SetCanReset=function(canreset){if(this.canreset==canreset)return;this.canreset=canreset;var reset=new RegExp("i_reset");var dreset=new RegExp("i_dreset");var alist=document.getElementsByTagName("a");var alen=alist.length;while(alen--){if(reset.test(alist[alen].className))alist[alen].style.display=canreset?"":"none";if(dreset.test(alist[alen].className))alist[alen].style.display=!canreset?"":"none"}};
GkodConfig.ConfigPage.prototype.ResetToDefaults=function(){for(var xid in this.va$id){var xva=this.va$id[xid];if(!xva.Enabled())continue;if(xva.canreset)this.Variable_Reset(xid,true)}};
GkodConfig.ConfigPage.prototype.CheckModified=function(){if(this.commentChanged)this.SetModified(true);else{var modified=false;var canreset=false;for(var xid in this.va$id){var xva=this.va$id[xid];if(!xva.Enabled())continue;if(xva.canreset)canreset=true;if(xva.modified)modified=true;if(canreset&&modified)break}this.SetModified(modified);this.SetCanReset(canreset)}};
GkodConfig.ConfigPage.prototype.Validate=function(changeList,sync){var o={};var modified=this.commentChanged;this.valid=true;for(var id in this.va$id){var va=this.va$id[id];if(!va.Enabled())continue;var v=this.Variable_Validate(id,false,changeList,true,sync);if(!va.valid)this.valid=false;if(va.modified)modified=true;if(va.cansave)o[va.varname]=v}this.SetModified(modified);return o};
GkodConfig.ConfigPage.prototype._Reload=function(){var self=this;GkodConfig.DelayedPageUpdate(function(){self.InjectStep0()});try{this.commentChanged=false;this.SetModified(false);this.configVisible=false;GkodConfig.CancelPageUpdate();if(this.DoLoad!==void 0)this.DoLoad.call(this);else{GkodConfig._LoadConfigContent(this.app);if(this.onLoad!==void 0){var newData=this.onLoad.call(this,this.app.ConfigData);if(newData!==void 0)this.app.ConfigData=newData}this.LoadCompleted(this.app.ConfigData,this.app.Comments)}}catch(e){Fail("GkodConfig.ConfigPage._Reload",
e)}};GkodConfig.ConfigPage.prototype.BindVariables=function(variables){this.variables=variables;var extra={};for(var name in variables)if(!this.has$vn[name]&&!Gkod.Helper.Equals(variables[name],this.cdefaults[name]))extra[name]=variables[name];this.extra=extra};GkodConfig.ConfigPage.prototype.BindPage=function(){for(var i=0;i<this.sectionList.length;++i)this.sectionList[i].BindPage(this)};
GkodConfig.ConfigPage.prototype.Edit=function(){++this.app.VersionCounter;var v={};Extend(true,v,this.cdefaults);Extend(true,v,this.variables);this.BindVariables(v);this.BindPage();this.InjectStep1()};
GkodConfig.ConfigPage.prototype.LoadCompleted=function(obj,comments){try{GkodConfig.CancelPageUpdate();this.cdefaults=this.CloneDefaults();this.original=CloneObject(obj);this.comments=comments||null;this.BindVariables(obj);this.BindPage();this.modified=false;this.canreset=false;this.InjectStep1();this.CheckModified()}catch(e){Fail("GkodConfig.ConfigPage.LoadCompleted",e)}};GkodConfig.ConfigPage.prototype.SaveCompleted=function(ok){GkodConfig.CancelPageUpdate();this.autoCheck=false};
GkodConfig.ConfigPage.prototype.OverrideVariables=function(variables){Gkod.Helper.Override(this.variables,variables);Gkod.Helper.Override(this.original,variables)};GkodConfig.ConfigPage.prototype.SaveAndCheck=function(){this.autoCheck=true;return this.Save()};
GkodConfig.ConfigPage.prototype.GetNotes=function(){var notes={};if(this.comments)for(variableName in this.comments){var comment=this.comments[variableName];var key=this.key+(variableName?"."+variableName:"");notes[key]={Author:comment.By,Note:comment.Comment,Time:comment.Time}}return notes};
GkodConfig.ConfigPage.prototype.Save=function(){this.smoothvalidation.Cancel();var changeList=new Array;var variables=this.Validate(changeList,true);if(changeList.length>0)this.ApplyChanges(changeList);if(!this.valid){alert(Gkrc("Config.Message.ConfirmSaveInvalid"));return false}if(this.DoSave)return this.DoSave(variables,this.original);var now=new Date;this.time=now.getTime();this.currentModifiedBy=GkodConfig.GetEditedBy();this.currentFileVersion=this.app.VersionCounter+1;this.currentVersion=GkodConfig.AppVersion+
"."+this.currentFileVersion;Extend(true,variables,this.extra);var config={Info:{ProductVersion:GkodConfig.AppVersion,FileVersion:this.app.VersionCounter+1,FileTime:this.time,Author:this.currentModifiedBy,Notes:this.GetNotes()}};if(GkodConfig.IsSmartHelpApplication(this.name)){config["PublishData"]=GkodConfig.PublishData.GetRoot();if(variables["ContentMap"]==null)variables["ContentMap"]=this.cdefaults["ContentMap"];config["SmartHelp"]=variables}else{config["Applications"]={};config["Applications"][this.name]=
variables}this.variables=variables;this.config=config;this.saveit_l=this.location;this.saveit_f=this.filename;this.saveit_c=Json.EncodeObject(config,true);var self=this;GkodConfig.DelayedPageUpdate(function(){self.InjectStep2()});this.$SaveContent_TryNextScript(false);return true};GkodConfig.ConfigPage.prototype.SaveAgain=function(noInject){this.autoCheck=false;if(this.saveit_l===void 0||this.saveit_f===void 0||this.saveit_c===void 0)return;if(!noInject){var self=this;GkodConfig.DelayedPageUpdate(function(){self.InjectStep2()})}this.$SaveContent_TryNextScript(false)};
GkodConfig.ConfigPage.prototype.ToggleSaveManually=function(){Gkod.Helper.Dom.Toggle(null,"i_savetext");Gkod.Helper.Dom.Toggle(null,"i_savemanually");Gkod.Helper.Dom.Toggle(null,"i_selectall");if(Gkod.Helper.Dom.IsVisible(Gkod.Helper.Dom.E("i_savetext")))Gkod.Helper.Dom.Focus(null,"i_savetext")};
GkodConfig.ConfigPage.prototype.ShowSaveManually=function(){Gkod.Helper.Dom.Show(null,"i_savetext");Gkod.Helper.Dom.Hide(null,"i_savemanually");Gkod.Helper.Dom.Show(null,"i_selectall");var ta=document.getElementById("savetext");ta.style.height=ta.scrollHeight+"px";if(Gkod.Helper.Dom.IsVisible(Gkod.Helper.Dom.E("i_savetext")))Gkod.Helper.Dom.Focus(null,"i_savetext")};
GkodConfig.ConfigPage.prototype.Reload=function(){this.smoothvalidation.Cancel();this.Validate();if(!confirm(Gkrc("Config.Message.ConfirmReload")))return false;this._Reload()};GkodConfig.ConfigPage.prototype.DoReload=function(message,type,noAutoHide){this._Reload()};
GkodConfig.ConfigPage.prototype.Exit=function(forceExit){this.smoothvalidation.Cancel();if(!forceExit){this.Validate();if(this.modified&&!confirm(Gkrc("Config.Message.ConfirmExit")))return false}GkodConfig._LoadConfigContent(this.app);GkodConfig.InjectMenu()};GkodConfig.ConfigPage.prototype.HideSaveManually=function(){};GkodConfig.ConfigPage.prototype.SelectCopyText=function(){Gkod.Helper.Dom.Focus(null,"savetext")};
GkodConfig.ConfigPage.prototype.Verify=function(){this.InjectStep3();var self=this;Gkod.Helper.AsyncLoad(this.location,function(content,request){self.VerifyConfig(content,request.GetResponseHeader("Last-Modified"))})};
GkodConfig.ConfigPage.prototype.VerifyConfig=function(content,lastModified){var msg=null;var hasError=true;var config={};if(content==null)msg=Gkrc("Config.Message.VerifyConfigNotFound");else{var config=Json.DecodeObject(content);if(config)if(Gkod.Helper.Equals(config,this.config)){msg=Gkrc("Config.Message.VerifySuccess");hasError=false}else{var info=this.config["Info"]||{};var productVersion=info["ProductVersion"];var fileVersion=info["FileVersion"];var fileTime=info["FileTime"];var author=info["Author"];
var verifyInfo=config["Info"]||{};var differentVersion=productVersion!=verifyInfo["ProductVersion"]||fileVersion!=verifyInfo["FileVersion"]||fileTime!=verifyInfo["FileTime"]||author!=verifyInfo["Author"];var temp=CloneObject(config);(new ConfigNode(temp)).CreateKey("Info").Extend({ProductVersion:productVersion,FileVersion:fileVersion,FileTime:fileTime,Author:author});var equalContent=Gkod.Helper.Equals(temp,this.config);if(differentVersion)if(equalContent)msg=Gkrc("Config.Message.VerifyDifferentVersion");
else msg=Gkrc("Config.Message.VerifyDifferent");else msg=Gkrc("Config.Message.VerifyDifferentContent")}else msg=Gkrc("Config.Message.VerifyConfigError")}var verify=Gkod.Helper.Dom.E("verify");verify.innerHTML=Gkod.Helper.FormatHtml(msg);verify.className=hasError?"error":"success";if(content)Gkod.Helper.Dom.E("serverdetails").innerHTML=this._RenderConfigDetails(config);Gkod.Helper.Dom.Show(null,"serverconfig",!!content);Gkod.Helper.Dom.Show(null,"currentconfig",hasError)};
GkodConfig.ConfigPage.prototype.Cancel=function(){return confirm(Gkrc("Config.Message.ConfirmExit"))};GkodConfig.ConfigPage.prototype.Item=function(id){return this.va$id[id]};GkodConfig.ConfigPage.prototype.AddItem=function(id){this.va$id[id].AddItem();this.Variable_Validate(id,true)};GkodConfig.ConfigPage.prototype.DeleteItem=function(id,ix){this.va$id[id].DeleteItem(ix);this.Variable_Validate(id,true)};
GkodConfig.ConfigPage.prototype.UndeleteItem=function(id,ix){this.va$id[id].UndeleteItem(ix);this.Variable_Validate(id,true)};
GkodConfig.ConfigPage.prototype.AddSection=function(rcid,flags){var name=rcid?rcid:"";if(this.sectionMap[name]===void 0){var rc={};rc.Title=rcid?this.rc("CT.Section."+rcid):null;rc.Show=rcid?this.rc("CT.Section."+rcid+".Show",null):null;rc.Hidden=rcid?this.rc("CT.Section."+rcid+".Hidden",null):null;var o=new GkodConfig.$Section(name,rc,flags);this.sectionMap[name]=o;this.sectionList.push(o);this.section=o}else this.section=this.sectionMap[name]};
GkodConfig.ConfigPage.prototype.AddVariable=function(name,type,flags){if(!name)throw"GkodConfig.ConfigPage.AddVariable: void 0 name";if(!type)throw"GkodConfig.ConfigPage.AddVariable("+name+"): void 0 type";this.$EnsureSection();var id=Gkod.Helper.UniqueId("va");var obj=new GkodConfig.$Variable(this.rc,id,name,type,flags);if(obj.required)this.hasRequired=true;if(obj.advanced)++this.advancedCount;this.has$vn[obj.varname]=true;this.va$name[name]=obj;this.va$id[id]=obj;if(obj.varcond){var ca=obj.varcond.split("=",
2);if(ca.length==2){if(this.ca$vn[ca[0]]===void 0)this.ca$vn[ca[0]]=[];this.ca$vn[ca[0]].push(id)}}this.section.Add(obj)};
GkodConfig.ConfigPage.prototype.AddTemplate=function(name,ignoreList){var t;if(!GkodConfig._TemplateMap||(t=GkodConfig._TemplateMap.Get(name))==null)return;var currentSection=this.section;for(var sn in t.sections){var st=t.sections[sn];this.AddSection(sn);for(var sti=0;sti<st.length;++sti){var st$=st[sti];if(ignoreList&&Gkod.Helper.Contains(ignoreList,st$.name.split("[")[0]))continue;this.AddVariable(st$.name,st$.type,st$.flags)}}this.section=currentSection};
GkodConfig.ConfigPage.prototype.InjectStep1=function(id){if(id===void 0)id="page";var commands=new Array(this.RenderResetButton(),this.RenderReloadButton(),this.RenderSaveButton());var error=(this.app.Config&&this.app.Config.ApplicationName&&this.app.Config.ApplicationName!=this.name?'<div class="dlgerror">'+'<div class="dlgerrorbody">'+"<b>"+Gkod.Helper.CombineUrl(window.location,this.location)+"</b>"+"<br/><br/>"+Gkod.Helper.FormatHtml(Gkod.Helper.Strip(Gkrc("Config.Message.ApplicationErrorInfo")),
{NAME:"<b>"+GkodConfig.GetApplicationName(this.app.Config.ApplicationName)+"</b>"})+"</div>"+"</div>":"")+(this.containsError?'<div class="dlgerror">'+'<div class="dlgerrorbody">'+"<b>"+Gkod.Helper.CombineUrl(window.location,this.location)+"</b>"+"<br/><br/>"+Gkod.Helper.FormatHtml(Gkrc("Config.Message.ConfigError"),{ERROR:"<b>"+this.configError+"</b>"})+"<br/><br/>"+Gkod.Helper.FormatHtml(Gkrc("Config.Message.CheckConfigFile"))+"</div>"+"</div>":"");try{var s=GkodConfig.RenderHead(Gkod.Helper.FormatHtml(this.title),
Gkrc("Config.Title.EditConfiguration"),'<a href="#" onclick="GkodConfig.Page.Exit();return false">'+Gkrc("Config.Action.Exit")+"</a>")+'<div id="page_body">'+error+this.RenderButtons(commands)+(GkodConfig.EnableComments?'<div id="page_comment">'+'<div class="notes_heading">'+Html.Escape(Gkrc("Config.Title.Notes"))+'<span class="comment_buttons">'+this.comment.BuildButtons()+"</span>"+"</div>"+this.comment.Build()+"</div>":"")+this.RenderSections()+this.RenderButtons(commands)+"</div>";Gkod.Helper.Dom.E(id).innerHTML=
s;this.configVisible=true;this.Validate();Gkod.Helper.Dom.Focus(null,"dlgbody")}catch(e){Fail("InjectStep1",e)}};GkodConfig.ConfigPage.prototype.RenderCheckButton=function(){var s='<a href="#" onclick="GkodConfig.Page.Verify();return false">'+Gkrc("Config.Action.CheckServer")+"</a>";return s};GkodConfig.ConfigPage.prototype.RenderEditButton=function(){var s='<a href="#" onclick="GkodConfig.Page.Edit();return false">'+Gkrc("Config.Action.Modify")+"</a>";return s};
GkodConfig.ConfigPage.prototype.RenderResetButton=function(){var s='<a class="i_reset" style="'+(this.canreset?"":"display:none")+'" href="#" onclick="GkodConfig.Page.ResetToDefaults();return false">'+Gkrc("Config.Action.ResetToDefaults")+"</a>"+'<a class="i_dreset disabled" style="'+(this.canreset?"display:none":"")+'" href="#" onclick="return false">'+Gkrc("Config.Action.ResetToDefaults")+"</a>";return s};
GkodConfig.ConfigPage.prototype.RenderSaveButton=function(){var s='<a href="#" onclick="GkodConfig.Page.SaveAndCheck();return false">'+Gkrc("Config.Action.Save")+"</a>";return s};GkodConfig.ConfigPage.prototype.RenderReloadButton=function(){var s='<a href="#" onclick="GkodConfig.Page.Reload();return false">'+Gkrc("Config.Action.Reload")+"</a>";return s};GkodConfig.ConfigPage.prototype.RenderButtons=function(commands){var s='<div class="page_buttons">'+commands.join("")+"</div>";return s};
GkodConfig.ConfigPage.prototype.RenderSections=function(){var s="";for(var i=0,n=this.sectionList.length;i<n;++i)if(this.sectionList[i].name=="ADVANCED"){this.sectionList.push(this.sectionList.splice(i,1)[0]);break}s+='<form id="settings" name="settings" action="." '+' onsubmit="GkodConfig.Page.SaveAndCheck();return false;">';for(var i=0,n=this.sectionList.length;i<n;++i)s+="<div>"+this.sectionList[i].Build(this)+"</div>";s+="</form>";if(this.hasRequired)s+='<div class="dlghint">'+Gkod.Helper.FormatHtml(Gkrc("Config.Message.RequiredFields"))+
"</div>";return s};
GkodConfig.ConfigPage.prototype.ApplyChanges=function(changeList){for(var i=0,n=changeList.length;i<n;++i){var va=changeList[i];if(va.advanced){this.visibleAdvanced+=va.visible?1:-1;if(va.visible)Gkod.Helper.Dom.Show(null,"s_"+va.sid)}Gkod.Helper.Dom.Show(null,"v_"+va.id,va.visible)}if(this.advancedCount)if(this.visibleAdvanced==this.advancedCount)Gkod.Helper.Dom.ShowHide(null,"i_hideadvanced","i_advanced",true);else Gkod.Helper.Dom.ShowHide(null,"i_advanced","i_hideadvanced",true);this.RenewVariableRows()};
GkodConfig.ConfigPage.prototype.RenewVariableRows=function(){var index=0;for(var id in this.va$id){var n=Gkod.Helper.Dom.E("v_"+id);if(Gkod.Helper.Dom.HasClassName(n,"first"))index=0;var va=this.va$id[id];if(!va.visible)continue;++index}};
GkodConfig.ConfigPage.prototype.ToggleAdvanced=function(show){this.smoothvalidation.Cancel();this.Validate();var changeList=new Array;for(var id in this.va$id){var va=this.va$id[id];if(va.advanced&&va.visible!=show){va.visible=!va.visible;changeList.push(va)}}if(!show){var a=this.sectionList;for(var i=0;i<a.length;++i)if(a[i].advanced)Gkod.Helper.Dom.Hide(null,"s_"+a[i].id)}this.ApplyChanges(changeList)};
GkodConfig.ConfigPage.prototype.InjectStep2=function(id,updated){try{if(id===void 0||id===null)id="page";var explainSaveSpan='<a href="#" onclick="GkodConfig.Page.ToggleSaveManually();return false"><b>'+Gkod.Helper.FormatHtml(Gkrc("Config.Span.SaveItManually"))+"</b></a>";var explainSave=Gkod.Helper.FormatHtml(Gkrc("Config.Explain."+(updated?"Update":"Save")),{SAVE_IT_MANUALLY:explainSaveSpan});var checkIt='<a href="#" onclick="GkodConfig.Page.Verify();return false"><b>'+Gkod.Helper.FormatHtml(Gkrc("Config.Span.PleaseCheck"))+
"</b></a>";var checkServerAfterSave=Gkod.Helper.FormatHtml(Gkrc("Config.Explain.CheckServerAfter"+(updated?"Update":"Save")),{PLEASE_CHECK:checkIt});var commands=new Array(this.RenderCheckButton(),this.RenderEditButton(),'<a href="#" onclick="GkodConfig.Page.SaveAgain(true);return false">'+Gkrc("Config.Action.RetrySave")+"</a>",'<a href="#" id="i_savemanually" onclick="GkodConfig.Page.ShowSaveManually();return false">'+Gkrc("Config.Action.SaveManually")+"</a>");var manualSave='<div id="i_savetext" style="display:none">'+
'<div class="page_explain">'+Gkod.Helper.FormatHtml(Gkrc("Config.Explain.SaveManually"))+"</div>"+'<div id="copytextcnt">'+'<form style="display:inline" onsubmit="return false;">'+'<textarea style="height:50%" class="copytext" name="savetext" id="savetext" readonly="readonly">'+Gkod.Helper.EscapeHtml(this.saveit_c)+"</textarea></form>"+"</div>"+'<div class="clearfix">&nbsp;</div>'+'<div class="page_buttons" style="clear:both">'+'<a href="#" id="i_selectall" onclick="GkodConfig.Page.SelectCopyText();return false" style="display:none">'+
Gkrc("Config.Action.SelectAll")+"</a>"+"</div>"+'<div class="clearfix">&nbsp;</div>'+"</div>";var s=GkodConfig.RenderHead(Gkod.Helper.FormatHtml(this.title),Gkrc("Config.Title.SaveConfiguration"),'<a href="#" onclick="GkodConfig.Page.Exit(true);return false">'+Gkrc("Config.Action.Exit")+"</a>");s+='<div id="page_body">'+'<div class="page_explain">'+explainSave+'<div id="page_location">'+Gkod.Helper.CombineUrl(window.location,this.location)+"</div>"+this._RenderConfigDetails(this.config);s+='<div id="checkafter">'+
checkServerAfterSave+"</div>"+"</div>"+manualSave+'<div class="clearfix">&nbsp;</div>'+this.RenderButtons(commands)+"</div>";this.configVisible=false;Gkod.Helper.Dom.E(id).innerHTML=s}catch(e){Fail("InjectStep2",e)}};
GkodConfig.ConfigPage.prototype._RenderConfigDetails=function(config){var info=config["Info"]||{};var fileTime=info["FileTime"]||null;var lastModified=fileTime?(new Date(fileTime)).toLocaleString():Gkrc("Config.Title.Unknown");var author=info["Author"]||Gkrc("Config.Title.Unknown");var applicationKeys=HashMap.GetKeys(config["Applications"]||{});var applicationName=applicationKeys.length?GkodConfig.GetApplicationName(applicationKeys[0]):Gkrc("Config.Title.Unknown");var s="<div>"+'<table class="configdetails" cellspacing="0" cellpadding="0">'+
"<tr>"+"<td><b>"+Html.Escape(Gkrc("Config.Title.Application"))+"</b></td>"+"<td>"+Html.Escape(applicationName)+"</td>"+"</tr>"+"<tr>"+"<td><b>"+Html.Escape(Gkrc("Config.Title.ModifiedBy"))+"</b></td>"+"<td>"+Html.Escape(author)+"</td>"+"</tr>"+"<tr>"+"<td><b>"+Html.Escape(Gkrc("Config.Title.LastModified"))+"</b></td>"+"<td>"+Html.Escape(lastModified)+"</td>"+"</tr>"+"</table>"+"</div>";return s};
GkodConfig.ConfigPage.prototype.InjectStep3=function(id){if(id===void 0)id="page";try{var commands=new Array('<a href="#" onclick="GkodConfig.Page.SaveAgain();return false">'+Gkrc("Config.Action.RetrySave")+"</a>",'<a href="#" onclick="GkodConfig.Page.Verify();return false">'+Gkrc("Config.Action.CheckAgain")+"</a>",'<a href="#" onclick="GkodConfig.Page.Edit();return false">'+Gkrc("Config.Action.Modify")+"</a>");var s=GkodConfig.RenderHead(Gkod.Helper.FormatHtml(this.title),Gkrc("Config.Title.CheckServerConfiguration"),
'<a href="#" onclick="GkodConfig.Page.Exit(true);return false">'+Gkrc("Config.Action.Exit")+"</a>");s+='<div id="page_body">'+'<div id="page_content">'+'<div id="dlgbody" class="">'+'<div id="page_message">'+'<div id="page_location">'+Gkod.Helper.CombineUrl(window.location,this.location)+"<br/><br/></div>"+'<div id="verify">'+Gkod.Helper.FormatHtml(Gkrc("Config.Message.Checking"))+"</div>"+"</div>"+'<div id="serverconfig">'+'<div id="page_subsubtitle">'+Gkrc("Config.Title.ServerConfiguration")+"</div>"+
'<div id="page_subexplain">'+'<div id="serverdetails">'+Gkod.Helper.FormatHtml(Gkrc("Config.Message.Checking"))+"</div>"+"</div>"+"</div>"+'<div id="currentconfig">'+'<div id="page_subsubtitle">'+Gkrc("Config.Title.CurrentConfiguration")+"</div>"+'<div id="page_subexplain">'+this._RenderConfigDetails(this.config)+"</div>"+"</div>"+"</div>"+"</div>"+'<div class="clearfix">&nbsp;</div>'+this.RenderButtons(commands)+"</div>";this.configVisible=false;Gkod.Helper.Dom.E(id).innerHTML=s;Gkod.Helper.Dom.Focus(null,
"dlgbody")}catch(e){Fail("InjectStep3 failed",e)}};GkodConfig.ConfigPage.prototype.$EnsureSection=function(){if(this.section!==null)return;var o=new GkodConfig.$Section("",null);this.sectionMap[""]=o;this.sectionList.push(o);this.section=o};
GkodConfig.ConfigPage.prototype.$SaveContent_TryNextScript=function(next){var self=this;if(GkodConfig.KPLaunch){if(!next);var p=this.saveit_l;var path="stdhemi\\hemi\\configurator\\"+p.replace(/\//g,"\\");parent.SaveFile(path,this.saveit_c,function(success,message){if(success)return self.$SaveContent_Updated()});return}if(this.tryScript){this.tryScript.Abort();this.currentScript=Gkod.Helper.GetInCircularRange(this.currentScript+1,0,this.saverScripts.length-1)}if(!next)this.lastScript=Gkod.Helper.GetInCircularRange(this.currentScript-
1,0,this.saverScripts.length-1);else{var last=this.currentScript==this.lastScript;this.currentScript=Gkod.Helper.GetInCircularRange(this.currentScript+1,0,this.saverScripts.length-1);if(last){GkodConfig.CommitPageUpdate();return}}this.tryScript=new AjaxRequest(this.saverScripts[this.currentScript],{asynchronous:true,method:"POST",parameters:{saveit_l:this.saveit_l,saveit_f:this.saveit_f,saveit_c:this.saveit_c},OnDone:function(arq){if(self.tryScript!==arq)return;self.tryScript=null;try{var text=arq.request.responseText;
if(!!text){if(text=="UPDATED")return self.$SaveContent_Updated();var jsonResponse=Json.DecodeObject(text);if(Gkod.Helper.Equals(self.config,jsonResponse))return self.$SaveContent_ContinueScript()}}catch(e){Fail("LoadConfig.OnDone",e)}return self.$SaveContent_TryNextScript(true)}})};GkodConfig.ConfigPage.prototype.$SaveContent_Updated=function(){GkodConfig.CancelPageUpdate();if(this.autoCheck){this.autoCheck=false;this.Verify()}else this.InjectStep2(null,true)};
GkodConfig.ConfigPage.prototype.$SaveContent_ContinueScript=function(){GkodConfig.CommitPageUpdate();this.autoCheck=false;var id="ConfigTplSaver";var framename=id+"Frame";var n=document.getElementById(id);if(n)n.parentNode.removeChild(n);n=document.createElement("div");n.id=id;n.style.width="0px";n.style.height="0px";n.style.overflow="hidden";n.innerHTML='<iframe id="'+framename+'" name="'+framename+'" style="display:block;border:none" frameborder="0" width="100" height="100" src="saver.html?use='+
encodeURIComponent(this.saverScripts[this.currentScript])+"&_="+(new Date).getTime()+'"></iframe>';document.body.insertBefore(n,null)};GkodConfig.ConfigPage.prototype.GetVariable=function(name){var va=this.va$name[name];return va===void 0?null:va};
GkodConfig.ConfigPage.prototype.SetVariable=function(name,value,dofocus){var va=this.va$name[name];va.Assign(value);var id=va.id;var n=Gkod.Helper.Dom.E("v_"+id);Gkod.Helper.Dom.AddClassName(n,"modified",va.modified);n.innerHTML=va.Build();this.Variable_Validate(id);this.Variable_OnChange(id);if(dofocus)Gkod.Helper.Dom.Focus(n)};
GkodConfig.ConfigPage.prototype.SetTitleAndExplainAlt=function(name,alt){var va=this.va$name[name];if(va==void 0)return;va.SetTitleAlt(alt);va.SetExplainAlt(alt);if(!this.configVisible)return;var id=va.id;var n=Gkod.Helper.Dom.E("v_"+id);n.innerHTML=va.Build()};
GkodConfig.ConfigPage.prototype.SetExplainAlt=function(name,alt){var va=this.va$name[name];va.SetExplainAlt(alt);if(!this.configVisible)return;var id=va.id;var n=Gkod.Helper.Dom.E("v_"+id);Gkod.Helper.Dom.AddClassName(n,"modified",va.modified);n.innerHTML=va.Build();this.Variable_Validate(id);this.Variable_OnChange(id)};GkodConfig.ConfigPage.prototype.Variable_Reset=function(id,nofocus){var va=this.va$id[id];this.SetVariable(va.name,va.Extract(this.CloneDefaults()),!nofocus);this.CheckDependentConditions(id)};
GkodConfig.ConfigPage.prototype.Variable_ButtonClick=function(id,index){var va=this.va$id[id];var onClick=va.buttons[index].onClick;onClick&&onClick.call(this)};GkodConfig.ConfigPage.prototype.Variable_Dispatch=function(id,action){this.smoothvalidation.Commit();var va=this.va$id[id];va&&va.Dispatch(action)};GkodConfig.ConfigPage.prototype.Variable_OnFocus=function(id){this.smoothvalidation.Activate(id)};
GkodConfig.ConfigPage.prototype.Variable_OnChange=function(id){var va=this.va$id[id];if(!va)return;var v=this.Variable_Validate(id,true);var old_v=this.variables[va.varname];if(Gkod.Helper.Equals(old_v,v))return;if(va.onChanged){var nv=va.onChanged.call(va,v);if(nv!==void 0)v=nv}this.variables[va.varname]=v;this.CheckDependentConditions(id)};
GkodConfig.ConfigPage.prototype.CheckDependentConditions=function(id){var va=this.va$id[id];if(!va)return;var ca=this.ca$vn[va.varname];if(!ca)return;var changeList=null;for(var i=0,n=ca.length;i<n;++i){var $i=ca[i];var va$i=this.va$id[$i];if(va$i.visible==va$i.Enabled())continue;va$i.visible=!va$i.visible;if(!changeList)changeList=new Array;changeList.push(va$i)}changeList&&this.ApplyChanges(changeList)};
GkodConfig.ConfigPage.prototype.Variable_OnBlur=function(id){this.Variable_Validate(id,true);this.smoothvalidation.Deactivate(id)};GkodConfig.ConfigPage.prototype.Variable_Deactivate=function(id){this.Variable_Validate(id)};
GkodConfig.ConfigPage.prototype.Variable_Validate=function(id,ignore,changeList,noModify,sync){var va=this.va$id[id];var r=va.Validate(ignore,sync);va.valid=r.length>1&&r[0]===true&&r[1]!==void 0;if(changeList&&!va.valid&&!va.visible){va.visible=true;changeList.push(va)}var modified=!va.valid||!Gkod.Helper.Equals(va.Extract(this.original),r[1]);var vn=Gkod.Helper.Dom.E("v_"+va.id);if(va.modified!=modified){va.modified=modified;Gkod.Helper.Dom.AddClassName(vn,"modified",modified)}var canreset=!va.valid||
!!r[3]||!Gkod.Helper.Equals(va.Extract(this.cdefaults),r[1]);if(va.canreset!=canreset){va.canreset=canreset;Gkod.Helper.Dom.AddClassName(vn,"customized",canreset);Gkod.Helper.Dom.E("vr_"+va.id).style.display=canreset?"":"none";if(canreset)this.SetCanReset(true)}va.cansave=va.valid&&!Gkod.Helper.Equals(va.Extract(this.cdefaults),r[1]);if(!noModify)this.CheckModified();return va.valid?r[1]:null};
GkodConfig.ConfigPage.prototype.Variable_ToggleHelp=function(id){Gkod.Helper.Dom.Toggle(null,id+"_h,"+id+"_hh")};GkodConfig.ConfigPage.prototype.CheckSection=function(name){var se=this.sectionMap[name];if(!se)return;var sn=Gkod.Helper.Dom.E("s_"+se.id);se.BindPage(this);sn.parentNode.innerHTML=se.Build(this);this.Validate()};
GkodConfig.ConfigPage.prototype.Section_Show=function(name){var se=this.sectionMap[name];if(!se)return;function onCompleted(success){var sn=Gkod.Helper.Dom.E("s_"+se.id);se.BindPage(this);sn.parentNode.innerHTML=se.Build(this);this.Validate()}Gkod.Helper.Dom.Show(null,"svw_"+se.id);Gkod.Helper.Dom.Hide(null,"svs_"+se.id);se.onShow.call(this,onCompleted)};
GkodConfig.ConfigPage.prototype.RenderComment=function(id,name){var co=this.comments[name];if(!co)return"";var head="";var onclick="Gkod.Helper.StopPropagation(event);GkodConfig.Page.Comment_Change('"+id+"','"+name+"')";return GkodConfig._RenderComment(name,co.Comment,co.By,co.Time,head,onclick)};
GkodConfig.ConfigPage.prototype.Comment_Delete=function(id,name){var cid=id+"_cb";var buttonsid="comment_"+id+"_buttons";Gkod.Helper.Dom.Show(null,cid,false);var n=Gkod.Helper.Dom.Get(id+"_cb");if(n)n.innerHTML="";delete this.comments[name];this.commentChanged=true;this.SetModified(true);Gkod.Helper.Dom.Show(null,"no_comment_"+id);Gkod.Helper.Dom.Hide(null,"has_comment_"+id)};
GkodConfig.ConfigPage.prototype.Comment_Change=function(id,name){var co=this.comments[name];var comment=co?co.Comment:Gkrc("Config.Message.YourNote");var cid=id+"_cb";var buttonsid="comment_"+id+"_buttons";var footer='<table width="100%" cellspacing="0" cellpadding="0"><tr><td>'+'<a class="commitnote" href="#" onclick="GkodConfig.Page.Comment_DoChange(\''+id+"','"+name+"',false);return false\">"+Gkod.Helper.FormatHtml(Gkrc("Config.Action.Cancel"))+"</a>"+"&nbsp&nbsp"+'<a class="commitnote" href="#" onclick="GkodConfig.Page.Comment_DoChange(\''+
id+"','"+name+"',true);return false\">"+Gkod.Helper.FormatHtml(Gkrc("Config.Action.Ok"))+"</a>"+"</td></tr></table>";Gkod.Helper.Dom.E(cid).innerHTML=GkodConfig._RenderComment(name,comment,GkodConfig.GetEditedBy(),0,null,null,footer,id+"_cbe");Gkod.Helper.Dom.ShowHide(null,cid,id+"_addnote");Gkod.Helper.Dom.Hide(null,"no_comment_"+id);Gkod.Helper.Dom.Show(null,"has_comment_"+id)};
GkodConfig.ConfigPage.prototype.Comment_DoChange=function(id,name,save){var n=Gkod.Helper.Dom.Get(id+"_cbe");if(!n)return;var co=this.comments[name];var has=co!==void 0;var cid=id+"_cb";if(save){var comment=Gkod.Helper.Trim(n.value);if(comment=="")return this.Comment_Delete(id,name);if(!has){has=true;this.comments[name]=co={}}co.Comment=comment;co.By=GkodConfig.GetEditedBy();co.Time=(new Date).getTime()}if(!has){Gkod.Helper.Dom.Show(null,"no_comment_"+id);Gkod.Helper.Dom.Hide(null,"has_comment_"+
id)}Gkod.Helper.Dom.E(cid).innerHTML=this.RenderComment(id,name);if(save){this.commentChanged=true;this.SetModified(true)}};GkodConfig.ConfigPage.prototype.MoveItemUp=function(id,ix){this.va$id[id].MoveItemUp(ix);this.Variable_Validate(id,true)};GkodConfig.ConfigPage.prototype.MoveItemDown=function(id,ix){this.va$id[id].MoveItemDown(ix);this.Variable_Validate(id,true)};GkodConfig.$Compound=function(columns,types){this.types=types;this.columns=columns};
GkodConfig.$Compound.prototype.New=function(){var a=[];for(var i=0,n=this.types.length;i<n;++i)a.push(this.types[i].New());return a};GkodConfig.$Compound.prototype.GetValueName=function(value){var a=[];for(var i=0,n=this.types.length;i<n;++i)a[i]=this.types[i].GetValueName(value[i]);return a};GkodConfig.$Compound.prototype.DecompileObject=function(value){var dob=[];for(var i=0,n=this.types.length;i<n;++i)dob.push(this.types[i].DecompileObject(value[i]));return dob};
GkodConfig.$Compound.prototype.RenderControl=function(ctx){var a=[];for(var i=0,n=this.types.length;i<n;++i)a.push(this.types[i].RenderControl({va:ctx.va,id:ctx.id+"@"+i,dob:ctx.dob[i],width:ctx.width[i]}));return a};GkodConfig.$Compound.prototype.RenderDeleted=function(ctx){var a=[];for(var i=0,n=this.types.length;i<n;++i)a.push(this.types[i].RenderDeleted({va:ctx.va,id:ctx.id+"@"+i,dob:ctx.dob[i],width:ctx.width[i]}));return a};
GkodConfig.$Compound.prototype.Validate=function(ctx,validate,ignore,sync){var a=[];var valid=true;for(var i=0,n=this.types.length;i<n;++i){var v=this.types[i].Validate({va:ctx.va,id:ctx.id+"@"+i},validate,ignore,sync);if(valid===true&&v[0]!==true)valid=v[0];a.push(v[1])}return[valid,a]};GkodConfig.$Named=function(columns,types){this.names=[];this.types=[];for(i in types){if(i=="Named")continue;this.names.push(i);this.types.push(types[i])}this.columns=columns};
GkodConfig.$Named.prototype.New=function(){var a={};for(var i=0,n=this.types.length;i<n;++i)a[this.names[i]]=this.types[i].New();return a};GkodConfig.$Named.prototype.DecompileObject=function(value){var dob=[];for(var i=0,n=this.types.length;i<n;++i)dob.push(this.types[i].DecompileObject(value[this.names[i]]));return dob};
GkodConfig.$Named.prototype.Validate=function(ctx,validate,ignore,sync){var a={};var valid=true;for(var i=0,n=this.types.length;i<n;++i){var v=this.types[i].Validate({va:ctx.va,id:ctx.id+"@"+i},validate,ignore,sync);if(valid===true&&v[0]!==true)valid=v[0];a[this.names[i]]=v[1]}return[valid,a]};GkodConfig.$Named.prototype.GetValueName=GkodConfig.$Compound.prototype.GetValueName;GkodConfig.$Named.prototype.RenderControl=GkodConfig.$Compound.prototype.RenderControl;
GkodConfig.$Named.prototype.RenderDeleted=GkodConfig.$Compound.prototype.RenderDeleted;GkodConfig.$RenderColumns=function(type,column,content,first,offs){var s="";if(type.constructor!==GkodConfig.$Compound&&type.constructor!==GkodConfig.$Named)s+="<td>"+content+"</td>";else for(var i=0,n=type.types.length;i<n;++i)s+="<td>"+column[i]+"</td>";return s};GkodConfig.$RenderRows=function(type,column,content,first,offs){};
GkodConfig.Array=function(rc,valueType,validate){this.rc=rc;this.validate=validate;if(valueType.Named!==void 0&&valueType.Named===true)this.vt=new GkodConfig.$Named(this.rc.ValueColumn,valueType);else this.vt=Gkod.Helper.IsArray(valueType)?new GkodConfig.$Compound(this.rc.ValueColumn,valueType):valueType;if(this.rc===void 0||this.rc===null)this.rc={};if(this.rc.ValueColumn===void 0)this.rc.ValueColumn=300;if(this.rc.RowLayout===void 0)this.rc.RowLayout=true;this.sortable=this.rc.hasOwnProperty("Sortable")?
this.rc.Sortable:false;if(this.sortable)this.sortOrder=[]};GkodConfig.Array.prototype.New=function(){return[]};GkodConfig.Array.prototype.GetValueName=function(value){return"(Array)"};
GkodConfig.Array.prototype.DecompileObject=function(value){var dob=[];for(var i=0,n=value.length;i<n;++i)dob.push({value:this.vt.DecompileObject(value[i]),deleted:false});if(dob.length==0)dob[0]={value:this.vt.DecompileObject(this.vt.New()),deleted:false};if(this.sortable&&this.sortOrder.length!==dob.length){this.sortOrder=[];for(var i=0;i<dob.length;i++)this.sortOrder.push(i)}return dob};
GkodConfig.Array.prototype.AddItem=function(va){var ix=va.dob.length;va.dob[ix]={value:this.vt.DecompileObject(this.vt.New()),deleted:false};var nn=document.createElement("div");nn.id=va.id+"_$"+ix;nn.className="listitem";nn.innerHTML=this.RenderItem(va,ix);Gkod.Helper.Dom.E(va.id+"_l").appendChild(nn);Gkod.Helper.Dom.Focus(nn);if(this.sortable)this.sortOrder.push(this.sortOrder.length)};
GkodConfig.Array.prototype.DeleteItem=function(va,ix){this.StoreItem(va,ix,false);va.dob[ix].deleted=true;this.UpdateItem(va,ix)};GkodConfig.Array.prototype.UndeleteItem=function(va,ix){va.dob[ix].deleted=false;this.UpdateItem(va,ix)};GkodConfig.Array.prototype.UpdateItem=function(va,ix){var n=Gkod.Helper.Dom.E(va.id+"_$"+ix);n.innerHTML=this.RenderItem(va,ix);Gkod.Helper.Dom.Focus(n)};
GkodConfig.Array.prototype.MoveItemUp=function(va,ix){var activeNode=Gkod.Helper.Dom.E(va.id+"_$"+ix);var Parent=activeNode.parentNode;var ordered_ix;for(var i=0;i<this.sortOrder.length;i++)if(this.sortOrder[i]==ix){ordered_ix=i;if(i>0){var bumped_ix=this.sortOrder.splice(i-1,1,ix);this.sortOrder.splice(i,1,bumped_ix[0]);var bumpedNode=Gkod.Helper.Dom.E(va.id+"_$"+bumped_ix[0]);Parent.insertBefore(activeNode,bumpedNode)}break}};
GkodConfig.Array.prototype.MoveItemDown=function(va,ix){var activeNode=Gkod.Helper.Dom.E(va.id+"_$"+ix);var Parent=activeNode.parentNode;var ordered_ix;var i;for(i=0;i<this.sortOrder.length;i++)if(this.sortOrder[i]==ix){ordered_ix=i;if(i<this.sortOrder.length-1){var bumped_ix=this.sortOrder.splice(i+1,1,ix);this.sortOrder.splice(i,1,bumped_ix[0]);var bumpedNode=Gkod.Helper.Dom.E(va.id+"_$"+bumped_ix[0]);Parent.insertBefore(bumpedNode,activeNode)}break}};
GkodConfig.Array.prototype.StoreItem=function(va,ix,validate,ignore,sync){var vv=this.vt.Validate({va:va,id:va.id+"_$"+ix+"v"},validate,ignore,sync);if(vv[0]===true)va.dob[ix].value=this.vt.DecompileObject(vv[1]);if(!validate)return vv;if(!ignore){var n=Gkod.Helper.Dom.E(va.id+"_$"+ix+"_n");if(vv[0]===true||vv[0]===false){n.style.display="none";n.parentNode.className=""}else{n.innerHTML=vv[0];n.style.display="";n.parentNode.className="errormark"}}return vv};
GkodConfig.Array.prototype.RenderItem=function(va,ix){var st=va.dob[ix];var buttons=(st.deleted?GkodConfig.RenderUndoDeleteItemButton(va.id,ix):GkodConfig.RenderDeleteItemButton(va.id,ix))+(this.sortable?GkodConfig.RenderMoveItemUpButton(va.id,ix)+GkodConfig.RenderMoveItemDownButton(va.id,ix):"");var controlParams={va:va,id:va.id+"_$"+ix+"v",dob:st.value,width:this.rc.ValueColumn};var control=st.deleted?this.vt.RenderDeleted(controlParams):this.vt.RenderControl(controlParams);var table=this.rc.RowLayout?
this.RenderRows(control,buttons):this.RenderColumns(control,buttons);var s=""+'<div id="'+va.id+"_$"+ix+'_n" '+' class="varerror" style="display:none;width:'+this.rc.ValueColumn+'px">'+"</div>"+table;return s};
GkodConfig.Array.prototype.RenderRows=function(values,buttons,offs){var count=0;var s='<table width="100%" cellspacing="0" cellpadding="0">'+'<tr><td colspan="2" class="listitembuttons">'+(buttons?buttons:"&nbsp;")+"</td></tr>";for(var i=0,n=this.vt.types.length;i<n;++i){s+='<tr><td class="varrowlabel '+(count%2?"odd":"even")+'">'+'<div class="listhead">'+this.rc.Value[i]+"</div></td>"+'<td class="varcontrol '+(count%2?"odd":"even")+'">'+values[i]+"</td></tr>";count++}s+="</table>";return s};
GkodConfig.Array.prototype.RenderColumns=function(values,right,offs){return'<table cellspacing="0" cellpadding="0"><tr>'+GkodConfig.$RenderColumns(this.vt,this.rc.ValueColumn,values,true,offs)+(right?"<td>"+right+"</td>":"")+"</tr></table>"};
GkodConfig.Array.prototype.RenderControl=function(ctx){var va=ctx.va;var itemList="";for(var i=0,n=va.dob.length;i<n;++i)itemList+='<div id="'+va.id+"_$"+i+'" class="listitem">'+this.RenderItem(va,i)+"</div>";var s='<div class="list">';if((this.vt.constructor==GkodConfig.$Compound||this.vt.constructor==GkodConfig.$Named)&&this.rc.RowLayout==false)s+='<div class="listhead">'+this.RenderColumns(this.rc.Value,null,4)+"</div>";s+='<div id="'+ctx.id+"_l"+'">'+itemList+"</div>"+'<table width="100%" cellspacing="0" cellpadding="0">'+
'<tr><td class="listitembuttons">'+GkodConfig.RenderAddItemButton(ctx.va.id,ctx.id)+"</td></tr>"+"</table>"+"</div>";return s};
GkodConfig.Array.prototype.Validate=function(ctx,validate,ignore,sync){var ev=this.vt.New();var va=ctx.va;var valid=true;var a=[];var canreset=va.dob.length!=1||va.dob[0].deleted;for(var j=0,n=va.dob.length;j<n;++j){var i=this.sortable?this.sortOrder[j]:j;if(va.dob[i].deleted)continue;var vi=this.StoreItem(va,i,validate,ignore,sync);if(Gkod.Helper.Equals(ev,vi[1]))continue;canreset=true;if(vi[0]===true)a.push(vi[1]);else valid=false}if(!validate||!this.validate)return[valid,a,canreset];var r=this.validate.call(ctx.va,
a,sync);if(r[0]===true&&valid)return r;if(r[0]===false)r[0]="Invalid";if(r[0]!==true)r[0]=Gkod.Helper.EscapeHtml(this.rc[r[0]]||r[0]);r[3]=canreset;return r};
GkodConfig.Dictionary=function(rc,keyType,valueType,validate,validateItem){this.rc=Gkod.Helper.Clone(rc);this.kt=Gkod.Helper.IsArray(keyType)?new GkodConfig.$Compound(this.rc.KeyColumn,keyType):keyType;this.vt=Gkod.Helper.IsArray(valueType)?new GkodConfig.$Compound(this.rc.ValueColumn,valueType):valueType;this.validate=validate;this.validateItem=validateItem;if(this.rc===void 0||this.rc===null)this.rc={};if(this.rc.KeyColumn===void 0)this.rc.KeyColumn=110;if(this.rc.ValueColumn===void 0)this.rc.ValueColumn=
260;if(this.rc.RowLayout===void 0)this.rc.RowLayout=true};GkodConfig.Dictionary.prototype.New=function(){return{}};GkodConfig.Dictionary.prototype.GetValueName=function(value){return"(Object)"};
GkodConfig.Dictionary.prototype.$DecompileKeyExItem=function(dob,types,keys,key,value){keys.push(key===void 0?types[0].New():key);var t=types.shift();if(types.length==0)dob.push({key:this.kt.DecompileObject(Gkod.Helper.DeepClone(keys)),value:this.vt.DecompileObject(value),deleted:false});else this.$DecompileKeyEx(dob,types,keys,value);types.unshift(t);keys.pop()};
GkodConfig.Dictionary.prototype.$DecompileKeyEx=function(dob,types,keys,value){if(value===void 0)return this.$DecompileKeyExItem(dob,types,keys);for(var m in value)this.$DecompileKeyExItem(dob,types,keys,m,value[m])};
GkodConfig.Dictionary.prototype.DecompileObject=function(value){var dob=[];if(this.kt.constructor===GkodConfig.$Compound)this.$DecompileKeyEx(dob,Gkod.Helper.Clone(this.kt.types),[],value);else for(var m in value)dob.push({key:this.kt.DecompileObject(m),value:this.vt.DecompileObject(value[m]),deleted:false});if(dob.length==0)dob[0]={key:this.kt.DecompileObject(this.kt.New()),value:this.vt.DecompileObject(this.vt.New()),deleted:false};return dob};
GkodConfig.Dictionary.prototype.AddItem=function(va){var ix=va.dob.length;va.dob[ix]={key:this.kt.DecompileObject(this.kt.New()),value:this.vt.DecompileObject(this.vt.New()),deleted:false};var nn=document.createElement("div");nn.id=va.id+"_$"+ix;nn.className="listitem";nn.innerHTML=this.RenderItem(va,ix);Gkod.Helper.Dom.E(va.id+"_l").appendChild(nn);Gkod.Helper.Dom.Focus(nn)};
GkodConfig.Dictionary.prototype.DeleteItem=function(va,ix){this.StoreItem(va,ix,false);va.dob[ix].deleted=true;this.UpdateItem(va,ix)};GkodConfig.Dictionary.prototype.UndeleteItem=function(va,ix){va.dob[ix].deleted=false;this.UpdateItem(va,ix)};GkodConfig.Dictionary.prototype.UpdateItem=function(va,ix){var n=Gkod.Helper.Dom.E(va.id+"_$"+ix);n.innerHTML=this.RenderItem(va,ix);Gkod.Helper.Dom.Focus(n)};
GkodConfig.Dictionary.prototype.StoreItem=function(va,ix,validate,ignore,sync){var st=va.dob[ix];var vk=this.kt.Validate({id:va.id+"_$"+ix+"k"},validate,ignore,sync);var vv=this.vt.Validate({id:va.id+"_$"+ix+"v"},validate,ignore,sync);if(!validate){st.key=this.kt.DecompileObject(vk[1]);st.value=this.vt.DecompileObject(vv[1]);return[true,vk[1],vv[1]]}var msga=[];var valid=true;var k=null;var v=null;if(vk[0]!==true){valid=false;if(vk[0]!==false)msga.push(vk[0])}if(vv[0]!==true){valid=false;if(vv[0]!==
false)msga.push(vv[0])}if(valid){if(!this.validateItem){k=vk[1];v=vv[1]}else{var r=this.validateItem(vk[1],vv[1],sync);if(r[0]===true){k=r[1];v=r[2]}else{valid=false;var msg=r[0]===false?"Invalid":r[0];if(this.rc[msg])msg=this.rc[msg];msga.push(Gkod.Helper.EscapeHtml(msg))}}if(valid){st.key=this.kt.DecompileObject(k);st.value=this.vt.DecompileObject(v)}}if(!ignore){var n=Gkod.Helper.Dom.E(va.id+"_$"+ix+"_n");if(msga.length>0){n.innerHTML=msga.join("<br/>");n.style.display="";n.parentNode.className=
"errormark"}else{n.style.display="none";n.parentNode.className=""}}return[valid,k,v]};
GkodConfig.Dictionary.prototype.RenderItem=function(va,ix){var st=va.dob[ix];var id_n=va.id+"_$"+ix+"_n";var varerror='<div id="'+id_n+'" class="varerror" style="display:none;width:'+(this.rc.KeyColumn+this.rc.ValueColumn)+'px">'+"</div>";var buttons=st.deleted?GkodConfig.RenderUndoDeleteItemButton(va.id,ix):GkodConfig.RenderDeleteItemButton(va.id,ix);var kcontrols=st.deleted?this.kt.RenderDeleted({va:va,id:va.id+"_$"+ix+"k",dob:st.key,width:this.rc.KeyColumn}):this.kt.RenderControl({va:va,id:va.id+
"_$"+ix+"k",dob:st.key,width:this.rc.KeyColumn});var vcontrols=st.deleted?this.vt.RenderDeleted({va:va,id:va.id+"_$"+ix+"v",dob:st.value,width:this.rc.ValueColumn}):this.vt.RenderControl({va:va,id:va.id+"_$"+ix+"v",dob:st.value,width:this.rc.ValueColumn});var table=this.RenderRows(kcontrols,vcontrols,buttons);var s=varerror+table;return s};
GkodConfig.Dictionary.prototype.RenderRows=function(keys,values,buttons,offs){var count=0;var s='<table width="100%" cellspacing="0" cellpadding="0">'+'<tr><td colspan="2" class="listitembuttons">'+(buttons?buttons:"&nbsp;")+"</td></tr>";if(this.kt.constructor!==GkodConfig.$Compound&&this.kt.constructor!==GkodConfig.$Named){s+='<tr><td class="varrowlabel '+(count%2?"odd":"even")+'">'+this.rc.Key+"</td>"+'<td class="varcontrol  '+(count%2?"odd":"even")+'">'+keys+"</td>"+"</tr>";count++}else{for(var i=
0,n=this.kt.types.length;i<n;++i)s+='<tr><td class="varrowlabel '+(count%2?"odd":"even")+'">'+this.rc.Key[i]+"</td>"+'<td class="varcontrol '+(count%2?"odd":"even")+'">'+keys[i]+"</td>"+"</tr>";count++}if(this.vt.constructor!==GkodConfig.$Compound&&this.vt.constructor!==GkodConfig.$Named){s+='<tr><td class="varrowlabel '+(count%2?"odd":"even")+'">'+this.rc.Value+"</td>"+'<td class="varcontrol '+(count%2?"odd":"even")+'">'+values+"</td>"+"</tr>";count++}else{for(var i=0,n=this.vt.types.length;i<n;++i)s+=
'<tr><td class="varrowlabel '+(count%2?"odd":"even")+'">'+this.rc.Value[i]+"</td>"+'<td class="varcontrol '+(count%2?"odd":"even")+'">'+values[i]+"</td>"+"</tr>";count++}s+="</table>";return s};GkodConfig.Dictionary.prototype.RenderColumns=function(keys,values,right,offs){return'<table cellspacing="0" cellpadding="0"><tr>'+GkodConfig.$RenderColumns(this.kt,this.rc.KeyColumn,keys,true,offs)+GkodConfig.$RenderColumns(this.vt,this.rc.ValueColumn,values,false,offs)+(right?"<td>"+right+"</td>":"")+"</tr></table>"};
GkodConfig.Dictionary.prototype.RenderControl=function(ctx){var va=ctx.va;var itemList="";for(var i=0,n=va.dob.length;i<n;++i)itemList+='<div id="'+va.id+"_$"+i+'" class="listitem">'+this.RenderItem(va,i)+"</div>";var s='<div class="list">';if((this.vt.constructor==GkodConfig.$Compound||this.vt.constructor==GkodConfig.$Named)&&this.rc.RowLayout==false)s+='<div class="listhead">'+this.RenderColumns(this.rc.Key,this.rc.Value,null,4)+"</div>";s+='<div id="'+ctx.id+"_l"+'">'+itemList+"</div>"+'<table width="100%" cellspacing="0" cellpadding="0">'+
'<tr><td class="listitembuttons">'+GkodConfig.RenderAddItemButton(ctx.va.id,ctx.id)+"</td></tr>"+"</table>"+"</div>";return s};GkodConfig.Dictionary.prototype.HasKey=function(o,key){if(this.kt.constructor!==GkodConfig.$Compound)return o[key]!==void 0;var c=o;for(var i=0,n=key.length;i<n;++i){if(c[key[i]]===void 0)return false;c=c[key[i]]}return true};
GkodConfig.Dictionary.prototype.EnsureKeyAndValue=function(o,key,value){if(this.kt.constructor!==GkodConfig.$Compound){o[key]=value;return}var c=o;for(var i=0,n=key.length-1;i<n;++i){if(c[key[i]]===void 0)c[key[i]]={};c=c[key[i]]}c[key[key.length-1]]=value};
GkodConfig.Dictionary.prototype.Validate=function(ctx,validate,ignore,sync){var ek=this.kt.New();var ev=this.vt.New();var msg;var msga=[];var va=ctx.va;var valid=true;var o={};var canreset=va.dob.length!=1||va.dob[0].deleted;for(var i=0,n=va.dob.length;i<n;++i){if(va.dob[i].deleted)continue;var vi=this.StoreItem(va,i,validate,ignore,sync);if(Gkod.Helper.Equals(ek,vi[1])&&Gkod.Helper.Equals(ev,vi[2]))continue;canreset=true;if(vi[0]===true){var k=vi[1];if(this.HasKey(o,k)){var kn=this.kt.GetValueName(k);
var ks=Gkod.Helper.IsArray(kn)?kn.join(", "):kn;msga.push(Gkod.Helper.FormatHtml(this.rc["DuplicatedKey"]||Gkrc("Config.Message.Dictionary.DuplicatedKey"),{KEY:ks}));valid=false}this.EnsureKeyAndValue(o,k,vi[2])}else valid=false}if(!validate||!this.validate)return[valid?true:msga.length>0?msga.join("<br/>"):false,o,canreset];var r=this.validate.call(ctx.va,o,sync);if(r[0]===true&&valid)return r;if(r[0]===false)r[0]="Invalid";if(r[0]!==true)msga.push(Gkod.Helper.EscapeHtml(this.rc[r[0]]||r[0]));r[0]=
msga.join("<br/>");r[3]=canreset;return r};GkodConfig.String=function(rc,validate){this.rc=rc;this.validate=validate;if(this.rc===void 0||this.rc===null)this.rc={};this.width=this.rc.Width===void 0?300:this.rc.Width;this.maxlength=this.rc.MaxLength===void 0?300:this.rc.MaxLength};GkodConfig.String.prototype.New=function(){return new String};GkodConfig.String.prototype.GetValueName=function(value){return value};GkodConfig.String.prototype.DecompileObject=function(value){return{value:value}};
GkodConfig.String.prototype.RenderControl=function(ctx){var v=String(ctx.dob.value);var width=ctx.width!==void 0?ctx.width:this.width;var maxlength=ctx.maxlength!==void 0?ctx.size:this.maxlength;var s="<input onfocus=\"GkodConfig.Page.Variable_OnFocus('"+ctx.va.id+"')\" onblur=\"GkodConfig.Page.Variable_OnBlur('"+ctx.va.id+'\')" id="'+ctx.id+'_i" name="'+ctx.id+'_i" class="control" type="text" value="'+Gkod.Helper.EscapeHtml(v)+'"'+(width>0?' style="width:'+width+'px" ':" ")+(maxlength>0?' maxlength="'+
maxlength+'"':"")+" />";return s};GkodConfig.String.prototype.RenderDeleted=function(ctx){var v=String(ctx.dob.value);var width=ctx.width!==void 0?ctx.width:this.width;var s='<div class="deletedtext"'+(width>0?' style="overflow:hidden;width:'+width+'px"':"")+">"+(v.length>0?Gkod.Helper.EscapeHtml(v):"&nbsp;")+"</div>";return s};GkodConfig.String.prototype.Get=function(ctx){return Gkod.Helper.Dom.E(ctx.id+"_i").value};
GkodConfig.String.prototype.Set=function(ctx,v){Gkod.Helper.Dom.E(ctx.id+"_i").value=v};GkodConfig.String.prototype.Validate=function(ctx,validate,ignore,sync){var vv=this.Get(ctx);var v=Gkod.Helper.Trim(vv);var r=!validate||!this.validate?[true,v]:this.validate.call(ctx.va,v,sync);if(r[0]===true)return r;if(r[0]===false)r[0]="Invalid";var msg=this.rc[r[0]];if(msg)r[0]=Gkod.Helper.EscapeHtml(msg);return r};
GkodConfig.DropDown=function(rc,map,def,validate){this.tc=Gkod.Helper.UniqueId("tc_");this.rc=rc;this.map=map;this.def=def===void 0||def===null?"":def;this.validate=validate;if(this.rc===void 0||this.rc===null)this.rc={};this.width=this.rc.Width===void 0?-1:this.rc.Width};GkodConfig.DropDown.prototype.New=function(){return this.def};
GkodConfig.DropDown.prototype.GetValueName=function(value){if(value===void 0)value=this.def;if(value===void 0)return"";return this.map[value]!==void 0?this.map[value]:value};GkodConfig.DropDown.prototype.SetDefault=function(def){this.def=def===void 0||def===null?"":def};GkodConfig.DropDown.prototype.ResetOptions=function(map,def){this.map=map||new Object;this.def=def===void 0?this.def:def===null?"":def};
GkodConfig.DropDown.prototype.AddOption=function(name,value,after){if(after===void 0){this.map[name]=value;return}var map=new Object;if(after===null)map[name]=value;for(var m in this.map){map[m]=this.map[m];if(m==after)map[name]=value}this.map=map};GkodConfig.DropDown.prototype.RemoveOption=function(name){if(this.map[name]===void 0)return;delete this.map[name]};GkodConfig.DropDown.prototype.DecompileObject=function(value){return{value:value}};
GkodConfig.DropDown.prototype.RenderControl=function(ctx){var v=String(ctx.dob.value);var s="";var width=ctx.width!==void 0?ctx.width:this.width;s+='<select class="'+this.tc+' control" onchange="GkodConfig.Page.Variable_OnChange(\''+ctx.va.id+"')\" onfocus=\"GkodConfig.Page.Variable_OnFocus('"+ctx.va.id+"')\" onblur=\"GkodConfig.Page.Variable_OnBlur('"+ctx.va.id+'\')" id="'+ctx.id+'_i" name="'+ctx.id+'_i"'+(width>0?' style="width:'+(width+5)+'px"':"")+">";for(var $v in this.map){var $n=this.map[$v];
var ESC_$n=Gkod.Helper.EscapeHtml($n);var ESC_$v=Gkod.Helper.EscapeHtml($v);s+='<option label="'+ESC_$n+'" value="'+ESC_$v+'"'+($v==v?' selected="selected"':"")+">"+ESC_$n+"</option>"}s+="</select>";return s};
GkodConfig.DropDown.prototype.RenderDeleted=function(ctx){var n=Gkod.Helper.Trim(this.map[ctx.dob.value]);var width=ctx.width!==void 0?ctx.width:this.width;var s='<div class="deletedtext"'+(width>0?' style="overflow:hidden;width:'+width+'px"':"")+">"+(n===void 0||n==""?"&nbsp;":Gkod.Helper.EscapeHtml(n))+"</div>";return s};GkodConfig.DropDown.prototype.Get=GkodConfig.String.prototype.Get;GkodConfig.DropDown.prototype.Set=GkodConfig.String.prototype.Set;
GkodConfig.DropDown.prototype.Validate=function(ctx,validate,ignore,sync){var v=Gkod.Helper.Dom.E(ctx.id+"_i").value;if(!validate||!this.validate)return[true,v];return this.validate.call(ctx.va,v,sync)};GkodConfig.LangId=function(useNoneAsDefault){this.useNoneAsDefault=!!useNoneAsDefault;GkodConfig.DropDown.call(this,null,null,null);this.SetLocaleMap({"Lang.None":""},"Lang.None",true)};GkodConfig.LangId.prototype=Gkod.Helper.Clone(GkodConfig.DropDown.prototype);
GkodConfig.LangId.prototype.GetValueName=function(value){value=value===void 0?this.def:value;value=Gkod.Helper.Get(this.rmap[value],value);return Gkod.Helper.Get(this.map[value],value)};GkodConfig.LangId.prototype.GetElements=function(){return GkodConfig.Page&&GkodConfig.Page.configVisible?Gkod.Helper.Dom.GetElements(null,"select",this.tc):[]};
GkodConfig.LangId.prototype.SetLocaleMap=function(lcmap,def){var lcm=this.useNoneAsDefault?{"Lang.None":""}:{};Gkod.Helper.Override(lcm,lcmap);if(def===void 0||def=="")def=lcm["Lang.None"]!==void 0?"Lang.None":"";var ea=this.GetElements();var transform=this.PrepareTransform(lcm,def,ea);this.RebuildOptions();for(var i=0;i<ea.length;++i)this.ResetDomElement(ea[i],transform)};
GkodConfig.LangId.prototype.PrepareTransform=function(lcmap,def,ea){var transform={};if(!ea)ea=this.GetElements();var lcm={};for(var m in lcmap)lcm[Gkrc(m,m=="Lang.None"?"":void 0)]=m;var lck=Gkod.Helper.GetKeys(lcm).sort();var pmap={};var rmap={};for(var i=0;i<lck.length;++i){var name=lck[i];var m=lcm[name];pmap[m]=name;rmap[lcmap[m]]=m}var xopt={};for(var i=0;i<ea.length;++i){var o=ea[i].value;if(pmap[o]===void 0&&rmap[o]===void 0){var lco=this.lcmap[o];if(lco===void 0)lco=o;transform[o]=lco;xopt[lco]=
true}}if(def!==void 0)this.def=Gkod.Helper.Get(lcmap[def],def);this.lcmap=lcmap;this.pmap=pmap;this.xopt=xopt;this.rmap=rmap;return transform};GkodConfig.LangId.prototype.RebuildOptions=function(){var map=Gkod.Helper.Clone(this.pmap);var xa=Gkod.Helper.GetKeys(this.xopt).sort();for(var i=0;i<xa.length;++i)map[xa[i]]=xa[i];this.map=map};GkodConfig.LangId.prototype.RemoveOptions=function(node){var v=node.value;while(node.options.length>0)node.remove(0);return v};
GkodConfig.LangId.prototype.ResetDomElement=function(node,transform){var v=this.RemoveOptions(node);for(var m in this.map){var o=document.createElement("OPTION");o.value=m;o.text=this.map[m];node.add(o,Gkod.Helper.IE?-1:null)}if(this.map[v]!==void 0)node.value=v;else if(transform&&transform[v]!==void 0)node.value=transform[v];else if(this.rmap[v]!==void 0)node.value=this.rmap[v];else node.value=this.def};
GkodConfig.LangId.prototype.DecompileObject=function(value){if(this.rmap[value]===void 0&&this.xopt[value]===void 0){this.xopt[value]=true;this.RebuildOptions()}var v=this.rmap[value];if(v===void 0)v=value;return{value:v}};GkodConfig.LangId.prototype.Validate=function(ctx,validate,ignore,sync){var v=Gkod.Helper.Dom.E(ctx.id+"_i").value;v=Gkod.Helper.Get(this.lcmap[v],v);if(!validate||!this.validate)return[true,v];return this.validate.call(ctx.va,v,sync)};
GkodConfig.Number=function(rc,validate){this.rc=rc;this.validate=validate;if(this.rc===void 0||this.rc===null)this.rc={};this.width=this.rc.Width===void 0?100:this.rc.Width;this.maxlength=this.rc.MaxLength===void 0?300:this.rc.MaxLength};GkodConfig.Number.prototype.New=function(){return new Number(0)};GkodConfig.Number.prototype.GetValueName=function(value){return String(value)};GkodConfig.Number.prototype.DecompileObject=function(value){return{value:value}};
GkodConfig.Number.prototype.RenderControl=function(ctx){var v=Number(ctx.dob.value);var width=ctx.width!==void 0?ctx.width:this.width;var maxlength=ctx.maxlength!==void 0?ctx.maxlength:this.maxlength;var s="<input onfocus=\"GkodConfig.Page.Variable_OnFocus('"+ctx.va.id+"')\" onblur=\"GkodConfig.Page.Variable_OnBlur('"+ctx.va.id+'\')" id="'+ctx.id+'_i" name="'+ctx.id+'_i" class="control" type="text" value="'+v+'"'+(width>0?' style="width:'+width+'px" ':" ")+(maxlength>0?' maxlength="'+maxlength+'"':
"")+" />";return s};GkodConfig.Number.prototype.RenderDeleted=function(ctx){var v=Number(ctx.dob.value);var width=ctx.width!==void 0?ctx.width:this.width;var s='<div class="deletedtext"'+(width>0?' style="overflow:hidden;width:'+width+'px"':"")+">"+v+"</div>";return s};GkodConfig.Number.prototype.Get=GkodConfig.String.prototype.Get;GkodConfig.Number.prototype.Set=GkodConfig.String.prototype.Set;
GkodConfig.Number.prototype.Validate=function(ctx,validate,ignore,sync){var vv=this.Get(ctx);var v=Gkod.Helper.Trim(vv);v=v==""?"0":v;var n=Number(v);var r=validate&&this.validate?this.validate.call(ctx.va,v,sync):[!isNaN(n),n];if(r[0]===true)return r;if(r[0]===false)r[0]="Invalid";var msg=this.rc[r[0]];if(msg)r[0]=Gkod.Helper.EscapeHtml(msg);return r};
GkodConfig.TypeIn=function(rc,map,def,validate,readonly){this.tid=Gkod.Helper.UniqueId("tin");this.readonly=readonly||false;this.rc=rc;this.map=map;this.def=def===void 0||def===null?"":def;this.validate=validate;if(this.rc===void 0||this.rc===null)this.rc={};this.width=this.rc.Width||150;this.paletteWidth=this.rc.PaletteWidth||0;GkodConfig.TypeIn.Register(this.tid,{map:map,paletteWidth:this.paletteWidth})};GkodConfig.TypeIn.vmap={};
GkodConfig.TypeIn.Register=function(tid,obj){GkodConfig.TypeIn.vmap[tid]=obj};GkodConfig.TypeIn.SetText=function(id){var text=Gkod.Helper.Dom.E(id+"_i");var list=Gkod.Helper.Dom.E(id+"_l");text.value=list.options[list.selectedIndex].value};GkodConfig.TypeIn.SetList=function(id){var text=Gkod.Helper.Dom.E(id+"_i");var list=Gkod.Helper.Dom.E(id+"_l");list.selectedIndex=0;for(var i=0,n=list.options.length;i<n;++i)if(list.options[i].value==text.value)list.selectedIndex=i};
GkodConfig.TypeIn.prototype.New=function(){return this.def};GkodConfig.TypeIn.prototype.GetValueName=function(value){if(value===void 0)value=this.def;if(value===void 0)return"";return this.map[value]!==void 0?this.map[value]:value};GkodConfig.TypeIn.prototype.DecompileObject=function(value){return{value:value}};
GkodConfig.TypeIn.prototype.RenderControl=function(ctx){var v=String(ctx.dob.value);var listWidth=ctx.width||this.width;var textWidth=listWidth>22?listWidth-22:0;var textid=ctx.id+"_i";var listid=ctx.id+"_l";var s='<div class="typein_container">'+'<select class="typein_list control"'+' id="'+listid+'"'+' name="'+listid+'"'+' style="width:'+listWidth+'px;"'+" onChange=\"GkodConfig.TypeIn.SetText('"+ctx.id+"')\""+(ctx.va?" onfocus=\"GkodConfig.Page.Variable_OnFocus('"+ctx.va.id+"')\""+" onblur=\"GkodConfig.Page.Variable_OnBlur('"+
ctx.va.id+"')\"":"")+(this.readOnly?" disabled":"")+">";for(var $v in this.map){var $n=this.map[$v];var ESC_$n=Gkod.Helper.EscapeHtml($n);var ESC_$v=Gkod.Helper.EscapeHtml($v);s+='<option label="'+ESC_$n+'" value="'+ESC_$v+'"'+($v==v?' selected="selected"':"")+">"+ESC_$n+"</option>"}s+="</select>"+'<input class="typein_text control"'+' id="'+textid+'"'+' name="'+textid+'"'+' style="width:'+textWidth+'px;"'+" onChange=\"GkodConfig.TypeIn.SetList('"+ctx.id+"');\""+(ctx.va?" onfocus=\"GkodConfig.Page.Variable_OnFocus('"+
ctx.va.id+"')\""+" onblur=\"GkodConfig.Page.Variable_OnBlur('"+ctx.va.id+"')\"":"")+(this.readOnly?" disabled":"")+' value="'+Gkod.Helper.EscapeHtml(v)+'"'+"/>"+"</div>";return s};GkodConfig.TypeIn.prototype.RenderDeleted=function(ctx){var width=ctx.width!==void 0?ctx.width:this.width;var s='<div class="deletedtext"'+(width>0?' style="overflow:hidden;width:'+width+'px"':"")+">"+(ctx.dob.value?Gkod.Helper.EscapeHtml(ctx.dob.value):"&nbsp;")+"</div>";return s};
GkodConfig.TypeIn.prototype.Get=function(ctx){return Gkod.Helper.Dom.E(ctx.id+"_i").value};GkodConfig.TypeIn.prototype.Set=function(ctx,v){Gkod.Helper.Dom.E(ctx.id+"_i").value=v};GkodConfig.TypeIn.prototype.Validate=function(ctx,validate,ignore,sync){var v=this.Get(ctx);if(!validate||!this.validate)return[true,v];return this.validate.call(ctx.va,v,sync)};
GkodConfig.Url=function(rc,validate){this.rc=rc;this.validate=validate;if(this.rc===void 0||this.rc===null)this.rc={};this.width=this.rc.Width===void 0?300:this.rc.Width;this.maxlength=this.rc.MaxLength===void 0?2E3:this.rc.MaxLength};GkodConfig.Url.prototype.New=GkodConfig.String.prototype.New;GkodConfig.Url.prototype.GetValueName=GkodConfig.String.prototype.GetValueName;GkodConfig.Url.prototype.DecompileObject=GkodConfig.String.prototype.DecompileObject;GkodConfig.Url.prototype.RenderControl=GkodConfig.String.prototype.RenderControl;
GkodConfig.Url.prototype.RenderDeleted=GkodConfig.String.prototype.RenderDeleted;GkodConfig.Url.prototype.Get=GkodConfig.String.prototype.Get;GkodConfig.Url.prototype.Set=GkodConfig.String.prototype.Set;GkodConfig.Url.prototype.Validate=GkodConfig.String.prototype.Validate;
GkodConfig.DelayedPageUpdate=function(updateFn){GkodConfig.CancelPageUpdate();GkodConfig._PageUpdateFn=updateFn;GkodConfig._PageUpdateTID=setTimeout(function(){try{var updateFn=GkodConfig._PageUpdateFn;GkodConfig._PageUpdateFn=null;GkodConfig._PageUpdateTID=null;updateFn.call()}catch(e){Fail("GkodConfig.DelayedPageUpdate",e)}},1500);updateFn};GkodConfig.CommitPageUpdate=function(){if(!GkodConfig._PageUpdateTID)return;var updateFn=GkodConfig._PageUpdateFn;GkodConfig.CancelPageUpdate();updateFn.call()};
GkodConfig.CancelPageUpdate=function(){if(!GkodConfig._PageUpdateTID)return;clearTimeout(GkodConfig._PageUpdateTID);GkodConfig._PageUpdateFn=null;GkodConfig._PageUpdateTID=null};
GkodConfig.CreatePage=function(app){var epos=app.Id.indexOf("/");var name=epos>=0?app.Id.substr(0,epos):app.Id;var embeddedName=epos>=0?app.Id.substr(epos+1):null;var irc=Gkod.Helper.CreateResourceManager(GkodConfig.DefaultResource);irc.AttachResource(app.Template);irc.LoadResources(GkodConfig.CurrentLanguage);var pg=new GkodConfig.ConfigPage(irc,app);var __template=app.Template;var __t_default="(function(){"+GkodConfig.DefaultTemplate+"}).call(this);";var __t_content="(function(){"+app.TemplateContent+
"}).call(this);";GkodConfig._TemplateMap=new GkodConfig.TemplateMap;try{(function(Page){var evalIx=0;try{var Defaults={};var Types={};var AppName=app.Id;var EmbeddedApp=embeddedName;var EmbeddedApps={Add:function(){}};var Templates=GkodConfig._TemplateMap;var Gkrc=irc;evalIx=1;eval(__t_default);evalIx=2;eval(__t_content);app.TemplateDefaults=Defaults}catch(e){Page.containsError=true;Page.configError=(evalIx==2?__template:"default-ct.js")+": "+Gkod.Helper.GetException(e)}}).call(this,pg)}catch(e){Fail("GkodConfig.CreatePage",
e,url)}return pg};GkodConfig.ConfigPage_Application=function(id){var app=GkodConfig.AppList[id];if(!app)return;GkodConfig.InjectConfigPage(app)};
var _Cookie={Create:function(name,evalue,keepDays,path,domain,secure){var ename=encodeURIComponent(name);var cookie=ename+"="+evalue;if(keepDays>=-1){var time=(new Date).getTime();var millisecondsSinceMidnight=time%864E5;var expires=new Date(time-millisecondsSinceMidnight+864E5*(keepDays+1));cookie+="; expires="+expires.toGMTString()}if(path)cookie+="; path="+path;if(domain)cookie+="; domain="+domain;if(secure)cookie+="; secure";return cookie},TryGet:function(cookie,name){var ename=encodeURIComponent(name);
var nameValueList=cookie.split("; ");for(var i=0,n=nameValueList.length;i<n;++i){var nameValue=nameValueList[i];if(nameValue==ename)return"";var eqPos=nameValue.indexOf("=");if(eqPos>0&&eqPos==ename.length&&nameValue.substr(0,eqPos)==ename)return nameValue.substr(eqPos+1)}return null},EncodeHash:function(hash){if(!hash)return"";var tokens=[];for(var key in hash)tokens.push(encodeURIComponent(key)+":"+encodeURIComponent(hash[key]));return tokens.join("&")},DecodeHash:function(value){var hash={};if(value){var tokens=
value.split("&");for(var i=0,n=tokens.length;i<n;++i){var keyValue=tokens[i].split(":");hash[decodeURIComponent(keyValue[0])]=keyValue.length==2?decodeURIComponent(keyValue[1]):""}}return hash}};
var Cookie={CreateFromValue:function(name,value,keepDays,path,domain,secure){return _Cookie.Create(name,encodeURIComponent(value),keepDays,path,domain,secure)},CreateFromHash:function(name,hash,keepDays,path,domain,secure){return _Cookie.Create(name,_Cookie.EncodeHash(hash),keepDays,path,domain,secure)},CreateExpired:function(name,path,domain){return _Cookie.Create(name,"",-1,path,domain)},TryGetValue:function(cookie,name,defaultValue){var evalue=_Cookie.TryGet(cookie,name);if(evalue==null)return defaultValue;
return encodeURIComponent(evalue)},TryGetHash:function(cookie,name,defaultValue){var evalue=_Cookie.TryGet(cookie,name);if(evalue==null)return defaultValue;return _Cookie.DecodeHash(evalue)}};
var GatewayCookie={Set:function(_cookie,_property,_value){var hash=Cookie.TryGetHash(document.cookie,_cookie,{});hash[_property]=_value;document.cookie=Cookie.CreateFromHash(_cookie,hash,365,"/")},Get:function(_cookie,_property){var hash=Cookie.TryGetHash(document.cookie,_cookie,{});return hash[_property]},GetAll:function(_cookie){return Cookie.TryGetHash(document.cookie,_cookie,{})}};var url=new Gkod.Helper.Url(document.URL);var test=url.Safe_GetParam("test",60,null);var done=false;
window["AutoRun"]=function(){if(done)return;done=true;try{if(test===null)GkodConfig.InjectMenu();else GkodConfig.InjectTest()}catch(xe){}};
