var cIE=false;var cFF=false;if(navigator.appName.indexOf('Netscape')!=-1)cFF=true;if(navigator.appName.indexOf('Explorer')!=-1)cIE=true;var cIE6lte=false;if(cIE)
{var ra=navigator.userAgent.match(new RegExp('MSIE (\\d)','i'));if(ra!=null)
{cIE6lte=ra[1]<=6;}}
var cIE7=cIE&&navigator.userAgent.indexOf('MSIE 7')!=-1;iTAB_INDEX=100;var objEditor2=null;var g_blnShowConsole=false;var g_blnJsWindowOpened=false;var g_intImageWidth=168;var g_intImageHeight=224;var g_intSmallImageWidth=42;var g_intSmallImageHeight=56;var cDecimalSymbol=',';var cFloatPrecision=2;var cGroupingSymbol='.';var cDigitGroupingType=0;var cDisplayLeadingZero=1;var cDisplayTrailingZero=0;var cDoublePrecision=3;var cShortDateFormat='yyyy.MM.dd';var cLongDateFormat='yyyy \'m.\' MMMM d \'d.\'';var cTimeFormat='HH:mm:ss';var cYearAhead=22;var intLastNr=0;function g_str_fIdGenerator()
{intLastNr++;return'gen'+intLastNr;}
function g_obj_fElement(p_objArbitraryObject)
{if(typeof(p_objArbitraryObject)=='string')
{return document.getElementById(p_objArbitraryObject);}
return p_objArbitraryObject;}
function g_fSetInnerText(p_objElement,p_strText)
{p_objElement=g_obj_fElement(p_objElement);if(!p_objElement)
return;if(cIE)
{p_objElement.innerText=p_strText;}
else
{p_objElement.textContent=p_strText;}}
function g_fAddInnerText(p_objElement,p_strText)
{p_objElement=g_obj_fElement(p_objElement);if(!p_objElement)
return;if(p_objElement.innerText)
{p_objElement.innerText+=p_strText;}
else
{p_objElement.textContent+=p_strText;}}
function bln_fIsImageOk(p_objImage)
{if(!p_objImage.complete)
{return false;}
if(typeof p_objImage.naturalWidth!="undefined"&&p_objImage.naturalWidth==0)
{return false;}
return true;}
function g_arr_obj_fGetElementsByClassName(p_objParent,p_strTagName,p_strClassName)
{var arrElements=p_objParent.getElementsByTagName(p_strTagName);var arrReturnElements=new Array();var strClassName=p_strClassName.replace(/-/g,"\-");var objRegExp=new RegExp("(^|\s)"+strClassName+"(\s|$)");var objElement;for(var i=0,intLength=arrElements.length;i<intLength;i++){objElement=arrElements[i];if(objRegExp.test(objElement.className)){arrReturnElements.push(objElement);}}
return(arrReturnElements)}
if(cFF)
{g_fStopEvent=function(e,p_blnAllowPropagation,p_blnAllowDefault)
{if(!p_blnAllowPropagation)
{e.stopPropagation();}
if(!p_blnAllowDefault)
{e.preventDefault();}}}
else
{g_fStopEvent=function(e,p_blnAllowPropagation,p_blnAllowDefault)
{if(!p_blnAllowPropagation)
{e.cancelBubble=true;}
if(!p_blnAllowDefault)
{if(e.keyCode!=17&&e.keyCode!=16)
{}
e.returnValue=false;}}}
if(cIE)
{var getSrcElement=function(e)
{return e.srcElement;}}
if(cFF)
{var getSrcElement=function(e)
{return e.target;}}
if(cIE)
{var g_obj_fGetNavigatingToElement=function(e)
{return e.toElement;}}
if(cFF)
{var g_obj_fGetNavigatingToElement=function(e)
{return e.relatedTarget;}}
if(cIE)
{var g_obj_fGetNavigatingFromElement=function(e)
{return e.fromElement;}}
if(cFF)
{var g_obj_fGetNavigatingFromElement=function(e)
{return e.currentTarget;}}
if(cIE)
{g_hsh_fGetCursorInformation=function(p_objInput)
{var intSelectionStart=0;var intSelectionEnd=0;var strSelectedText='';var strOldValue=p_objInput.value;var strSpecialSymbol='~@#@~';var selectionRange=document.selection.createRange();var oldSelection=selectionRange.text;strSelectedText=selectionRange.text;selectionRange.text=strSpecialSymbol;var strNewValue=p_objInput.value;intSelectionStart=strNewValue.indexOf(strSpecialSymbol);intSelectionEnd=intSelectionStart+oldSelection.length;var selectionRangeEnd=document.selection.createRange();var a=selectionRangeEnd.compareEndPoints('StartToStart',selectionRange);var b=selectionRangeEnd.compareEndPoints('StartToEnd',selectionRange);var c=selectionRangeEnd.compareEndPoints('EndToEnd',selectionRange);var d=selectionRangeEnd.compareEndPoints('EndToStart',selectionRange);if(c!=-1&&d!=-1)
{selectionRange.move('character',-5);}
selectionRangeEnd.setEndPoint('StartToStart',selectionRange);selectionRangeEnd.select();document.selection.clear();var selectionRangeStart=document.selection.createRange();selectionRange.text=oldSelection;selectionRange.move('character',oldSelection.length);var selectionRangeEnd=document.selection.createRange();selectionRangeEnd.setEndPoint('StartToStart',selectionRangeStart);selectionRangeEnd.select();return{selectionStart:intSelectionStart,selectionEnd:intSelectionEnd,selectedText:strSelectedText};}}
if(cFF)
{g_hsh_fGetCursorInformation=function(p_objInput)
{var strSelectedText=p_objInput.value.substring(p_objInput.selectionStart,p_objInput.selectionEnd);var intSelectionStart=p_objInput.selectionStart;var intSelectionEnd=p_objInput.selectionEnd;return{selectionStart:intSelectionStart,selectionEnd:intSelectionEnd,selectedText:strSelectedText};}}
if(cIE)
{g_int_fGetCharCode=function(p_objEvent)
{return p_objEvent.keyCode;}}
if(cFF)
{g_int_fGetCharCode=function(p_objEvent)
{return p_objEvent.charCode;}}
if(cIE)
{g_int_fGetKeyCode=function(p_objEvent)
{return p_objEvent.keyCode;}}
if(cFF)
{g_int_fGetKeyCode=function(p_objEvent)
{return p_objEvent.which;}}
if(cIE)
{g_str_fGetInputChar=function(p_objEvent)
{return String.fromCharCode(p_objEvent.keyCode);}}
if(cFF)
{g_str_fGetInputChar=function(p_objEvent)
{return String.fromCharCode(p_objEvent.which);}}
if(cIE)
{g_fSetSelectionRange=function(p_objInput,p_intStart,p_intEnd)
{var strValue=p_objInput.value;var strEnding=strValue.substr(0,p_intEnd);var strBegining=strValue.substr(0,p_intStart).replace(/\r\n/g,'\n');var strEnding=strValue.substr(0,p_intEnd).replace(/\r\n/g,'\n');strValue=strValue.replace(/\r\n/g,'\n');var objRange=p_objInput.createTextRange();objRange.moveStart('character',strBegining.length);objRange.moveEnd('character',strEnding.length-strValue.length);objRange.select();}}
if(cFF)
{g_fSetSelectionRange=function(p_objInput,p_intStart,p_intEnd)
{p_objInput.focus();p_objInput.setSelectionRange(p_intStart,p_intEnd);}}
function g_fRemoveStyle(p_strSelector)
{p_strSelector=p_strSelector.toLowerCase();if(cIE)
{var arr_strSelectorTokens=p_strSelector.split(',');if(arr_strSelectorTokens.length>1)
{for(var k=0;k<arr_strSelectorTokens.length;k++)
{g_fRemoveStyle(arr_strSelectorTokens[k]);}
return;}}
var sheetList=document.styleSheets;var ruleList;var i,j;for(i=sheetList.length-1;i>=0;i--)
{if(cIE)
ruleList=sheetList[i].rules;if(cFF)
ruleList=sheetList[i].cssRules;for(j=0;j<ruleList.length;j++)
{if(((cFF&&ruleList[j].type==CSSRule.STYLE_RULE)||(cIE))&&ruleList[j].selectorText.toLowerCase()==p_strSelector)
{if(sheetList[i].removeRule)
sheetList[i].removeRule(j);else if(sheetList[i].deleteRule)
sheetList[i].deleteRule(j);j--;}}}}
function g_fAddStyle(p_strSelector,p_strStyle)
{var sheetList=document.styleSheets;var ruleList;var index;var sheetIndex=sheetList.length-1;if(sheetList.length==0)
return;if(cIE)
ruleList=sheetList[sheetIndex].rules;if(cFF)
ruleList=sheetList[sheetIndex].cssRules;index=ruleList.length;if(index<0)
index=0;if(cFF)
{sheetList[sheetIndex].insertRule(p_strSelector+'{'+p_strStyle+'}',index);}
if(cIE)
{sheetList[sheetIndex].addRule(p_strSelector,p_strStyle,index);}}
if(cIE)
{var g_str_fGetClipboardText=function()
{var strText='cEMPTY';var strText=window.clipboardData.getData('Text');return(strText);}}
if(cFF)
{var g_str_fGetClipboardText=function()
{var strText='cEMPTY';netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var clip=Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);if(!clip)
return strText;var trans=Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);if(!trans)
return strText;trans.addDataFlavor('text/unicode');clip.getData(trans,clip.kGlobalClipboard);var str=new Object();var strLength=new Object();try
{trans.getTransferData('text/unicode',str,strLength);if(str)str=str.value.QueryInterface(Components.interfaces.nsISupportsString);if(str)strText=str.data.substring(0,strLength.value/2);}
catch(ex)
{}
return(strText);}}
if(cIE)
{var fCopyToClipboard=function(p_text)
{if(window.clipboardData||clipboardData)
window.clipboardData.setData("Text",p_text);return;}}
if(cFF)
{var fCopyToClipboard=function(p_text)
{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var gClipboardHelper=Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);gClipboardHelper.copyString(p_text);return;}}
if(cIE)
{var bln_fCopyToClipboard=function(p_text)
{if(window.clipboardData||clipboardData)
window.clipboardData.setData("Text",p_text);return true;}}
if(cFF)
{var bln_fCopyToClipboard=function(p_text)
{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var copytext=p_strText;var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);if(!str)
return false;str.data=copytext;var trans=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!trans)
return false;trans.addDataFlavor("text/unicode");trans.setTransferData("text/unicode",str,copytext.length*2);var clipid=Components.interfaces.nsIClipboard;var clip=Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);if(!clip)
return false;clip.setData(trans,null,clipid.kGlobalClipboard);return true;}}
function g_bln_fIsLeftClick(p_objEvent)
{return cIE&&p_objEvent.button==1||cFF&&p_objEvent.button==0;}
function g_bln_fIsRightClick(p_objEvent)
{return p_objEvent.button==2;}
function g_bln_fIsMiddleClick(p_objEvent)
{return cIE&&p_objEvent.button==4||cFF&&p_objEvent.button==1;}
function g_arr_str_fGetParentChain(p_objElement)
{var arr_strResult=[];var objElement=p_objElement;while(objElement)
{var strItem=objElement.tagName;if(objElement.className)
strItem+='.'+objElement.className;if(objElement.id)
strItem+=' #'+objElement.id;arr_strResult.push(strItem);var objParent=objElement.parentNode;if(objParent==objElement)
break;objElement=objParent;}
return arr_strResult;}
if(cFF)
{g_fSetEnabled=function(p_objElement,p_blnEnabled)
{if(p_blnEnabled)
{p_objElement.style.cursor='pointer';p_objElement.style.MozOpacity='1';}
else
{p_objElement.style.cursor='default';p_objElement.style.MozOpacity='0.5';}}}
else if(cIE)
{g_fSetEnabled=function(p_objElement,p_blnEnabled)
{if(p_blnEnabled)
{p_objElement.style.cursor='pointer';p_objElement.style.filter='';}
else
{p_objElement.style.cursor='default';p_objElement.style.filter='alpha (opacity=50)';}}}
if(cFF)
{g_fSetEnabledFilter=function(p_objElement,p_blnEnabled)
{if(p_blnEnabled)
{p_objElement.style.MozOpacity='1';}
else
{p_objElement.style.MozOpacity='0.5';}}}
else if(cIE)
{g_fSetEnabledFilter=function(p_objElement,p_blnEnabled)
{if(p_blnEnabled)
{p_objElement.style.filter='';}
else
{p_objElement.style.filter='alpha (opacity=50)';}}}
function g_fInsertAfter(p_objParent,p_objNode,p_objReferenceNode)
{p_objParent.insertBefore(p_objNode,p_objReferenceNode.nextSibling);}
function g_fInsertBefore(p_objParent,p_objNode,p_objReferenceNode)
{p_objParent.insertBefore(p_objNode,p_objReferenceNode);}
function addEvent(p_objElement,p_strEventType,p_fHandler,p_objContext)
{var fHandler=p_fHandler;if(p_objContext!=null&&typeof(p_objContext)=='object')
{fHandler=p_fHandler.closure(p_objContext);}
if(p_objElement.addEventListener)
{p_objElement.addEventListener(p_strEventType,fHandler,false);return(true);}
else
if(p_objElement.attachEvent)
{var fRet=p_objElement.attachEvent("on"+p_strEventType,fHandler);return(fRet);}
else
{return(false);}}
function removeEvent(p_objElement,p_strEventType,p_fHandler,p_objContext)
{if(p_objElement==null)
{return;}
var fHandler=p_fHandler;if(p_objContext!=null&&typeof(p_objContext)=='object')
{fHandler=p_fHandler.closure(p_objContext);}
if(p_objElement.removeEventListener)
{p_objElement.removeEventListener(p_strEventType,fHandler,false);return true;}
else
if(p_objElement.detachEvent)
{var fRet=p_objElement.detachEvent('on'+p_strEventType,fHandler);return(fRet);}
else
{consoleA("Handler could not be removed");}}
function iEventInterface(p_arr_strAllowedEvents)
{if(p_arr_strAllowedEvents)
{this.hshAllowed=g_hsh_int_fMakeExistanceHash(p_arr_strAllowedEvents);this.bln_fEventAllowed=function(p_strEvent)
{return this.hshAllowed[p_strEvent];}}
else
{this.bln_fEventAllowed=function()
{return true;}}
this.g_fAddEvent=function(p_strEvent,p_objContext,p_fFunction,p_blnOneTimeRun)
{return this.fAddEvent(p_strEvent,p_objContext,p_fFunction,p_blnOneTimeRun);}
this.fAddEvent=function(p_strEvent,p_objContext,p_fFunction,p_blnOneTimeRun)
{if(!this.bln_fEventAllowed(p_strEvent))
return false;if(typeof(p_fFunction)=='function')
{if(p_objContext==null)
p_objContext=window;p_blnOneTimeRun=p_blnOneTimeRun?true:false;Listener.add(this,p_strEvent,p_fFunction,p_objContext,p_blnOneTimeRun);}
return true;}
this.g_fRemoveEvent=function(p_strEvent,p_objContext,p_fFunction)
{if(!this.bln_fEventAllowed(p_strEvent))
return false;if(p_objContext==null)
p_objContext=window;Listener.remove(this,p_strEvent,p_fFunction,p_objContext);return true;}
this.fFireEvent=function(p_strEvent,p_objArg)
{if(!this.bln_fEventAllowed(p_strEvent))
return false;Listener.fire(this,p_strEvent,[p_objArg]);return true;}
this.g_fFireEventExcept=function(p_strEvent,p_objArgs,p_objExceptionObject)
{if(!this.bln_fEventAllowed(p_strEvent))
return false;Listener.fireConditional(this,p_strEvent,[p_objArgs],p_objExceptionObject,false);return true;}
this.g_fFireEventOnly=function(p_strEvent,p_objArgs,p_objExclusiveObject)
{if(!this.bln_fEventAllowed(p_strEvent))
return false;Listener.fireConditional(this,tp_strEvent,[p_objArgs],p_objExclusiveObject,true);return true;}
this.int_fGetRegisteredHandlerCount=function(p_strEvent)
{return Listener.getLength(this,p_strEvent);}
this.g_fRegisterEventTypes=function(p_arr_strTypes)
{if(this.hshAllowed==null)
{this.hshAllowed=g_hsh_int_fMakeExistanceHash(p_arr_strTypes);this.bln_fEventAllowed=function(p_strEvent)
{return this.hshAllowed[p_strEvent];}}
else
{this.hshAllowed=g_hsh_int_fAppendExistanceHash(this.hshAllowed,p_arr_strTypes);}}}
var cEvents={};cEvents.cClick='onClick';cEvents.cDblClick='onDblClick';cEvents.cKeyDown='onKeyDown';cEvents.cKeyUp='onKeyUp';cEvents.cKeyPress='onKeyPress';cEvents.cChange='onChange';cEvents.cExpand='onExpand';cEvents.cCollapse='onCollapse';cEvents.cLoad='onLoad';cEvents.cLoadHeader='onLoadHeader';cEvents.cLoadContent='onLoadContent';cEvents.cSelect='onSelect';cEvents.cUnselect='onUnselect';cEvents.cMouseOver='onMouseOver';cEvents.cMouseOut='onMouseOut';cEvents.cDragStart='onDragStart';cEvents.cDragEnd='onDragEnd';cEvents.cDragOut='onDragOut';cEvents.cDragOver='onDragOver';cEvents.cDrag='onDrag';cEvents.cDrop='onDrop';cEvents.cDragFailed='onDragFailed';cEvents.cPropertyChanged='onPropertyChanged';cEvents.cSelectStart='onSelectStart';cEvents.cSelectMove='onSelectMove';cEvents.cSelectEnd='onSelectEnd';cEvents.cShow='onShow';cEvents.cHide='onHide';cEvents.cBeforeShow='onBeforeShow';cEvents.cBeforeHide='onBeforeHide';cEvents.cStateChange='onStateChanged';cEvents.cUp='onUp';cEvents.cDown='onDown';cEvents.cAccept='onAccept';cEvents.cDelete='onDelete';cEvents.cError='onError';cEvents.cValidationOK='onValidationOK';cEvents.cFocus='onFocus';cEvents.cBlur='onBlur';cEvents.cFileUploaded='onFileUpload';cEvents.cInvalidate='onInvalidate';cEvents.cSearch='onSearch';cEvents.cCreate='onCreate';cEvents.cEdit='onEdit';cEvents.cRefresh='onRefresh';function g_hsh_int_fMakeExistanceHash(p_arr_strKeyArray)
{var hsh_intExistanceHash={};for(var i=0,intLength=p_arr_strKeyArray.length;i<intLength;i++)
{hsh_intExistanceHash[p_arr_strKeyArray[i]]=1;}
return hsh_intExistanceHash;}
function g_hsh_int_fAppendExistanceHash(p_hsh_intOriginal,p_arr_strKeyArray)
{for(var i=0,intLength=p_arr_strKeyArray.length;i<intLength;i++)
{p_hsh_intOriginal[p_arr_strKeyArray[i]]=1;}
return p_hsh_intOriginal;}
function Listener(fp,scope,removing,args){this.fp=fp;this.scope=scope;this.removeing=removing;}
Listener.add=function(oSource,sEvent,fpDest,oScope,bRunOnce){if(!oSource[sEvent]||oSource[sEvent]==null||!oSource[sEvent]._listeners){oSource[sEvent]=function(){Listener.fire(oSource,sEvent,arguments)};oSource[sEvent]._listeners=new Array();}
var idx=this.findForEvent(oSource[sEvent],fpDest,oScope);if(idx==-1)idx=oSource[sEvent]._listeners.length;oSource[sEvent]._listeners[idx]=new Listener(fpDest,oScope,bRunOnce);}
Listener.getLength=function(oSource,sEvent){if(oSource[sEvent]==null||oSource[sEvent]._listeners==null)
return 0;return oSource[sEvent]._listeners.length;}
Listener.remove=function(oSource,sEvent,fpDest,oScope){var idx=this.findForEvent(oSource[sEvent],fpDest,oScope);if(idx!=-1){var iLast=oSource[sEvent]._listeners.length-1;oSource[sEvent]._listeners[idx]=oSource[sEvent]._listeners[iLast];oSource[sEvent]._listeners.length--;}}
Listener.findForEvent=function(fpEvent,fpDest,oScope){if(fpEvent._listeners){for(var i=0;i<fpEvent._listeners.length;i++){if(fpEvent._listeners[i].scope==oScope&&fpEvent._listeners[i].fp==fpDest){return i;}}}
return-1;}
Listener.fire=function(oSourceObj,sEvent,args){if(oSourceObj&&oSourceObj[sEvent]&&oSourceObj[sEvent]._listeners){var lstnr,fp;var last=oSourceObj[sEvent]._listeners.length-1;for(var i=last;i>=0;i--){lstnr=oSourceObj[sEvent]._listeners[i];fp=lstnr.fp;fp.apply(lstnr.scope,args);if(lstnr.remove)Listener.remove(oSourceObj,sEvent,lstnr.fp,lstnr.scope);}}
return(-1)}
Listener.fireConditional=function(oSourceObj,sEvent,args,p_objObject,p_blnShowObject){if(oSourceObj&&oSourceObj[sEvent]&&oSourceObj[sEvent]._listeners){var lstnr,fp;var last=oSourceObj[sEvent]._listeners.length-1;for(var i=last;i>=0;i--){lstnr=oSourceObj[sEvent]._listeners[i];if(p_blnShowObject&&lstnr.scope!=p_objObject||!p_blnShowObject&&lstnr.scope==p_objObject)
continue;fp=lstnr.fp;fp.apply(lstnr.scope,args);if(lstnr.remove)Listener.remove(oSourceObj,sEvent,lstnr.fp,lstnr.scope);}}
return(-1)}
if(!Function.prototype.apply){Function.prototype.apply=function(oScope,args){var sarg=[];var rtrn,call;if(!oScope)oScope=window;if(!args)args=[];for(var i=0;i<args.length;i++){sarg[i]="args["+i+"]";}
call="oScope.__applyTemp__("+sarg.join(",")+");";oScope.__applyTemp__=this;rtrn=eval(call);delete oScope.__applyTemp__;return rtrn;}}
var g_objEventManager=new clsEventManaging();function clsEventManaging()
{this.g_strId=null;this.g_strParentId='';this.g_arr_strChildId=new Array();this.g_bln_hshEventAdded=new Object();this.g_intX=null;this.g_intY=null;var objThis=this;var hsh_hsh_Function=new Object();var hsh_arr_strFunctionId=new Object();var hsh_blnEventKilled=new Object();var hsh_arr_strKilledFunctionId=new Object();this.str_fGetId=function()
{var strId=null;if(window.parent!=window&&window.parent.g_objEventManager!=null)
{strId=window.parent.g_objEventManager.str_fRegisterChild();return strId;}
else
return'parentDoc';}
this.str_fRegisterChild=function()
{var intChildLength=this.g_arr_strChildId.length;var strId=this.g_strId+'_'+intChildLength;this.g_arr_strChildId[intChildLength]=strId;return strId;}
this.g_intGetChildIndex=function(p_strChildId)
{if(cIE==true)
{if(document.frames!=null)
{for(var i=0;i<document.frames.length;i++)
{if(document.frames[i].g_objEventManager!=null)
if(document.frames[i].g_objEventManager.g_strId==p_strChildId)
{return i;break;}}}}
else if(cFF==true)
{if(window.frames!=null)
{for(var i=0;i<window.frames.length;i++)
{if(window.frames[i].g_objEventManager!=null)
if(window.frames[i].g_objEventManager.g_strId==p_strChildId)
{return i;break;}}}}}
this.fSetXYByChild=function(p_strChildId)
{var objFrame=null;var objChildEventManager=null;if(cIE==true)
{if(document.frames!=null)
{for(var i=0;i<document.frames.length;i++)
{if(document.frames[i].g_objEventManager!=null)
if(document.frames[i].g_objEventManager.g_strId==p_strChildId)
{objFrame=document.frames[i];objChildEventManager=document.frames[i].g_objEventManager;break;}}}}
else if(cFF==true)
{if(window.frames!=null)
{for(var i=0;i<window.frames.length;i++)
{if(window.frames[i].g_objEventManager!=null)
if(window.frames[i].g_objEventManager.g_strId==p_strChildId)
{objFrame=window.frames[i];objChildEventManager=window.frames[i].g_objEventManager;break;}}}}
var arrArg=objPosition(objFrame.frameElement);this.g_intX=arrArg[2]+objChildEventManager.g_intX;this.g_intY=arrArg[3]+objChildEventManager.g_intY;}
this.fCallParent=function(p_strChildId,p_strEvent,p_objEvent,p_strDocumentURL,p_arrNavigation)
{var objParent=objThis.g_obj_fGetParent();if(objParent!=null)
{var intChildIndex=objParent.g_intGetChildIndex(p_strChildId);var arr_intCloneNav=g_obj_fClone(p_arrNavigation);arr_intCloneNav.splice(0,0,intChildIndex);objParent.fSetXYByChild(p_strChildId);objParent.fHandleEvent(p_strEvent,p_objEvent,p_strDocumentURL,arr_intCloneNav);objParent.fCallChildren(p_strEvent,p_strChildId,p_objEvent,p_strDocumentURL,arr_intCloneNav);objParent.fCallParent(objParent.g_strId,p_strEvent,p_objEvent,p_strDocumentURL,arr_intCloneNav);}}
this.fSetXYByParent=function(p_strIgnoredId)
{var arr_objChild=objThis.g_arr_obj_fGetChild();if(arr_objChild!=null)
{for(var i=0;i<arr_objChild.length;i++)
{if(arr_objChild[i].g_strId!=p_strIgnoredId)
{var objFrame=null;var objChildEventManager=null;if(cIE==true)
{if(document.frames!=null)
{for(var y=0;y<document.frames.length;y++)
{if(document.frames[y].g_objEventManager!=null)
if(document.frames[y].g_objEventManager.g_strId==arr_objChild[i].g_strId)
{objFrame=document.frames[y];objChildEventManager=document.frames[y].g_objEventManager;break;}}}}
else if(cFF==true)
{if(window.frames!=null)
{for(var y=0;y<window.frames.length;y++)
{if(window.frames[y].g_objEventManager!=null)
if(window.frames[y].g_objEventManager.g_strId==arr_objChild[i].g_strId)
{objFrame=window.frames[y];objChildEventManager=window.frames[y].g_objEventManager;break;}}}}
var arrArg=objPosition(objFrame.frameElement);arr_objChild[i].g_intX=objThis.g_intX-arrArg[2];arr_objChild[i].g_intY=objThis.g_intY-arrArg[3];}}}}
this.fCallChildren=function(p_strEvent,p_strIgnoredId,p_objEvent,p_strDocumentURL,p_arr_intNavigation)
{var arr_objChild=objThis.g_arr_obj_fGetChild();if(arr_objChild.length>0)
{var arr_intCloneNav=g_obj_fClone(p_arr_intNavigation);arr_intCloneNav.splice(0,0,-1);objThis.fSetXYByParent(p_strIgnoredId);for(var i=0;i<arr_objChild.length;i++)
{if(arr_objChild[i].g_strId!=p_strIgnoredId)
{arr_objChild[i].fHandleEvent(p_strEvent,p_objEvent,p_strDocumentURL,arr_intCloneNav);arr_objChild[i].fCallChildren(p_strEvent,null,p_objEvent,p_strDocumentURL,arr_intCloneNav);}}}}
this.fAddEventOnDoc=function(p_strEvent)
{addEvent(document,p_strEvent,fOnEvent);g_fRegisterObject(p_strEvent);}
this.fAddEventOnParent=function(p_strChildId,p_strEvent)
{var objParent=objThis.g_obj_fGetParent();if(objParent!=null)
{objParent.g_bln_hshEventAdded[p_strEvent]=true;objParent.fAddEventOnDoc(p_strEvent);objParent.fAddEventOnChildren(p_strEvent,p_strChildId);objParent.fAddEventOnParent(objParent.g_strId,p_strEvent);}}
this.fAddEventOnChildren=function(p_strEvent,p_strIgnoredId)
{var arr_objChild=objThis.g_arr_obj_fGetChild();if(arr_objChild!=null)
{for(var i=0;i<arr_objChild.length;i++)
{if(arr_objChild[i].g_strId!=p_strIgnoredId)
{arr_objChild[i].g_bln_hshEventAdded[p_strEvent]=true;arr_objChild[i].fAddEventOnDoc(p_strEvent);arr_objChild[i].fAddEventOnChildren(p_strEvent,null);}}}}
this.g_obj_fGetParent=function()
{var a=window;var aparent=window.parent;if(window.parent!=window)
{return window.parent.g_objEventManager;}
else
{return null;}}
this.g_arr_obj_fGetChild=function()
{var arr_objChild=new Array();if(cIE==true)
{if(document.frames!=null)
{for(var i=0;i<document.frames.length;i++)
{if(document.frames[i].g_objEventManager!=null)
arr_objChild.push(document.frames[i].g_objEventManager);}}}
else if(cFF==true)
{if(window.frames!=null)
{for(var i=0;i<window.frames.length;i++)
{if(window.frames[i].g_objEventManager!=null)
arr_objChild.push(window.frames[i].g_objEventManager);}}}
return arr_objChild;}
this.fHandleEvent=function(p_strEvent,e,p_strDocumentURL,p_arr_intNavigation)
{if(hsh_hsh_Function[p_strEvent]!=null)
{var intTemp=hsh_arr_strFunctionId[p_strEvent].length-1;for(var i=intTemp;i>-1;i--)
{var hshArg=new Object();hshArg['strFunctionId']=hsh_arr_strFunctionId[p_strEvent][i];hshArg['intX']=objThis.g_intX;hshArg['intY']=objThis.g_intY;hshArg['arr_intNavigation']=p_arr_intNavigation;hshArg['event']=e;if(document.URL==p_strDocumentURL)
hshArg['blnEventOnCurrDoc']=true;else
hshArg['blnEventOnCurrDoc']=false;if(hsh_blnEventKilled[p_strEvent]==false)
{if(hsh_hsh_Function[p_strEvent][hsh_arr_strFunctionId[p_strEvent][i]]!=null)
{hsh_hsh_Function[p_strEvent][hsh_arr_strFunctionId[p_strEvent][i]](e,hshArg);}}
else
{if(hsh_arr_strKilledFunctionId[p_strEvent]!=null)
{var blnFunctionFound=false;for(var y=0;y<hsh_arr_strKilledFunctionId[p_strEvent].length;y++)
{if(hsh_arr_strKilledFunctionId[p_strEvent][y]==hsh_arr_strFunctionId[p_strEvent][i])
{blnFunctionFound=true;break;}}
if(blnFunctionFound==false)
{if(hsh_hsh_Function[p_strEvent][hsh_arr_strFunctionId[p_strEvent][i]]!=null)
{hsh_hsh_Function[p_strEvent][hsh_arr_strFunctionId[p_strEvent][i]](e,hshArg);}}}
else
{}}}
hsh_arr_strKilledFunctionId[p_strEvent]=null;hsh_blnEventKilled[p_strEvent]=false;}}
function fOnEvent(e)
{objThis.g_intX=e.clientX;objThis.g_intY=e.clientY;var objDocument=null;var objTemp=getSrcElement(e);while(objTemp!=null&&objTemp!=document)
{objTemp=objTemp.parentNode;}
if(objTemp!=null)
{objDocument=objTemp;var arr_intNavigation=new Array();objThis.fHandleEvent(e.type,e,objDocument.URL,arr_intNavigation);objThis.fCallParent(objThis.g_strId,e.type,e,objDocument.URL,arr_intNavigation);objThis.fCallChildren(e.type,null,e,objDocument.URL,arr_intNavigation);}}
this.g_fAddEvent=function(p_strId,p_strEvent,p_str_fFunction)
{g_fRegisterObject(p_strEvent);if(hsh_hsh_Function[p_strEvent]==null)
{hsh_hsh_Function[p_strEvent]=new Object();hsh_arr_strFunctionId[p_strEvent]=new Array();}
hsh_blnEventKilled[p_strEvent]=false;hsh_hsh_Function[p_strEvent][p_strId]=p_str_fFunction;hsh_arr_strFunctionId[p_strEvent].push(p_strId);var objParent=this.g_obj_fGetParent();if(this.g_bln_hshEventAdded[p_strEvent]!=true)
{this.g_bln_hshEventAdded[p_strEvent]=true;this.fAddEventOnParent(objThis.g_strId,p_strEvent);this.fAddEventOnChildren(p_strEvent,null);addEvent(document,p_strEvent,fOnEvent);}}
this.g_fRemoveEvent=function(p_strId,p_strEvent)
{if(hsh_hsh_Function[p_strEvent]!=null)
{hsh_hsh_Function[p_strEvent][p_strId]=null;for(var i=0;i<hsh_arr_strFunctionId[p_strEvent].length;i++)
{if(hsh_arr_strFunctionId[p_strEvent][i]==p_strId)
{hsh_arr_strFunctionId[p_strEvent].splice(i,1);return;}}}}
this.g_fKillEvent=function(p_strEvent,p_arr_strId)
{hsh_blnEventKilled[p_strEvent]=true;if(p_arr_strId!=null)
{if(hsh_arr_strKilledFunctionId[p_strEvent]==null)
{hsh_arr_strKilledFunctionId[p_strEvent]=p_arr_strId;}
else
{hsh_arr_strKilledFunctionId[p_strEvent]=hsh_arr_strKilledFunctionId[p_strEvent].concat(p_arr_strId);}}}
this.g_fFireEvent=function(p_strEvent,e)
{objThis.g_intX=e.clientX;objThis.g_intY=e.clientY;var objDocument=null;var objTemp=getSrcElement(e);while(objTemp!=null&&objTemp!=document)
{objTemp=objTemp.parentNode;}
if(objTemp!=null)
{objDocument=objTemp;var arr_intNavigation=new Array();objThis.fHandleEvent(p_strEvent,e,objDocument.URL,arr_intNavigation);objThis.fCallParent(objThis.g_strId,p_strEvent,e,objDocument.URL,arr_intNavigation);objThis.fCallChildren(p_strEvent,null,e,objDocument.URL,arr_intNavigation);}}
var g_arr_strRegister=new Array();function g_fRegisterObject(p_strId)
{for(var i=0;i<g_arr_strRegister.length;i++)
{if(g_arr_strRegister==p_strId)
return;}
g_arr_strRegister.push(p_strId);}
addEvent(window,'unload',fDestructor);function fDestructor(e)
{for(var i=0;i<g_arr_strRegister.length;i++)
{removeEvent(document,g_arr_strRegister[i],fOnEvent);}
removeEvent(window,'unload',fDestructor);}
if(window.parent!=window&&window.parent.g_objEventManager!=null)
this.g_strParentId=window.parent.g_objEventManager.g_strId;this.g_strId=this.str_fGetId();var objParent=this.g_obj_fGetParent();if(objParent!=null)
{for(var i in objParent.g_bln_hshEventAdded)
{if(objParent.g_bln_hshEventAdded[i]==true)
{this.g_bln_hshEventAdded[i]=true;this.fAddEventOnDoc(i);}}}}
function call(p_strUrl,p_strData,p_fAfterDataArrived)
{var pageUrl=p_strUrl+"?call=true";if(window.XMLHttpRequest)
{var objXmlCall;objXmlCall=new XMLHttpRequest();objXmlCall.onreadystatechange=p_fAfterDataArrived;objXmlCall.open("POST",pageUrl,true);objXmlCall.send(p_strData);}
else if(window.ActiveXObject)
{var objXmlCall;objXmlCall=new ActiveXObject("Microsoft.XMLHTTP")
if(objXmlCall)
{objXmlCall.onreadystatechange=p_fAfterDataArrived;objXmlCall.open("POST",pageUrl,true);objXmlCall.send(p_strData);}}}
function call2(p_strUrl,p_strData)
{var objXmlCall;var pageUrl=p_strUrl+"?call=true";if(window.XMLHttpRequest)
{objXmlCall=new XMLHttpRequest();objXmlCall.open("POST",pageUrl,false);objXmlCall.send(p_strData);return(objXmlCall.responseText);}
else
if(window.ActiveXObject)
{objXmlCall=new ActiveXObject("Microsoft.XMLHTTP");objXmlCall.open("POST",pageUrl,false);objXmlCall.setRequestHeader("Content-Type","application/x-www-form-urlencoded");objXmlCall.send(p_strData);return(objXmlCall.ResponseText);}}
function getXml(p_strText)
{var objXmlDOM;var strTemp=""+p_strText.replace(/&(?!(quot;|apos;|amp;|lt;|gt;))/g,'&amp;');if(window.ActiveXObject)
{objXmlDOM=new ActiveXObject("MSXML2.DOMDocument");objXmlDOM.loadXML(strTemp);objXmlDOM.setProperty("SelectionLanguage","XPath");if(objXmlDOM.parseError.errorCode!=0)
{console("Error parsing xml: \n"+strTemp+'_');console(objXmlDOM.parseError.errorCode);console(objXmlDOM.parseError.reason);console(objXmlDOM.parseError.line);if(strTemp.search('var blnLoginPage = true;')>-1)
window.location=window.location;if(g_objLoadingIndicator&&g_objLoadingIndicator.g_fHide)
g_objLoadingIndicator.g_fHide();return(null);}}
else
{objXmlDOM=(new DOMParser).parseFromString(strTemp,"text/xml");objXmlDOM.normalize();if(objXmlDOM.documentElement&&objXmlDOM.documentElement.nodeName=="parsererror")
{console("Error parsing xml: \n"+strTemp);if(strTemp.search('var blnLoginPage = true;')>-1)
window.location=window.location;if(g_objLoadingIndicator&&g_objLoadingIndicator.g_fHide)
g_objLoadingIndicator.g_fHide();return(null);}}
return(objXmlDOM);}
function g_str_fSerializeXml(p_objXmlDoc)
{if(p_objXmlDoc.xml)
{return(p_objXmlDoc.xml);}
else
{var objSerializer=new XMLSerializer();var strAts=objSerializer.serializeToString(p_objXmlDoc);return(strAts);}}
function getChildren(p_objElement,p_intType)
{var intType=1;if(p_intType!=null)intType=p_intType;var arr_objChildren=new Array();if(p_objElement!=null&&p_objElement.childNodes!=null)
{var objNodes=p_objElement.childNodes;for(var i=0;i<objNodes.length;i++)
{if(objNodes[i].nodeType==intType)
{arr_objChildren.push(objNodes[i]);}}}
return(arr_objChildren);}
function g_arr_hsh_fHashArrayFromXml(p_objXml)
{var arrChld=getChildren(p_objXml);arrChld=getChildren(arrChld[0]);var arr_hshResultArray=new Array();for(var j=0;j<arrChld.length;j++)
{arrChld2=getChildren(arrChld[j]);var objRow=new Object();for(var k=0;k<arrChld2.length;k++)
{if(arrChld2[k].firstChild!=null)
objRow[arrChld2[k].tagName]=arrChld2[k].firstChild.nodeValue;else
objRow[arrChld2[k].tagName]='';}
arr_hshResultArray.push(objRow);}
return arr_hshResultArray;}
if(document.implementation.hasFeature("XPath","3.0"))
{if(!XMLDocument)
{var XMLDocument=Document;}
XMLDocument.prototype.selectNodes=function(cXPathString,xNode)
{if(!xNode){xNode=this;}
var oNSResolver=this.createNSResolver(this.documentElement)
var aItems=this.evaluate(cXPathString,xNode,oNSResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null)
var aResult=[];for(var i=0;i<aItems.snapshotLength;i++)
{aResult[i]=aItems.snapshotItem(i);}
return aResult;}
XMLDocument.prototype.selectSingleNode=function(cXPathString,xNode)
{if(!xNode){xNode=this;}
var xItems=this.selectNodes(cXPathString,xNode);if(xItems.length>0)
{return xItems[0];}
else
{return null;}}
Element.prototype.selectNodes=function(cXPathString)
{if(this.ownerDocument.selectNodes)
{return this.ownerDocument.selectNodes(cXPathString,this);}
else{throw"For XML Elements Only";}}
Element.prototype.selectSingleNode=function(cXPathString)
{if(this.ownerDocument.selectSingleNode)
{return this.ownerDocument.selectSingleNode(cXPathString,this);}
else{throw"For XML Elements Only";}}}
if(cFF)
{g_str_fOuterXML=function(p_objNode)
{if(!p_objNode||(p_objNode.constructor!=Element&&p_objNode.constructor!=XMLDocument))
{return'';}
return(new XMLSerializer()).serializeToString(p_objNode);}}
else
if(cIE)
{g_str_fOuterXML=function(p_objNode)
{if(!p_objNode||!p_objNode.xml)
{return'';}
return p_objNode.xml;}}
function g_str_fInnerXML(p_objNode)
{var strResult='';if(!p_objNode||!p_objNode.childNodes)
return strResult;var arr_objChildren=p_objNode.childNodes;for(var i=0,intLength=arr_objChildren.length;i<intLength;i++)
{strResult+=g_str_fOuterXML(arr_objChildren[i]);}
return strResult;}
String.prototype.trim=function()
{var x=this;x=x.replace(/^\s*(.*)/,"$1");x=x.replace(/(.*?)\s*$/,"$1");return x;}
String.prototype.trimLeft=function()
{var x=this;x=x.replace(/^\s*(.*)/,"$1");return x;}
String.prototype.trimRight=function()
{var x=this;x=x.replace(/(.*?)\s*$/,"$1");return x;}
String.prototype.reverse=function()
{var strAts="";for(var i=this.length;i>0;--i)
{strAts+=this.charAt(i-1);}
return(strAts);}
function encode(p_strText)
{return(encodeURIComponent(p_strText));}
function decode(p_strText)
{return(decodeURIComponent(p_strText));}
function g_str_fAddWordWraping(p_strWord,p_strCharacter)
{var objRegExp=new RegExp(p_strCharacter,'g');return p_strWord.replace(objRegExp,p_strCharacter+'<wbr>');}
function p_hsh_fGetStringDifference(p_strA,p_strB)
{var i=0;var intLengthA=p_strA.length;var intLengthB=p_strB.length;for(;i<intLengthA&&i<intLengthB;i++)
{if(p_strA.charAt(i)!=p_strB.charAt(i))
break;}
var intBeginLength=i;var intIndA=intLengthA-1;var intIndB=intLengthB-1;for(;intIndA>=intBeginLength&&intIndB>=intBeginLength;)
{if(p_strA.charAt(intIndA)!=p_strB.charAt(intIndB))
break;intIndA--;intIndB--;}
intIndA++;intIndB++;return{strBegin:p_strA.substr(0,intBeginLength),strEnd:p_strA.substr(intIndA),strDiffA:p_strA.substr(intBeginLength,intIndA-intBeginLength),strDiffB:p_strB.substr(intBeginLength,intIndB-intBeginLength)};}
function p_hsh_fGetStringDiffWithCursor(p_strA,p_intCursorPosition,p_strB)
{var i=0;var intLengthA=p_strA.length;var intLengthB=p_strB.length;var intMaxA=Math.min(p_intCursorPosition,intLengthA);var intMaxB=intLengthB-(intLengthA-p_intCursorPosition);var intMaxi=Math.min(intMaxA,intMaxB);for(;i<intMaxi;i++)
{if(p_strA.charAt(i)!=p_strB.charAt(i))
break;}
var intBeginLength=i;return{strBegin:p_strA.substr(0,intBeginLength),strEnd:p_strA.substr(intMaxA),strDiffA:p_strA.substr(intBeginLength,intMaxA-intBeginLength),strDiffB:p_strB.substr(intBeginLength,intMaxB-intBeginLength)};}
function g_str_fBuildURLParameterString(p_hshInput)
{var strParameters='';for(strKey in p_hshInput)
{if(strParameters=='')
strParameters+='?';else
strParameters+='&';strParameters+=strKey+'='+encode(p_hshInput[strKey]);}
return strParameters;}
function g_hsh_fDecodeURLParameterString(p_strParameterString)
{var hshAts=new Object();var arr_strPairs=p_strParameterString.split('?')[1].split('&');for(var i=0;i<arr_strPairs.length;i++)
{var arr_strItems=arr_strPairs[i].split('=');hshAts[arr_strItems[0]]=decode(arr_strItems[1]);}
return(hshAts);}
function g_str_fSplitPath(p_strPath,p_strDelimiter)
{var arr_strTokens=p_strPath.split(p_strDelimiter);var strFileName=arr_strTokens[arr_strTokens.length-1];var strPath=p_strPath.substring(0,p_strPath.length-strFileName.length);return[strPath,strFileName];}
function g_str_fGetFileName(p_strPath)
{if(p_strPath.indexOf('\\')!=-1)
{var arr_strTokens=p_strPath.split('\\');return arr_strTokens[arr_strTokens.length-1];}
else if(p_strPath.indexOf('/')!=-1)
{var arr_strTokens=p_strPath.split('/');return arr_strTokens[arr_strTokens.length-1];}
else
return p_strPath;}
function g_str_fIntToPx(p_intValue)
{return parseInt(p_intValue)+'px';}
function g_str_fEscapeForXml(p_strValue)
{return p_strValue.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/\'/g,'&apos;');}
function g_str_fUnescapeFromXml(p_strValue)
{if(!p_strValue)
return'';return p_strValue.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&apos;/g,'\'').replace(/&quot;/g,'"').replace(/&amp;/g,'&');}
function g_int_fGetTextWidth(p_strText,p_strClassName)
{var objElement=document.createElement('SPAN');objElement.innerHTML='<nobr>'+p_strText+'</nobr>';objElement.style.position='absolute';if(p_strClassName)
objElement.className=p_strClassName;document.body.appendChild(objElement);var intWidth=objElement.offsetWidth;document.body.removeChild(objElement);return intWidth;}
function g_arr_int_fGetCharCodes(p_strText)
{var arr_intReturn=[];if(!p_strText||!p_strText.charCodeAt)
return arr_intReturn;for(var i=0,intLength=p_strText.length;i<intLength;i++)
{arr_intReturn[i]=p_strText.charCodeAt(i);}
return arr_intReturn;}
function g_str_fGetJoinedString(p_strString,p_intCount)
{return new Array(p_intCount+1).join(p_strString);}
function g_str_fPadIntToRequestedLength(p_intItem,p_intRequestedLength,p_strPad)
{var strStringFromInt=p_intItem.toString();var intDiff=p_intRequestedLength-strStringFromInt.length;if(intDiff<0)
{return strStringFromInt.substr(-p_intRequestedLength);}
else
{return g_str_fGetJoinedString(p_strPad,intDiff)+strStringFromInt;}}
function g_str_fGetLocalizedId(p_strId)
{var intLast=p_strId.lastIndexOf('_');if(intLast<0)
return p_strId;else
return p_strId.substr(intLast+1);}
function g_hsh_fParseUrl(p_strUrl)
{var hshParams={};if(p_strUrl!=''&&p_strUrl!=null)
{var arr_strParams=p_strUrl.split('&');var intCount=arr_strParams.length;for(var i=0;i<intCount-1;i++)
{var arr_strMas=arr_strParams[i+1].split('=');hshParams[arr_strMas[0]]=arr_strMas[1];}}
return hshParams;}
function g_str_fFormatUrl(p_hshParams)
{var strUrl='';if(p_hshParams!=null)
{for(i in p_hshParams)
{strUrl+='&';strUrl+=i+'=';strUrl+=decode(p_hshParams[i]);}
strUrl+=';';}
return strUrl;}
function g_obj_fGetDate(p_strDate,p_strFormat)
{if(p_strDate==null)
return null;var strTemp='';var intPradzia=p_strFormat.indexOf('d')
var intPabaiga=p_strFormat.lastIndexOf('d')+1;var strEil=p_strDate.substring(intPradzia,intPabaiga).trim();strEil=strEil.replace(/^(0*)/,'').replace(/[\D]/g,'0');strTemp+=strEil+'.';var intDienos=parseInt(strEil);intPradzia=p_strFormat.indexOf('M')
intPabaiga=p_strFormat.lastIndexOf('M')+1;strEil=p_strDate.substring(intPradzia,intPabaiga).trim();strEil=strEil.replace(/^(0*)/,'').replace(/[\D]/g,'0');strTemp+=strEil+'.';var intMenesiai=parseInt(strEil);intPradzia=p_strFormat.indexOf('y');intPabaiga=p_strFormat.lastIndexOf('y')+1;strEil=p_strDate.substring(intPradzia,intPabaiga);var strTempString=strEil;var index=strEil.search(/[0,1,2,3,4,5,6,7,8,9]/g);var strTrimed=strEil.trim();if(strTrimed.length<=2)
{var objTodaysDate=new Date();var intFullYears=objTodaysDate.getFullYear();var intYears=intFullYears%100;var intMetai=parseInt(strEil);if(intMetai>intYears+20)
{intMetai=intFullYears-intYears+intMetai-100;}
else
{intMetai=intFullYears-intYears+intMetai;}}
else
{strEil=strEil.replace(/^[\D]/,'2').replace(/^(0*)/,'').replace(/[\D]/g,'0');var intMetai=parseInt(strEil);}
strTemp+=strEil+'.';if(index==-1)
intMetai='2000';intPradzia=p_strFormat.indexOf('H');intPabaiga=p_strFormat.lastIndexOf('H')+1;strEil=p_strDate.substring(intPradzia,intPabaiga);strEil=strEil.replace(/^(0)/,'');strTemp+=strEil+'.';var intValandos=parseInt(strEil);intPradzia=p_strFormat.indexOf('m');intPabaiga=p_strFormat.lastIndexOf('m')+1;strEil=p_strDate.substring(intPradzia,intPabaiga);strEil=strEil.replace(/^(0)/,'');strTemp+=strEil+'.';var intMinutes=parseInt(strEil);intPradzia=p_strFormat.indexOf('s');intPabaiga=p_strFormat.lastIndexOf('s')+1;strEil=p_strDate.substring(intPradzia,intPabaiga);strEil=strEil.replace(/^(0)/,'');strTemp+=strEil+'.';var intSekundes=parseInt(strEil);if(isNaN(intDienos)==false||isNaN(intMenesiai)==false||isNaN(intMetai)==false||isNaN(intValandos)==false||isNaN(intMinutes)==false||isNaN(intSekundes)==false)
{if(isNaN(intDienos))intDienos='01';if(isNaN(intMenesiai))intMenesiai='01';if(isNaN(intMetai))intMetai='2000';if(isNaN(intValandos))intValandos='00';if(isNaN(intMinutes))intMinutes='00';if(isNaN(intSekundes))intSekundes='00';var objData=new Date(intMenesiai+'/'+intDienos+'/'+intMetai+' '+intValandos+':'+intMinutes+':'+intSekundes);return(objData);}
else
return null;}
var g_objDateTimeFormat={};g_objDateTimeFormat.cMONTHS=['January','February','March','April','May','June','July','August','September','October','November','December'];g_objDateTimeFormat.cDAYS=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];g_objDateTimeFormat.cSUFFIXES=['st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'];g_objDateTimeFormat.g_str_fFormat=function(p_objDate,p_strFormat)
{var formatted=(p_strFormat!=null)?p_strFormat:'dd-mm-yy';var letters='dMyHDhmst'.split('');var temp=new Array();var count=0;var regexA;var regexB=/\[(\d+)\]/;var day=p_objDate.getDay();var date=p_objDate.getDate();var month=p_objDate.getMonth();var year=p_objDate.getFullYear().toString();var hours=p_objDate.getHours();var minutes=p_objDate.getMinutes();var seconds=p_objDate.getSeconds();var formats=new Object();formats['d']=date;formats['D']=date+this.cSUFFIXES[date-1];formats['dd']=(date<10)?'0'+date:date;formats['ddd']=this.cDAYS[day].substring(0,3);formats['dddd']=this.cDAYS[day];formats['M']=month+1;formats['MM']=g_str_fApplyFormat('ss','@','0',''+(month+1));formats['MMM']=this.cMONTHS[month].substring(0,3);formats['MMMM']=this.cMONTHS[month];formats['y']=(year.charAt(2)=='0')?year.charAt(3):year.substring(2,4);formats['yy']=year.substring(2,4);formats['yyyy']=g_str_fApplyFormat('ssss','@','0',year);formats['H']=hours;formats['HH']=g_str_fApplyFormat('ss','@','0',''+hours);formats['h']=(hours>12||hours==0)?Math.abs(hours-12):hours;formats['hh']=g_str_fApplyFormat('ss','@','0',''+formats['h']);formats['m']=minutes;formats['mm']=g_str_fApplyFormat('ss','@','0',''+minutes);formats['s']=seconds;formats['ss']=g_str_fApplyFormat('ss','@','0',''+seconds);formats['t']=(hours<12)?'A':'P';formats['tt']=(hours<12)?'AM':'PM';for(var i=0;i<letters.length;i++)
{regexA=new RegExp('('+letters[i]+'+)');while(regexA.test(formatted))
{temp[count]=RegExp.$1;formatted=formatted.replace(RegExp.$1,'['+count+']');count++;}}
while(regexB.test(formatted))
{formatted=formatted.replace(regexB,formats[temp[RegExp.$1]]);}
return formatted;}
function g_str_fApplyFormat(p_strFormat,p_strDelimiter,p_strEmptyDelimiter,p_strText)
{var arr_strDalys=p_strText.split(p_strDelimiter);var intDalis=0;var intDaliesKuris=0;var strFormattedString='';var strFormatuotaDalis='';for(var i=0;i<p_strFormat.length;i++)
{if(p_strFormat.charAt(i)==p_strDelimiter)
{intDalis++;intDaliesKuris=0;strFormattedString+=strFormatuotaDalis+p_strDelimiter;strFormatuotaDalis='';}
else
if(arr_strDalys[intDalis].length>intDaliesKuris)
{strFormatuotaDalis+=arr_strDalys[intDalis].charAt(intDaliesKuris);intDaliesKuris++;}
else
{if(p_strFormat.charAt(i)=='s')
{strFormatuotaDalis=p_strEmptyDelimiter+strFormatuotaDalis;}
else if(p_strFormat.charAt(i)=='c')
{strFormatuotaDalis+=p_strEmptyDelimiter;}}}
strFormattedString+=strFormatuotaDalis;return(strFormattedString);}
function g_str_fFormatDate(p_strDate,p_strOldFormat,p_strNewFormat)
{var objDate=g_obj_fGetDate(p_strDate,p_strOldFormat);return g_objDateTimeFormat.g_str_fFormat(objDate,p_strNewFormat);}
function g_hsh_fHashArrayByKey(p_arr_objInput,p_strKeyField)
{var hshReturn=new Object();if(p_arr_objInput==null)return hshReturn;for(var i=0;i<p_arr_objInput.length;i++)
{hshReturn[p_arr_objInput[i][p_strKeyField]]=i;}
return hshReturn;}
function g_hsh_fMergeHashes(p_hshDefaults,p_hshSpecificSettings)
{var hshCopy=g_obj_fClone(p_hshDefaults);if(hshCopy==null)
return g_obj_fClone(p_hshSpecificSettings);for(var i in p_hshSpecificSettings)
hshCopy[i]=g_obj_fClone(p_hshSpecificSettings[i]);return hshCopy;}
function g_hsh_fGetHashFromXml(p_strXml)
{var hshResult=new Object();var objDoc=getXml(p_strXml);var mainNode=getChildren(objDoc)[0];fParseXML(hshResult,mainNode);return hshResult;}
function fParseXML(p_hshParent,p_objNode)
{if(p_objNode.nodeType==1)
{var tagName=p_objNode.tagName;var hshPart=new Object();if(p_hshParent[tagName]==null)
{p_hshParent[tagName]=hshPart;}
else
if(ftypeof(p_hshParent[tagName])=='array')
{p_hshParent[tagName].push(hshPart);}
else
{var objTemp=p_hshParent[tagName];p_hshParent[tagName]=new Array();p_hshParent[tagName].push(objTemp);p_hshParent[tagName].push(hshPart);}
if(p_objNode.attributes)
{for(i=0;i<p_objNode.attributes.length;i++)
{hshPart[p_objNode.attributes[i].nodeName]=p_objNode.attributes[i].nodeValue;}}
for(var i=0;i<p_objNode.childNodes.length;i++)
{fParseXML(hshPart,p_objNode.childNodes[i]);}}
else if(p_objNode.nodeType==3)
{if(p_hshParent['_val']==null)p_hshParent['_val']='';p_hshParent['_val']+=p_objNode.nodeValue;}}
function g_hsh_fGetHashFromXml2(p_strXml)
{var objDoc=getXml(p_strXml);var mainNode=getChildren(objDoc)[0];return obj_fParseXML2(mainNode);}
function obj_fParseXML2(p_objNode)
{if(p_objNode.nodeType!=1)
{return p_objNode.nodeValue;}
var objChildren=p_objNode.childNodes;if(objChildren.length==0)
return null;if(objChildren.length==1&&objChildren[0].nodeType==3)
{return objChildren[0].nodeValue;}
var hshResult={};for(var i=0,intLength=objChildren.length;i<intLength;i++)
{if(objChildren[i].nodeType==1)
{var strTagName=objChildren[i].tagName;if(hshResult[strTagName]==null)
{hshResult[strTagName]=obj_fParseXML2(objChildren[i]);}
else if(ftypeof(hshResult[strTagName])=='array')
{hshResult[strTagName].push(obj_fParseXML2(objChildren[i]));}
else
{var objTemp=hshResult[strTagName];hshResult[strTagName]=[];hshResult[strTagName].push(objTemp);hshResult[strTagName].push(obj_fParseXML2(objChildren[i]));}}}
return hshResult;}
function g_hsh_fGetFixedHashFromXml(p_strResults)
{var hshResults=g_hsh_fGetHashFromXml2(p_strResults);if(hshResults==null)
hshResults={'Table':[]};if(hshResults['Table']==null)
hshResults['Table']=[];if(!g_bln_fIsArray(hshResults['Table']))
hshResults['Table']=[hshResults['Table']];return hshResults;}
function g_str_fGetXmlFromObject(p_objObject,p_strKey,p_intLevel)
{if(p_intLevel<=0)
return'';if(p_strKey==null||p_strKey=='')
{p_strKey='root';}
var strReturn='<'+g_str_fClearXmlEntities(''+p_strKey)+'>';if(typeof(p_objObject)=='object'&&p_objObject!=null)
{if(p_objObject.constructor==Array)
{for(var intKey in p_objObject)
{if(g_bln_fIsInt(intKey)&&typeof(p_objObject[intKey])!='undefined')
{strReturn+=g_str_fGetXmlFromObject(p_objObject[intKey],intKey,p_intLevel-1);}}}
else
if(p_objObject.constructor==Object||p_objObject.constructor.toString().match(/\s*function (.*)\(/))
{for(strKey in p_objObject)
{strReturn+=g_str_fGetXmlFromObject(p_objObject[strKey],strKey,p_intLevel-1);}}
else
strReturn+=g_str_fEscapeXmlEntities(''+p_objObject);}
else
{if(p_objObject!=null)
{strReturn+=g_str_fEscapeXmlEntities(''+p_objObject);}}
strReturn+='</'+g_str_fClearXmlEntities(''+p_strKey)+'>';return strReturn;}
function g_str_fEscapeXmlEntities(p_strXmlString)
{if(!p_strXmlString)return'';return p_strXmlString.replace(/&/g,'&amp;').replace(/\'/g,'&apos;').replace(/\"/g,'&quot;').replace(/>/g,'&gt;').replace(/</g,'&lt;');}
function g_str_fClearXmlEntities(p_strXmlString)
{if(!p_strXmlString)return'';return p_strXmlString.replace(/[\'\"&><]/gi,'');}
function g_fApplyStyleProperties(p_objDOMElement,p_objStyle)
{if(!p_objDOMElement||!p_objDOMElement.style||!p_objStyle)
return;var objElementStyle=p_objDOMElement.style;for(var key in p_objStyle)
{objElementStyle[key]=p_objStyle[key];}}
function g_str_fEncodeArray(p_arr_arr_strInput)
{var strReturn='';for(var i=0;i<p_arr_arr_strInput.length;i++)
{for(var j=0;j<p_arr_arr_strInput[i].length;j++)
{strReturn+=encode(p_arr_arr_strInput[i][j]);if(j!=p_arr_arr_strInput[i].length-1)
{strReturn+=encode(cSYS.cDELIM2);}}
if(i!=p_arr_arr_strInput.length-1)
{strReturn+=encode(cSYS.cDELIM1);}}
return strReturn;}
function g_arr_str_fGetListing(p_arr_hshInput,p_strKey)
{if(p_strKey==null)
return g_obj_fClone(p_arr_hshInput);if(p_arr_hshInput==null)
return p_arr_hshInput;var arr_strResult=new Array();var intLength=p_arr_hshInput.length;for(var i=0;i<intLength;i++)
{arr_strResult.push(p_arr_hshInput[i][p_strKey]);}
return arr_strResult;}
Array.prototype.inArray=function(value)
{for(var i=0;i<this.length;i++)
{if(this[i]==value)
{return i;}}
return-1;};Array.prototype.contains=function(r){for(var x=0;x<this.length;x++){if(this[x]==r){return true;}}return false;}
Array.prototype.intersection=function(arr2)
{var returnArray=new Array();var y=0;for(var x=0;x<this.length;x++)
{if(arr2.contains(this[x]))
{returnArray[y++]=this[x];}}
return y==0?null:returnArray;}
Array.prototype.isSimilar=function(array)
{return(this.toString()==array.toString());}
Array.prototype.complement=function(array)
{for(var i=0,j=this.length;i<j;i++)
{if(this[i]==null)
this[i]=array[i];}
return this;}
Array.prototype.swap=function(a,b)
{var tmp=this[a];this[a]=this[b];this[b]=tmp;}
if(cFF)
{Array.prototype.sort=function(func)
{return msort(this,0,this.length,func);}}
function insert(array,begin,end,v,func)
{while((begin+1<end)&&(func(array[begin+1],v)<0))
{array.swap(begin,begin+1);++begin;}
array[begin]=v;}
function merge(array,begin,begin_right,end,func)
{for(;begin<begin_right;++begin)
{if(func(array[begin],array[begin_right])>0)
{var v=array[begin];array[begin]=array[begin_right];insert(array,begin_right,end,v,func);}}}
function msort(array,begin,end,func)
{var size=end-begin;if(size<2)return;var begin_right=begin+Math.floor(size/2);msort(array,begin,begin_right,func);msort(array,begin_right,end,func);merge(array,begin,begin_right,end,func);return array;}
function g_bln_fIsArray(p_objObject)
{if(p_objObject==null)
return false;if(p_objObject.constructor==Array)
return true;return false;}
function clsIndexedHash()
{this.hsh_intIndexHash={};this.arr_objArray=[];}
clsIndexedHash.prototype.g_str_fAdd=function(p_objElement,p_intIndex,p_strKey)
{if(!p_objElement)
return;if(p_intIndex<0)
{p_intIndex=0;}
else
if(p_intIndex==null||p_intIndex>=this.arr_objArray.length)
{p_intIndex=this.arr_objArray.length;}
this.arr_objArray.splice(p_intIndex,0,p_objElement);for(var i=p_intIndex+1,intLength=this.arr_objArray.length;i<intLength;i++)
{this.hsh_intIndexHash[this.arr_objArray[i].__key]=i;}
var strKey=p_strKey||g_str_fIdGenerator();while(this.g_fKeyExists(strKey))
{strKey=g_str_fIdGenerator();}
this.hsh_intIndexHash[strKey]=p_intIndex;p_objElement.__key=strKey;return strKey;}
clsIndexedHash.prototype.g_fUninit=function()
{delete this.hsh_intIndexHash;delete this.arr_objArray;this.hsh_intIndexHash={};this.arr_objArray=[];}
clsIndexedHash.prototype.g_obj_fGetAllElements=function()
{return[].concat(this.arr_objArray);}
clsIndexedHash.prototype.g_obj_fGetByIndex=function(p_intIndex)
{return this.arr_objArray[p_intIndex];}
clsIndexedHash.prototype.g_obj_fGetByKey=function(p_strKey)
{var intIndex=this.hsh_intIndexHash[p_strKey];if(intIndex==null)
return null;return this.arr_objArray[intIndex];}
clsIndexedHash.prototype.g_int_fGetCount=function()
{return this.arr_objArray.length;}
clsIndexedHash.prototype.g_obj_fGetFirst=function()
{return this.arr_objArray[0];}
clsIndexedHash.prototype.g_obj_fGetIndex=function(p_objElement)
{return this.hsh_intIndexHash[p_objElement.__key];}
clsIndexedHash.prototype.g_obj_fGetIndexFromKey=function(p_strKey)
{return this.hsh_intIndexHash[p_strKey];}
clsIndexedHash.prototype.g_str_fGetKey=function(p_objElement)
{var strKey=p_objElement.__key;if(this.g_fIsIn(strKey))
return strKey;return null;}
clsIndexedHash.prototype.g_obj_fGetLast=function()
{var intLength=this.arr_objArray.length;if(intLength>0)
{return this.arr_objArray[intLength-1];}
return null;}
clsIndexedHash.prototype.g_obj_fGetNext=function(p_objElement)
{var intIndex=this.hsh_intIndexHash[p_objElement.__key];if(intIndex==null)
return null;return this.arr_objArray[intIndex+1];}
clsIndexedHash.prototype.g_obj_fGetPrevious=function(p_objElement)
{var intIndex=this.hsh_intIndexHash[p_objElement.__key];if(intIndex==null||intIndex==0)
return null;return this.arr_objArray[intIndex-1];}
clsIndexedHash.prototype.g_str_fInsertAfter=function(p_objElement,p_objReferenceElement,p_strKey)
{var intIndex=this.hsh_intIndexHash[p_objReferenceElement.__key]+1;return this.g_str_fAdd(p_objElement,intIndex,p_strKey);}
clsIndexedHash.prototype.g_str_fInsertBefore=function(p_objElement,p_objReferenceElement,p_strKey)
{var intIndex=this.hsh_intIndexHash[p_objReferenceElement.__key];return this.g_str_fAdd(p_objElement,intIndex,p_strKey);}
clsIndexedHash.prototype.g_bln_fIsFirst=function(p_objElement)
{return this.arr_objArray[0]==p_objElement;}
clsIndexedHash.prototype.g_fIsIn=function(p_objElement)
{return this.hsh_intIndexHash[p_objElement.__key]!=null;}
clsIndexedHash.prototype.g_bln_fIsLast=function(p_objElement)
{return this.arr_objArray[this.arr_objArray.length-1]==p_objElement;}
clsIndexedHash.prototype.g_fIterate=function(p_fFunction)
{for(var i=0,intLength=this.arr_objArray.length;i<intLength;i++)
{p_fFunction(this.arr_objArray[i]);}}
clsIndexedHash.prototype.g_fIterateWithContext=function(p_objContext,p_fFunction)
{for(var i=0,intLength=this.arr_objArray.length;i<intLength;i++)
{p_fFunction.apply(p_objContext,this.arr_objArray[i]);}}
clsIndexedHash.prototype.g_fKeyExists=function(p_strKey)
{return this.hsh_intIndexHash[p_strKey]!=null;}
clsIndexedHash.prototype.g_obj_fPop=function()
{return this.g_obj_fRemoveByIndex(this.arr_objArray.length-1);}
clsIndexedHash.prototype.g_str_fPush=function(p_objElement,p_strKey)
{return this.g_str_fAdd(p_objElement,this.arr_objArray.length,p_strKey);}
clsIndexedHash.prototype.g_obj_fRemove=function(p_objElement)
{return this.g_obj_fRemoveByKey(p_objElement.__key);}
clsIndexedHash.prototype.g_obj_fRemoveByIndex=function(p_intIndex)
{if(p_intIndex<0||p_intIndex==null||p_intIndex>=this.arr_objArray.length)
{return null;}
var objRemoved=this.arr_objArray[p_intIndex];delete this.hsh_intIndexHash[objRemoved.__key];objRemoved.__key=null;this.arr_objArray.splice(p_intIndex,1);for(var i=p_intIndex,intLength=this.arr_objArray.length;i<intLength;i++)
{this.hsh_intIndexHash[this.arr_objArray[i].__key]=i;}
return objRemoved;}
clsIndexedHash.prototype.g_obj_fRemoveByKey=function(p_strKey)
{var intIndex=this.hsh_intIndexHash[p_strKey];if(intIndex==null)
return null;return this.g_obj_fRemoveByIndex(intIndex);}
clsIndexedHash.prototype.g_fReplace=function(p_objOldItem,p_objNewItem,p_strKeyIfNew)
{if(p_objOldItem==null||this.hsh_intIndexHash[p_objOldItem.__key]==null)
{this.g_str_fAdd(p_objNewItem,this.arr_objArray.length,p_strKeyIfNew);}
else
{p_objNewItem.__key=p_objOldItem.__key;var intIndex=this.hsh_intIndexHash[p_objOldItem.__key];this.arr_objArray.splice(intIndex,1,p_objNewItem);}}
function g_fFillHash(p_hshParamHash,p_strKey,p_strValue,p_strFunction)
{if(p_strValue)
{p_hshParamHash[p_strKey]=p_strValue;if(p_strFunction)
p_hshParamHash[p_strKey+'Fun']=p_strFunction;}}
function ekranoWH()
{var winW=null;var winH=null;if(navigator.appName=="Netscape")
{winW=window.innerWidth;winH=window.innerHeight;}
else
if(navigator.appName.indexOf("Microsoft")!=-1)
{winW=document.body.offsetWidth;winH=document.body.offsetHeight;}
return([winW,winH]);}
function g_fGetViewportHeight()
{if(document.compatMode=='CSS1Compat'){return document.documentElement.clientHeight;}
if(document.body){return document.body.clientHeight;}
return window.undefined;}
function g_fGetViewportWidth()
{var intW=window.undefined;if(window.innerWidth!=window.undefined)intW=parseInt(window.innerWidth);if(document.compatMode=='CSS1Compat')intW=parseInt(document.documentElement.clientWidth);if(document.body)intW=parseInt(document.body.clientWidth);return intW;}
function g_int_fGetWindowScrollTop()
{if(document.compatMode=='CSS1Compat')
return document.documentElement.scrollTop;else
return document.body.scrollTop;}
function g_int_fGetWindowScrollLeft()
{if(document.compatMode=='CSS1Compat')
return document.documentElement.scrollLeft;else
return document.body.scrollLeft;}
function g_arr_fCentroKoordinates()
{var intWindowHeight=g_fGetViewportHeight();var intWindowWidth=g_fGetViewportWidth();var objBody=document.body;var intScrollTop=parseInt(objBody.scrollTop,10);var intScrollLeft=parseInt(objBody.scrollLeft,10);var intY=(intScrollTop+(intWindowHeight/2));var intX=(intScrollLeft+(intWindowWidth/2));return([intX,intY]);}
function g_fCentruoti(p_objLangas)
{var int_arrCoord=g_arr_fCentroKoordinates();p_objLangas.style.top=(int_arrCoord[1]-parseInt(p_objLangas.offsetHeight)/2)+"px";p_objLangas.style.left=(int_arrCoord[0]-parseInt(p_objLangas.offsetWidth)/2)+"px";}
function g_bln_fIsOnScreen(pX,pY,p_strBoundaryObjId)
{var objBody=document.body;var intScrollTop=0;var intScrollLeft=0;if(document.documentElement)
{if(document.documentElement.scrollTop)
{intScrollTop=document.documentElement.scrollTop;}
if(document.documentElement.scrollLeft)
{intScrollLeft=document.documentElement.scrollLeft;}}
if(document.body)
{if(document.body.scrollTop)
{intScrollTop=document.body.scrollTop;}
if(document.body.scrollLeft)
{intScrollLeft=document.body.scrollLeft;}}
var blnIsOnScreen=false;if(pX>=intScrollLeft&&pX<(intScrollLeft+g_fGetViewportWidth()))
{if(pY>=intScrollTop&&pY<(intScrollTop+g_fGetViewportHeight()))
{blnIsOnScreen=true;}}
if(blnIsOnScreen==true)
{if(p_strBoundaryObjId!=null)
{var objBoundaryObj=document.getElementById(p_strBoundaryObjId);if(objBoundaryObj==null){consoleA('boundary obj doesnt exist');return false;}
var arr_intBoundaryPos=objPosition(objBoundaryObj);var intX=arr_intBoundaryPos[2];var intY=arr_intBoundaryPos[3];var intWidth=arr_intBoundaryPos[0];var intHeight=arr_intBoundaryPos[1];if(pX>intX&&pX<(intX+intWidth))
{if(pY>intY&&pY<(intY+intHeight))
{return(true);}}
return(false);}
else
return(true);}
else
return(false);}
function objPosition(id,p_strType)
{var obj=null;try
{if(typeof(id)!='object')
{obj=document.getElementById(id);}
else
{obj=id;}
var l=0;var t=0;var w=0;var h=0;w=obj.offsetWidth;h=obj.offsetHeight;}
catch(strError)
{return;}
if(p_strType==null||p_strType!='simple')
{if(obj.offsetParent)
{for(posX=0,posY=0;obj.offsetParent;obj=obj.offsetParent)
{if(obj.id=='minwidthcont'||obj.className=='minwidthcont')
continue;posX+=obj.offsetLeft;posY+=obj.offsetTop;}
l=posX;t=posY;}
else if(obj.x)
{l=obj.x;t=obj.y;}}
else
if(p_strType=='simple')
{var tempLeft=obj.style.left;var tempTop=obj.style.top;l=parseInt(tempLeft);t=parseInt(tempTop);}
return([w,h,l,t]);}
function getMouse(e)
{var xPos;var yPos;if(e.pageX||e.pageY)
{xPos=e.pageX;yPos=e.pageY;}
else if(e.clientX||e.clientY)
{xPos=e.clientX+document.body.scrollLeft;yPos=e.clientY+document.body.scrollTop;}
if(cIE)
{yPos+=g_int_fGetWindowScrollTop();}
return([xPos,yPos]);}
function g_obj_fGetMousePoint(e)
{return new clsPoint(getMouse(e));}
function clsMouseAligning()
{}
clsMouseAligning.prototype.g_obj_fGetPosition=function(p_objEvent,p_intWidth,p_intHeight)
{if(p_intWidth<0)
p_intWidth=0;if(p_intHeight<0)
p_intHeight=0;var objPoint=g_obj_fGetMousePoint(p_objEvent);var objAnchorRegion=new clsRegion(objPoint.X,objPoint.Y,0,0);var objRegion=g_obj_fGetSuitableRegion(objAnchorRegion,p_intWidth,p_intHeight);return objRegion;}
function clsAnchorAligning(p_objAnchor)
{this.objAnchor=p_objAnchor;}
clsAnchorAligning.prototype.g_obj_fGetPosition=function(p_objEvent,p_intWidth,p_intHeight)
{if(p_intWidth<0)
p_intWidth=0;if(p_intHeight<0)
p_intHeight=0;var objAnchorRegion=g_obj_fGetRegion(this.objAnchor);var objRegion=g_obj_fGetSuitableRegion(objAnchorRegion,p_intWidth,p_intHeight);return objRegion;}
function g_obj_fGetSuitableRegion(p_objAnchorRegion,p_intWidth,p_intHeight)
{var intWindX1=g_int_fGetWindowScrollLeft();var intWindW=g_fGetViewportWidth();var intWindX2=intWindX1+intWindW;var intWindY1=g_int_fGetWindowScrollTop();var intWindH=g_fGetViewportHeight();var intWindY2=intWindY1+intWindH;var intY1=p_objAnchorRegion.Y;var intY2=p_objAnchorRegion.Y+p_objAnchorRegion.H;var intX1=p_objAnchorRegion.X;var intX2=p_objAnchorRegion.X+p_objAnchorRegion.W;var intDownY=intWindY2-intY2;var intUpY=intY1-intWindY1;var intRightX=intWindX2-intX2;var intLeftX=intX1-intWindX1;if(p_intWidth<intWindW&&(intDownY>0&&p_intHeight<intDownY||intUpY>0&&p_intHeight<intUpY)||p_intHeight<intWindH&&(intRightX>0&&p_intWidth<intRightX||intLeftX>0&&p_intWidth<intLeftX))
{return g_obj_fGetSuitablePosition(p_objAnchorRegion,p_intWidth,p_intHeight);}
var intMaxWidth=0;var intMaxHeight=0;var intBiggerHeight=Math.max(intDownY,intUpY);var intCurWidth=Math.min(p_intWidth,intWindW);var intCurHeight=Math.min(p_intHeight,intBiggerHeight);if(intCurWidth*intCurHeight>intMaxWidth*intMaxHeight)
{intMaxWidth=intCurWidth;intMaxHeight=intCurHeight;}
var intBiggerWidth=Math.max(intRightX,intLeftX);var intCurWidth=Math.min(p_intWidth,intBiggerWidth);var intCurHeight=Math.min(p_intHeight,intWindH);if(intCurWidth*intCurHeight>intMaxWidth*intMaxHeight)
{intMaxWidth=intCurWidth;intMaxHeight=intCurHeight;}
return g_obj_fGetSuitablePosition(p_objAnchorRegion,intMaxWidth,intMaxHeight);}
function g_obj_fGetSuitablePosition(p_objAnchorRegion,p_intWidth,p_intHeight)
{var intWindX1=g_int_fGetWindowScrollLeft();var intWindW=g_fGetViewportWidth();var intWindX2=intWindX1+intWindW;var intWindY1=g_int_fGetWindowScrollTop();var intWindH=g_fGetViewportHeight();var intWindY2=intWindY1+intWindH;var intY1=p_objAnchorRegion.Y;var intY2=p_objAnchorRegion.Y+p_objAnchorRegion.H;var intX1=p_objAnchorRegion.X;var intX2=p_objAnchorRegion.X+p_objAnchorRegion.W;var blnH1OK=g_bln_fFitsInRange(intWindY1,intWindY2,intY2,intY2+p_intHeight);var blnW1OK=g_bln_fFitsInRange(intWindX1,intWindX2,intX1,intX1+p_intWidth);if(blnW1OK&&blnH1OK)
return new clsRegion(intX1,intY2,p_intWidth,p_intHeight);var blnW2OK=g_bln_fFitsInRange(intWindX1,intWindX2,intX2-p_intWidth,intX2);if(blnW2OK&&blnH1OK)
return new clsRegion(intX2-p_intWidth,intY2,p_intWidth,p_intHeight);var blnW6OK=g_bln_fFitsInRange(intWindX1,intWindX2,intWindX1,intWindX1+p_intWidth);blnW3OK=blnW6OK&&g_bln_fFitsInRange(intWindX1,intWindX1+p_intWidth,intX1,intX2);if(blnW3OK&&blnH1OK)
return new clsRegion(0,intY2,p_intWidth,p_intHeight);var blnH2OK=g_bln_fFitsInRange(intWindY1,intWindY2,intY1-p_intHeight,intY1);if(blnW1OK&&blnH2OK)
return new clsRegion(intX1,intY1-p_intHeight,p_intWidth,p_intHeight);if(blnW2OK&&blnH2OK)
return new clsRegion(intX2-p_intWidth,intY1-p_intHeight,p_intWidth,p_intHeight);if(blnW3OK&&blnH2OK)
return new clsRegion(0,intY1-p_intHeight,p_intWidth,p_intHeight);var blnW4OK=g_bln_fFitsInRange(intWindX1,intWindX2,intX2,intX2+p_intWidth);var blnH3OK=g_bln_fFitsInRange(intWindY1,intWindY2,intY1,intY1+p_intHeight);if(blnW4OK&&blnH3OK)
return new clsRegion(intX2,intY1,p_intWidth,p_intHeight);var blnH4OK=g_bln_fFitsInRange(intWindY1,intWindY2,intY2-p_intHeight,intY2);if(blnW4OK&&blnH4OK)
return new clsRegion(intX2,intY2-p_intHeight,p_intWidth,p_intHeight);var blnH6OK=g_bln_fFitsInRange(intWindY1,intWindY2,intWindY1,intWindY1+p_intHeight);var blnH7OK=g_bln_fFitsInRange(intWindY1,intWindY2,intWindY2-p_intHeight,intWindY2);blnH5OK=blnH7OK&&g_bln_fFitsInRange(intWindY2-p_intHeight,intWindY2,intY1,intY2);if(blnW4OK&&blnH5OK)
return new clsRegion(intX2,intWindY2-p_intHeight,p_intWidth,p_intHeight);var blnW5OK=g_bln_fFitsInRange(intWindX1,intWindX2,intX1-p_intWidth,intX1);if(blnW5OK&&blnH3OK)
return new clsRegion(intX1-p_intWidth,intY1,p_intWidth,p_intHeight);if(blnW5OK&&blnH4OK)
return new clsRegion(intX1-p_intWidth,intY2-p_intHeight,p_intWidth,p_intHeight);if(blnW5OK&&blnH5OK)
return new clsRegion(intX1-p_intWidth,intWindY1,p_intWidth,p_intHeight);blnW6OK=blnW6OK&&g_bln_fFitsInRange(intX1,intX2,intWindX1,intWindX1);if(blnW6OK&&blnH1OK)
return new clsRegion(intWindX1,intY2,p_intWidth,p_intHeight);blnH6OK=blnH6OK&&g_bln_fFitsInRange(intY1,intY2,intWindY1,intWindY1);if(blnW4OK&&blnH6OK)
return new clsRegion(intX2,intWindY1,p_intWidth,p_intHeight);var blnW7OK=g_bln_fFitsInRange(intWindX1,intWindX2,intWindX2-p_intWidth,intWindX2);blnW7OK=blnW7OK&&g_bln_fFitsInRange(intX1,intX2,intWindX2,intWindX2);if(blnW7OK&&blnH1OK)
return new clsRegion(intWindX2-p_intWidth,intY2,p_intWidth,p_intHeight);if(blnW5OK&&blnH6OK)
return new clsRegion(intX1-p_intWidth,intWindY1,p_intWidth,p_intHeight);if(blnW6OK&&blnH2OK)
return new clsRegion(intWindX1,intY1-p_intHeight,p_intWidth,p_intHeight);blnH7OK=blnH7OK&&g_bln_fFitsInRange(intY1,intY2,intWindY2,intWindY2);if(blnW4OK&&blnH7OK)
return new clsRegion(intX2,intWindY2-p_intHeight,p_intWidth,p_intHeight);if(blnW7OK&&blnH2OK)
return new clsRegion(intWindX2-p_intWidth,intY1-p_intHeight,p_intWidth,p_intHeight);if(blnW5OK&&blnH7OK)
return new clsRegion(intX1-p_intWidth,intWindY2-p_intHeight,p_intWidth,p_intHeight);return new clsRegion(0,0,p_intWidth,p_intHeight);}
function g_bln_fFitsInRange(p_intOuterR1,p_intOuterR2,p_intInnerR1,p_intInnerR2)
{return p_intOuterR1<=p_intInnerR1&&p_intInnerR2<=p_intOuterR2;}
function g_arr_int_fGetCoords(p_strPlatformId,p_intGlobalX,p_intGlobalY,p_intStartX,p_intStartY,p_strItemId)
{return(g_arr_int_fGetCoords2(p_strPlatformId,p_intGlobalX,p_intGlobalY,p_intStartX,p_intStartY,p_strItemId));var intLocalX=0;var intLocalY=0;if(typeof(p_strPlatformId)!='object')
var objPlatform=document.getElementById(p_strPlatformId);else
var objPlatform=p_strPlatformId;var objParent=null;var blnOverflow=false;var objTempPlatform=objPlatform;while(objTempPlatform!=null&&objTempPlatform!=document)
{var blnDivOverflow=(objTempPlatform.tagName=='DIV'&&objTempPlatform.style.overflow!=''&&objTempPlatform.style.overflow!='none'||(cFF&&(objTempPlatform.scrollTop!=0||objTempPlatform.scrollLeft!=0)));if(objTempPlatform.style.position=='absolute'||objTempPlatform.style.position=='relative'||blnDivOverflow)
{blnOverflow=blnDivOverflow;objParent=objTempPlatform;break;}
objTempPlatform=objTempPlatform.parentNode;if(objTempPlatform==document)
{objParent=null;break;}}
if(objParent!=null)
{var arr_intGlobalPos=objPosition(objParent);if(objParent.style.position=='absolute'||objParent.style.position=='relative'||(cIE&&blnOverflow))
{intLocalX=p_intGlobalX-arr_intGlobalPos[2];intLocalY=p_intGlobalY-arr_intGlobalPos[3];}
else if(cFF&&blnOverflow)
{var objTempPlatform=objPlatform;var intCorrectionY=0;var intCorrectionX=0;while(objTempPlatform!=null&&objTempPlatform!=document)
{if(objTempPlatform.scrollTop)
intCorrectionY+=objTempPlatform.scrollTop;if(objTempPlatform.scrollLeft)
intCorrectionX+=objTempPlatform.scrollLeft;if(objTempPlatform.style.position=='absolute'||objTempPlatform.style.position=='relative')
{objParent=objTempPlatform;break;}
objTempPlatform=objTempPlatform.parentNode;}
var arr_intGlobalPos=objPosition(objParent);if(objParent.style.position=='absolute'||objParent.style.position=='relative')
{intLocalX=p_intGlobalX-arr_intGlobalPos[2]-intCorrectionX;intLocalY=p_intGlobalY-arr_intGlobalPos[3]-intCorrectionY;}
else
{intLocalX=p_intGlobalX-intCorrectionX;intLocalY=p_intGlobalY-intCorrectionY;}}
else
{intLocalX=p_intGlobalX;intLocalY=p_intGlobalY;}}
else
{intLocalX=p_intGlobalX;intLocalY=p_intGlobalY;}
if(p_strItemId!=null)
{var objItem=document.getElementById(p_strItemId);objItem.style.left=intLocalX;objItem.style.top=intLocalY;}
return([intLocalX,intLocalY]);}
function g_arr_int_fGetCoords2(p_strPlatformId,p_intGlobalX,p_intGlobalY,p_intStartX,p_intStartY,p_strItemId)
{var intLocalX=0;var intLocalY=0;if(typeof(p_strPlatformId)!='object')
var objPlatform=document.getElementById(p_strPlatformId);else
var objPlatform=p_strPlatformId;var objParent=null;var blnOverflow=false;var objTempPlatform=objPlatform;while(objTempPlatform!=null&&objTempPlatform!=document)
{var blnDivOverflow=(objTempPlatform.tagName=='DIV'&&objTempPlatform.style.overflow!=''&&objTempPlatform.style.overflow!='none'||(cFF&&(objTempPlatform.scrollTop!=0||objTempPlatform.scrollLeft!=0)));if(objTempPlatform.style.position=='absolute'||objTempPlatform.style.position=='relative'||blnDivOverflow)
{blnOverflow=blnDivOverflow;objParent=objTempPlatform;break;}
objTempPlatform=objTempPlatform.parentNode;if(objTempPlatform==document)
{objParent=null;break;}}
if(objParent!=null)
{var arr_intGlobalPos=g_arr_int_fPosition(objParent);intLocalX=p_intGlobalX-arr_intGlobalPos[0];intLocalY=p_intGlobalY-arr_intGlobalPos[1];}
else
{intLocalX=p_intGlobalX;intLocalY=p_intGlobalY;}
if(p_strItemId!=null)
{var objItem=document.getElementById(p_strItemId);objItem.style.left=intLocalX;objItem.style.top=intLocalY;}
return([intLocalX,intLocalY]);}
function g_hsh_int_fGetCoordsByPosition(p_intX,p_intY,p_intParentWidth,p_intParentHeight,p_intWidth,p_intHeight,p_arrPosition,p_strBoundaryObjId)
{var hshArg=new Object();hshArg['fits']=false;var intLeft=null;var intTop=null;var intCurrPos=null;var blnFoundPosition=false;for(var i=0;i<p_arrPosition.length;i++)
{intCurrPos=p_arrPosition[i];var hshATemp=g_hsh_fCheckPosition(p_intX,p_intY,p_intParentWidth,p_intParentHeight,p_intWidth,p_intHeight,intCurrPos,p_strBoundaryObjId);if(hshATemp['fits']==true)
{hshArg['fits']=true;hshArg['intX']=hshATemp['x'];hshArg['intY']=hshATemp['y'];blnFoundPosition=true;break;}}
if(blnFoundPosition==false)
{switch(p_arrPosition[0])
{case 1:hshArg['intX']=p_intX-p_intWidth;hshArg['intY']=p_intY-p_intHeight;break;case 2:hshArg['intX']=p_intX;hshArg['intY']=p_intY-p_intHeight;break;case 22:hshArg['intX']=p_intX+p_intParentWidth-p_intWidth;hshArg['intY']=p_intY-p_intHeight;break;case 3:hshArg['intX']=p_intX+p_intParentWidth;hshArg['intY']=p_intY-p_intHeight;break;case 4:hshArg['intX']=p_intX-p_intWidth;hshArg['intY']=p_intY;break;case 44:hshArg['intX']=p_intX-p_intWidth;hshArg['intY']=p_intY+p_intParentHeight-p_intHeight;break;case 5:hshArg['intX']=p_intX;hshArg['intY']=p_intY;break;case 6:hshArg['intX']=p_intX+p_intParentWidth;hshArg['intY']=p_intY;break;case 66:hshArg['intX']=p_intX+p_intParentWidth;hshArg['intY']=p_intY+p_intParentHeight-p_intHeight;break;case 7:hshArg['intX']=p_intX-p_intWidth;hshArg['intY']=p_intY+p_intParentHeight;break;case 8:hshArg['intX']=p_intX;hshArg['intY']=p_intY+p_intParentHeight;break;case 88:hshArg['intX']=p_intX+p_intParentWidth-p_intWidth;hshArg['intY']=p_intY+p_intParentHeight;break;case 9:hshArg['intX']=p_intX+p_intParentWidth;hshArg['intY']=p_intY+p_intParentHeight;break;default:break;}}
return hshArg;}
function g_hsh_fCheckPosition(p_intX,p_intY,p_intParentWidth,p_intParentHeight,p_intWidth,p_intHeight,p_intPosition,p_strBoundaryObjId)
{var hsh_intFitToScreen=null;switch(p_intPosition)
{case 1:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX,p_intY,p_intWidth,p_intHeight,1,p_strBoundaryObjId);break;case 2:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX,p_intY,p_intWidth,p_intHeight,4,p_strBoundaryObjId);break;case 22:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX+p_intParentWidth-p_intWidth,p_intY,p_intWidth,p_intHeight,4,p_strBoundaryObjId);break;case 3:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX+p_intParentWidth,p_intY,p_intWidth,p_intHeight,4,p_strBoundaryObjId);break;case 4:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX,p_intY,p_intWidth,p_intHeight,2,p_strBoundaryObjId);break;case 44:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX,p_intY+p_intParentHeight-p_intHeight,p_intWidth,p_intHeight,2,p_strBoundaryObjId);break;case 5:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX,p_intY,p_intWidth,p_intHeight,3,p_strBoundaryObjId);break;case 6:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX+p_intParentWidth,p_intY,p_intWidth,p_intHeight,3,p_strBoundaryObjId);break;case 66:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX+p_intParentWidth,p_intY+p_intParentHeight-p_intHeight,p_intWidth,p_intHeight,3,p_strBoundaryObjId);break;case 7:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX,p_intY+p_intParentHeight,p_intWidth,p_intHeight,2,p_strBoundaryObjId);break;case 8:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX,p_intY+p_intParentHeight,p_intWidth,p_intHeight,3,p_strBoundaryObjId);break;case 88:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX+p_intParentWidth-p_intWidth,p_intY+p_intParentHeight,p_intWidth,p_intHeight,3,p_strBoundaryObjId);break;case 9:hsh_intFitToScreen=g_hsh_int_fFitToScreen(p_intX+p_intParentWidth,p_intY+p_intParentHeight,p_intWidth,p_intHeight,3,p_strBoundaryObjId);break;default:consoleA('no such position');break;}
return hsh_intFitToScreen;}
function g_hsh_int_fFitToScreen(p_intLeft,p_intTop,p_intWidth,p_intHeight,p_intWantedPos,p_strBoundaryObjId)
{var hsh_int1Fited=new Object();hsh_int1Fited['x']=null;hsh_int1Fited['y']=null;hsh_int1Fited['fits']=false;var hsh_int1=new Object();var hsh_int2=new Object();var hsh_int3=new Object();var hsh_int4=new Object();hsh_int1['x']=p_intLeft;hsh_int1['y']=p_intTop;hsh_int2['x']=p_intLeft;hsh_int2['y']=p_intTop+p_intHeight;hsh_int4['x']=p_intLeft+p_intWidth;hsh_int4['y']=p_intTop;hsh_int3['x']=hsh_int4['x'];hsh_int3['y']=hsh_int2['y'];switch(p_intWantedPos)
{case 1:hsh_int4['x']=hsh_int4['x']-2*p_intWidth;hsh_int3['x']=hsh_int4['x'];var bln41ReversedFits=true;if(g_bln_fIsOnScreen(hsh_int4['x'],hsh_int4['y'],p_strBoundaryObjId)==false)bln41ReversedFits=false;if(g_bln_fIsOnScreen(hsh_int1['x'],hsh_int1['y'],p_strBoundaryObjId)==false)bln41ReversedFits=false;if(bln41ReversedFits==true)
{hsh_int3['y']=hsh_int3['y']-2*p_intHeight;hsh_int2['y']=hsh_int3['y'];var bln32ReversedFits=true;if(g_bln_fIsOnScreen(hsh_int3['x'],hsh_int3['y'],p_strBoundaryObjId)==false)bln32ReversedFits=false;if(g_bln_fIsOnScreen(hsh_int2['x'],hsh_int2['y'],p_strBoundaryObjId)==false)bln32ReversedFits=false;if(bln32ReversedFits==true)
{hsh_int1Fited['x']=hsh_int3['x'];hsh_int1Fited['y']=hsh_int3['y'];hsh_int1Fited['fits']=true;}}
break;case 2:var bln12Fits=true;if(g_bln_fIsOnScreen(hsh_int1['x'],hsh_int1['y'],p_strBoundaryObjId)==false)bln12Fits=false;if(g_bln_fIsOnScreen(hsh_int2['x'],hsh_int2['y'],p_strBoundaryObjId)==false)bln12Fits=false;if(bln12Fits==true)
{hsh_int4['x']=hsh_int4['x']-2*p_intWidth;hsh_int3['x']=hsh_int4['x'];var bln43ReversedFits=true;if(g_bln_fIsOnScreen(hsh_int4['x'],hsh_int4['y'],p_strBoundaryObjId)==false)bln43ReversedFits=false;if(g_bln_fIsOnScreen(hsh_int3['x'],hsh_int3['y'],p_strBoundaryObjId)==false)bln43ReversedFits=false;if(bln43ReversedFits==true)
{hsh_int1Fited['x']=hsh_int4['x'];hsh_int1Fited['y']=hsh_int4['y'];hsh_int1Fited['fits']=true;}}
break;case 3:var bln14Fits=true;if(g_bln_fIsOnScreen(hsh_int1['x'],hsh_int1['y'],p_strBoundaryObjId)==false)bln14Fits=false;if(g_bln_fIsOnScreen(hsh_int4['x'],hsh_int4['y'],p_strBoundaryObjId)==false)bln14Fits=false;if(bln14Fits==true)
{var bln23Fits=true;if(g_bln_fIsOnScreen(hsh_int2['x'],hsh_int2['y'],p_strBoundaryObjId)==false)bln23Fits=false;if(g_bln_fIsOnScreen(hsh_int3['x'],hsh_int3['y'],p_strBoundaryObjId)==false)bln23Fits=false;if(bln23Fits==true)
{hsh_int1Fited['x']=hsh_int1['x'];hsh_int1Fited['y']=hsh_int1['y'];hsh_int1Fited['fits']=true;}}
break;case 4:var bln14Fits=true;if(g_bln_fIsOnScreen(hsh_int1['x'],hsh_int1['y'],p_strBoundaryObjId)==false)bln14Fits=false;if(g_bln_fIsOnScreen(hsh_int4['x'],hsh_int4['y'],p_strBoundaryObjId)==false)bln14Fits=false;if(bln14Fits==true)
{hsh_int2['y']=hsh_int2['y']-2*p_intHeight;hsh_int3['y']=hsh_int2['y'];var bln23ReversedFits=true;if(g_bln_fIsOnScreen(hsh_int2['x'],hsh_int2['y'],p_strBoundaryObjId)==false)bln23ReversedFits=false;if(g_bln_fIsOnScreen(hsh_int3['x'],hsh_int3['y'],p_strBoundaryObjId)==false)bln23ReversedFits=false;if(bln23ReversedFits==true)
{hsh_int1Fited['x']=hsh_int2['x'];hsh_int1Fited['y']=hsh_int2['y'];hsh_int1Fited['fits']=true;}}}
return hsh_int1Fited;}
function g_arr_int_fPosition(p_objElement)
{var objElement=p_objElement;if(!objElement)
objElement=document.body;if(typeof(objElement)=='string')
{objElement=document.getElementById(objElement);}
if(objElement==null)
objElement=document.body;var l=0;var t=0;var w=0;var h=0;w=objElement.offsetWidth;h=objElement.offsetHeight;if(objElement.offsetParent)
{for(posX=0,posY=0;objElement.offsetParent;objElement=objElement.offsetParent)
{if(objElement.id=='minwidthcont'||objElement.className=='minwidthcont')
continue;l+=objElement.offsetLeft-objElement.scrollLeft;t+=objElement.offsetTop-objElement.scrollTop;}}
return([l,t,w,h]);}
function g_obj_fGetRegion(p_objElement)
{return new clsRegion(g_arr_int_fPosition(p_objElement));}
function g_arr_int_fMakeRelative(p_arr_intGlobalCoords,p_strPlatformId)
{var arr_intPosition=g_arr_int_fPosition(p_strPlatformId);return[p_arr_intGlobalCoords[0]-arr_intPosition[0],p_arr_intGlobalCoords[1]-arr_intPosition[1]];}
function g_obj_fMakeRelative(p_objGlobalCoords,p_strPlatformId)
{var objRegion=g_obj_fGetRegion(p_strPlatformId);return new clsPoint(p_objGlobalCoords.X-objRegion.X,p_objGlobalCoords.Y-objRegion.Y);}
function g_bln_fIsInside(p_objEvent,p_objDOMObject)
{var arr_intMouseCoords=getMouse(p_objEvent);var arr_intRectCoords=g_arr_int_fPosition(p_objDOMObject);return(arr_intMouseCoords[0]>=arr_intRectCoords[0]&&arr_intMouseCoords[0]<=arr_intRectCoords[0]+arr_intRectCoords[2]&&arr_intMouseCoords[1]>=arr_intRectCoords[1]&&arr_intMouseCoords[1]<=arr_intRectCoords[1]+arr_intRectCoords[3]);}
function g_bln_fIsInsideStrict(p_objEvent,p_objDOMObject)
{var arr_intMouseCoords=getMouse(p_objEvent);var arr_intRectCoords=g_arr_int_fPosition(p_objDOMObject);return(arr_intMouseCoords[0]>arr_intRectCoords[0]&&arr_intMouseCoords[0]<arr_intRectCoords[0]+arr_intRectCoords[2]&&arr_intMouseCoords[1]>arr_intRectCoords[1]&&arr_intMouseCoords[1]<arr_intRectCoords[1]+arr_intRectCoords[3]);}
function clsPoint()
{if(arguments.length==0||arguments[0]==null)
{this.X=0;this.Y=0;}
else
if(arguments.length==1)
{if(g_bln_fIsArray(arguments[0]))
{this.X=arguments[0][0];this.Y=arguments[0][1];}
else
{this.X=arguments[0].X;this.Y=arguments[0].Y;}}
else
if(arguments.length>=2)
{this.X=arguments[0];this.Y=arguments[1];}}
function clsRegion()
{if(arguments.length==0||arguments[0]==null)
{this.X=0;this.Y=0;this.W=0;this.H=0;}
else
if(arguments.length==1)
{if(g_bln_fIsArray(arguments[0]))
{this.X=arguments[0][0];this.Y=arguments[0][1];this.W=arguments[0][2];this.H=arguments[0][3];}
else
{this.X=arguments[0].X;this.Y=arguments[0].Y;this.W=arguments[0].W;this.H=arguments[0].H;}}
else
if(arguments.length>=4)
{this.X=arguments[0];this.Y=arguments[1];this.W=arguments[2];this.H=arguments[3];}}
clsRegion.prototype.g_bln_fContainsX=function(p_objPoint)
{return(p_objPoint.X>=this.X&&p_objPoint.X<=this.X+this.W);}
clsRegion.prototype.g_bln_fContainsY=function(p_objPoint)
{return(p_objPoint.Y>=this.Y&&p_objPoint.Y<=this.Y+this.H);}
clsRegion.prototype.g_bln_fContains=function(p_objPoint)
{return(p_objPoint.X>=this.X&&p_objPoint.X<=this.X+this.W&&p_objPoint.Y>=this.Y&&p_objPoint.Y<=this.Y+this.H);}
clsRegion.prototype.g_int_fSize=function()
{return Math.abs(this.W)*Math.abs(this.H);}
function g_arr_fFormatSize(p_intValue)
{if(p_intValue<1024)
{return[p_intValue,'KB'];}
else
{return[g_int_fSizeInSpecUnits(p_intValue,'MB'),'MB'];}}
function g_int_fSizeInSpecUnits(p_intValue,p_strUnit)
{if(p_strUnit.toLowerCase()=='mb')
{return Math.round(p_intValue/1024*10)/10;}
else
return p_intValue;}
function g_str_fFormatNumber(p_fltValue)
{var strValue=''+p_fltValue;var arr_strParts=strValue.split('.');arr_strParts=g_arr_str_fFormatFraction(arr_strParts);arr_strParts=g_arr_str_fFormatIntegralPart(arr_strParts);var strResult=arr_strParts[0];if(arr_strParts[1]!='')
strResult+=cDecimalSymbol+arr_strParts[1];return strResult;}
function g_flt_fGetRealValue(p_strDisplayValue)
{var strDisplay=p_strDisplayValue;var objSepReg=new RegExp('['+cDecimalSymbol+']','g');var objGroupReg=new RegExp('['+cGroupingSymbol+']','g');strDisplay=strDisplay.replace(objGroupReg,'');strDisplay=strDisplay.replace(objSepReg,'.');return parseFloat(strDisplay);}
function g_arr_str_fFormatFraction(p_arr_strParts)
{var strFraction=p_arr_strParts[1];if(strFraction==null)
strFraction='';var intPrecision=2
var blnDisplayTrailingZero=false;if(intPrecision>0)
{if(strFraction.length<intPrecision)
{if(blnDisplayTrailingZero)
{strFraction+=g_str_fGetJoinedString('0',intPrecision-strFraction.length);}}
else
{strFraction=strFraction.substr(0,intPrecision);}}
else
{strFraction='';}
return[p_arr_strParts[0],strFraction];}
function g_arr_str_fFormatIntegralPart(p_arr_strParts)
{var strIntegral=p_arr_strParts[0];if(!strIntegral)
strIntegral='0';var blnHasMinus=false;if(strIntegral.charAt(0)=='-')
{blnHasMinus=true;strIntegral=strIntegral.substr(1);}
var strFormed='';var intLength=strIntegral.length;var intGrouping=1;var strGroupingSymbol=cGroupingSymbol;if(intGrouping==1)
{var i=intLength%3;strFormed=strIntegral.substr(0,i);for(;i<intLength;i+=3)
{if(strFormed!='')
strFormed+=strGroupingSymbol;strFormed+=strIntegral.substr(i,3);}
strIntegral=strFormed;}
else if(intGrouping==2)
{if(intLength<=3)
{strFormed=strIntegral;}
else
{intLength-=3;var i=intLength%2;strFormed=strIntegral.substr(0,i);for(;i<intLength;i+=2)
{if(strFormed!='')
strFormed+=strGroupingSymbol;strFormed+=strIntegral.substr(i,2);}
if(strFormed!='')
strFormed+=strGroupingSymbol;strFormed+=strIntegral.substr(i,3);}
strIntegral=strFormed;}
return[strIntegral,p_arr_strParts[1]];}
function decToHex(dec,priekis)
{dec=parseInt(dec,10);if(!isNaN(dec))
{hexChars="0123456789ABCDEF";if(dec>255)
{return(null);}
var i=dec%16;var j=(dec-i)/16;result='';if(priekis!=null)
{result+=priekis;}
result+=hexChars.charAt(j)+hexChars.charAt(i);return(result);}
else
{return(null);}}
function clsBase64()
{var hshSymbols=new Object();hshSymbols['A']=0;hshSymbols['B']=1;hshSymbols['C']=2;hshSymbols['D']=3;hshSymbols['E']=4;hshSymbols['F']=5;hshSymbols['G']=6;hshSymbols['H']=7;hshSymbols['I']=8;hshSymbols['J']=9;hshSymbols['K']=10;hshSymbols['L']=11;hshSymbols['M']=12;hshSymbols['N']=13;hshSymbols['O']=14;hshSymbols['P']=15;hshSymbols['Q']=16;hshSymbols['R']=17;hshSymbols['S']=18;hshSymbols['T']=19;hshSymbols['U']=20;hshSymbols['V']=21;hshSymbols['W']=22;hshSymbols['X']=23;hshSymbols['Y']=24;hshSymbols['Z']=25;hshSymbols['a']=26;hshSymbols['b']=27;hshSymbols['c']=28;hshSymbols['d']=29;hshSymbols['e']=30;hshSymbols['f']=31;hshSymbols['g']=32;hshSymbols['h']=33;hshSymbols['i']=34;hshSymbols['j']=35;hshSymbols['k']=36;hshSymbols['l']=37;hshSymbols['m']=38;hshSymbols['n']=39;hshSymbols['o']=40;hshSymbols['p']=41;hshSymbols['q']=42;hshSymbols['r']=43;hshSymbols['s']=44;hshSymbols['t']=45;hshSymbols['u']=46;hshSymbols['v']=47;hshSymbols['w']=48;hshSymbols['x']=49;hshSymbols['y']=50;hshSymbols['z']=51;hshSymbols['0']=52;hshSymbols['1']=53;hshSymbols['2']=54;hshSymbols['3']=55;hshSymbols['4']=56;hshSymbols['5']=57;hshSymbols['6']=58;hshSymbols['7']=59;hshSymbols['8']=60;hshSymbols['9']=61;hshSymbols['+']=62;hshSymbols['/']=63;this.g_str_fConvertToNormal=function(p_strBase64String)
{var strAts='';for(var i=0;i<p_strBase64String.length;i++)
{var strChar=p_strBase64String.charAt(i);if(strChar!='=')
{var intCode=hshSymbols[strChar];strAts+=str_fIntegerTo6bit(intCode);}}
var arr_intDec=arr_int_fBitsToBytes(strAts);for(var i=0;i<arr_intDec.length;i++)
{arr_intDec[i]=decToHex(arr_intDec[i],'');}
var strAts='0x';for(var i=0;i<Math.min(8,arr_intDec.length);i++)
{strAts+=arr_intDec[i];}
return(strAts);}
function arr_int_fBitsToBytes(p_strBits)
{var arr_intAts=new Array();var arr_intSvoriai=new Array(128,64,32,16,8,4,2,1);while(true)
{var strBaitas=p_strBits.slice(0,Math.min(8,p_strBits.length));var intSuma=0;for(var i=0;i<strBaitas.length;i++)
{var intKiek=parseInt(strBaitas.charAt(i));intSuma+=intKiek*arr_intSvoriai[i];}
arr_intAts.push(intSuma);if(p_strBits.length>8)
{p_strBits=p_strBits.substring(8,p_strBits.length);}
else
{break;}}
return(arr_intAts);}
function str_fIntegerTo6bit(p_intInteger)
{var strAts='';var arr_intSvoriai=new Array(32,16,8,4,2,1);for(var i=0;i<arr_intSvoriai.length;i++)
{if(p_intInteger>=arr_intSvoriai[i])
{strAts+='1';p_intInteger-=arr_intSvoriai[i];}
else
{strAts+='0';}}
return(strAts);}}
function g_int_fComparator(p_objA,p_objB)
{return(p_objB<p_objA)-(p_objA<p_objB);}
function asciiToUrl(eilute)
{if(eilute!=null)
{var ss=/\&\#[0-9]{1,3}\;/g;var ra=eilute.match(ss);var ats=eilute;if(ra!=null)
{for(r=0;r<ra.length;r++)
{ats=ats.replace(ra[r],'%'+decToHex(ra[r].substr(2,ra[r].length-3)));}}
return(ats);}
return(null);}
function g_bln_fIsInt(p_objValue)
{var intValue=parseInt(p_objValue);if(isNaN(intValue))return false;return p_objValue==intValue&&p_objValue.toString()==intValue.toString();}
Function.prototype.closure=function(obj)
{if(!window.__objs)
{window.__objs=[];window.__funs=[];}
var fun=this;var objId=obj.__objId;if(!objId)
__objs[objId=obj.__objId=__objs.length]=obj;var funId=fun.__funId;if(!funId)
__funs[funId=fun.__funId=__funs.length]=fun;if(!obj.__args)
obj.__args=[];obj.__args[funId]=[];for(var i=1,intLength=arguments.length;i<intLength;i++)
{obj.__args[funId].push(arguments[i]);}
if(!obj.__closures)
obj.__closures=[];var closure=obj.__closures[funId];if(closure)
return closure;obj=null;fun=null;return __objs[objId].__closures[funId]=function(p_objEvent)
{if(typeof(ftypeof)!='function')
return null;if(ftypeof(p_objEvent)=='event')
{var hshArg={};var objElement=getSrcElement(p_objEvent)
hshArg['event']=p_objEvent;hshArg['object']=objElement;if(__objs[objId])
{hshArg['args']=__objs[objId].__args[funId];}
return __funs[funId].apply(__objs[objId],[hshArg]);}
return __funs[funId].apply(__objs[objId],arguments);};};function clsFunctionCaller(p_objFunction,p_objContext,p_intDelay)
{var arr_objTempArray=arguments;if(arguments.length==1)
{arr_objTempArray=arguments[0];p_objFunction=arr_objTempArray[0];p_intDelay=arr_objTempArray[2];p_objContext=arr_objTempArray[1];}
this.g_intId='AsyncCaller'+(g_objAsyncCaller.g_intCounter++);this.g_intDelay=p_intDelay;this.objFunction=p_objFunction;this.g_strTimerId=0;this.objContext=p_objContext;this.arr_objArguments=[];for(var i=3;i<arr_objTempArray.length;i++)
{this.arr_objArguments.push(arr_objTempArray[i]);}
this.blnHasBeenCalled=false;this.fCallBack=null;this.g_objReturn=null;this.g_fResult=null;this.g_fExecute=function()
{delete g_objAsyncCaller.g_hshPendingCalls[this.g_intId];if(this.objContext==null)
this.objContext=window;if(typeof(this.objFunction)=='string')
this.objFunction=this.objContext[this.objFunction];if(typeof(this.objFunction)=='function')
this.g_fResult=this.objFunction.apply(this.objContext,this.arr_objArguments);this.blnHasBeenCalled=true;Listener.fire(this,'onEnd',[this.g_fResult]);}
this.g_fAddExecutionEndListener=function(p_fFunction,p_objContext)
{Listener.add(this,'onEnd',p_fFunction,p_objContext,false);}
this.g_fCancel=function()
{clearTimeout(this.g_strTimerId);g_objAsyncCaller.g_hshPendingCalls[this.g_intId]==null;}
this.g_bln_fHasBeenCalled=function()
{return this.blnHasBeenCalled;}
this.g_fStartCounter=function()
{if(arguments.length>0)
this.arr_objArguments=arguments;if(!g_objAsyncCaller.g_hshPendingCalls[this.g_intId])
g_objAsyncCaller.g_hshPendingCalls[this.g_intId]=this;else
{clearTimeout(this.g_strTimerId);}
g_objAsyncCaller.g_hshPendingCalls[this.g_intId].g_strTimerId=setTimeout('g_objAsyncCaller.g_hshPendingCalls["'+this.g_intId+'"].g_fExecute()',this.g_intDelay);}
g_objAsyncCaller.g_hshPendingCalls[this.g_intId]=this;}
g_objAsyncCaller={};g_objAsyncCaller.g_intCounter=0;g_objAsyncCaller.g_hshPendingCalls={};function g_fAsyncCall(p_objFunctionCaller)
{if(g_objAsyncCaller.g_hshPendingCalls[p_objFunctionCaller.g_intId])
{if(g_objAsyncCaller.g_hshPendingCalls[p_objFunctionCaller.g_intId].g_strTimerId!=0)
clearTimeout(this.g_strTimerId);g_objAsyncCaller.g_hshPendingCalls[p_objFunctionCaller.g_intId].g_strTimerId=setTimeout('g_objAsyncCaller.g_hshPendingCalls["'+p_objFunctionCaller.g_intId+'"].g_fExecute()',p_objFunctionCaller.g_intDelay);}}
g_objAsyncCaller.g_fAsyncCall=g_fAsyncCall;function g_obj_fAsyncCallImediate()
{var arr_objArguments=[];for(var i=0,intLength=arguments.length;i<intLength;i++)
{arr_objArguments.push(arguments[i]);}
var objCaller=new clsFunctionCaller(arr_objArguments);g_objAsyncCaller.g_fAsyncCall(objCaller);return objCaller;}
g_objAsyncCaller.g_fAsyncCallImediate=g_obj_fAsyncCallImediate;function clsIntervalCaller(p_objFunction,p_objContext,p_intPeriod)
{var arr_objTempArray=arguments;if(arguments.length==1)
{arr_objTempArray=arguments[0];p_objFunction=arr_objTempArray[0];p_intPeriod=arr_objTempArray[2];p_objContext=arr_objTempArray[1];}
this.g_intId='IntervalCaller'+(g_objIntervalCaller.g_intCounter++);this.g_intPeriod=p_intPeriod;this.objFunction=p_objFunction;this.g_strIntervalId=0;this.objContext=p_objContext;this.arr_objArguments=[];for(var i=3;i<arr_objTempArray.length;i++)
{this.arr_objArguments.push(arr_objTempArray[i]);}
this.blnHasBeenCalled=false;this.intCallCount=0;this.fCallBack=null;this.g_objReturn=null;this.g_fResult=null;this.g_fExecute=function()
{if(this.objContext==null)
this.objContext=window;if(typeof(this.objFunction)=='string')
this.objFunction=this.objContext[this.objFunction];if(typeof(this.objFunction)=='function')
this.g_fResult=this.objFunction.apply(this.objContext,this.arr_objArguments);this.blnHasBeenCalled=true;this.intCallCount++;Listener.fire(this,'onEnd',[this.g_fResult]);}
this.g_fAddExecutionEndListener=function(p_fFunction,p_objContext)
{Listener.add(this,'onEnd',p_fFunction,p_objContext,false);}
this.g_fCancel=function()
{clearInterval(this.g_strIntervalId);g_objIntervalCaller.g_hshIntervals[this.g_intId]==null;}
this.g_bln_fHasBeenCalled=function()
{return this.blnHasBeenCalled;}
this.g_fStartInterval=function()
{if(arguments.length>0)
this.arr_objArguments=arguments;if(!g_objIntervalCaller.g_hshIntervals[this.g_intId])
g_objIntervalCaller.g_hshIntervals[this.g_intId]=this;else
{clearInterval(this.g_strIntervalId);}
g_objIntervalCaller.g_hshIntervals[this.g_intId].g_strIntervalId=setInterval('g_objIntervalCaller.g_hshIntervals["'+this.g_intId+'"].g_fExecute()',this.g_intPeriod);}
g_objIntervalCaller.g_hshIntervals[this.g_intId]=this;}
g_objIntervalCaller={};g_objIntervalCaller.g_intCounter=0;g_objIntervalCaller.g_hshIntervals={};var _ret=null;var _val=null;var _fReturn=null;var _fOnChildLoad=null;var _fOnChildUnload=null;function setVal(p_objArg,p_fRet,p_fOnLoad,p_fOnUnload)
{_val=p_objArg;_fReturn=p_fRet;_fOnChildLoad=p_fOnLoad;_fOnChildUnload=p_fOnUnload;}
try
{if(window.opener)
{if(window.opener._fOnChildLoad!=null)
{addEvent(window,'load',callParent);}
if(window.opener._fOnChildUnload!=null)
addEvent(window,'unload',callParent);}}
catch(exception){}
function callParent(e)
{if(e.type=='load'&&window.opener._fOnChildLoad)
window.opener._fOnChildLoad(window);if(e.type=='unload'&&window.opener._fOnChildUnload)
window.opener._fOnChildUnload(window);}
function setRet(arg)
{var objMainWind=g_obj_fGetMainWindow();if(objMainWind&&objMainWind!=window)
{objMainWind.setRet(arg);}
else
{try
{window.opener._ret=arg;if(window.opener._fReturn)
window.opener._fReturn(arg);}
catch(ee)
{window.returnValue=arg;}}}
function getVal()
{var objMainWind=g_obj_fGetMainWindow();if(objMainWind&&objMainWind!=window)
{return objMainWind.getVal();}
else
{try
{return(window.opener._val);}
catch(ee)
{return(window.dialogArguments);}}}
function g_obj_fGetMainWindow()
{var obj=window;if(obj.blnMainWindow)return obj;while(obj.parent!=obj)
{obj=obj.parent;if(obj.blnMainWindow)return obj;}
return null;}
function g_obj_fGetSuperParentWindow()
{var obj=window;while(obj.parent!=obj)
{obj=obj.parent;}
return obj;}
function g_fSHClose()
{if(window.parent!=window)
{window.parent.g_fSHClose();}
else
{window.close();}}
function openDialog(p_strUrl,p_intWidth,p_intHeight,p_strParams,p_strResizable)
{if(cIE)
{p_intWidth=p_intWidth+5;p_intHeight=p_intHeight+25;}
if(p_strParams==null)
{p_strParams=new Object();p_strParams['window']=window;}
if(p_strResizable==null)
{p_strResizable='yes';}
if(p_strResizable==true)
{p_strResizable='yes';}
if(p_strResizable==false)
{p_strResizable='no';}
if(cIE)
{return(window.showModalDialog(p_strUrl,p_strParams,'dialogWidth:'+p_intWidth+'px; dialogHeight:'+p_intHeight+'px; center:yes; status:no; help:no; resizable:'+p_strResizable+'; scroll:no;'));}
else
{try
{setVal(p_strParams);netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");var intScreenX=parseInt(window.screenX);var intScreenY=parseInt(window.screenY);var objTemp=window;while(objTemp!=window.top)
{objTemp=objTemp.parent;}
var intInnerHeight=objTemp.outerHeight;var intInnerWidth=objTemp.outerWidth;var intCenterLeft=parseInt(intScreenX);var intCenterTop=parseInt(intScreenY);intCenterLeft+=parseInt(intInnerWidth/2);intCenterTop+=parseInt(intInnerHeight/2);var intLeft=intCenterLeft-parseInt(p_intWidth/2);var intTop=intCenterTop-parseInt(p_intHeight/2);var objWindow=window.open(p_strUrl,'_blank','left='+intLeft+',top='+intTop+',width='+p_intWidth+',height='+p_intHeight+',modal=yes,dialog=yes,resizable='+p_strResizable);return(_ret);}
catch(ee)
{return(ee);}}}
function openWindow(p_strUrl,p_intWidth,p_intHeight,p_intLeft,p_intTop,p_strTarget,p_strResizable,p_hshData,p_fRet,p_fOnLoad,p_fOnUnload)
{if(cIE)
{p_intWidth=p_intWidth-5;p_intHeight=p_intHeight-3;}
var strTarget='_blank';var strResizab='yes';if(p_strTarget!=null)
strTarget=p_strTarget;if(p_strResizable!=null)
strResizab=p_strResizable;setVal(p_hshData,p_fRet,p_fOnLoad,p_fOnUnload);var objWindow=window.open(p_strUrl,strTarget,'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=0, resizable='+strResizab+', copyhistory=no, width='+p_intWidth+', height='+p_intHeight+',top='+p_intTop+',left='+p_intLeft);return objWindow;}
function g_hsh_fOpenForm(p_strFile,p_strType,p_arr_strValue,p_arr_strKeys,p_strToolbarButtons,p_hshData,p_objWindow,p_fRet,p_strSizeType)
{if(((p_strFile=='viewRole')||(p_strFile=='securityRole'))&&(p_strType=='new'))
{return null;}
var hshParameters=new Object();hshParameters['strFileType']=p_strFile;hshParameters['strType']=p_strType;hshParameters['arr_strKeyValues']=p_arr_strValue;if(p_strToolbarButtons!=null)
hshParameters['strToolbarButtons']=p_strToolbarButtons;else
hshParameters['strToolbarButtons']='save_saveClose_help';if(p_arr_strKeys!=null)
hshParameters['arr_strKeyFields']=p_arr_strKeys;hshParameters['fOnSave']='fAfterSave';var strPage=g_str_fOpenDialogWithTree(hshParameters);var hshData=new Object();var hshPar=new Object();hshPar['window']=window;hshPar['data']=p_hshData;if(p_strSizeType==null)p_strSizeType='normal';var hshSizes;if(g_objDialogWithTreeSizes.g_hshSizes[p_strSizeType]!=null)
{hshSizes=g_objDialogWithTreeSizes.g_hshSizes[p_strSizeType];}
else
{hshSizes=g_objDialogWithTreeSizes.g_hshSizes['normal'];}
if(p_fRet==null)
hshData=openDialog(strPage,hshSizes['intMozDialogWidth'],hshSizes['intMozDialogHeight'],hshPar,'yes')
else
openWindow(strPage,hshSizes['intMozWindowWidth'],hshSizes['intMozWindowHeight'],100,100,null,'yes',hshPar,p_fRet);return(hshData);}
function g_hsh_fOpenWADialogWithTree(p_strTable,p_arr_strKey,p_arr_strValue,p_strPersonData,p_objWindow,p_strSizeType)
{var strKey=p_arr_strKey[0];var arr_strKey=new Array();for(var i=0;i<p_arr_strKey.length;i++)
{arr_strKey.push(p_arr_strKey[i]);}
arr_strKey.push('table');arr_strKey.push('key');var arr_strValue=new Array();for(var i=0;i<p_arr_strValue.length;i++)
{arr_strValue.push(p_arr_strValue[i]);}
arr_strValue.push(p_strTable);arr_strValue.push(strKey);var hshParameters=new Object();hshParameters['strType']='read';hshParameters['strStatus']='read';hshParameters['arr_strKeyValues']=arr_strValue;hshParameters['strToolbarButtons']=null;if(p_strTable!='wbk')
{hshParameters['strFile']='xmlWATree';}
else
{hshParameters['strFile']='xmlWAWBKTree';hshParameters['blnDb']=false;hshParameters['strConn']='WA_DATA';}
hshParameters['arr_strKeyFields']=arr_strKey;hshParameters['strLabelWord1']='person_details';hshParameters['strTranslate']='1_1_0';if(p_strPersonData!=null)
{hshParameters['strLabelWord2']=p_strPersonData;}
var strPage=g_str_fOpenDialogWithTree(hshParameters);var hshData=new Object();if(p_objWindow!=null)
{p_objWindow.location.href=strPage;}
else
{if(p_strSizeType==null)p_strSizeType='normal';var hshSizes;if(g_objDialogWithTreeSizes.g_hshSizes[p_strSizeType]!=null)
{hshSizes=g_objDialogWithTreeSizes.g_hshSizes[p_strSizeType];}
else
{hshSizes=g_objDialogWithTreeSizes.g_hshSizes['normal'];}
var hshPar=new Object();hshPar['window']=window;hshData=openDialog(strPage,hshSizes['intMozDialogWidth'],hshSizes['intMozDialogHeight'],hshPar,'no');}
return hshData;}
function g_str_fOpenDialogWithTree(p_hshParameters)
{strValue=cSYS.cABS_VIRTUAL_PATH+'frmDialogWithTree.aspx';if(p_hshParameters!=null)
{strValue+='?';if(p_hshParameters['strPage']!=null)
strValue+='page='+p_hshParameters['strPage'];if(p_hshParameters['strFileType']!=null)
strValue+='&fileType='+p_hshParameters['strFileType'];if(p_hshParameters['strToolbarButtons']!=null)
strValue+='&toolbar='+p_hshParameters['strToolbarButtons'];else
strValue+='&toolbar='+'save_saveClose_help';if(p_hshParameters['fOnSave']!=null)
strValue+='&java='+p_hshParameters['fOnSave'];if(p_hshParameters['strStatus']!=null)
strValue+='&status='+p_hshParameters['strStatus'];if(p_hshParameters['strLabelWord1']!=null)
{strValue+='&path='+p_hshParameters['strLabelWord1'];if(p_hshParameters['strLabelWord2']!=null)
strValue+='&path2='+encode(p_hshParameters['strLabelWord2']);}
if(p_hshParameters['strTranslate']!=null)
strValue+='&lang='+p_hshParameters['strTranslate'];if(p_hshParameters['strFile']!=null)
strValue+='&file='+p_hshParameters['strFile'];if(p_hshParameters['strType']!=null)
strValue+='&type='+p_hshParameters['strType'];if(p_hshParameters['blnDb']!=null)
strValue+='&inDb='+p_hshParameters['blnDb'];if(p_hshParameters['strConn']!=null)
strValue+='&conn='+p_hshParameters['strConn'];if((p_hshParameters['arr_strKeyFields']!=null)&&(p_hshParameters['arr_strKeyValues']!=null))
{if((p_hshParameters['arr_strKeyFields'].length==p_hshParameters['arr_strKeyValues'].length)&&(p_hshParameters['arr_strKeyFields'].length>0))
{var strFields='';for(var i=0;i<p_hshParameters['arr_strKeyFields'].length;i++)
{if(i>0)
strFields+='&';strFields+=p_hshParameters['arr_strKeyFields'][i]+'='+encode(p_hshParameters['arr_strKeyValues'][i]);}
strValue+='&fields='+encode(strFields);}}}
return(strValue);}
function g_fOpenPrintTool(p_strPrintPath,p_strDirectory,p_strFileName,p_strParameters,p_strConnectionString,p_strLang)
{if((p_strPrintPath!=null)&&(p_strFileName!=null))
{var strPath=p_strPrintPath+'print.aspx?fileName='+encode(p_strFileName)+'&dir='+p_strDirectory;if(p_strConnectionString!=null)
strPath+='&connection='+encode(p_strConnectionString);if((p_strParameters!=null)&&(p_strParameters!=''))
strPath+='&parameter='+encode(p_strParameters);if(p_strLang!=null)
strPath+='&lang='+encode(p_strLang);var intWidth=window.screen.availWidth-50;var intHeight=window.screen.availHeight-100;openWindow(strPath,window.screen.availWidth-10,window.screen.availHeight-50,null,null,'printWindow','yes');}}
function g_fOpenPrintToolEdit(p_strPrintPath,p_strDirectory,p_strFileName,p_strLang)
{if((p_strPrintPath!=null)&&(p_strFileName!=null))
{var strPath=p_strPrintPath+'Default.aspx?fileName='+encode(p_strFileName)+'&dir='+p_strDirectory;if(p_strLang!=null)
{strPath+='&lang='+encode(p_strLang);}
var intWidth=window.screen.availWidth-50;var intHeight=window.screen.availHeight-100;openWindow(strPath,window.screen.availWidth-10,window.screen.availHeight-50,null,null,'printWindow','yes');}}
function g_fOpenHelp(p_strLang,p_strFilename)
{openWindow(cHELP_TOOL_PATH+'help.aspx?lang='+p_strLang+'&path='+cHELP_DIR+'&file='+p_strFilename,400,600,100,100,'helpCmcMain','yes');}
var g_objDialogWithTreeSizes=new clsDialogWithTreeSizes();function clsDialogWithTreeSizes()
{this.g_hshSizes=new Object();var hshTemp=new Object();hshTemp['intMozDialogWidth']=855;hshTemp['intMozDialogHeight']=523;hshTemp['intMozWindowWidth']=855;hshTemp['intMozWindowHeight']=526;hshTemp['intTabWidth']=675;hshTemp['intTabHeight']=385;this.g_hshSizes['normal']=hshTemp;}
function bcCacheSystem()
{var xmlCache=new Object();var objThis=this;function g_objFindParent()
{try
{if(window.parent!=window&&window.parent.cacheSystem!=null)
{return(window.parent.cacheSystem);}
else
if(window.opener!=null&&window.opener.cacheSystem!=null)
{return(window.opener.cacheSystem);}
else
if(window.dialogArguments&&window.dialogArguments['window']!=null&&window.dialogArguments['window'].cacheSystem)
{return(window.dialogArguments['window'].cacheSystem);}
else
{return(null);}}
catch(objExcep)
{return(null);}}
this.g_fInsertXml=function(p_strFilename,p_objXml)
{var objParent=g_objFindParent();if(objParent!=null)
{objParent.g_fInsertXml(p_strFilename,p_objXml);}
else
{xmlCache[p_strFilename]=p_objXml;}}
this.g_obj_fGetXml=function(p_strFilename)
{try
{var objParent=g_objFindParent();if(objParent!=null)
{return(objParent.g_obj_fGetXml(p_strFilename));}
else
{return(xmlCache[p_strFilename]);}}
catch(Exception)
{consoleA('is cacho...[klaida isimant is cacheSystem]');return(null);}}}
var cacheSystem=new bcCacheSystem();function g_fRedirectToPage(p_strPageUrl)
{window.location=cSYS.cABS_VIRTUAL_PATH+p_strPageUrl;}
var g_strQuery='';var g_strDbString=null;var g_fPrintingHandlerFunction=null;function g_fManagePrinting(p_strQuery,p_objParams,p_arr_hshBcPrintPresets,p_strTitle,p_strConnString,p_fFunction)
{g_strDBSelector=p_strConnString;g_strQuery=p_strQuery;g_fPrintingHandlerFunction=p_fFunction;g_objPrintDialog.g_fOpen(null,null,p_objParams,p_arr_hshBcPrintPresets,g_fCompletePrintingSelection,p_strTitle);}
function g_fCompletePrintingSelection(p_hshAts)
{if(typeof(g_fPrintingHandlerFunction)=='function')
g_fPrintingHandlerFunction(p_hshAts);if(p_hshAts==null)
return;var arr_strDalys=cCONN_STRINGS.split('*');var hshConnStrings=new Object();for(var i=0;i<arr_strDalys.length;i++)
{var arr_strDalysTemp=arr_strDalys[i].split('^');hshConnStrings['['+arr_strDalysTemp[0]+']']=arr_strDalysTemp[1];}
var strConnString='';switch(g_strDBSelector)
{case'[confCmcDbString]':strConnString=cCMC_CONN_STRING;break;case'[confWaffenDbString]':strConnString=cWAFFEN_CONN_STRING;break;case'[confLbfDbString]':strConnString=cLBF_CONN_STRING;break;default:strConnString=cCMC_CONN_STRING;break;}
if(hshConnStrings[g_strDBSelector]!=null)
strConnString=hshConnStrings[g_strDBSelector];if(p_hshAts!=null)
g_fOpenPrintTool(cPRINT_TOOL_PATH,cREPORT_SAVE_DIR,p_hshAts['filename'],g_strQuery,strConnString,cSYS.cLANG);}
function clsWindow(p_blnModal)
{this.g_strId=g_str_fIdGenerator();this.g_fSetModal(p_blnModal);this.intZ=0;this.intLeft='';this.intTop='';this.blnOpened=false;this.hshConstraints={};this.blnAttached=false;this.fCreate();}
clsWindow.prototype.g_fShow=function()
{if(this.blnOpened)
return;var intZ=clsWindowManager.g_int_fSetWindowOnTop(this);this.fApplyPosition();this.g_fSetZ(intZ);this.blnOpened=true;if(!this.blnAttached)
{this.fAppendToDOM();}}
clsWindow.prototype.g_fHide=function()
{if(!this.blnOpened)
return;this.objMainElement.style.display='none';if(this.blnCurtainShown)
{g_objCurtain.g_fHide();this.blnCurtainShown=false;}
this.blnOpened=false;clsWindowManager.g_fWindowClose(this);}
clsWindow.prototype.g_fMakeDraggable=function(p_objHeader)
{if(typeof clsDraggable=='function')
{p_objHeader=g_obj_fElement(p_objHeader);p_objHeader.style.cursor='move';var objDrager=new clsDraggable(p_objHeader,'window');objDrager.g_fAddEvent(cEvents.cDragStart,this,this.fDragStart);objDrager.g_fAddEvent(cEvents.cDrag,this,this.fDrag);}}
clsWindow.prototype.g_fMakeAllDraggable=function()
{this.g_fMakeDraggable(this.objMainElement);}
clsWindow.prototype.g_fMakeResizable=function(p_objHeader,p_strHorizontal,p_strVertical)
{if(typeof clsDraggable=='function')
{p_objHeader=g_obj_fElement(p_objHeader);var objResizer=new clsDraggable(p_objHeader,'window_resize');objResizer.g_fSetValue('horizontal',p_strHorizontal);objResizer.g_fSetValue('vertical',p_strVertical);objResizer.g_fAddEvent(cEvents.cDragStart,this,this.fResizeStart);objResizer.g_fAddEvent(cEvents.cDrag,this,this.fResize);var strCursorStyle='';if(p_strVertical=='top')
strCursorStyle+='n';else if(p_strVertical=='bottom')
strCursorStyle+='s';if(p_strHorizontal=='left')
strCursorStyle+='w';else if(p_strHorizontal=='right')
strCursorStyle+='e';if(strCursorStyle!='')
p_objHeader.style.cursor=strCursorStyle+'-resize';}}
clsWindow.prototype.g_fSetSize=function(p_objWidth,p_objHeight)
{this.fCalculatePositionDiffs();if(p_objWidth!=null)
{if(p_objWidth==='')
this.objSizeElement.style.width='';else
this.objSizeElement.style.width=(p_objWidth-this.intLeftDiff-this.intRightDiff)+'px';}
if(p_objHeight!=null)
{if(p_objHeight==='')
this.objSizeElement.style.height='';else
this.objSizeElement.style.height=(p_objHeight-this.intRightDiff-this.intBottomDiff)+'px';}}
clsWindow.prototype.g_fSetPosition=function(p_objLeft,p_objTop)
{if(p_objLeft!=null)
{this.intLeft=p_objLeft;}
if(p_objTop!=null)
{this.intTop=p_objTop;}
if(this.blnOpened)
this.fApplyPosition();}
clsWindow.prototype.g_fSetConstraints=function(p_hshConstraints)
{if(p_hshConstraints&&typeof(p_hshConstraints)=='object')
{this.hshConstraints=p_hshConstraints;}}
clsWindow.prototype.g_fSetModal=function(p_blnModal)
{this.blnModal=!!p_blnModal;}
clsWindow.prototype.g_int_fGetZ=function()
{return this.intZ;}
clsWindow.prototype.g_fSetZ=function(p_intZ)
{this.intZ=p_intZ;this.objMainElement.style.zIndex=this.intZ;this.objMainElement.style.display='block';this.g_fActivate();}
clsWindow.prototype.g_fActivate=function()
{if(this.blnModal)
{g_objCurtain.g_fShow(this.intZ-1);this.blnCurtainShown=true;}}
clsWindow.prototype.g_obj_fGetContent=function()
{return this.objMainElement;}
clsWindow.prototype.fActivateOnClick=function()
{var intZ=clsWindowManager.g_int_fSetWindowOnTop(this);this.g_fSetZ(intZ);}
clsWindow.prototype.fApplyPosition=function()
{if(this.intLeft==='')
{var intViewportStartX=document.documentElement.scrollLeft;var intViewportWidth=document.documentElement.clientWidth;var intWidth=this.objMainElement.offsetWidth;var intLeft=(intViewportWidth-intWidth)/2;intLeft=intLeft<0?0:intLeft;intLeft+=intViewportStartX;this.objMainElement.style.left=intLeft+'px';}
else
{this.objMainElement.style.left=this.intLeft+'px';}
if(this.intTop==='')
{var intViewportStartY=document.documentElement.scrollTop;var intViewportHeight=document.documentElement.clientHeight;var intHeight=this.objMainElement.offsetHeight;var intTop=(intViewportHeight-intHeight)/2;intTop=intTop<0?0:intTop;intTop+=intViewportStartY;this.objMainElement.style.top=intTop+'px';}
else
{this.objMainElement.style.top=(document.documentElement.scrollTop+this.intTop)+'px';}}
clsWindow.prototype.fDragStart=function(p_hshEvent)
{var objDraggable=p_hshEvent['object'];objDraggable.g_fSetBlock(this.objMainElement);this.intViewportStartX=document.documentElement.scrollLeft;this.intViewportStartY=document.documentElement.scrollTop;this.intViewportEndX=document.documentElement.clientWidth+this.intViewportStartX;this.intViewportEndY=document.documentElement.clientHeight+this.intViewportStartY;this.intContentWidth=document.documentElement.scrollWidth;this.intContentHeight=document.documentElement.scrollHeight;this.arr_intDiff=g_arr_int_fMakeRelative(g_arr_int_fPosition(p_hshEvent.object.objDragHandle),this.objMainElement);var objHandle=p_hshEvent.object.objDragHandle;this.intHandleWidth=objHandle.offsetWidth;this.intHandleHeight=objHandle.offsetHeight;this.intBlockWidth=this.objMainElement.offsetWidth;this.intBlockHeight=this.objMainElement.offsetHeight;}
clsWindow.prototype.fDrag=function(p_hshEvent)
{var intLeft=p_hshEvent['X']+p_hshEvent['hshHandleOffset']['intXStartDiff'];if(intLeft+this.intHandleWidth>this.intViewportEndX)
intLeft=this.intViewportEndX-this.intHandleWidth;intLeft=intLeft>this.intViewportStartX?intLeft:this.intViewportStartX;intLeft-=this.arr_intDiff[0];if(intLeft+this.intBlockWidth>this.intContentWidth)
intLeft=this.intContentWidth-this.intBlockWidth;intLeft=intLeft<0?0:intLeft;var intTop=p_hshEvent['Y']+p_hshEvent['hshHandleOffset']['intYStartDiff'];if(intTop+this.intHandleHeight>this.intViewportEndY)
intTop=this.intViewportEndY-this.intHandleHeight;intTop=intTop>this.intViewportStartY?intTop:this.intViewportStartY;intTop-=this.arr_intDiff[1];if(intTop+this.intBlockHeight>this.intContentHeight)
intTop=this.intContentHeight-this.intBlockHeight;intTop=intTop<0?0:intTop;this.objMainElement.style.left=intLeft+'px';this.objMainElement.style.top=intTop+'px';}
clsWindow.prototype.fResizeStart=function(p_hshEvent)
{var objResizer=p_hshEvent['object'];this.strHorizontal=objResizer.g_obj_fGetValue('horizontal');this.strVertical=objResizer.g_obj_fGetValue('vertical');this.intViewportStartX=document.documentElement.scrollLeft;this.intViewportStartY=document.documentElement.scrollTop;this.intViewportEndX=document.documentElement.clientWidth+this.intViewportStartX;this.intViewportEndY=document.documentElement.clientHeight+this.intViewportStartY;this.fCalculatePositionDiffs();}
clsWindow.prototype.fResize=function(p_hshEvent)
{if(this.strHorizontal=='right')
{var intWidth=this.arr_intMainPos[2]-p_hshEvent.firstLocalCoords.X+p_hshEvent.X;if(this.arr_intMainPos[0]+intWidth>this.intViewportEndX)
intWidth=this.intViewportEndX-this.arr_intMainPos[0];if(this.hshConstraints['intMaxWidth']&&intWidth>this.hshConstraints['intMaxWidth'])
intWidth=this.hshConstraints['intMaxWidth'];var intMinWidth=20;if(this.hshConstraints['intMinWidth'])
intMinWidth=this.hshConstraints['intMinWidth'];if(intWidth<intMinWidth)
intWidth=intMinWidth;this.objSizeElement.style.width=(intWidth-this.intLeftDiff-this.intRightDiff)+'px';}
else if(this.strHorizontal=='left')
{var intWindowEndX=this.objMainElement.offsetLeft+this.objMainElement.offsetWidth;var intLeft=this.arr_intMainPos[0]-p_hshEvent.firstLocalCoords.X+p_hshEvent.X;if(intLeft<this.intViewportStartX)
{intLeft=this.intViewportStartX;}
var intWidth=intWindowEndX-intLeft;if(this.hshConstraints['intMaxWidth']&&intWidth>this.hshConstraints['intMaxWidth'])
{intLeft=intWindowEndX-this.hshConstraints['intMaxWidth'];}
var intMinWidth=20;if(this.hshConstraints['intMinWidth'])
intMinWidth=this.hshConstraints['intMinWidth'];if(intLeft>intWindowEndX-intMinWidth)
{intLeft=intWindowEndX-intMinWidth;}
intWidth=intWindowEndX-intLeft;this.objMainElement.style.left=intLeft+'px';this.objSizeElement.style.width=(intWidth-this.intLeftDiff-this.intRightDiff)+'px';}
if(this.strVertical=='bottom')
{var intHeight=this.arr_intMainPos[3]-p_hshEvent.firstLocalCoords.Y+p_hshEvent.Y;if(this.arr_intMainPos[1]+intHeight>this.intViewportEndY)
intHeight=this.intViewportEndY-this.arr_intMainPos[1];if(this.hshConstraints['intMaxHeight']&&intHeight>this.hshConstraints['intMaxHeight'])
intHeight=this.hshConstraints['intMaxHeight'];var intMinHeight=20;if(this.hshConstraints['intMinHeight'])
intMinHeight=this.hshConstraints['intMinHeight'];if(intHeight<intMinHeight)
intHeight=intMinHeight;this.objSizeElement.style.height=(intHeight-this.intTopDiff-this.intBottomDiff)+'px';}
else if(this.strVertical=='top')
{var intWindowEndY=this.objMainElement.offsetTop+this.objMainElement.offsetHeight;var intTop=this.arr_intMainPos[1]-p_hshEvent.firstLocalCoords.Y+p_hshEvent.Y;if(intTop<this.intViewportStartY)
{intTop=this.intViewportStartY;}
var intHeight=intWindowEndY-intTop;if(this.hshConstraints['intMaxHeight']&&intHeight>this.hshConstraints['intMaxHeight'])
{intTop=intWindowEndY-this.hshConstraints['intMaxHeight'];}
var intMinHeight=20;if(this.hshConstraints['intMinHeight'])
intMinHeight=this.hshConstraints['intMinHeight'];if(intTop>intWindowEndY-intMinHeight)
{intTop=intWindowEndY-intMinHeight;}
intHeight=intWindowEndY-intTop;this.objMainElement.style.top=intTop+'px';this.objSizeElement.style.height=(intHeight-this.intTopDiff-this.intBottomDiff)+'px';}}
clsWindow.prototype.fCreate=function()
{this.objMainElement=document.createElement('DIV');this.objMainElement.id=this.g_strId;this.objSizeElement=this.objMainElement;var objStyle=this.objMainElement.style;objStyle.display='none';objStyle.position='absolute';objStyle.left='0px';objStyle.top='0px';if(document.body)
{this.fAppendToDOM();}}
clsWindow.prototype.fAppendToDOM=function()
{document.body.appendChild(this.objMainElement);addEvent(this.objMainElement,'mousedown',this.fActivateOnClick,this);this.blnAttached=true;}
clsWindow.prototype.fCalculatePositionDiffs=function()
{this.arr_intMainPos=g_arr_int_fPosition(this.objMainElement);this.arr_intSizePos=g_arr_int_fPosition(this.objSizeElement);this.intLeftDiff=this.arr_intSizePos[0]-this.arr_intMainPos[0];this.intTopDiff=this.arr_intSizePos[1]-this.arr_intMainPos[1];this.intRightDiff=this.arr_intMainPos[0]+this.arr_intMainPos[2]-this.arr_intSizePos[0]-this.arr_intSizePos[2];this.intBottomDiff=this.arr_intMainPos[1]+this.arr_intMainPos[3]-this.arr_intSizePos[1]-this.arr_intSizePos[3];}
var clsWindowManager={hshWindows:new clsIndexedHash(),intMaxZ:0};clsWindowManager.g_int_fSetWindowOnTop=function(p_objWindow)
{if(this.hshWindows.g_bln_fIsLast(p_objWindow))
return this.intMaxZ;if(this.hshWindows.g_fIsIn(p_objWindow))
{this.hshWindows.g_obj_fRemove(p_objWindow);}
var objTopWindow=this.hshWindows.g_obj_fGetLast();if(objTopWindow)
this.intMaxZ=objTopWindow.g_int_fGetZ();else
this.intMaxZ=0;var intLength=this.hshWindows.g_int_fGetCount();this.hshWindows.g_str_fAdd(p_objWindow,intLength,p_objWindow.g_strId);this.intMaxZ+=2;p_objWindow.g_fSetZ(this.intMaxZ);return this.intMaxZ;}
clsWindowManager.g_fWindowClose=function(p_objWindow)
{if(this.hshWindows.g_bln_fIsLast(p_objWindow))
{var objSecondTopWindow=this.hshWindows.g_obj_fGetPrevious(p_objWindow);if(objSecondTopWindow)
objSecondTopWindow.g_fActivate();}
this.hshWindows.g_obj_fRemove(p_objWindow);}
var g_objCurtain={};g_objCurtain.blnCreated=false;g_objCurtain.blnWasResized=false;g_objCurtain.g_fShow=function(p_intZIndex)
{this.fCreate();if(this.objMainElement.parentNode!=document.body)
document.body.appendChild(this.objMainElement);this.objMainElement.style.zIndex=p_intZIndex;this.fOnResize();addEvent(window,'resize',this.fOnResize,this);}
g_objCurtain.g_fHide=function()
{this.objMainElement.parentNode.removeChild(this.objMainElement);this.blnWasResized=true;removeEvent(window,'resize',this.fOnResize,this);}
g_objCurtain.fCreate=function()
{if(this.blnCreated)
return;this.objMainElement=document.createElement('DIV');this.objMainElement.className='curtain';var objStyle=this.objMainElement.style;if(cIE)
g_fAddStyle('.curtain','filter: alpha(opacity=40);');objStyle.display='none';objStyle.position='absolute';objStyle.top='0px';objStyle.left='0px';document.body.appendChild(this.objMainElement);this.blnCreated=true;}
g_objCurtain.fOnResize=function()
{var objParentNode=document.documentElement;if(!this.blnWasResized)
{this.intFirstWidth=objParentNode.scrollWidth;this.intFirstHeight=objParentNode.scrollHeight;}
this.blnWasResized=true;var intWidth=objParentNode.scrollLeft+objParentNode.clientWidth;var intClientHeight=objParentNode.clientHeight;var intHeight=objParentNode.scrollTop+intClientHeight;intHeight=Math.max(intHeight,this.intFirstHeight);if(intWidth>this.intFirstWidth)
{if(cIE7)
intHeight+=16;}
else
{intWidth=this.intFirstWidth;}
this.objMainElement.style.width=intWidth+'px';this.objMainElement.style.height=intHeight+'px';this.objMainElement.style.display='block';}
function clsConsole()
{clsConsole.baseConstructor.call(this,false);this.intMaxSimbolCount=200000;this.intDepth=8;this.blnShowFunctions=false;this.blnMinimized=false;this.blnCanOpen=true;this.blnConstructed=false;}
g_fExtend(clsConsole,clsWindow);clsConsole.prototype.g_fShow=function()
{if(!this.blnCanOpen)
return;if(!this.blnOpened)
this.g_fSetPosition(g_fGetViewportWidth()-220,20);if(!this.blnConstructed)
this.fCreateConsole();if(!this.blnAttached)
{this.fAppendToDOM();}
if(this.blnOpened)
return;var intZ=2000;this.fApplyPosition();this.g_fSetZ(intZ);this.blnOpened=true;}
clsConsole.prototype.g_fSetShowFunctions=function(p_blnValue)
{this.blnShowFunctions=p_blnValue;}
clsConsole.prototype.g_bln_fGetShowFunctions=function()
{return this.blnShowFunctions;}
clsConsole.prototype.g_fPrintLine=function(p_objItem)
{var strAlert=this.str_fConstruct(p_objItem,1,'');if(typeof(strAlert)!=typeof(p_objItem)||strAlert!=p_objItem)
{strAlert='<pre>'+strAlert+'</pre>';}
this.g_fShow();if(this.objDiv)
{this.fInsertText(this.objDiv,strAlert);this.objDiv.parentNode.scrollTop=this.objDiv.scrollHeight;}}
clsConsole.prototype.g_fUninit=function()
{this.blnCanOpen=false;if(this.objMinimizeImg)
removeEvent(this.objMinimizeImg,'click',this.fMinimize,this);this.objMinimizeImg=null;if(this.objMaximizeImg)
removeEvent(this.objMaximizeImg,'click',this.fMaximize,this);this.objMaximizeImg=null;if(this.objCloseImg)
removeEvent(this.objCloseImg,'click',this.fClose,this);this.objCloseImg=null;if(this.objClosePermImg)
removeEvent(this.objClosePermImg,'click',this.fClosePerm,this);this.objClosePermImg=null;this.objContentRow=null;this.objFooterRow=null;this.objDiv=null;this.blnConstructed=false;}
clsConsole.prototype.g_str_fConstruct=function(p_objItem)
{return this.str_fConstruct(p_objItem,1,'');}
clsConsole.prototype.g_fSetLevel=function(p_intLevel)
{if(p_intLevel!=null)
{this.intDepth=p_intLevel;}}
clsConsole.prototype.fActivateOnClick=function()
{}
clsConsole.prototype.str_fConstruct=function(p_objItem,p_intLevel,p_strPad)
{var strNewPad=p_strPad+'    ';if(p_intLevel==this.intDepth)
return('');var strAts='';var strType=ftypeof(p_objItem);switch(strType)
{case'jsobject':for(strKey in p_objItem)
{var strChildType=ftypeof(p_objItem[strKey]);if(strKey==('g_objParent')&&strChildType=='jsobject')
{strAts+='\n'+p_strPad+'[\''+strKey+'\']: '+'[...]';}
else
if(strChildType!='function'||this.blnShowFunctions)
{strAts+='\n'+p_strPad+'[\''+strKey+'\']:  '+this.str_fConstruct(p_objItem[strKey],p_intLevel+1,strNewPad);}}
break;case'array':strAts+='Array:';for(var i=0,intLength=p_objItem.length;i<intLength;i++)
{if(typeof(p_objItem[i])!='undefined')
strAts+='\n'+p_strPad+'['+i+']: '+this.str_fConstruct(p_objItem[i],p_intLevel+1,strNewPad);}
break;case'domelement':strAts+='DOM Element:'+this.str_fConstructDom(p_objItem,p_intLevel,p_strPad);break;case'event':strAts+='DOM Event:'+this.str_fConstructEvent(p_objItem,p_intLevel,p_strPad);break;case'function':if(this.blnShowFunctions)strAts+='function(){...}';break;default:if(p_objItem)
{if(p_objItem.replace)
{strAts+=p_objItem.replace(/>/g,'&gt;').replace(/</g,'&lt;');}
else
{strAts+=p_objItem.toString();}}
else
{strAts+=p_objItem;}
break;}
return(strAts);}
clsConsole.prototype.str_fConstructEvent=function(p_objItem,p_intLevel,p_strPad)
{var strNewPad=p_strPad+'    ';var strResult='';p_strPad=strNewPad;strResult+='\n'+p_strPad+'type: '+p_objItem.type;strResult+='\n'+p_strPad+'clientX: '+p_objItem.clientX;strResult+='\n'+p_strPad+'clientY: '+p_objItem.clientY;strResult+='\n'+p_strPad+'screenX: '+p_objItem.screenX;strResult+='\n'+p_strPad+'screenY: '+p_objItem.screenY;strResult+='\n'+p_strPad+'offsetX: '+p_objItem.offsetX;strResult+='\n'+p_strPad+'offsetY: '+p_objItem.offsetY;strResult+='\n'+p_strPad+'layerX: '+p_objItem.layerX;strResult+='\n'+p_strPad+'layerY: '+p_objItem.layerY;strResult+='\n'+p_strPad+'pageX: '+p_objItem.pageX;strResult+='\n'+p_strPad+'pageY: '+p_objItem.pageY;strResult+='\n'+p_strPad+'x: '+p_objItem.x;strResult+='\n'+p_strPad+'y: '+p_objItem.y;strResult+='\n'+p_strPad+'button: '+p_objItem.button;strResult+='\n'+p_strPad+'keyCode: '+p_objItem.keyCode;strResult+='\n'+p_strPad+'charCode: '+p_objItem.charCode;strResult+='\n'+p_strPad+'which: '+p_objItem.which;strResult+='\n'+p_strPad+'altKey: '+p_objItem.altKey;strResult+='\n'+p_strPad+'ctrlKey: '+p_objItem.ctrlKey;strResult+='\n'+p_strPad+'shiftKey: '+p_objItem.shiftKey;strResult+='\n'+p_strPad+'metaKey: '+p_objItem.metaKey;strResult+='\n'+p_strPad+'cancelBubble: '+p_objItem.cancelBubble;strResult+='\n'+p_strPad+'bubbles: '+p_objItem.bubbles;strResult+='\n'+p_strPad+'cancelable: '+p_objItem.cancelable;strResult+='\n'+p_strPad+'eventPhase: '+p_objItem.eventPhase;strResult+='\n'+p_strPad+'returnValue: '+p_objItem.returnValue;strResult+='\n'+p_strPad+'reason: '+p_objItem.reason;strResult+='\n'+p_strPad+'timestamp: '+p_objItem.timestamp;strResult+='\n'+p_strPad+'srcElement: '+this.str_fConstruct(p_objItem.srcElement,p_intLevel+1,strNewPad);strResult+='\n'+p_strPad+'currentTarget: '+this.str_fConstruct(p_objItem.currentTarget,p_intLevel+1,strNewPad);strResult+='\n'+p_strPad+'relatedTarget: '+this.str_fConstruct(p_objItem.relatedTarget,p_intLevel+1,strNewPad);strResult+='\n'+p_strPad+'srcFilter: '+this.str_fConstruct(p_objItem.srcFilter,p_intLevel+1,strNewPad);strResult+='\n'+p_strPad+'fromElement: '+this.str_fConstruct(p_objItem.fromElement,p_intLevel+1,strNewPad);strResult+='\n'+p_strPad+'toElement: '+this.str_fConstruct(p_objItem.toElement,p_intLevel+1,strNewPad);strResult+='\n'+p_strPad+'target: '+this.str_fConstruct(p_objItem.target,p_intLevel+1,strNewPad);return strResult;}
clsConsole.prototype.str_fConstructDom=function(p_objItem,p_intLevel,p_strPad)
{var strNewPad=p_strPad+'    ';var strResult='';p_strPad=strNewPad;strResult+='\n'+p_strPad+'id: '+p_objItem.id;strResult+='\n'+p_strPad+'className: '+p_objItem.className;strResult+='\n'+p_strPad+'nodeName: '+p_objItem.nodeName;strResult+='\n'+p_strPad+'nodeType: '+p_objItem.nodeType;strResult+='\n'+p_strPad+'nodeValue: '+p_objItem.nodeValue;strResult+='\n'+p_strPad+'tabIndex: '+p_objItem.tabIndex;strResult+='\n'+p_strPad+'tagName: '+p_objItem.tagName;strResult+='\n'+p_strPad+'title: '+p_objItem.title;strResult+='\n'+p_strPad+'readOnly: '+p_objItem.readOnly;strResult+='\n'+p_strPad+'disabled: '+p_objItem.disabled;strResult+='\n'+p_strPad+'type: '+p_objItem.type;strResult+='\n'+p_strPad+'clientWidth: '+p_objItem.clientWidth;strResult+='\n'+p_strPad+'clientHeight: '+p_objItem.clientHeight;strResult+='\n'+p_strPad+'offsetLeft: '+p_objItem.offsetLeft;strResult+='\n'+p_strPad+'offsetTop: '+p_objItem.offsetTop;strResult+='\n'+p_strPad+'offsetWidth: '+p_objItem.offsetWidth;strResult+='\n'+p_strPad+'offsetHeight: '+p_objItem.offsetHeight;strResult+='\n'+p_strPad+'scrollLeft: '+p_objItem.scrollLeft;strResult+='\n'+p_strPad+'scrollTop: '+p_objItem.scrollTop;strResult+='\n'+p_strPad+'scrollWidth: '+p_objItem.scrollWidth;strResult+='\n'+p_strPad+'scrollHeight: '+p_objItem.scrollHeight;strResult+='\n'+p_strPad+'style: '+this.str_fConstruct(p_objItem.style,p_intLevel+1,strNewPad);strResult+='\n'+p_strPad+'dir: '+p_objItem.dir;strResult+='\n'+p_strPad+'lang: '+p_objItem.lang;return strResult;}
clsConsole.prototype.fCreateConsole=function()
{this.blnConstructed=true;var objTable=document.createElement('TABLE');objTable.id='consoleTable';objTable.className='consoleTable';objTable.style.width='100%';objTable.style.height='100%';objTable.cellSpacing=0;objTable.cellPadding=0;var objRow1=objTable.insertRow(0);var objCell=objRow1.insertCell(0);objCell.className='consoleHeader';objCell.innerHTML='<span style="padding:2px;">Console</span>';objCell=objRow1.insertCell(1);objCell.className='consoleHeader';objCell.style.width='80px';objCell.style.textAlign='right';this.objMinimizeImg=document.createElement('IMG');this.objMinimizeImg.id='consoleMiniImg';this.objMinimizeImg.src=cSYS.cIMAGE_PATH+'14_minimize.gif';this.objMinimizeImg.className='consoleButtons';this.objMinimizeImg.title='Minimize';objCell.appendChild(this.objMinimizeImg);addEvent(this.objMinimizeImg,'click',this.fMinimize,this);this.objMaximizeImg=document.createElement('IMG');this.objMaximizeImg.id='consoleMaxiImg';this.objMaximizeImg.src=cSYS.cIMAGE_PATH+'14_maximize.gif';this.objMaximizeImg.className='consoleButtons';this.objMaximizeImg.title='Maximize';objCell.appendChild(this.objMaximizeImg);addEvent(this.objMaximizeImg,'click',this.fMaximize,this);this.objCloseImg=document.createElement('IMG');this.objCloseImg.id='consoleCloseImg';this.objCloseImg.src=cSYS.cIMAGE_PATH+'14_close2.gif';this.objCloseImg.className='consoleButtons';this.objCloseImg.title='Close console';objCell.appendChild(this.objCloseImg);addEvent(this.objCloseImg,'click',this.fClose,this);this.objClosePermImg=document.createElement('IMG');this.objClosePermImg.id='consoleClosePermImg';this.objClosePermImg.src=cSYS.cIMAGE_PATH+'14_close_red.gif';this.objClosePermImg.className='consoleButtons';this.objClosePermImg.title='Close console permanently';objCell.appendChild(this.objClosePermImg);addEvent(this.objClosePermImg,'click',this.fClosePerm,this);this.fSetButtonState();this.objContentRow=objTable.insertRow(1);this.objContentRow.style.height='100%';objCell=this.objContentRow.insertCell(0);objCell.colSpan=2;objCell.style.verticalAlign='top';objCell.style.backgroundColor='white';objCell.style.height='100%';var objDiv=document.createElement('DIV');objDiv.style.height='100%';objDiv.style.width='100%';objDiv.style.overflow='auto';objDiv.style.position='relative';objDiv.style.backgroundColor='white';this.objDiv=document.createElement('DIV');this.objDiv.style.position='absolute';this.objDiv.style.padding='2px';this.objDiv.id='console_div';objDiv.appendChild(this.objDiv);objCell.appendChild(objDiv);this.objFooterRow=objTable.insertRow(2);objCell=this.objFooterRow.insertCell(0);objCell.colSpan=2;objCell.className='consoleFooter';objCell.style.textAlign='right';var objResizeImg=document.createElement('IMG');objResizeImg.src=cSYS.cIMAGE_PATH+'14_resizer.gif';objResizeImg.style.margin='1px';objResizeImg.title='Close console';objCell.appendChild(objResizeImg);this.objMainElement.appendChild(objTable);this.g_fSetSize(200,400);this.g_fSetConstraints({intMinWidth:200,intMinHeight:100,intMaxHeight:500});this.g_fMakeDraggable(objRow1);this.g_fMakeResizable(objResizeImg,'right','bottom');}
clsConsole.prototype.fMinimize=function()
{this.intOldHeight=this.objMainElement.clientHeight;this.intOldWidth=this.objMainElement.clientWidth;this.objMainElement.style.height='20px';this.objMainElement.style.width='200px';this.objFooterRow.style.display='none';this.objContentRow.style.display='none';this.blnMinimized=true;this.fSetButtonState();}
clsConsole.prototype.fMaximize=function()
{this.objMainElement.style.height=this.intOldHeight+'px';this.objMainElement.style.width=this.intOldWidth+'px';this.objFooterRow.style.display='';this.objContentRow.style.display='';this.blnMinimized=false;this.fSetButtonState();}
clsConsole.prototype.fClose=function()
{this.g_fHide();this.g_fClear();}
clsConsole.prototype.fClosePerm=function()
{this.blnCanOpen=false;this.g_fHide();this.g_fClear();}
clsConsole.prototype.fSetButtonState=function()
{if(this.blnMinimized)
{this.objMaximizeImg.style.display='';this.objMinimizeImg.style.display='none';}
else
{this.objMaximizeImg.style.display='none';this.objMinimizeImg.style.display='';}}
clsConsole.prototype.fInsertText=function(p_objNode,p_strText)
{while(p_objNode.innerHTML.length>this.intMaxSimbolCount)
{p_objNode.removeChild(p_objNode.firstChild);}
p_objNode.innerHTML+=p_strText+'<br/>';}
clsConsole.prototype.g_fClear=function()
{if(this.objDiv)
{this.objDiv.innerHTML='';}}
clsConsole.prototype.g_fAlertLine=function(p_objItem)
{var strAlert=this.str_fConstruct(p_objItem,1,'');alert(strAlert);}
var g_objConsole=new clsConsole();addEvent(window,'unload',consoleUninit);function consoleUninit()
{g_objConsole.g_fUninit();}
function console(p_objInput,p_intLevel)
{if(!g_blnShowConsole)return;if(!document.body)
return consoleA(p_strInput,p_intLevel);if(window.parent!=window&&parent.console!=null)
{parent.console(p_objInput,p_intLevel);return;}
g_objConsole.g_fSetLevel(p_intLevel);g_objConsole.g_fPrintLine(p_objInput);}
function o(p_strInput,p_intLevel)
{console(p_strInput,p_intLevel)}
function consoleF(p_objInput,p_intLevel)
{if(!g_blnShowConsole)return;if(window.parent!=window&&parent.consoleF!=null)
{parent.consoleF(p_objInput,p_intLevel);return;}
g_objConsole.g_fSetLevel(p_intLevel);var blnSetting=g_objConsole.g_bln_fGetShowFunctions();g_objConsole.g_fSetShowFunctions(true);g_objConsole.g_fPrintLine(p_objInput);g_objConsole.g_fSetShowFunctions(blnSetting);}
function consoleA(p_objInput,p_intLevel)
{if(!g_blnShowConsole)return;if(window.parent!=window&&parent.consoleA!=null)
{parent.consoleA(p_objInput,p_intLevel);return;}
g_objConsole.g_fSetLevel(p_intLevel);g_objConsole.g_fAlertLine(p_objInput);}
function oa(p_objInput,p_intLevel)
{consoleA(p_objInput,p_intLevel);}
function a(p_strInput,p_intLevel)
{consoleA(p_strInput,p_intLevel);}
function consoleClear()
{if(!g_blnShowConsole)return;if(window.parent!=window&&parent.consoleClear!=null)
{parent.consoleClear();return;}
g_objConsole.g_fClear();}
function consoleSize(p_intLeft,p_intTop,p_intWidth,p_intHeight)
{if(!g_blnShowConsole)return;if(window.parent!=window&&parent.consoleSize!=null)
{parent.consoleSize(p_intLeft,p_intTop,p_intWidth,p_intHeight);return;}
g_objConsole.g_fSetSize(p_intWidth,p_intHeight);g_objConsole.g_fSetPosition(p_intLeft,p_intTop);}
function consoleClose()
{if(!g_blnShowConsole)return;if(window.parent!=window&&parent.consoleClose!=null)
{parent.consoleClose();return;}
g_objConsole.g_fClose();}
function consoleClosePerm()
{if(!g_blnShowConsole)return;if(window.parent!=window&&parent.consoleClosePerm!=null)
{parent.consoleClosePerm();return;}
g_objConsole.g_fClosePerm();}
function clsDraggableManager(p_strPlatformId)
{this.strDragType=null;this.g_objDragedObject=null;this.g_objPreDragedObject=null;this.g_blnDragStarted=false;this.hsh_arr_objZones={};if(cFF)
{this.objEmptyCaptDiv=document.createElement('DIV');this.objEmptyCaptDiv.tabIndex=-1;}
this.g_fRegisterPreDrag=function(p_hshEvent)
{if(this.g_blnDragStarted)
return;this.g_objCurrentDropZone=null;this.g_objPreDragedObject=p_hshEvent['object'];this.g_blnDragStarted=true;if(cFF)
{var objSrcElement=getSrcElement(p_hshEvent['event']);objSrcElement.appendChild(this.objEmptyCaptDiv);this.objEmptyCaptDiv.focus();}
if(cIE)
{document.body.setCapture();}}
this.g_fRegisterDrag=function(p_hshEvent)
{this.strDragType=p_hshEvent['strType'];this.g_objDragedObject=p_hshEvent['object'];this.g_objPreDragedObject=null;this.g_blnDragStarted=true;}
this.g_fDrag=function(p_hshEvent)
{if(this.g_objDragedObject)
{p_hshEvent['draggedObject']=this.g_objDragedObject;this.g_objDragedObject.g_fDrag(p_hshEvent);this.fCheckDroppables(p_hshEvent);if(this.g_objCurrentDropZone!=null)
{this.g_objCurrentDropZone.g_fDrag(p_hshEvent);}}
else if(this.g_objPreDragedObject)
{this.g_objPreDragedObject.g_fPreDrag(p_hshEvent);}}
this.g_fRestoreSelection=function()
{if(cFF)
document.body.style.MozUserSelect='';}
this.g_fDragEnd=function(p_hshEvent)
{this.g_fRestoreSelection();if(this.g_objDragedObject)
{if(this.g_objCurrentDropZone)
{p_hshEvent['dropPlace']=this.g_objCurrentDropZone;this.g_objDragedObject.g_fDragEnd(p_hshEvent);p_hshEvent['draggedObject']=this.g_objDragedObject;delete p_hshEvent['dropPlace'];this.g_objCurrentDropZone.g_fAcceptDraggable(p_hshEvent);}
else
{this.g_objDragedObject.g_fDragFailed(p_hshEvent);}
this.strDragType=null;this.g_objDragedObject=null;}
if(cIE&&document&&document.body&&document.body.releaseCapture)
document.body.releaseCapture();this.g_objPreDragedObject=null;this.g_blnDragStarted=false;this.g_objCurrentDropZone=null;}
this.g_fAddDroppable=function(p_objDroppable,p_strType)
{if(this.hsh_arr_objZones[p_strType]==null)
{this.hsh_arr_objZones[p_strType]=[p_objDroppable];}
else
{this.hsh_arr_objZones[p_strType].push(p_objDroppable);}}
this.fCheckDroppables=function(p_hshEvent)
{var objPoint=g_obj_fGetMousePoint(p_hshEvent['event']);p_hshEvent['point']=objPoint;var arr_objZones=this.hsh_arr_objZones[this.strDragType];if(arr_objZones)
{var arr_objOver=[];for(var i=0,intLength=arr_objZones.length;i<intLength;i++)
{var currHandle=arr_objZones[i].g_obj_fGetHandle();var objZoneRegion=g_obj_fGetRegion(currHandle);arr_objZones[i].g_objRegion=objZoneRegion;if(objZoneRegion.g_bln_fContains(objPoint))
{arr_objOver.push(arr_objZones[i]);}}
if(arr_objOver.length==0)
{this.fSetNewCurrentDroppable(null,p_hshEvent);}
else if(arr_objOver.length==1)
{this.fSetNewCurrentDroppable(arr_objOver[0],p_hshEvent);}
else
{var intMaxIndex=0;for(var i=1,intLength=arr_objOver.length;i<intLength;i++)
{if(arr_objOver[i].g_objRegion.g_int_fSize()<arr_objOver.g_objRegion.g_int_fSize())
{intMaxIndex=i;}}
this.fSetNewCurrentDroppable(arr_objOver[intMaxIndex],p_hshEvent);}}
else
{this.fSetNewCurrentDroppable(null,p_hshEvent);}}
this.fSetNewCurrentDroppable=function(p_objDroppable,p_hshEvent)
{if(p_objDroppable!=this.g_objCurrentDropZone)
{if(this.g_objCurrentDropZone!=null)
{this.g_objCurrentDropZone.g_fMouseOut(p_hshEvent);}
if(p_objDroppable!=null)
{p_objDroppable.g_fMouseOver(p_hshEvent);}
this.g_objCurrentDropZone=p_objDroppable;}}
this.g_fInit=function()
{if(this.strPlatformId==null)
{addEvent(document,'mousemove',this.g_fDrag,this);addEvent(document,'mouseup',this.g_fDragEnd,this);}
else
{var objPlatform=document.getElementById(this.strPlatformId);if(objPlatform)
{addEvent(objPlatform,'mousemove',this.g_fDrag,this);addEvent(objPlatform,'mouseup',this.g_fDragEnd,this);}
else
{addEvent(document,'mousemove',this.g_fDrag,this);addEvent(document,'mouseup',this.g_fDragEnd,this);}}}
this.g_fUninit=function()
{if(this.strPlatformId==null)
{removeEvent(document,'mousemove',this.g_fDrag,this);removeEvent(document,'mouseup',this.g_fDragEnd,this);}
else
{var objPlatform=document.getElementById(this.strPlatformId);if(objPlatform)
{removeEvent(objPlatform,'mousemove',this.g_fDrag,this);removeEvent(objPlatform,'mouseup',this.g_fDragEnd,this);}
else
{removeEvent(document,'mousemove',this.g_fDrag,this);removeEvent(document,'mouseup',this.g_fDragEnd,this);}}
this.g_blnInitted=false;}
this.strPlatformId=p_strPlatformId;this.g_fInit();}
var g_objDrager=new clsDraggableManager(null);function clsDraggable(p_objHandle,p_strType,p_objRelative)
{if(!p_objHandle)
return;this.hshValues={};this.iEvents=iEventInterface;this.iEvents([cEvents.cDragStart,cEvents.cDrag,cEvents.cDragEnd,cEvents.cDragFailed]);this.fInit(p_objHandle,p_strType,p_objRelative);}
clsDraggable.prototype.fInit=function(p_objHandle,p_strType,p_objRelative)
{if(typeof(p_objHandle)=='string')
{p_objHandle=document.getElementById(p_objHandle);}
this.objDragHandle=p_objHandle;this.objRelativeElement=p_objRelative;this.g_strType=p_strType;if(this.g_strType==null)
{this.g_strType='default';}
addEvent(this.objDragHandle,'mousedown',this.g_fPreDragStart.closure(this));if(cIE)
addEvent(this.objDragHandle,'dragstart',g_fStopEvent);if(cFF)
{addEvent(this.objDragHandle,'draggesture',g_fStopEvent);}}
clsDraggable.prototype.g_fPreDragStart=function(p_hshEvent)
{if(!g_bln_fIsLeftClick(p_hshEvent['event']))
return;if(cFF)
{document.body.style.MozUserSelect='none';}
p_hshEvent['object']=this;g_objDrager.g_fRegisterPreDrag(p_hshEvent);this.objInitialGCoords=g_obj_fGetMousePoint(p_hshEvent['event']);this.objInitialLCoords=g_obj_fMakeRelative(this.objInitialGCoords,this.objRelativeElement);var objHandleRegion=g_obj_fGetRegion(this.objDragHandle);this.intXStartDiff=objHandleRegion.X-this.objInitialGCoords.X;this.intYStartDiff=objHandleRegion.Y-this.objInitialGCoords.Y;this.intXEndDiff=objHandleRegion.X+objHandleRegion.W-this.objInitialGCoords.X;this.intYEndDiff=objHandleRegion.Y+objHandleRegion.H-this.objInitialGCoords.Y;this.hshHandleOffset={intXStartDiff:this.intXStartDiff,intYStartDiff:this.intYStartDiff,intXEndDiff:this.intXEndDiff,intYEndDiff:this.intYEndDiff};}
clsDraggable.prototype.g_fPreDrag=function(p_hshEvent)
{var objGCoords=g_obj_fGetMousePoint(p_hshEvent['event']);var dx=this.objInitialGCoords.X-objGCoords.X;var dy=this.objInitialGCoords.Y-objGCoords.Y;if(dx*dx+dy*dy>2*2)
{this.g_fDragStart(p_hshEvent);}}
clsDraggable.prototype.g_fDragStart=function(p_hshEvent)
{p_hshEvent['strType']=this.g_strType;p_hshEvent['object']=this;g_objDrager.g_fRegisterDrag(p_hshEvent);this.objLastGCoords=g_obj_fGetMousePoint(p_hshEvent['event']);this.objLastLCoords=g_obj_fMakeRelative(this.objLastGCoords,this.objRelativeElement);this.intXStartDiff+=this.objInitialLCoords.X-this.objLastLCoords.X;this.intYStartDiff+=this.objInitialLCoords.Y-this.objLastLCoords.Y;this.intXEndDiff+=this.objInitialLCoords.X-this.objLastLCoords.X;this.intYEndDiff+=this.objInitialLCoords.Y-this.objLastLCoords.Y;this.objInitialGCoords=this.objLastGCoords;this.objInitialLCoords=this.objLastLCoords;p_hshEvent['hshHandleOffset']=this.hshHandleOffset;p_hshEvent['X']=this.objLastLCoords.X;p_hshEvent['Y']=this.objLastLCoords.Y;p_hshEvent['global']=this.objLastGCoords;p_hshEvent['firstGlobalCoords']=this.objInitialGCoords;p_hshEvent['firstLocalCoords']=this.objInitialLCoords;this.fFireEvent(cEvents.cDragStart,p_hshEvent);this.blnFirstDrag=true;this.g_fDrag(p_hshEvent);}
clsDraggable.prototype.g_fDrag=function(p_hshEvent)
{p_hshEvent['object']=this;this.objLastGCoords=g_obj_fGetMousePoint(p_hshEvent['event']);this.objLastLCoords=g_obj_fMakeRelative(this.objLastGCoords,this.objRelativeElement);p_hshEvent['hshHandleOffset']=this.hshHandleOffset;p_hshEvent['X']=this.objLastLCoords.X;p_hshEvent['Y']=this.objLastLCoords.Y;p_hshEvent['global']=this.objLastGCoords;p_hshEvent['firstGlobalCoords']=this.objInitialGCoords;p_hshEvent['firstLocalCoords']=this.objInitialLCoords;g_fStopEvent(p_hshEvent['event']);this.fFireEvent(cEvents.cDrag,p_hshEvent);}
clsDraggable.prototype.g_fDragEnd=function(p_hshEvent)
{p_hshEvent['object']=this;p_hshEvent['hshHandleOffset']=this.hshHandleOffset;p_hshEvent['X']=this.objLastLCoords.X;p_hshEvent['Y']=this.objLastLCoords.Y;p_hshEvent['global']=this.objLastGCoords;p_hshEvent['firstGlobalCoords']=this.objInitialGCoords;p_hshEvent['firstLocalCoords']=this.objInitialLCoords;this.fFireEvent(cEvents.cDragEnd,p_hshEvent);}
clsDraggable.prototype.g_arr_fGetCurrentCoordinates=function()
{return this.arr_intLastCoords;}
clsDraggable.prototype.g_arr_fGetFirstCoordinates=function()
{return this.arr_intFirstCoords;}
clsDraggable.prototype.g_fDragFailed=function(p_hshEvent)
{p_hshEvent['object']=this;p_hshEvent['hshHandleOffset']=this.hshHandleOffset;p_hshEvent['X']=this.objLastLCoords.X;p_hshEvent['Y']=this.objLastLCoords.Y;p_hshEvent['global']=this.objLastGCoords;p_hshEvent['firstGlobalCoords']=this.objInitialGCoords;p_hshEvent['firstLocalCoords']=this.objInitialLCoords;this.fFireEvent(cEvents.cDragFailed,p_hshEvent);}
clsDraggable.prototype.g_fUninit=function()
{removeEvent(this.objDragHandle,'mousedown',this.g_fPreDragStart.closure(this));if(cIE)
removeEvent(this.objDragHandle,'dragstart',g_fStopEvent);if(cFF)
removeEvent(this.objDragHandle,'draggesture',g_fStopEvent);this.objDragHandle=null;this.objDragBlock=null;}
clsDraggable.prototype.g_obj_fGetHandle=function()
{return this.objDragHandle;}
clsDraggable.prototype.g_fSetBlock=function(p_objElement)
{this.objBlock=p_objElement;}
clsDraggable.prototype.g_obj_fGetBlock=function()
{return this.objBlock;}
clsDraggable.prototype.g_fSetValue=function(p_strKey,p_objValue)
{this.hshValues[p_strKey]=p_objValue;}
clsDraggable.prototype.g_obj_fGetValue=function(p_strKey)
{return this.hshValues[p_strKey];}
function clsDroppable(p_objHandle,p_arr_strTypes)
{if(!p_objHandle)
return;this.hshValues={};this.iEvents=iEventInterface;this.iEvents([cEvents.cDragOver,cEvents.cDrag,cEvents.cDragOut,cEvents.cDrop]);this.fInit(p_objHandle,p_arr_strTypes);}
clsDroppable.prototype.fInit=function(p_objHandle,p_arr_strTypes)
{if(typeof(p_objHandle)=='string')
{p_objHandle=document.getElementById(p_objHandle);}
this.objDropHandle=p_objHandle;this.arr_strTypes=p_arr_strTypes;if(this.arr_strTypes==null||this.arr_strTypes.length==0)
{g_objDrager.g_fAddDroppable(this,'default');}
else
{var intLength=this.arr_strTypes.length;for(var i=0;i<intLength;i++)
{g_objDrager.g_fAddDroppable(this,this.arr_strTypes[i]);}}}
clsDroppable.prototype.g_fMouseOver=function(p_hshEvent)
{p_hshEvent['object']=this;this.fFireEvent(cEvents.cDragOver,p_hshEvent);}
clsDroppable.prototype.g_fMouseOut=function(p_hshEvent)
{p_hshEvent['object']=this;this.fFireEvent(cEvents.cDragOut,p_hshEvent);}
clsDroppable.prototype.g_fDrag=function(p_hshEvent)
{p_hshEvent['object']=this;this.fFireEvent(cEvents.cDrag,p_hshEvent);}
clsDroppable.prototype.g_fAcceptDraggable=function(p_hshEvent)
{p_hshEvent['object']=this;this.fFireEvent(cEvents.cDrop,p_hshEvent);}
clsDroppable.prototype.g_obj_fGetHandle=function()
{return this.objDropHandle;}
clsDroppable.prototype.g_fSetValue=function(p_strKey,p_objValue)
{this.hshValues[p_strKey]=p_objValue;}
clsDroppable.prototype.g_obj_fGetValue=function(p_strKey)
{return this.hshValues[p_strKey];}
var g_objHistoryManager={};g_objHistoryManager.g_intCheckingInterval=100;g_objHistoryManager.g_intSeparator=';';g_objHistoryManager.g_strIframeSrc='private/history.html';g_objHistoryManager.blnStarted=false;g_objHistoryManager.strState=null;g_objHistoryManager.strBackState="";g_objHistoryManager.hshDataOptions={skipDefaultMatch:true,defaults:[],regexpParams:''};g_objHistoryManager.g_obj_fRegister=function(p_strId,p_arrDefaultValues,p_fOnMatch,p_fOnGenerate,p_objRegexp,p_objContext)
{if(!this.arr_objModules)
this.g_fInit();var hshData=g_hsh_fMergeHashes(this.hshDataOptions,{defaults:p_arrDefaultValues,onMatch:p_fOnMatch,onGenerate:p_fOnGenerate,regexp:p_objRegexp});hshData['context']=p_objContext;hshData.regexp=hshData.regexp||p_strId+'-([\\w_-]*)';if(typeof hshData.regexp=='string')
hshData.regexp=new RegExp(hshData.regexp,hshData.regexpParams);hshData.onGenerate=hshData.onGenerate||function(values){return p_strId+'-'+values[0];};hshData.values=g_obj_fClone(hshData.defaults);hshData.id=p_strId;this.hsh_objModules[p_strId]=hshData;if(this.strStartState&&this.blnStarted)
{this.g_fCheckOneModule(this.strStartState,hshData);this.g_fUpdate();}
return{setValues:function(p_arrValues){return this.g_fSetValues(p_strId,p_arrValues);}.closure(this),setValue:function(p_intIndex,p_strValue){return this.g_fSetValue(p_strId,p_intIndex,p_strValue);}.closure(this),generate:function(p_arr_strValues){return this.g_str_fGenerate(p_strId,p_arr_strValues);}.closure(this),unregister:function(){return this.g_fUnregister(p_strId);}.closure(this),getValues:function(){return this.g_arr_fGetValues(p_strId);}.closure(this)}}
g_objHistoryManager.g_fUnregister=function(p_strId)
{this.modules[p_strId]=null;}
g_objHistoryManager.g_str_fGetBackState=function()
{return this.strBackState;}
g_objHistoryManager.g_str_fGetFullBackState=function()
{var href=top.location.href;var pos=href.indexOf('#')+1;var strBack=this.strBackState;if(strBack.indexOf('#')!=0)
strBack='#'+strBack;href=href.substring(0,pos)+strBack;console(href);return href;return this.strBackState;}
g_objHistoryManager.g_str_fGetStartState=function()
{return this.strStartState;}
g_objHistoryManager.g_str_fGetState=function()
{return this.strState;}
g_objHistoryManager.g_fInit=function()
{if(this.hsh_objModules)return this;this.hsh_objModules={};}
g_objHistoryManager.g_fStart=function()
{if(!this.blnStarted)
{var objCaller=new clsIntervalCaller(this.g_fCheck,this,this.g_intCheckingInterval);objCaller.g_fStartInterval();this.blnStarted=true;}
this.strStartState=this.str_fGetState();this.g_fCheck();this.g_fUpdate();}
g_objHistoryManager.g_fCheck=function()
{var strNewState=this.str_fGetState();if(strNewState==this.strState)
return;if(this.strState!=null)
{this.strBackState=this.strState;}
this.strCurrStateUrl=top.location.href;this.strState=strNewState;if(cIE&&(this.strState!==null))
{this.fSetState(this.strState,true);}
for(var strId in this.hsh_objModules)
{var hshData=this.hsh_objModules[strId];this.g_fCheckOneModule(this.strState,hshData);}}
g_objHistoryManager.g_fCheckOneModule=function(p_strState,p_hshModule)
{var hshData=p_hshModule;var objMatch=p_strState.match(hshData.regexp)
if(objMatch)
{objMatch.splice(0,1);objMatch.complement(hshData.defaults);if(!objMatch.isSimilar(hshData.defaults))
hshData.values=objMatch;else
hshData.values=g_obj_fClone(hshData.defaults);}
else
{hshData.values=g_obj_fClone(hshData.defaults);}
hshData.onMatch.apply(hshData.context,[hshData.values,hshData.defaults]);}
g_objHistoryManager.g_bln_fMatchOneModule=function(p_strState,p_hshModule)
{var objMatch=p_strState.match(p_hshModule.regexp);return!!objMatch;}
g_objHistoryManager.str_fGetHash=function()
{var href=top.location.href;var pos=href.indexOf('#')+1;return(pos)?href.substr(pos):'';}
g_objHistoryManager.g_str_fGenerateState=function()
{var arrState=[];for(var strId in this.hsh_objModules)
{var hshData=this.hsh_objModules[strId];if(hshData.values.isSimilar(hshData.defaults))
{if(!this.g_bln_fMatchOneModule(this.strState,hshData)&&hshData.skipDefaultMatch)
continue;}
var strStateToken=hshData.onGenerate.apply(hshData.context,[hshData.values]);if(strStateToken!='')
arrState.push(strStateToken);}
return arrState.join(this.g_intSeparator);}
g_objHistoryManager.g_str_fGenerate=function(p_strId,p_arr_strValues)
{var hshData=this.hsh_objModules[p_strId];var current=g_obj_fClone(hshData.values);hshData.values=p_arr_strValues;var state=this.g_str_fGenerateState();hshData.values=current;return'#'+state;}
g_objHistoryManager.g_fUpdate=function()
{if(!this.blnStarted)
return;var strState=this.g_str_fGenerateState();this.fSetState(strState);}
g_objHistoryManager.str_fGetState=function()
{var state=this.str_fGetHash();if(this.iframe){var doc=this.iframe.contentWindow.document;if(doc&&doc.body.id=='state'){var istate=doc.body.innerText;if(this.strState==state)
return istate;this.blnIsStateOld=true;}else return this.strIState;}
return state;}
g_objHistoryManager.fSetState=function(p_strState,p_blnFix)
{this.strBackState=this.strState;p_strState=p_strState==null?'':p_strState;p_strState=p_strState||'';var strLocHash=top.location.hash;this.strState=p_strState;if(!(strLocHash==p_strState||strLocHash=='#'+p_strState))
{if(p_strState=="")
p_strState="#";top.location.hash=p_strState;}
if(cIE&&(!p_blnFix||this.blnIsStateOld))
{if(!this.iframe){this.iframe=document.createElement('iframe');this.iframe.src=cSYS.cABS_VIRTUAL_PATH+this.g_strIframeSrc;this.iframe.style.visibility='hidden';this.iframe.style.width='0px';this.iframe.style.height='0px';document.body.appendChild(this.iframe);this.strIState=this.strState;}
try{var doc=this.iframe.contentWindow.document;doc.open();doc.write('<html><body id="state">'+p_strState+'</body></html>');doc.close();this.blnIsStateOld=false;}catch(e){};}
this.strState=p_strState;}
g_objHistoryManager.g_fSetValues=function(p_strId,p_arr_strValues)
{var hshData=this.hsh_objModules[p_strId];if(!hshData||hshData.values.isSimilar(p_arr_strValues))
return;hshData.values=p_arr_strValues;console(hshData.values);this.g_fUpdate();}
g_objHistoryManager.g_fSetValue=function(p_strId,p_intIndex,p_strValue)
{var hshData=this.hsh_objModules[p_strId];if(!hshData||hshData.values[p_intIndex]==p_strValue)
return;hshData.values[p_intIndex]=p_strValue;this.g_fUpdate();}
g_objHistoryManager.g_arr_fGetValues=function(p_strId)
{var hshData=this.hsh_objModules[p_strId];if(!hshData)
return[];return hshData.values;}
g_objHistoryManager.g_fInit();function clsKeyManager(p_strId,p_objPlatform)
{this.g_strId=p_strId;var objThis=this;if(p_objPlatform==null)p_objPlatform=document;var objPlatform=p_objPlatform;var arr_hshKeyMap=new Array();var arr_hshFKeyMap=new Array();var blnEnabled=true;this.g_fSetEnabled=function(p_blnEnabled)
{blnEnabled=p_blnEnabled;}
this.g_fRegister=function(p_fHandler,p_intKey,p_blnCtrl,p_blnShift,p_blnAlt,p_strTag,p_blnStopDefault)
{var hshKey=new Object();if(typeof(p_intKey)=='object')
{hshKey=p_intKey;if(typeof(hshKey['key'])=='string')
{hshKey['key']=(hshKey['key']).charCodeAt(0);}
hshKey['handler']=p_fHandler;}
else
{if(typeof(p_intKey)=='string')
hshKey['key']=p_intKey.charCodeAt(0);if(typeof(p_intKey)=='number')
{hshKey['key']=p_intKey;}
hshKey['ctrl']=p_blnCtrl;hshKey['shift']=p_blnShift;hshKey['alt']=p_blnAlt;hshKey['handler']=p_fHandler;hshKey['tag']=p_strTag;hshKey['stopDefault']=p_blnStopDefault;}
arr_hshFKeyMap.push(hshKey);}
function bln_fIsFKey(p_intCode)
{for(intKey in g_objFKeys)
{if(g_objFKeys[intKey]==p_intCode)
return(true);}
return(false);}
var strUniqueId='GKM_'+Math.random()+'_'+new Date();function fInit()
{g_objEventManager.g_fAddEvent(strUniqueId,'keydown',fKeyDown);}
addEvent(window,'unload',fUninit);function fUninit()
{g_objEventManager.g_fRemoveEvent(strUniqueId,'keydown');}
function fKeyDown(e,p_hshEvent)
{if(blnEnabled)
{var intKey=g_int_fGetKeyCode(e);for(var i=0;i<arr_hshFKeyMap.length;i++)
{if(arr_hshFKeyMap[i]['key']==intKey&&arr_hshFKeyMap[i]['ctrl']==e.ctrlKey&&arr_hshFKeyMap[i]['shift']==e.shiftKey&&arr_hshFKeyMap[i]['alt']==e.altKey)
{var hshEvent=new Object();hshEvent['key']=arr_hshFKeyMap[i]['key'];hshEvent['ctrl']=arr_hshFKeyMap[i]['ctrl'];hshEvent['shift']=arr_hshFKeyMap[i]['shift'];hshEvent['tag']=arr_hshFKeyMap[i]['tag'];hshEvent['stopDefault']=arr_hshFKeyMap[i]['stopDefault'];hshEvent['event']=e;hshEvent['object']=objThis;if(hshEvent['stopDefault'])
g_fStopEvent(e);g_obj_fAsyncCallImediate(arr_hshFKeyMap[i]['handler'],null,0,hshEvent);}}}}
fInit();}
var g_objKeyManager=new clsKeyManager('globalKeyManager');function clsFKeys()
{this.cDEL=46;this.cF1=112;this.cF2=113;this.cF3=114;this.cF4=115;this.cF5=116;this.cF6=117;this.cF7=118;this.cF8=119;this.cF9=120;this.cF10=121;this.cF11=122;this.cF12=123;this.cTAB=9;this.cENTER=13;this.cESC=27;this.cPGUP=33;this.cPGDOWN=34;this.cEND=35;this.cHOME=36;this.cWINDOWS=91;this.cCAPSLOCK=20;this.cSPACE=32;}
var g_objFKeys=new clsFKeys();function clsKeysMap()
{this.cNEW={ctrl:true,shift:false,alt:false,key:78,tag:'001',stopDefault:true};this.cDELETE={ctrl:false,shift:false,alt:false,key:g_objFKeys.cDEL,tag:'002',stopDefault:true};this.cEDIT={ctrl:true,shift:false,alt:false,key:69,tag:'003',stopDefault:true};this.cPRINT={ctrl:true,shift:false,alt:false,key:80,tag:'004',stopDefault:true};this.cSEARCH={ctrl:true,shift:false,alt:false,key:70,tag:'005',stopDefault:true};this.cSAVE={ctrl:true,shift:false,alt:false,key:83,tag:'006',stopDefault:true};this.cHELP={ctrl:false,shift:false,alt:false,key:g_objFKeys.cF1,tag:'007',stopDefault:true};}
var g_objDefaultKeysMap=new clsKeysMap();function g_obj_fClone(p_objInput)
{if(typeof(p_objInput)!='object')
{if(p_objInput&&p_objInput.constructor==RegExp)
{return new RegExp(p_objInput);}
return p_objInput;}
if(p_objInput==null)return p_objInput;var strFTypeOf=ftypeof(p_objInput);if(strFTypeOf=='domelement')
{return p_objInput.cloneNode(true);}
var objReturn;var fConstructor=p_objInput.constructor;if(fConstructor!=null)
{switch(fConstructor)
{case Array:objReturn=new Array();break;case Date:return new Date(+p_objInput);case Object:objReturn=new Object();break;default:if(typeof(p_objInput.g_obj_fClone)=='function')
{return p_objInput.g_obj_fClone();}
else
{var sConstructor=fConstructor.toString();var aMatch=sConstructor.match(/\s*function (.*)\(/);if(aMatch!=null)
{objReturn=new fConstructor();}
else
{objReturn=new Object();}}}}
for(var i in p_objInput)
objReturn[i]=g_obj_fClone(p_objInput[i]);return objReturn;}
function g_fExtend(p_clsSubClass,p_clsBaseClass)
{function inheritance(){}
inheritance.prototype=p_clsBaseClass.prototype;p_clsSubClass.prototype=new inheritance();p_clsSubClass.prototype.constructor=p_clsSubClass;p_clsSubClass.baseConstructor=p_clsBaseClass;p_clsSubClass.superClass=p_clsBaseClass.prototype;}
function ftypeof(vExpression)
{var sTypeOf=typeof vExpression;if(sTypeOf=="function")
{return'function';}
if(sTypeOf!="object")
{return sTypeOf;}
switch(vExpression)
{case null:return"null";case window:return"window";case window.event:return"event";}
if(window.event&&(event.type==vExpression.type))
{return"event";}
if(vExpression.eventPhase!=null&&vExpression.type!=null)
{return'event';}
var fConstructor=vExpression.constructor;if(fConstructor!=null)
{switch(fConstructor)
{case Array:sTypeOf="array";break;case Date:return"date";case RegExp:return"regexp";case Object:sTypeOf="jsobject";break;case ReferenceError:return"error";default:var sConstructor=fConstructor.toString();var aMatch=sConstructor.match(/\s*function (.*)\(/);if(aMatch!=null)
{return'jsobject';}}}
var nNodeType=vExpression.nodeType;if(nNodeType!=null)
{switch(nNodeType)
{case 1:if(vExpression.item==null)
{return"domelement";}
break;case 3:return"textnode";}}
if(vExpression.toString!=null)
{var sExpression=vExpression.toString();var aMatch=sExpression.match(/^\[object (.*)\]$/i);if(aMatch!=null)
{var sMatch=aMatch[1];switch(sMatch.toLowerCase())
{case"event":return"event";case"math":return"math";case"error":return"error";case"mimetypearray":return"mimetypecollection";case"pluginarray":return"plugincollection";case"windowcollection":return"window";case"nodelist":case"htmlcollection":case"elementarray":return"domcollection";}}}
if(vExpression.moveToBookmark&&vExpression.moveToElementText)
{return"textrange";}
else if(vExpression.callee!=null)
{return"arguments";}
else if(vExpression.item!=null)
{return"domcollection";}
return sTypeOf;}
function g_fDynaTranslate(p_objElement)
{var objData=new Object();objData['project']='CMC';objData['file']=cSYS.cLANG_PATH;objData['tag']=p_objElement.innerHTML;var hshRet=openDialog(cSYS.cLANG_TOOL_PATH+'forms/frmTagEdit.aspx',400,500,objData,'no');if(hshRet!=null)
{if(p_objElement!=null&&p_objElement.innerHTML)
{p_objElement.innerHTML=hshRet[cSYS.cLANG];}}}
function clsLightMenu(p_hshArg,p_hshEvents,p_arr_intPositions,p_blnRelativeToMouse,p_intMaxNodes)
{var objThis=this;var hshTempArg=p_hshArg;var hshArg=p_hshArg;var hshEvents=p_hshEvents;var arr_intPositions=p_arr_intPositions;var blnRelativeToMouse=p_blnRelativeToMouse;var arr_intMousePosition;var objCallerElement;var blnIsIn=false;var blnMoves=false;var blnWasClosed=false;var arr_objNodes=null;var hsh_intTypeCounts=null;var strLastSelectedId=null;var strPrefix='lightMenu_';var intMaxNodes=p_intMaxNodes;this.g_obj_fGetLocalElement=function(p_strRelativeId)
{return document.getElementById(this.g_str_fCreateId(p_strRelativeId));}
this.g_str_fCreateId=function(p_strElementId)
{return strFilterId+'_'+p_strElementId;}
this.g_fInit=function()
{arr_objNodes=new Array();hsh_intTypeCounts=new Object();fConstructMenu(hshTempArg);}
this.g_fUninit=function()
{var objMainDiv=document.getElementById(hshArg['strId']);if(objMainDiv)
{removeEvent(objMainDiv,'mouseover',fOver);removeEvent(objMainDiv,'mouseout',fOut);removeEvent(objMainDiv,'mousemove',fMove);g_objEventManager.g_fRemoveEvent(hshArg['strId'],'click');var objParent=document.getElementById(p_hshArg['strParentId']);removeEvent(objParent,'contextmenu',g_fStopEvent);if(cIE==true)
removeEvent(objMainDiv,'selectstart',g_fStopEvent);removeEvent(objMainDiv,'contextmenu',g_fStopEvent);}}
function fOver(e)
{blnIsIn=true;}
function fOut(e)
{blnIsIn=false;if(strLastSelectedId)
{var objRow=document.getElementById(strPrefix+strLastSelectedId);if(objRow)fSetStyle(objRow,false);}
strLastSelectedId=null;}
function fMove(e)
{blnMoves=true;var objElement=getSrcElement(e);var strRowId=objElement.getAttribute('strRowId');if(!strRowId)return;if(strLastSelectedId==strRowId)return;if(strLastSelectedId)
{var objRow=document.getElementById(strPrefix+strLastSelectedId);if(objRow)fSetStyle(objRow,false);}
strLastSelectedId=strRowId;var objRow=document.getElementById(strPrefix+strRowId);if(objRow)fSetStyle(objRow,true);}
this.g_fOpen=function(p_objCallerEvent)
{fOpenMenu(p_objCallerEvent);}
this.g_arr_fGetState=function(p_blnNeedToMove)
{var blnCanBeClosed=false;if(p_blnNeedToMove)
{blnCanBeClosed=!blnIsIn||!blnMoves;blnMoves=false;return blnResult;}
else
{blnMoves=false;blnCanBeClosed=!blnIsIn;}
return[blnWasClosed,blnCanBeClosed,blnIsIn];}
this.g_fClose=function()
{objThis.g_fHide();}
function fConstructMenu(p_hshArg)
{hshArg=new Object();if(typeof(g_objConfiguration)!='undefined')
{hshArg=g_obj_fClone(g_objConfiguration.g_hshContextMenuCmc);}
for(var key in p_hshArg)
{hshArg[key]=p_hshArg[key];}
var objParent=document.getElementById(p_hshArg['strParentId']);addEvent(objParent,'contextmenu',g_fStopEvent);objParent.setAttribute('strTagName','strTd_HMenu');objParent.setAttribute('strTopMenuId',p_hshArg['strParentId']);g_fCreateContent(hshArg);}
function fMenuClick(p_hshEvent)
{blnIsIn=false;blnWasClosed=true;var strNode=p_hshEvent['strNode'];var objEvent=p_hshEvent['event'];if(typeof(hshEvents['MenuClick'])=='function')
{hshEvents['MenuClick'](strNode);}}
function fOpenMenu(p_hshEvent)
{blnWasClosed=false;arr_intMousePosition=p_hshEvent['event']['mousePosition'];objCallerElement=p_hshEvent['element'];objThis.g_fHide();objThis.g_fDeleteAll();if(typeof(hshEvents['BuildMenu'])=='function')
{hshEvents['BuildMenu'](p_hshEvent,objThis);}
if(arr_objNodes==null||arr_objNodes.length==0)
{objThis.g_fHide();}
else
{fShowMenu(arr_intPositions,hshArg['NodeWidth'],hshArg['NodeHeight'],objCallerElement,arr_intMousePosition);}}
function fShowMenu(p_arr_intPosition,p_intNodeWidth,p_intNodeHeight,p_objParentObj,p_arr_intMousePosition)
{var hshTemp=new Object();var arr;var textNodeCount=objThis.g_int_fGetCountOfType('text');var breakerNodeCount=objThis.g_int_fGetCountOfType('breaker');var intMenuHeight=textNodeCount*hshArg['NodeHeight']+breakerNodeCount*5;if(blnRelativeToMouse)
{hshTemp=g_hsh_int_fGetCoordsByPosition(arr_intMousePosition[0],arr_intMousePosition[1],0,0,p_intNodeWidth,intMenuHeight,p_arr_intPosition);arr=[hshTemp['intX'],hshTemp['intY']];}
else
{var objParentObj=p_objParentObj;var arrArg=objPosition(objParentObj);hshTemp=g_hsh_int_fGetCoordsByPosition(arrArg[2],arrArg[3],arrArg[0],arrArg[1],p_intNodeWidth,intMenuHeight,p_arr_intPosition);arr=g_arr_int_fGetCoords(p_objParentObj,hshTemp['intX'],hshTemp['intY']);}
objThis.g_fShow(arr[0],arr[1]);}
function fHideEventHandler()
{if(typeof(hshEvents['HideMenu'])=='function')
{hshEvents['HideMenu']();}}
function fShowEventHandler()
{if(typeof(hshEvents['ShowMenu'])=='function')
{hshEvents['ShowMenu']();}}
function g_fCreateContent(hshArg)
{var objParentDiv=document.getElementById(hshArg['strParentId']);if(objParentDiv)
{var objMainDiv=document.getElementById(hshArg['strId']);if(!objMainDiv)
{objMainDiv=document.createElement('DIV');objMainDiv.style.position='absolute';objMainDiv.id=hshArg['strId'];objMainDiv.style.zIndex=hshArg['zindex'];objMainDiv.style.display='none';objMainDiv.style.visibility='hidden';objMainDiv.style.cursor='default';objMainDiv.style.border=hshArg['strMenuBorderStyle'];if(hshArg['intNodeWidth']!=null)
objMainDiv.style.width=hshArg['intNodeWidth'];objParentDiv.appendChild(objMainDiv);g_objEventManager.g_fAddEvent(hshArg['strId'],'click',fClick);addEvent(objMainDiv,'mouseover',fOver);addEvent(objMainDiv,'mouseout',fOut);addEvent(objMainDiv,'mousemove',fMove);if(cIE==true)
addEvent(objMainDiv,'selectstart',g_fStopEvent);if(cFF==true)
objMainDiv.style.MozUserSelect='none';addEvent(objMainDiv,'contextmenu',g_fStopEvent);var objTable=document.createElement('table');objTable.style.borderCollapse='collapse';objTable.cellSpacing='0';objTable.cellPadding='0';objTable.id=hshArg['strId']+'_table';objMainDiv.appendChild(objTable);}}}
this.g_fShow=function(p_intX,p_intY)
{var objMainDiv=document.getElementById(hshArg['strId']);if(objMainDiv)
{objMainDiv.style.display='';objMainDiv.style.visibility='visible';objMainDiv.style.position='absolute';objMainDiv.style.left=p_intX;objMainDiv.style.top=p_intY;if(intMaxNodes!=null&&intMaxNodes>0&&arr_objNodes.length>intMaxNodes)
{objMainDiv.style.height=intMaxNodes*hshArg['intNodeHeight'];objMainDiv.style.overflow='auto';}
else
{objMainDiv.style.height='';}
fShowEventHandler();}}
this.g_fHide=function()
{var objMainDiv=document.getElementById(hshArg['strId']);if(objMainDiv)
{objMainDiv.style.display='none';objMainDiv.style.visibility='hidden';fHideEventHandler();}}
this.g_fInsert=function(p_strParent,p_strItem,p_strText,p_strType)
{var objMainTable=document.getElementById(hshArg['strId']+'_table');if(objMainTable)
{var objTr=objMainTable.insertRow(objMainTable.rows.length);objTr.setAttribute('strRowId',p_strItem);objTr.setAttribute('strMenuId',hshArg['strId']);objTr.id=strPrefix+p_strItem;objTr.style.height=hshArg['intNodeHeight'];objTr.style.width=hshArg['intNodeWidth'];var objTd=objTr.insertCell(0);objTd.setAttribute('strTagType','Item');objTd.setAttribute('strMenuId',hshArg['strId']);objTd.setAttribute('strRowId',p_strItem);objTd.style.width='20px';objTd=objTr.insertCell(1);objTd.setAttribute('strTagType','Item');objTd.setAttribute('strMenuId',hshArg['strId']);objTd.setAttribute('strRowId',p_strItem);objTd.style.paddingLeft='5px';objTd.style.paddingRight='5px';objTd.innerHTML=p_strText;fSetStyle(objTr,false);var objNewItem=new Object();objNewItem['strParent']=p_strParent;objNewItem['strItem']=p_strItem;objNewItem['strText']=p_strText;objNewItem['strType']=p_strType;if(typeof(hsh_intTypeCounts[p_strType])=='undefined')
{hsh_intTypeCounts[p_strType]=0;}
hsh_intTypeCounts[p_strType]++;arr_objNodes.push(objNewItem);}}
function fSetStyle(p_objRow,p_blnSelected)
{var objFirstCell=p_objRow.cells[0];var objSecondCell=p_objRow.cells[1];if(p_blnSelected)
{objFirstCell.style.backgroundColor=hshArg['strSelectLeftColor'];objSecondCell.style.backgroundColor=hshArg['strSelectRightColor'];}
else
{objFirstCell.style.backgroundColor=hshArg['strLeftColor'];objSecondCell.style.backgroundColor=hshArg['strRightColor'];}}
this.g_fDeleteAll=function()
{var objMainTable=document.getElementById(hshArg['strId']+'_table');if(objMainTable)
{for(var i=objMainTable.rows.length-1;i>=0;i--)
{objMainTable.deleteRow(i);}
arr_objNodes=new Array();hsh_intTypeCounts=new Object();}}
this.g_int_fGetCountOfType=function(p_strType)
{if(typeof(hsh_intTypeCounts[p_strType])=='undefined')
{return 0;}
return hsh_intTypeCounts[p_strType];}
function fClick(e,p_hshArg)
{if(p_hshArg['blnEventOnCurrDoc']==true)
{var objElement=getSrcElement(e);var strRowId=objElement.getAttribute('strRowId');var strMenuId=objElement.getAttribute('strMenuId');if(!strRowId||strMenuId!=hshArg['strId'])
{objThis.g_fHide();}
else
{var hshEvent=new Object();hshEvent['strNode']=strRowId;hshEvent['event']=e;fMenuClick(hshEvent);}}
else
{objThis.g_fHide();}}}
var objTimeoutHelper=new Object();function clsNoClickEventShooter(p_strId,p_arr_strElementsToHandle,p_intTimeoutToShow,p_intTransitionTimeout,p_intTimeoutToHide,p_blnNeedToMove,p_fOpen,p_fCanClose,p_fClose)
{var cTimesToClose=4;var strId='Shooter_'+p_strId;var arr_strElementsToHandle=p_arr_strElementsToHandle;var intTimeoutToShow=p_intTimeoutToShow;var intTransitionTimeout=p_intTransitionTimeout;var intTimeoutToHide=p_intTimeoutToHide/cTimesToClose;var blnNeedToMove=p_blnNeedToMove;var fOpenHandler=p_fOpen;var fCanCloseHandler=p_fCanClose;var fCloseHandler=p_fClose;var objCurrentElementToShow=null;var objCurrentlyShownElement=null;var objCurrentEvent=null;var intSeed=0;var blnIsOpened=false;var blnWasClosed=false;var arr_intMousePosition;var intLeftToClose;var blnInited=false;var blnGo=false;var blnBlocked=false;var blnIsOnMenu=false;var objThis=this;this.g_fStart=function()
{blnGo=true;if(!blnInited)
{fInit();blnInited=true;}}
this.g_fStop=function()
{blnGo=false;}
function fInit()
{objTimeoutHelper.g_fTimeoutFunction=fOpenOnDelay;addEvent(document,'mouseover',fOver);addEvent(document,'mouseout',fOut);addEvent(document,'mousedown',fMouseDown);addEvent(document,'mousemove',fMouseMove);addEvent(window,'unload',fUninit);}
this.g_fUninit=function()
{fUninit();}
function fUninit()
{removeEvent(document,'mouseover',fOver);removeEvent(document,'mouseout',fOut);removeEvent(document,'mousedown',fMouseDown);removeEvent(document,'mousemove',fMouseMove);removeEvent(window,'unload',fUninit);}
function fOver(e)
{if(!blnGo)return;var objHTMLElement=getSrcElement(e);if(objHTMLElement!=objCurrentElementToShow)
{objCurrentElementToShow=objHTMLElement;}
if(objCurrentElementToShow==objCurrentlyShownElement)return;var intTimeout=blnIsOpened?intTransitionTimeout:intTimeoutToShow;var intNextSeed=int_fGetNextSeed();var strDescriptor=objHTMLElement.id?objHTMLElement.id:objHTMLElement;objHTMLElement.setAttribute(strId,intNextSeed);setTimeout('objTimeoutHelper.g_fTimeoutFunction(\''+intNextSeed+'\')',intTimeout);}
function fOut(e)
{if(!blnGo)return;var objHTMLElement=getSrcElement(e);objHTMLElement.removeAttribute(strId);var strDescriptor=objHTMLElement.id?objHTMLElement.id:objHTMLElement;}
function fMouseDown(e)
{if(!blnGo)return;if(!blnIsOpened&&!blnIsOnMenu)
{var objHTMLElement=getSrcElement(e);objCurrentElementToShow=objHTMLElement;fShow(objCurrentElementToShow,true);}}
function fMouseMove(e)
{arr_intMousePosition=getMouse(e);}
function fOpenOnDelay(p_intSeed)
{var strGotSeed=objCurrentElementToShow.getAttribute(strId);if(!strGotSeed)return;var arr_blnState=arr_fCallGetState(true);if((strGotSeed==p_intSeed)&&arr_blnState[0]&&!arr_blnState[1])
{fShow(objCurrentElementToShow);}}
function fCloseOnDelay()
{var arr_blnState=arr_fCallGetState();if(arr_blnState[1])
{fClose();}
else
if(arr_blnState[0])
{intLeftToClose--;if(intLeftToClose<=0)
{fClose();}
else
{setTimeout(fCloseOnDelay,p_intTimeoutToHide);}}
else
{intLeftToClose=cTimesToClose;setTimeout(fCloseOnDelay,p_intTimeoutToHide);}}
function fShow(p_objCurrentElementToShow,p_blnIgnoreRestrictions)
{if(!p_blnIgnoreRestrictions)
{if(blnBlocked)return;if(objCurrentlyShownElement==p_objCurrentElementToShow)return;}
blnIsOpened=true;objCurrentlyShownElement=p_objCurrentElementToShow;var hshEvent=new Object();hshEvent['event']=new Object;hshEvent['event']['mousePosition']=arr_intMousePosition;hshEvent['element']=objCurrentlyShownElement;if(typeof(fOpenHandler)=='function')
{fOpenHandler(hshEvent);}
setTimeout(fCloseOnDelay,p_intTimeoutToHide);intLeftToClose=cTimesToClose;}
function fClose()
{blnIsOpened=false;if(typeof(fCloseHandler)=='function')
{fCloseHandler();}
if(objCurrentlyShownElement!=objCurrentElementToShow)
{objCurrentlyShownElement=null;fShow(objCurrentElementToShow);}}
function arr_fCallGetState(p_blnIgnoreBlocked)
{if(typeof(fCanCloseHandler)!='function')
{blnBlocked=true;return true;}
var arr_blnState=fCanCloseHandler(blnNeedToMove);if(!p_blnIgnoreBlocked&&arr_blnState[0]&&blnBlocked==false)
{blnBlocked=true;setTimeout(fUnblock,intTimeoutToShow);}
blnIsOnMenu=arr_blnState[2];return[arr_blnState[1],blnBlocked];}
function fUnblock()
{blnBlocked=false;}
function int_fGetNextSeed()
{intSeed++;if(intSeed>1000000)
intSeed=0;return intSeed;}}
var g_objTranslator=new clsTranslator();function clsTranslator()
{var strId='Translator1';var objEventShooter;var objMenu;var intMaxMenuNodes=50;var objCurrentEvent=null;var blnShowFull=false;this.g_fInit=function()
{var objDiv=document.createElement('DIV');objDiv.id=strId;document.body.appendChild(objDiv);var hshArg=new Object();hshArg['strId']=strId+'_Menu';hshArg['strParentId']=strId;hshArg['intNodeWidth']=null;hshArg['intNodeHeight']=20;hshArg['zindex']=1000;hshArg['strMenuBorderStyle']='1px outset menu';hshArg['strRightColor']='white';hshArg['strLeftColor']='gainsboro';hshArg['strSelectLeftColor']='silver';hshArg['strSelectRightColor']='silver';hshArg['strNodeMenuBorderStyle']='1px outset menu';hshArg['strBreakerPicture']='breaker.gif';hshArg['strDisabledFontColor']='gray';var hshEvents=new Object();hshEvents['MenuClick']=fMenuClick;hshEvents['BuildMenu']=fBuildMenu;hshEvents['HideMenu']=fHideMenu;hshEvents['ShowMenu']=fShowMenu;var arr_intPositions=[9,8,6,7,3,4,2,1,5];objMenu=new clsLightMenu(hshArg,hshEvents,arr_intPositions,true,5);objMenu.g_fInit();objEventShooter=new clsNoClickEventShooter('EventShooter1',null,500,200,1000,false,objMenu.g_fOpen,objMenu.g_arr_fGetState,objMenu.g_fClose);objEventShooter.g_fStart();addEvent(window,'unload',fUninit);}
function fUninit()
{if(objEventShooter)objEventShooter.g_fUninit();if(objMenu)objMenu.g_fUninit();objCurrentEvent=null;removeEvent(window,'unload',fUninit);}
function fMenuClick(p_strNode)
{g_fDynaTranslate(p_strNode);}
function g_fDynaTranslate(p_strTag)
{var objData=new Object();objData['project']='CMCMain';objData['file']=cSYS.cLANG_PATH;objData['tag']=p_strTag;var hshRet=openDialog(cSYS.cLANG_TOOL_PATH+'forms/frmTagEdit.aspx',400,500,objData,'no');if(hshRet!=null)
{}}
function fBuildMenu(p_objEvent,p_objMenu)
{objCurrentEvent=p_objEvent;var hshResult=hshGetUntranslatedWords(p_objEvent['element']);for(var i=0;i<hshResult['list'].length&&(i<intMaxMenuNodes||blnShowFull);i++)
{p_objMenu.g_fInsert('root',hshResult['list'][i],[hshResult['list'][i]],'text');}
blnShowFull=false;}
function hshGetUntranslatedWords(p_objElement)
{var hshResult=new Object();hshResult['fullList']=true;hshResult['list']=new Array();var hshStringHolder=new Object();var intGotWords=int_fGetUntranslatedWordsFromNode(hshStringHolder,p_objElement,0);hshResult['fullList']=blnShowFull?true:intGotWords<=intMaxMenuNodes;for(var key in hshStringHolder)
{hshResult['list'].push(key);}
return hshResult;}
function int_fGetUntranslatedWordsFromNode(p_hshStringHolder,p_objNode,p_intGotWords)
{var intGotWords=p_intGotWords;if(!p_objNode)return intGotWords;var i;intGotWords=int_fGetUntranslatedWordsFromString(p_hshStringHolder,p_objNode.innerHTML,intGotWords);return intGotWords;}
function int_fGetUntranslatedWordsFromString(p_hshStringHolder,p_strTestedString,p_intGotWords)
{if(p_strTestedString==null)return p_intGotWords;var intGotWords=p_intGotWords;var arr=p_strTestedString.match(/\[([^\[\]]+)\]/g);if(!arr)return intGotWords;var substr='';for(var i=0;i<arr.length;i++)
{substr=arr[i].substring(1,arr[i].length-1);if(!p_hshStringHolder[substr])intGotWords++;p_hshStringHolder[substr]=intGotWords;if(!blnShowFull&&intGotWords>intMaxMenuNodes)return intGotWords;}
return intGotWords;}
function fHideMenu()
{}
function fShowMenu()
{}}
function g_fCreateFeedLink(p_objParent,p_strFeedURL,p_strTitle)
{p_objParent=g_obj_fElement(p_objParent);if(!p_objParent)
return;var objAdder=document.createElement('IMG');objAdder.src=cSYS.cIMAGE_PATH+'bcfeed.gif';objAdder.border=0;objAdder.style.verticalAlign='text-top';objAdder.style.cursor='pointer';objAdder.setAttribute('bclink',p_strFeedURL);objAdder.style.marginRight='2px';if(p_strTitle)
objAdder.setAttribute('bctitle',p_strTitle);p_objParent.insertBefore(objAdder,p_objParent.firstChild);addEvent(objAdder,'click',g_fAddFeedToDesktop);}
function g_fAddFeedToDesktop(p_objEvent)
{var objElement=getSrcElement(p_objEvent);var strTitle=objLang.g_str_fGetString('really_want_to_add_feed');var strMessage=objLang.g_str_fGetString('information');clsAlert.g_fPromptYesNo(strTitle,strMessage,null,fAddFeed,objElement);}
function fAddFeed(p_strArg,objElement)
{if(p_strArg=='yes')
{var strLink=objElement.getAttribute('bclink');if(!strLink)
return;var strTitle=objElement.getAttribute('bctitle');var strModuleName='clsFeedViewer'+Math.round(Math.random()*10000);var hshSettings={modules:{}};hshSettings['modules'][strModuleName]={container:'main',type:'clsFeedViewer',contargs:{col:'0',row:'-1'},settings:{items:'10',source:strLink,title:strTitle}};var strValue=g_str_fGetXmlFromObject(hshSettings,'root',10);var objResult=g_obj_fExecuteQuery('cmdSettingSet',{ITEM:'root',VALUE:strValue,PAGE:'default'},function(){});}}
function g_obj_fGetUserLink(p_strId,p_strFName,p_strLName,p_intStatus,p_strClassName)
{if(p_intStatus==2||p_intStatus==3)
{return document.createTextNode(p_strFName+' '+p_strLName);}
else
{var objReturn=document.createElement('A');objReturn.href='profile.aspx?uid='+p_strId;objReturn.className=p_strClassName;var objContent=document.createTextNode(p_strFName+' '+p_strLName);objReturn.appendChild(objContent);return objReturn;}}
function g_str_fGetUserLinkSource(p_strId,p_strFName,p_strLName,p_intStatus,p_strClassName)
{if(p_intStatus==2||p_intStatus==3)
{return g_str_fEscapeXmlEntities(p_strFName+' '+p_strLName);}
else
{var strSource='<a href="profile.aspx?uid='+p_strId+'" class="'+p_strClassName+'">'+g_str_fEscapeXmlEntities(p_strFName+' '+p_strLName)+'</a>';return strSource;}}
function g_obj_fGetUserLinkCustomContent(p_strId,p_objContent,p_intStatus,p_strClassName)
{if(p_intStatus==2||p_intStatus==3)
{return p_objContent;}
else
{var objReturn=document.createElement('A');objReturn.href='profile.aspx?uid='+p_strId;objReturn.className=p_strClassName;objReturn.appendChild(p_objContent);return objReturn;}}
function g_obj_fGetUserLinkCustomContentSource(p_strId,p_strContent,p_intStatus,p_strClassName)
{if(p_intStatus==2||p_intStatus==3)
{return p_strContent;}
else
{var strSource='<a href="profile.aspx?uid='+p_strId+'" class="'+p_strClassName+'">'+p_strContent+'</a>';return strSource;}}
function _config()
{addEvent(document,'contextmenu',_contextMenu);addEvent(document,'selectstart',_select);}
function _contextMenu(){return(true);}
function _select(){return(false);}
addEvent(window,'unload',g_fUninitShared);function g_fUninitShared(e)
{removeEvent(document,'contextmenu',_contextMenu);removeEvent(document,'selectstart',_select);removeEvent(window,'unload',g_fUninitShared);}
addEvent(document,'help',g_fStopEvent);function g_fApplicationStart()
{if(typeof g_objHistoryManager!='undefined'&&g_objHistoryManager!=null)
g_objHistoryManager.g_fStart();}
function _false(e)
{if(e.preventDefault)e.preventDefault();e.cancelBubble=true;return(false);}
function g_fReplaceBrowseButton(p_strId)
{if(document.getElementById(p_strId))
{var objParent=document.getElementById(p_strId).parentNode;document.getElementById(p_strId).className='file input';var objDiv=document.createElement('DIV');objDiv.className='fileinputs';objDiv.appendChild(document.getElementById(p_strId));objParent.appendChild(objDiv);var objFakeInput=document.createElement('INPUT');objFakeInput.type='text';objFakeInput.className='input fakeinput';objFakeInput.id=p_strId+'_fakeInput';objFakeInput.readOnly='readonly';objDiv.appendChild(objFakeInput);var objFakeBrowse=document.createElement('DIV');objFakeBrowse.className='fakebrowse';objFakeBrowse.id=p_strId+'_fakeBrowse';objFakeBrowse.innerHTML=objLang.g_str_fGetString('browse');objDiv.appendChild(objFakeBrowse);addEvent(document.getElementById(p_strId),'change',fChange);addEvent(document.getElementById(p_strId+'_fakeInput'),'focus',fSelectAll);document.getElementById(p_strId).value='';if(cIE)
{document.getElementById(p_strId+'_fakeBrowse').style.left=document.getElementById(p_strId).clientWidth+5+'px';document.getElementById(p_strId+'_fakeBrowse').style.top='1px';document.getElementById(p_strId+'_fakeInput').style.top='1px';document.getElementById(p_strId+'_fakeInput').style.width=document.getElementById(p_strId).clientWidth+'px';document.getElementById(p_strId+'_fakeInput').style.height=document.getElementById(p_strId).clientHeight+'px';}
else if(cFF)
{document.getElementById(p_strId+'_fakeBrowse').style.left=document.getElementById(p_strId).clientWidth-65+'px';document.getElementById(p_strId+'_fakeInput').style.width=document.getElementById(p_strId).clientWidth-68+'px';document.getElementById(p_strId+'_fakeInput').style.height=document.getElementById(p_strId).clientHeight-4+'px';}}
function fChange()
{document.getElementById(p_strId+'_fakeInput').value=document.getElementById(p_strId).value;}
function fSelectAll()
{document.getElementById(p_strId+'_fakeInput').select();}}
function g_obj_fGetSkypeImage(p_strSkypeUser)
{var cHIDE=false;if(cHIDE)
return'<img src="'+cSYS.cIMAGE_PATH+'16_empty.gif'+'">';else
{if(p_strSkypeUser&&p_strSkypeUser.length>0)
return'<a href="skype:'+p_strSkypeUser+'" onclick="return skypeCheck();"><img title="'+p_strSkypeUser+'" border="0" src="http://mystatus.skype.com/smallicon/'+p_strSkypeUser+'"></a>';else
return'<img src="'+cSYS.cIMAGE_PATH+'16_empty.gif'+'">';}}
function g_str_fGetSkypeImage(p_strSkypeUser)
{var cHIDE=false;if(cHIDE)
return cSYS.cIMAGE_PATH+'16_empty.gif';else
return'http://mystatus.skype.com/smallicon/'+p_strSkypeUser;}
function g_fSetMaxLength(p_objInput,p_intMaxLength)
{var newAttr=document.createAttribute("maxLength");newAttr.nodeValue=p_intMaxLength;p_objInput.setAttributeNode(newAttr);if(cFF)
{addEvent(p_objInput,'input',fPreventInput,p_objInput);addEvent(p_objInput,'dragdrop',fIEDelay);}
if(cIE)
{addEvent(p_objInput,'keydown',fPreventInput,p_objInput);addEvent(p_objInput,'drop',fIEDelay);addEvent(p_objInput,'paste',fIEDelay);}}
function fIEDelay(p_objEvent)
{var objTextArea=getSrcElement(p_objEvent);var objCaller=new clsFunctionCaller(fPreventInput,objTextArea,0);objCaller.g_fStartCounter();}
function fPreventInput()
{var intLength=this.value.length;if(parseInt(intLength)>parseInt(this.getAttribute('maxLength')))
{g_fSetValidationMessages(this,null,this.parentNode,'too_long',this.getAttribute('maxLength')+' '+objLang.g_str_fGetString('simbols_allowed'))}
else
{g_fRemoveValidationMessages(this);}}
function g_fSetMaxLengthWC(p_objInput,p_intMaxLength,p_fOnValidation,p_objCont)
{if(!p_objCont)
{g_fSetMaxLength(p_objInput,p_intMaxLength);}
p_objCont.blnValidTextArea=true;var newAttr=document.createAttribute("maxLength");newAttr.nodeValue=p_intMaxLength;p_objCont._objMaxLenghtInput=p_objInput;p_objCont._fMaxLenghtFunction=p_fOnValidation;p_objInput.setAttributeNode(newAttr);if(cFF)
{addEvent(p_objInput,'input',fPreventInputWC,p_objCont);addEvent(p_objInput,'dragdrop',fIEDelayWC,p_objCont);}
if(cIE)
{addEvent(p_objInput,'keydown',fPreventInputWC,p_objCont);addEvent(p_objInput,'drop',fIEDelayWC,p_objCont);addEvent(p_objInput,'paste',fIEDelayWC,p_objCont);}}
function fIEDelayWC(p_objEvent)
{p_objEvent=p_objEvent.event;var objTextArea=getSrcElement(p_objEvent);var objCaller=new clsFunctionCaller(fPreventInputWC,this,0);objCaller.g_fStartCounter();}
function fPreventInputWC()
{var objInput=this._objMaxLenghtInput;var objFunc=this._fMaxLenghtFunction;var intLength=objInput.value.length;if(parseInt(intLength)>parseInt(objInput.getAttribute('maxLength')))
{if(this.blnValidTextArea)
{g_fSetValidationMessages(objInput,null,objInput.parentNode,'too_long',objInput.getAttribute('maxLength')+' '+objLang.g_str_fGetString('simbols_allowed'))
this._fMaxLenghtFunction(false);this.blnValidTextArea=false;}}
else
{if(!this.blnValidTextArea)
{g_fRemoveValidationMessages(objInput);this._fMaxLenghtFunction(true);this.blnValidTextArea=true;}}}
function g_fLoadTinyMCE_GZ()
{tinyMCE_GZ.init({plugins:'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,imagemanager',themes:'simple,advanced',languages:objLang.g_str_fGetString('language_tag').toLowerCase(),disk_cache:true,debug:false});}
function g_fLoadMailTinyMCE(p_strParentId)
{tinyMCE.init({mode:"exact",elements:p_strParentId,theme:"advanced",language:objLang.g_str_fGetString('language_tag').toLowerCase(),theme_advanced_buttons1:"bold,italic,underline,fontselect,fontsizeselect,forecolor,separator,bullist,numlist,separator,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_resize_horizontal:true,theme_advanced_resizing:true,apply_source_formatting:true,entity_encoding:'raw',relative_urls:false,valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|"
+"onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|"
+"onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|"
+"name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,"
+"#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|"
+"src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,"
+"-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"
+"height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|"
+"height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,"
+"#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor"
+"|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,"
+"-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face"
+"|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],"
+"object[classid|width|height|codebase|id|*],param[name|value|_value],embed[type|width"
+"|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,"
+"button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|"
+"valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],"
+"input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],"
+"kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],"
+"q[cite],samp,select[disabled|multiple|name|size],small,"
+"textarea[cols|rows|disabled|name|readonly],tt,var,big"});}
function g_fLoadArticlesTinyMCE(p_strParentId,p_strFunction)
{tinyMCE.init({mode:"exact",elements:p_strParentId,theme:"advanced",language:objLang.g_str_fGetString('language_tag').toLowerCase(),plugins:"preview,insertdatetime,emotions,iespell,advhr,media,print,contextmenu,table",theme_advanced_buttons1:"bold,italic,underline,fontselect,fontsizeselect,formatselect,forecolor,backcolor,separator,bullist,numlist,separator,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator",theme_advanced_buttons2:"cut,copy,paste,separator,undo,redo,separator,anchor,image,code,separator,insertdate,inserttime,preview,separator,removeformat,separator,charmap,emotions,iespell,media,advhr,separator,print,separator,cleanup,separator,tablecontrols,table,row_props,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,row_after,row_before,split_cells,merge_cells,separator",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",plugin_insertdate_dateFormat:"%Y-%m-%d",plugin_insertdate_timeFormat:"%H:%M:%S",file_browser_callback:p_strFunction,theme_advanced_resize_horizontal:true,theme_advanced_resizing:true,apply_source_formatting:true,entity_encoding:'raw',relative_urls:false,valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|"
+"onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|"
+"onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|"
+"name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,"
+"#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|"
+"src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,"
+"-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"
+"height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|"
+"height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,"
+"#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor"
+"|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,"
+"-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face"
+"|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],"
+"object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width"
+"|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,"
+"button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|"
+"valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],"
+"input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],"
+"kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],"
+"q[cite],samp,select[disabled|multiple|name|size],small,"
+"textarea[cols|rows|disabled|name|readonly],tt,var,big"});}
function g_str_fParseTemplate(p_strTemplateString,p_hshContext)
{for(var strItem in p_hshContext)
{p_strTemplateString=p_strTemplateString.replace(new RegExp('\\${'+strItem+'}','g'),p_hshContext[strItem]);}
return p_strTemplateString;}
function clsBCServer(p_strServerUrl)
{var strServerUrl=p_strServerUrl;var strSid='';var strData='';var strSidElementId='bcSid';var fAsyncFunction=null;var arr_hshCommMetaData=new Array();this.g_fInsertCom=function(p_objCommand)
{arr_hshCommMetaData.push(p_objCommand.g_hsh_fGetMetaData());strData+=p_objCommand.g_str_fGetXml();return(arr_hshCommMetaData.length-1);}
this.g_obj_fSend=function(p_fAfterGetData,p_intPacketId)
{if(p_fAfterGetData!=null)
{fAsyncFunction=p_fAfterGetData;fAsyncCallServer(strServerUrl,str_fGetPacket(p_intPacketId),fAsyncResult);strData='';}
else
{var strAts=call2(strServerUrl,str_fGetPacket(p_intPacketId));strData='';return(obj_fGetResult(strAts));}}
var objXmlAsyncRequest=null;function fAsyncCallServer(p_strUrl,p_strData,fReturnFunction)
{var strPageUrl=p_strUrl+"?call=true";if(window.XMLHttpRequest)
{objXmlAsyncRequest=new XMLHttpRequest();objXmlAsyncRequest.onreadystatechange=fReturnFunction;objXmlAsyncRequest.open("POST",strPageUrl,true);objXmlAsyncRequest.send(p_strData);}
else if(window.ActiveXObject)
{objXmlAsyncRequest=new ActiveXObject("Microsoft.XMLHTTP")
if(objXmlAsyncRequest)
{objXmlAsyncRequest.onreadystatechange=fReturnFunction;objXmlAsyncRequest.open("POST",strPageUrl,true);objXmlAsyncRequest.send(p_strData);}}}
function fAsyncResult()
{try
{if(objXmlAsyncRequest.readyState==4)
{if(objXmlAsyncRequest.status==200)
{fAsyncFunction(obj_fGetResult(objXmlAsyncRequest.responseText));}
else
{}}}
catch(objException)
{console('clsBCServer.js fAsyncResult Exception');console(objException);if(g_objLoadingIndicator&&g_objLoadingIndicator.g_fHide)
g_objLoadingIndicator.g_fHide();}}
function obj_fGetResult(p_strAts)
{var objXml=getXml(p_strAts);if(objXml==null)return(null);var objTemp=objXml.getElementsByTagName('PACKET')[0];var objResult=new clsResponse(objTemp.getAttribute('XML_STATUS'),objTemp.getAttribute('SID_STATUS'),objTemp.getAttribute('ID'));var arr_objTemp=objXml.getElementsByTagName('COMMAND');for(var i=0;i<arr_objTemp.length;i++)
{var arr_objTemp2=getChildren(arr_objTemp[i]);var arr_strTags=new Array();var arr_strValues=new Array();for(var j=0;j<arr_objTemp2.length;j++)
{arr_strTags.push(arr_objTemp2[j].tagName);var strValue='';if(arr_objTemp2[j].firstChild!=null)
strValue=arr_objTemp2[j].firstChild.nodeValue;if(arr_objTemp2[j].getAttribute('encoded')=='true')
strValue=decode(strValue);arr_strValues.push(strValue);}
arr_strTags.push('COMMAND_TYPE');arr_strValues.push(arr_hshCommMetaData[i]['strType']);objResult.g_fInsertServerResponse(arr_strTags,arr_strValues);}
arr_hshCommMetaData=new Array();return(objResult);}
function str_fGetPacket(p_strId)
{if(p_strId==null)p_strId='';return('<?xml version="1.0" encoding="utf-8" ?><PACKET SID="'+strSid+'" ID="'+p_strId+'">'+strData+'</PACKET>');}
function fGetSid()
{strSid=cSAK;}
fGetSid();}
function clsResponse(p_strXmlStatus,p_strSidStatus,p_strId)
{this.g_strId=p_strId;this.g_strXmlStatus=p_strXmlStatus;this.g_strSidStatus=p_strSidStatus;this.arr_objItems=new Array();this.g_intLength=0;this.g_fInsertServerResponse=function(p_arr_strNames,p_arr_strValues)
{var objProps=new Object();for(var i=0;i<p_arr_strNames.length;i++)
{objProps[p_arr_strNames[i]]=p_arr_strValues[i];}
this.arr_objItems.push(objProps);this.g_intLength++;}
this.getValue=function(p_intItem,p_strProperty)
{var strRet=this.arr_objItems[p_intItem][p_strProperty];var objDate=new Date();var strRetold=strRet;var objDate2=new Date();var intSkirtumas=objDate2-objDate;if(intSkirtumas>1000)
consoleA(intSkirtumas+', ilgai uztrukom clsBCserver getValue metode...');return(strRet);}}
function clsBCCommand(p_strType)
{var strConnectionId='';var strRawConnectionId='';var strDataItems='';var strType=p_strType;var strLogInformation='';this.g_hsh_fGetMetaData=function()
{var hshMetaData=new Object();hshMetaData['strConnectionId']=strRawConnectionId;hshMetaData['strType']=strType;return(hshMetaData);}
this.g_str_fGetXml=function()
{var strTemp='\n'+strConnectionId+'\n'+str_fMakeTag('COMMAND_TYPE',strType,true)+'\n'+strLogInformation+'\n';strTemp+=str_fMakeTag('DATA',strDataItems);strTemp=str_fMakeTag('COMMAND',strTemp);return(strTemp);}
this.g_fInsert=function(p_strName,p_strValue)
{var strTemp=str_fMakeTag('NAME',p_strName,true)+str_fMakeTag('VALUE',p_strValue,true);strTemp=str_fMakeTag('DATA_ITEM',strTemp);strDataItems+='\n'+strTemp;}
this.g_fSetConn=function(p_strConnectionId)
{strRawConnectionId=p_strConnectionId;strConnectionId=str_fMakeTag('CONNECTION_ID',p_strConnectionId,true);}
this.g_fSetLogInfo=function(p_strLogAction,p_strLogDescription)
{var strTemp=str_fMakeTag('ACTION',p_strLogAction,true);strTemp+=str_fMakeTag('DESCRIPTION',p_strLogDescription,true);strLogInformation=str_fMakeTag('LOG_INFO',strTemp);}
function str_fMakeTag(p_strTagName,p_strValue,p_blnIsCDATA)
{var strEncode='';if(p_blnIsCDATA)
{if(p_strValue.indexOf(']]>')>-1)
{p_strValue=encode(p_strValue);strEncode=' encode="true" ';}
p_strValue='<![CDATA['+p_strValue+']]>';}
return('<'+p_strTagName+strEncode+'>'+p_strValue+'</'+p_strTagName+'>');}}
function g_obj_fConnectionTest(p_strServer,p_strConnectionType,p_strConnectionString)
{var objAts=new Object();g_objConn=new clsBCServer(p_strServer);var objCBegin=new clsBCCommand('cmdStartConnection');objCBegin.g_fInsert('DATA_SOURCE',p_strConnectionType);objCBegin.g_fInsert('CONNECTION_STRING',p_strConnectionString);objCBegin.g_fInsert('MODE','SIMPLE');objCBegin.g_fSetConn('connectionTest');var objCEnd=new clsBCCommand('cmdEndConnection');objCEnd.g_fSetConn('connectionTest');g_objConn.g_fInsertCom(objCBegin);g_objConn.g_fInsertCom(objCSelect);g_objConn.g_fInsertCom(objCEnd);objResult=g_objConn.g_obj_fSend();if(objResult.g_strXmlStatus=='XmlOk')
{if(objResult.g_strSidStatus=='SidOk')
{for(var i=0;i<objResult.g_intLength;i++)
{if(i!=1&&objResult.getValue(i,'STATUS')=='error')
{objAts['error']=objResult.getValue(i,'ERROR_MESSAGE');objAts['status']=false;}
if(i==1&&objResult.getValue(i,'STATUS')=='ok')
{var objXml=getXml(objResult.getValue(i,'RET_VAL'));objAts['version']=getChildren(objXml.getElementsByTagName('Table')[0])[0].firstChild.nodeValue;objAts['database']=getChildren(objXml.getElementsByTagName('Table')[0])[1].firstChild.nodeValue;}
else if(i==1&&objResult.getValue(i,'STATUS')=='error')
{objAts['version']='error';objAts['database']='error';}}
if(objAts['error']==null)
{objAts['status']=true;}}
else
{objAts['error']='SidError';objAts['status']=false;}}
else
{objAts['error']='xmlError';objAts['status']=false;}
return(objAts);}
addEvent(window,'load',g_fOnLoadInitTranslator);function g_fOnLoadInitTranslator()
{if(cUSER&&cUSER=='lang'&&g_objTranslator)
g_objTranslator.g_fInit();}
function g_fBCExport(p_strType,p_strPrefix,p_strData)
{var g_objConn=new clsBCServer(cSYS.cSERVER);var objExport=new clsBCCommand('EXPORT');objExport.g_fInsert('ACTION',p_strType);objExport.g_fInsert('PREFIX',p_strPrefix);objExport.g_fInsert('DATA',p_strData);objExport.g_fSetLogInfo(objLang.g_str_fGetString('exporting_data'),objLang.g_str_fGetString('export_type')+': '+p_strPrefix);g_objConn.g_fInsertCom(objExport);objResult=g_objConn.g_obj_fSend();if(objResult.g_strXmlStatus=='XmlOk')
{if(objResult.g_strSidStatus=='SidOk')
{if(objResult.getValue(0,'STATUS')=='ok')
{g_fDownloadAttachment(objResult.getValue(0,'RET_VAL'));}
else
{consoleA('Klaida exportuojant duomenis: '+objResult.getValue(0,'ERROR_MESSAGE'));}}}}
function g_fDownloadAttachment(strFileName,p_strIndex)
{var strURL='proxy.file?src=ca&fn='+encode(strFileName)+'&d=1';if(p_strIndex==null)
p_strIndex='';if(cIE)
{var res=openWindow(cSYS.cABS_VIRTUAL_PATH+'frmDownloader.aspx?url='+encode(strURL),300,150,null,null,'_blank');}
if(cFF)
{var objMainWind=g_obj_fGetMainWindow();if(!objMainWind)
objMainWind=window;if(objMainWind.opener&&!objMainWind.opener.closed&&typeof(objMainWind.opener.g_fDownloadAttachment)=='function')
{objMainWind.opener.g_fDownloadAttachment(strFileName,p_strIndex);}
else
{var objDArea=document.getElementById('downloadableUniqueArea'+p_strIndex);if(objDArea==null)
{objDArea=document.createElement('IFRAME');objDArea.id='downloadableUniqueArea';objDArea.style.display='none';document.body.appendChild(objDArea);}
objDArea.src=strURL;}}}
function clsLiveConnector(p_strId,p_strServerUrl,p_intTickInterval,p_blnAsinkro)
{var objThis=this;var strId=p_strId;this.g_strId=strId;var blnAsinkro=p_blnAsinkro;var strServerUrl=p_strServerUrl;var objInterval=null;var intInterval=p_intTickInterval;var arr_hshCalls=new Array();var intCurrentTick=0;function fInit()
{objInterval=window.setInterval(fTickEvent,intInterval);}
fInit();function fUnInit()
{clearInterval(objInterval);}
this.g_fSetInterval=function(p_intInteval)
{fUnInit();intInterval=p_intInteval;fInit();}
function fTickEvent()
{for(var i=0;i<arr_hshCalls.length;i++)
{var hshCall=arr_hshCalls[i];if(intCurrentTick%hshCall['timeout']==0)
{if(hshCall['tickcount']!=null)
{if(hshCall['tickcount']>0)hshCall['tickcount']=hshCall['tickcount']-1;else
{objThis.g_fRemoveCall(hshCall['name']);continue;}}
if(hshCall['onbeforecall']!=null)
{var hshEvent=new Object();hshEvent['object']=objThis;hshEvent['call']=hshCall;if(hshCall['object']!=null)
hshCall['onbeforecall'].apply(hshCall['object'],[hshEvent]);else
hshCall['onbeforecall'](hshEvent);}
fRegisterCommands(hshCall);}}
intCurrentTick++;fCallServer();}
this.g_int_fGetCurrentTick=function(){return(intCurrentTick);}
this.g_fRegisterCall=function(p_strName,p_arr_objCommands,p_intTimeout,p_fOnBeforeCall,p_fOnCall,p_objInstance,p_blnCallNow,p_intTickCount)
{var hshCall=new Object();hshCall['name']=p_strName;hshCall['commands']=p_arr_objCommands;hshCall['timeout']=int_fGetTimeInTicks(p_intTimeout);hshCall['oncall']=p_fOnCall;hshCall['onbeforecall']=p_fOnBeforeCall;hshCall['object']=p_objInstance;hshCall['tickcount']=p_intTickCount;arr_hshCalls.push(hshCall);if(p_blnCallNow)
{fRegisterCommands(hshCall);fCallServer();}}
function int_fGetTimeInTicks(p_intMillis)
{if(/^\d+[t]$/.test(p_intMillis))
return(parseInt(p_intMillis.replace('t','')));else
return(Math.round(p_intMillis/intInterval));}
this.g_fRemoveCall=function(p_strName)
{var intIndex=int_fFindCallIndex(p_strName);if(intIndex>-1)
{arr_hshCalls.splice(intIndex,1);}}
function int_fFindCallIndex(p_strName)
{for(var i=0;i<arr_hshCalls.length;i++)
{if(arr_hshCalls[i]['name']==p_strName)
{return(i);}}
return(-1);}
this.g_hsh_fGetCall=function(p_strName)
{var intIndex=int_fFindCallIndex(p_strName);if(intIndex>0)
{return(arr_hshCalls[intIndex]);}
return(null);}
var arr_hshEilesTvarka=new Array();var arr_objPacket=new Array();var hshDataCache=new Object();function fRegisterCommands(p_hshCall)
{var hshCall=new Object();hshCall['name']=p_hshCall['name'];hshCall['start']=arr_objPacket.length;hshCall['count']=p_hshCall['commands'].length;hshCall['call']=p_hshCall;arr_hshEilesTvarka.push(hshCall);for(var i=0;i<p_hshCall['commands'].length;i++)
{arr_objPacket.push(p_hshCall['commands'][i]);}}
var intUni=0;function fCallServer()
{if(arr_objPacket.length>0)
{var intUniqueId=intUni;intUni++;hshDataCache[intUniqueId+'t']=g_obj_fClone(arr_hshEilesTvarka);hshDataCache[intUniqueId+'p']=g_obj_fClone(arr_objPacket);var objConn=new clsBCServer(strServerUrl);for(var i=0;i<arr_objPacket.length;i++)
{objConn.g_fInsertCom(arr_objPacket[i]);}
if(blnAsinkro)
{objConn.g_obj_fSend(fPriimtiRezultatus,intUniqueId);}
else
{var objResult=objConn.g_obj_fSend(null,intUniqueId);fPriimtiRezultatus(objResult);}
arr_hshEilesTvarka=new Array();arr_objPacket=new Array();}}
function fPriimtiRezultatus(p_objResult)
{if(p_objResult==null)return;if(p_objResult.g_strXmlStatus=='XmlOk')
{if(p_objResult.g_strSidStatus=='SidOk')
{var strUniqueId=p_objResult.g_strId;for(var i=0;i<p_objResult.g_intLength;i++)
{hshDataCache[strUniqueId+'p'][i]['RET_VAL']=p_objResult.getValue(i,'RET_VAL');hshDataCache[strUniqueId+'p'][i]['STATUS']=p_objResult.getValue(i,'STATUS');if(p_objResult.getValue(i,'STATUS')=='error')
{hshDataCache[strUniqueId+'p'][i]['ERROR_MESSAGE']=p_objResult.getValue(i,'ERROR_MESSAGE');}}
fPateiktiAtsakyma(strUniqueId);}
else{o('Netaisingas Security Id');}}
else{o('Neteisinga Xml paketo struktūra');}}
function fPateiktiAtsakyma(p_strId)
{var arr_hshTvarka=hshDataCache[p_strId+'t'];var arr_objKomandos=hshDataCache[p_strId+'p'];for(var i=0;i<arr_hshTvarka.length;i++)
{var hshMeta=arr_hshTvarka[i];var hshCall=hshMeta['call'];var arr_hshData=new Array();for(var j=hshMeta['start'];j<hshMeta['start']+hshMeta['count'];j++)
{var objCommand=arr_objKomandos[j];arr_hshData.push(objCommand)}
if(hshCall['oncall']!=null)
{try
{var hshEvent=new Object();hshEvent['object']=objThis;hshEvent['data']=arr_hshData;if(hshCall['object']!=null)
hshCall['oncall'].apply(hshCall['object'],[hshEvent]);else
{hshCall['oncall'](hshEvent);}}
catch(Exception)
{}}}
hshTemp[p_strId+'t']=null;hshTemp[p_strId+'p']=null;}}
function g_hsh_fCallWebService(p_strUrl,p_hshParams,p_fAfterDataArrived,p_strUser,p_strPassword)
{if(p_hshParams==null)p_hshParams=new Object();var strParams='';for(var strKey in p_hshParams)
{strParams+=strKey+'='+p_hshParams[strKey]+'&';}
strParams=strParams.substr(0,strParams.length-1)
var objXmlCall;if(window.XMLHttpRequest)
{try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");}catch(e){}
objXmlCall=new XMLHttpRequest();if(p_fAfterDataArrived)
{objXmlCall.open("POST",p_strUrl,true,p_strUser,p_strPassword);objXmlCall.onreadystatechange=function()
{if(objXmlCall.readyState==4)
{p_fAfterDataArrived(objXmlCall.responseText);}}
objXmlCall.setRequestHeader('Content-Type','application/x-www-form-urlencoded');objXmlCall.setRequestHeader('Content-Length',strParams.length);objXmlCall.send(strParams);}
else
{try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");}catch(e){}
objXmlCall.open("POST",p_strUrl,false,p_strUser,p_strPassword);objXmlCall.setRequestHeader('Content-Type','application/x-www-form-urlencoded');objXmlCall.setRequestHeader('Content-Length',strParams.length);objXmlCall.send(strParams);return(objXmlCall.responseText);}}
else
if(window.ActiveXObject)
{objXmlCall=new ActiveXObject("Microsoft.XMLHTTP");if(p_fAfterDataArrived)
{objXmlCall.open("POST",p_strUrl,true,p_strUser,p_strPassword);objXmlCall.onreadystatechange=function()
{if(objXmlCall.readyState==4)
{p_fAfterDataArrived(objXmlCall.responseText);}}
objXmlCall.setRequestHeader('Content-Type','application/x-www-form-urlencoded');objXmlCall.setRequestHeader('Content-Length',strParams.length);objXmlCall.send(strParams);}
else
{objXmlCall.open("POST",p_strUrl,false,p_strUser,p_strPassword);objXmlCall.setRequestHeader('Content-Type','application/x-www-form-urlencoded');objXmlCall.setRequestHeader('Content-Length',strParams.length);objXmlCall.send(strParams);return(objXmlCall.responseText);}}}
function g_obj_fExecuteCommand(p_strCommandName,p_hshCommandArgs,p_fFunction,p_objContext,p_blnDBContext)
{var g_objConn=new clsBCServer(cSYS.cSERVER);var objCommand=new clsBCCommand(p_strCommandName);if(p_blnDBContext)
{objCommand.g_fInsert('CONNECTION_STRING','[confDbString]');objCommand.g_fInsert('MODE','SIMPLE');}
for(strKey in p_hshCommandArgs)
{objCommand.g_fInsert(strKey,''+p_hshCommandArgs[strKey]);}
g_objConn.g_fInsertCom(objCommand);if(typeof(p_fFunction)=='function')
{var objCaller={};objCaller.fFunction=p_fFunction;objCaller.objContext=p_objContext;objCaller.fAsyncCallerFunction=fAsyncCallerFunction;g_objConn.g_obj_fSend(objCaller.fAsyncCallerFunction.closure(objCaller));g_objLoadingIndicator.g_fShow();}
else
{g_objLoadingIndicator.g_fShow();var objResult=g_objConn.g_obj_fSend();g_objLoadingIndicator.g_fHide();if(objResult.g_strXmlStatus=='XmlOk'&&objResult.g_strSidStatus=='SidOk')
return objResult;else
return null;}}
function g_obj_fExecuteQuery(p_strCommandName,p_hshCommandArgs,p_fFunction,p_objContext)
{return g_obj_fExecuteCommand(p_strCommandName,p_hshCommandArgs,p_fFunction,p_objContext,true);}
function g_obj_fExecuteCommandAsync(p_strCommandName,p_hshCommandArgs,p_blnDBContext)
{return g_obj_fExecuteCommand(p_strCommandName,p_hshCommandArgs,function(){},null,p_blnDBContext)}
function g_obj_fExecuteQueryAsync(p_strCommandName,p_hshCommandArgs)
{return g_obj_fExecuteCommand(p_strCommandName,p_hshCommandArgs,function(){},null,true);}
function fAsyncCallerFunction(p_objResult)
{g_objLoadingIndicator.g_fHide();if(p_objResult.g_strXmlStatus!='XmlOk'||p_objResult.g_strSidStatus!='SidOk')
p_objResult=null;this.fFunction.apply(this.objContext,[p_objResult]);}
var g_objLoadingIndicator={};g_objLoadingIndicator.blnToHide=false;g_objLoadingIndicator.blnEnabled=true;g_objLoadingIndicator.g_fShow=function()
{if(!this.blnEnabled)
return;if(!this.blnVisible)
{if(this.objElement)
{this.objElement.style.display='';}
else
{this.objElement=document.createElement('DIV');this.objElement.className='loadingIndicator';if(cIE&&!cIE7)
{this.objElement.style.position='absolute';this.fMoveBox();}
this.objElement.innerHTML=objLang.g_str_fGetString('loading_indicator');document.body.appendChild(this.objElement);}
if(cIE&&!cIE7)
{addEvent(window,'scroll',this.fMoveBox,this);}}
this.blnToHide=false;this.blnVisible=true;}
g_objLoadingIndicator.g_fHide=function()
{if(this.objCaller)
this.objCaller.g_fCancel();this.blnToHide=true;this.objCaller=new clsFunctionCaller(this.fHideActions,this,2000);this.objCaller.g_fStartCounter();}
g_objLoadingIndicator.fHideActions=function()
{this.objCaller=null;if(this.blnToHide)
if(this.objElement)
{this.objElement.style.display='none';this.blnVisible=false;if(cIE&&!cIE7)
{removeEvent(window,'scroll',this.fMoveBox,this);}}}
g_objLoadingIndicator.fMoveBox=function()
{if(this.blnVisible)
this.objElement.style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-24)+'px';}
var hsh_objContainers={};var arr_objModules=[];var objTheme='';var hsh_arrModuleRegistration={};hsh_arrModuleRegistration['basic']=new Array();hsh_arrModuleRegistration['news']=new Array();hsh_arrModuleRegistration['tools']=new Array();hsh_arrModuleRegistration['sport']=new Array();hsh_arrModuleRegistration['entertainment']=new Array();hsh_arrModuleRegistration['applications']=new Array();hsh_arrModuleRegistration['finance']=new Array();hsh_arrModuleRegistration['health']=new Array();var hshModuleConstructors={};var blnApplicationLoaded=false;function g_fApplicationLoad()
{if(blnApplicationLoaded)
return;blnApplicationLoaded=true;if(typeof(cUSER_SETTINGS)=='undefined')
cUSER_SETTINGS={};g_fLoadSettings(cUSER_SETTINGS);if(typeof clsTheme!='undefined')
objTheme=new clsTheme(g_objSettings.g_obj_fGetSetting('theme'));if(typeof clsWidget!='undefined')
{var arrContainersEl=g_arr_obj_fGetElementsByClassName(document,'div','modContainer');for(var i=0,intLength=arrContainersEl.length;i<intLength;i++)
{hsh_objContainers[arrContainersEl[i].id]=g_objContainerFactory.g_obj_fGetContainer(arrContainersEl[i],arrContainersEl[i].id);}
var hshContainers=g_objSettings.g_obj_fGetSetting('containers');if(hshContainers!=null)
{for(var strContainerKey in hshContainers)
{fCreateContainer(strContainerKey,hshContainers);}}
g_fCheckCommonWidgets();var hshModules=g_objSettings.g_obj_fGetSetting('modules');for(var strKey in hshModules)
{var objWidget=g_objWidgetFactory.g_obj_fGetWidget('modules_'+strKey);if(objWidget)
arr_objModules.push(objWidget);}
for(var strKey in hsh_objContainers)
{hsh_objContainers[strKey].g_fRefresh();}}
if(document.compatMode!='CSS1Compat')
console(document.compatMode);}
function fCreateContainer(p_strKey,hshContainersInfo)
{if(hsh_objContainers[p_strKey]!=null)
return;var hshMyInfo=hshContainersInfo[p_strKey];if(hshMyInfo['parent']!=null)
{fCreateContainer(hshMyInfo['parent'],hshContainersInfo);if(hsh_objContainers[hshMyInfo['parent']]!=null)
{var objElement=hsh_objContainers[hshMyInfo['parent']].g_obj_fGetItem(hshMyInfo['contargs']);hsh_objContainers[p_strKey]=g_objContainerFactory.g_obj_fGetContainer(objElement,'containers_'+p_strKey);}}}
function g_fCheckCommonWidgets()
{if(hsh_objContainers['staticC']==null)
return;hshCommonModule=g_objSettings.g_obj_fGetSetting('modules_contcounter');if(hshCommonModule==null)
{g_objSettings.g_fSetSetting('modules_contcounter',{container:'staticC',contargs:{col:0,row:0},state:'static',type:'clsContactsCounter'});}
var hshCommonModule=g_objSettings.g_obj_fGetSetting('modules_widgetadder');if(hshCommonModule==null)
{g_objSettings.g_fSetSetting('modules_widgetadder',{container:'staticC',contargs:{col:0,row:1},state:'static',type:'widgetadder'});}
hshCommonModule=g_objSettings.g_obj_fGetSetting('modules_clsquickinvite');if(hshCommonModule==null)
{g_objSettings.g_fSetSetting('modules_clsquickinvite',{container:'staticC',contargs:{col:0,row:2},state:'static',type:'clsQuickInvite'});}}
addEvent(window,'load',g_fApplicationLoad);function clsFormat()
{var objDateTimeFormat=new clsDateTimeFormat();var objNumberFormat=new clsNumberFormat();this.g_str_fFormat=function(p_objObject,p_strFormat,p_strType)
{var strAts='';switch(p_strType)
{case'date':try
{strAts=objDateTimeFormat.g_str_fFormat(p_objObject,p_strFormat);}
catch(ex)
{strAts=p_objObject;}
break;case'number':try
{strAts=objNumberFormat.g_str_fFormat(p_objObject,p_strFormat);break;}
catch(ex)
{strAts=p_objObject;}
break;case'general':strAts=p_objObject;break;}
return(strAts);}}
function g_str_fApplyFormat(p_strFormat,p_strDelimiter,p_strEmptyDelimiter,p_strText)
{var arr_strDalys=p_strText.split(p_strDelimiter);var intDalis=0;var intDaliesKuris=0;var strFormattedString='';var strFormatuotaDalis='';for(var i=0;i<p_strFormat.length;i++)
{if(p_strFormat.charAt(i)==p_strDelimiter)
{intDalis++;intDaliesKuris=0;strFormattedString+=strFormatuotaDalis+p_strDelimiter;strFormatuotaDalis='';}
else
if(arr_strDalys[intDalis].length>intDaliesKuris)
{strFormatuotaDalis+=arr_strDalys[intDalis].charAt(intDaliesKuris);intDaliesKuris++;}
else
{if(p_strFormat.charAt(i)=='s')
{strFormatuotaDalis=p_strEmptyDelimiter+strFormatuotaDalis;}
else if(p_strFormat.charAt(i)=='c')
{strFormatuotaDalis+=p_strEmptyDelimiter;}}}
strFormattedString+=strFormatuotaDalis;return(strFormattedString);}
function clsDateTimeFormat()
{this.cMONTHS=['January','February','March','April','May','June','July','August','September','October','November','December'];this.cDAYS=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];this.cSUFFIXES=['st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'];this.g_str_fFormat=function(p_objDate,p_strFormat)
{var formatted=(p_strFormat!=null)?p_strFormat:'dd-mm-yy';var letters='dMyHDhmst'.split('');var temp=new Array();var count=0;var regexA;var regexB=/\[(\d+)\]/;var day=p_objDate.getDay();var date=p_objDate.getDate();var month=p_objDate.getMonth();var year=p_objDate.getFullYear().toString();var hours=p_objDate.getHours();var minutes=p_objDate.getMinutes();var seconds=p_objDate.getSeconds();var formats=new Object();formats['d']=date;formats['D']=date+this.cSUFFIXES[date-1];formats['dd']=(date<10)?'0'+date:date;formats['ddd']=this.cDAYS[day].substring(0,3);formats['dddd']=this.cDAYS[day];formats['M']=month+1;formats['MM']=g_str_fApplyFormat('ss','@','0',''+(month+1));formats['MMM']=this.cMONTHS[month].substring(0,3);formats['MMMM']=this.cMONTHS[month];formats['y']=(year.charAt(2)=='0')?year.charAt(3):year.substring(2,4);formats['yy']=year.substring(2,4);formats['yyyy']=g_str_fApplyFormat('ssss','@','0',year);formats['H']=hours;formats['HH']=g_str_fApplyFormat('ss','@','0',''+hours);formats['h']=(hours>12||hours==0)?Math.abs(hours-12):hours;formats['hh']=g_str_fApplyFormat('ss','@','0',''+formats['h']);formats['m']=minutes;formats['mm']=g_str_fApplyFormat('ss','@','0',''+minutes);formats['s']=seconds;formats['ss']=g_str_fApplyFormat('ss','@','0',''+seconds);formats['t']=(hours<12)?'A':'P';formats['tt']=(hours<12)?'AM':'PM';for(var i=0;i<letters.length;i++)
{regexA=new RegExp('('+letters[i]+'+)');while(regexA.test(formatted))
{temp[count]=RegExp.$1;formatted=formatted.replace(RegExp.$1,'['+count+']');count++;}}
while(regexB.test(formatted))
{formatted=formatted.replace(regexB,formats[temp[RegExp.$1]]);}
return formatted;}}
function clsNumberFormat()
{function clsFormatting()
{var intValue='0'
this.g_fFormatIt=function(p_intNumber,p_strFormat)
{intValue=p_intNumber;return(this.createNewFormat(p_strFormat));}
this.createNewFormat=function(format)
{var code='';var formats=format.split(";");switch(formats.length)
{case 1:code+=this.createTerminalFormat(format);break;case 2:if(intValue<0)
{code+=this.createTerminalFormat(formats[1]);}
else
{code+=this.createTerminalFormat(formats[0]);}
break;case 3:if(intValue<0)
{code+=this.createNewFormat(this.escape(formats[1]));}
if(intValue==0)
{code+=this.createNewFormat(this.escape(formats[2]));}
if(intValue>0)
{code+=this.createNewFormat(this.escape(formats[0]));}
break;default:code+="throw 'Too many semicolons in format string';";break;}
return(code);}
this.createTerminalFormat=function(format)
{if(format.length>0&&format.search(/[0#?]/)==-1)
{return"return '"+this.escape(format)+"';\n";}
var code="var val = new Number(Math.abs("+intValue+"));\n";var thousands=false;var lodp=format;var rodp="";var ldigits=0;var rdigits=0;var scidigits=0;var scishowsign=false;var sciletter="";m=format.match(/\..*(e)([+-]?)(0+)/i);if(m)
{sciletter=m[1];scishowsign=(m[2]=="+");scidigits=m[3].length;format=format.replace(/(e)([+-]?)(0+)/i,"");}
var m=format.match(/^([^.]*)\.(.*)$/);if(m)
{lodp=m[1].replace(/\./g,"");rodp=m[2].replace(/\./g,"");}
if(format.indexOf('%')>=0)
{code+="val *= 100;\n";}
m=lodp.match(/(,+)(?:$|[^0#?,])/);if(m)
{code+="val /= "+Math.pow(1000,m[1].length)+"\n;";}
if(lodp.search(/[0#?],[0#?]/)>=0)
{thousands=true;}
if((m)||thousands)
{lodp=lodp.replace(/,/g,"");}
m=lodp.match(/0[0#?]*/);if(m)
{ldigits=m[0].length;}
m=rodp.match(/[0#?]*/);if(m)
{rdigits=m[0].length;rdigits=this.g_intCountRDigits(intValue,rodp);}
if(scidigits>0)
{code+="var sci = objNumberF.toScientific(val,"
+ldigits+", "+rdigits+", "+scidigits+", "+scishowsign+");\n"
+"var arr = [sci.l, sci.r];\n";}
else
{if(format.indexOf('.')<0)
{code+="val = (val > 0) ? Math.ceil(val) : Math.floor(val);\n";}
code+=" var strTemp = objNumberF.round(val,"+rdigits+");\n";code+=" var arr = strTemp.toFixed("+rdigits+").split('.');";code+="arr[0] = (val < 0 ? '-' : '') + objNumberF.leftPad((val < 0 ? arr[0].substring(1) : arr[0]), "+ldigits+", '0');\n";}
if(thousands)
{code+="arr[0] = objNumberF.addSeparators(arr[0]);\n";}
code+="arr[0] = objNumberF.injectIntoFormat(arr[0].reverse(), '"+this.escape(lodp.reverse())+"', true).reverse();\n";if(rdigits>0)
{code+="arr[1] = objNumberF.injectIntoFormat(arr[1], '"+this.escape(rodp)+"', false);\n";}
if(scidigits>0)
{code+="arr[1] = arr[1].replace(/(\\d{"+rdigits+"})/, '$1"+sciletter+"' + sci.s);\n";}
return code+"strAtsakymas = (arr.join('.'));\n";}
this.toScientific=function(val,ldigits,rdigits,scidigits,showsign)
{var result={l:"",r:"",s:""};var ex="";var before=Math.abs(val).toFixed(ldigits+rdigits+1).trim('0');var after=Math.round(new Number(before.replace(".","").replace(new RegExp("(\\d{"+(ldigits+rdigits)+"})(.*)"),"$1.$2"))).toFixed(0);if(after.length>=ldigits)
{after=after.substring(0,ldigits)+"."+after.substring(ldigits);}
else
{after+='.';}
result.s=(before.indexOf(".")-before.search(/[1-9]/))-after.indexOf(".");if(result.s<0)
{result.s++;}
result.l=(val<0?'-':'')+String.leftPad(after.substring(0,after.indexOf(".")),ldigits,"0");result.r=after.substring(after.indexOf(".")+1);if(result.s<0){ex="-";}
else if(showsign){ex="+";}
result.s=ex+String.leftPad(Math.abs(result.s).toFixed(0),scidigits,"0");return result;}
this.injectIntoFormat=function(val,format,stuffExtras)
{var i=0;var j=0;var result="";while(i<format.length&&j<val.length&&format.substring(i).search(/[0#?]/)>=0)
{if(format.charAt(i).match(/[0#?]/))
{if(val.charAt(j)!='-')
{result+=val.charAt(j);}
else
{result+='0';}
j++;}
else
{result+=format.charAt(i);}
++i;}
if(j<val.length&&(stuffExtras||val.substring(j)=='-'))
{result+=val.substring(j);}
if(i<format.length)
{result+=format.substring(i);}
result=result.replace(/#/g,"").replace(/\?/g," ");return(result);}
this.g_intCountRDigits=function(p_intValue,p_strFormat)
{var arrInt=(p_intValue+'').split('.');if(arrInt.length>1)
{var intRInt=(arrInt[1]+'').length;var intFInt=p_strFormat.length;var arrMatch=p_strFormat.match(/[0]/g);if(arrMatch)
var intZeros=arrMatch.length;else
var intZeros=0;var intAts=Math.max(Math.min(intRInt,intFInt),intZeros-1);return(intAts);}
else
{return(0);}}
this.addSeparators=function(val)
{return val.reverse().replace(/(\d{3})/g,'$1,').reverse().trim(',');}
this.trim=function(p_strString,p_strSkyriklis)
{if(!p_strSkyriklis)
p_strSkyriklis=' ';return(p_strString.replace(new RegExp('^'+p_strSkyriklis+'+|'+p_strSkyriklis+'+$','g'),''));}
this.leftPad=function(p_strText,p_intIlgis,p_strSkyriklis)
{var objString=new String(p_strText);if(p_strSkyriklis==null)
{p_strSkyriklis=' ';}
while(objString.length<p_intIlgis)
{objString=p_strSkyriklis+objString;}
return(objString);}
this.escape=function(p_strString)
{return(p_strString.replace(/('|\\)/g,'\\$1'));}
this.round=function(p_objNumber,p_intDecimals)
{if(p_intDecimals>0)
{var m=p_objNumber.toFixed(p_intDecimals+1).match(new RegExp("(-?\\d*)\.(\\d{"+p_intDecimals+"})(\\d)\\d*$"));if(m&&m.length)
{var intNum=new Number(m[1]+"."+this.leftPad(Math.round(m[2]+"."+m[3]),p_intDecimals,"0"));return(intNum);}}
return p_objNumber;}}
var objNumberF=new clsFormatting();var strAtsakymas='';this.g_str_fFormat=function(p_strNumber,p_strFormat)
{eval(objNumberF.g_fFormatIt(p_strNumber,p_strFormat));return(strAtsakymas);}}
var objFormat=new clsFormat();function clsLang()
{if(typeof(cLANG_OBJ)!='undefined')
{this.hshCache=cLANG_OBJ;}
function obj_fInit()
{var g_objConn=new clsBCServer(cSYS.cSERVER);var objCom=new clsBCCommand('cmdLanguage');g_objConn.g_fInsertCom(objCom);objResult=g_objConn.g_obj_fSend();if(objResult.g_strXmlStatus=='XmlOk'&&objResult.g_strSidStatus=='SidOk')
{var strStatus=objResult.getValue(0,'STATUS');if(strStatus=='ok')
{var strParam=objResult.getValue(0,'RET_VAL');}
else
{return(null);}}
else
{return(null);}
var objDoc=getXml(strParam);return(objDoc);}
this.g_str_fGetString=function(p_strString,p_strLang)
{var str_arrCmds=null;var str_arrTagWithCmd=p_strString.split(']');if(str_arrTagWithCmd.length>1)
{p_strString=str_arrTagWithCmd[1];str_arrCmds=str_arrTagWithCmd[0].substring(1).split(',');}
if(this.hshCache!=null)
{if(this.hshCache[p_strString]!=null)
{if(str_arrCmds!=null)
{for(var i=0;i<str_arrCmds.length;i++)
{if(str_arrCmds[i]=='up')
{return this.hshCache[p_strString].charAt(0).toUpperCase()+this.hshCache[p_strString].substring(1);}
if(str_arrCmds[i]=='down')
{return this.hshCache[p_strString].charAt(0).toLowerCase()+this.hshCache[p_strString].substring(1);}}}
return this.hshCache[p_strString];}
else
{return('-['+p_strString+']');}}
if(typeof cSYS=='undefined')
return('-['+p_strString+']');if(p_strLang==null)p_strLang=cSYS.cLANG;if(cacheSystem.g_obj_fGetXml('lang')==null)
{var objDoc=obj_fInit();if(objDoc==null)
{cacheSystem.g_fInsertXml('lang','error');}
else
{cacheSystem.g_fInsertXml('lang',objDoc);}}
try
{var strItems=cacheSystem.g_obj_fGetXml('lang').getElementsByTagName(p_strString);}
catch(exception)
{return('*['+p_strString+']');}
for(var i=0;i<strItems.length;i++)
{if(strItems[i].parentNode.getAttribute('id')==p_strLang)
{if(strItems[i].firstChild!=null)
{if(str_arrCmds!=null)
{for(var j=0;j<str_arrCmds.length;j++)
{if(str_arrCmds[j]=='up')
{return strItems[i].firstChild.nodeValue.charAt(0).toUpperCase()+strItems[i].firstChild.nodeValue.substring(1);}
if(str_arrCmds[j]=='down')
{return strItems[i].firstChild.nodeValue.charAt(0).toLowerCase()+strItems[i].firstChild.nodeValue.substring(1);}}}
return(g_str_fInnerXML(strItems[i]));}}}
if(strItems.length>0)
{return('['+p_strString+']');}
else
{if(''+p_strString=='null')consoleA('null tagas');if(p_strString.indexOf('tree_generator')!=-1)consoleA(p_strString);return('-['+p_strString+']');}}
function fRegisterUntranslatedTag(p_strTag)
{var arr_hshTagai=cacheSystem.g_obj_fGetXml('needs_translation');if(arr_hshTagai==null)
{var arr_hshTagai=new Array();cacheSystem.g_fInsertXml('needs_translation',arr_hshTagai)}
var blnRasta=false;for(var i=0;i<arr_hshTagai.length;i++)
{if(arr_hshTagai[i]['tag']==p_strTag)
{arr_hshTagai[i]['count']++;blnRasta=true;break;}}
if(!blnRasta)
{var hshTag=new Object();hshTag['tag']=p_strTag;hshTag['count']=1;arr_hshTagai.push(hshTag);}}}
var objLang=new clsLang();var g_objSettings=null;function g_fLoadSettings(p_hshArgs)
{g_objSettings=new clsSettings(p_hshArgs);}
function clsSettings(p_hshArgs)
{this.hshArgs=p_hshArgs;this.hshUnsavedSettings={};this.hshSettingsToDelete={};if(this.hshArgs==null)
this.hshArgs={};this.blnSettingsSaved=true;this.blnSettingDeleteSaved=true;this.strPage=cSYS.cPAGE==''||cSYS.cPAGE=='_all'?null:cSYS.cPAGE;}
clsSettings.prototype.g_fSetSetting=function(p_strKey,p_hshValue)
{var arr_strKeys=p_strKey;if(ftypeof(p_strKey)!='array')
arr_strKeys=arr_strKeys.split('_');this.hshCurrentStorage=this.hshArgs;this.hshCurrentUnsavedStorage=this.hshUnsavedSettings;var intLength=arr_strKeys.length;for(var i=0;i<intLength-1;i++)
{if(this.hshCurrentStorage[arr_strKeys[i]]==null)
{this.hshCurrentStorage[arr_strKeys[i]]={};}
this.hshCurrentStorage=this.hshCurrentStorage[arr_strKeys[i]];if(this.hshCurrentUnsavedStorage[arr_strKeys[i]]==null)
{this.hshCurrentUnsavedStorage[arr_strKeys[i]]={};}
this.hshCurrentUnsavedStorage=this.hshCurrentUnsavedStorage[arr_strKeys[i]];}
if(intLength>0)
{this.hshCurrentStorage[arr_strKeys[intLength-1]]=p_hshValue;this.hshCurrentUnsavedStorage[arr_strKeys[intLength-1]]=p_hshValue;this.blnSettingsSaved=false;this.fSetIndicator(false);}
this.fDelayCall();}
clsSettings.prototype.g_obj_fGetSetting=function(p_strKey)
{var arr_strKeys=p_strKey;if(ftypeof(p_strKey)!='array')
arr_strKeys=arr_strKeys.split('_');this.hshSearchedStorage=this.hshArgs;var intLength=arr_strKeys.length;for(var i=0;i<intLength;i++)
{this.hshSearchedStorage=this.hshSearchedStorage[arr_strKeys[i]];if(this.hshSearchedStorage==null)
return null;}
return this.hshSearchedStorage;}
clsSettings.prototype.g_fDeleteSetting=function(p_strKey)
{var arr_strKeys=p_strKey;if(ftypeof(p_strKey)!='array')
arr_strKeys=arr_strKeys.split('_');this.hshCurrentStorage=this.hshArgs;this.hshCurrentUnsavedStorage=this.hshUnsavedSettings;this.hshCurrentStorageToDelete=this.hshSettingsToDelete;var intLength=arr_strKeys.length;var blnCheckUnsaved=true;for(var i=0;i<intLength-1;i++)
{this.hshCurrentStorage=this.hshCurrentStorage[arr_strKeys[i]];if(this.hshCurrentStorage==null)
return;if(blnCheckUnsaved)
{this.hshCurrentUnsavedStorage=this.hshCurrentUnsavedStorage[arr_strKeys[i]];if(this.hshCurrentUnsavedStorage==null)
blnCheckUnsaved=false;}}
if(intLength>0)
{if(this.hshCurrentStorage[arr_strKeys[intLength-1]]==null)
return;this.hshCurrentStorage[arr_strKeys[intLength-1]]=null;if(blnCheckUnsaved)
{this.hshCurrentUnsavedStorage[arr_strKeys[intLength-1]]=null;delete this.hshCurrentUnsavedStorage[arr_strKeys[intLength-1]];}
this.blnSettingDeleteSaved=false;this.fSetIndicator(false);}
for(var i=0;i<intLength-1;i++)
{if(this.hshCurrentStorageToDelete[arr_strKeys[i]]==null)
{this.hshCurrentStorageToDelete[arr_strKeys[i]]={};}
else if(this.hshCurrentStorageToDelete[arr_strKeys[i]]==1)
{return;}
this.hshCurrentStorageToDelete=this.hshCurrentStorageToDelete[arr_strKeys[i]];}
if(intLength>0)
{this.hshCurrentStorageToDelete[arr_strKeys[intLength-1]]=1;}
this.fDelayCall();}
clsSettings.prototype.g_fUnload=function()
{if(this.objIntervalCaller!=null)
this.objIntervalCaller.g_fCancel();this.fSaveSettings();this.objIntervalCaller=null;}
clsSettings.prototype.g_fForcedSaveSettings=function()
{this.fSaveSettings(true);}
clsSettings.prototype.fDelayCall=function()
{if(this.objCaller!=null)
{this.objCaller.g_fCancel();delete this.objCaller;}
this.objCaller=new clsFunctionCaller(this.fSaveSettings,this,2000);this.objCaller.g_fStartCounter();}
clsSettings.prototype.fSetPageProperty=function(p_objCommand)
{if(this.strPage!=null)
p_objCommand.g_fInsert('PAGE',this.strPage);}
clsSettings.prototype.fSaveSettings=function(p_blnSync)
{if(this.blnSettingsSaved&&this.blnSettingDeleteSaved)
return;var objConn=new clsBCServer(cSYS.cSERVER);if(this.blnSettingsSaved||this.blnSettingDeleteSaved)
{if(!this.blnSettingsSaved)
{var objCommand=new clsBCCommand('cmdSettingSet');objCommand.g_fInsert('CONNECTION_STRING','[confDbString]');objCommand.g_fInsert('ITEM','root');objCommand.g_fInsert('VALUE',g_str_fGetXmlFromObject(this.hshUnsavedSettings,'root',10));this.fSetPageProperty(objCommand);objConn.g_fInsertCom(objCommand);}
else
{var objCommand=new clsBCCommand('cmdSettingDelete');objCommand.g_fInsert('CONNECTION_STRING','[confDbString]');objCommand.g_fInsert('ITEM','root');objCommand.g_fInsert('VALUE',g_str_fGetXmlFromObject(this.hshSettingsToDelete,'root',10));this.fSetPageProperty(objCommand);objConn.g_fInsertCom(objCommand);}}
else
{var objCommand=new clsBCCommand('cmdStartConnection');objCommand.g_fSetConn('setting_update_123');objCommand.g_fInsert('CONNECTION_STRING','[confDbString]');objConn.g_fInsertCom(objCommand);var objCommand=new clsBCCommand('cmdSettingDelete');objCommand.g_fSetConn('setting_update_123');objCommand.g_fInsert('ITEM','root');objCommand.g_fInsert('VALUE',g_str_fGetXmlFromObject(this.hshSettingsToDelete,'root',10));this.fSetPageProperty(objCommand);objConn.g_fInsertCom(objCommand);var objCommand=new clsBCCommand('cmdSettingSet');objCommand.g_fSetConn('setting_update_123');objCommand.g_fInsert('ITEM','root');objCommand.g_fInsert('VALUE',g_str_fGetXmlFromObject(this.hshUnsavedSettings,'root',10));this.fSetPageProperty(objCommand);objConn.g_fInsertCom(objCommand);var objCommand=new clsBCCommand('cmdEndConnection');objCommand.g_fSetConn('setting_update_123');objConn.g_fInsertCom(objCommand);}
if(p_blnSync)
objConn.g_obj_fSend();else
objConn.g_obj_fSend(function(){});this.hshUnsavedSettings={};this.hshSettingsToDelete={};this.blnSettingsSaved=true;this.blnSettingDeleteSaved=true;this.fSetIndicator(true);}
clsSettings.prototype.fSetIndicator=function(p_blnSaved)
{if(this.objIndicator==null)
this.fInitSettingIndicator();if(p_blnSaved)
{this.objIndicator.style.display='none';}
else
{this.objIndicator.style.display='';}}
clsSettings.prototype.fInitSettingIndicator=function()
{var objExisting=document.getElementById('indicatorPlace');var objStyle=null;if(objExisting)
{this.objIndicator=objExisting;this.objIndicator.display='none';this.objIndicator.className='indicator indicatorPositioning';}
else
{this.objIndicator=document.createElement('DIV');this.objIndicator.innerHTML='&nbsp;';this.objIndicator.style.display='none';this.objIndicator.className='indicator indicatorPositioning';document.body.appendChild(this.objIndicator);}
addEvent(this.objIndicator,'click',this.fSaveSettings,this);}
function fUnloadSettings()
{if(g_objSettings)
g_objSettings.g_fUnload();}
addEvent(window,'beforeunload',fUnloadSettings);