
function getAttribute(element,attr){var v;try{if(element!==null&&typeof(element)=="object"&&element.getAttribute!==null){v=element.getAttribute(attr);if(v!==null){return v;}}}catch(e){}
return'';}
function getAttributeI(element,attr){var v=getAttribute(element,attr,'');if(v.length){return v;}
var parElement=document.all?element.parentElement:element.parentNode;if(parElement){return getAttributeI(parElement,attr);}
return'';}
var globaltooltip=false;function eosShowTooltip(txt,tt_width){if(!globaltooltip){globaltooltip=new Eosdivtool();if(document.all){globaltooltip.useIFrame=true;}
if(tt_width){globaltooltip.setWidth(tt_width);}else{}
globaltooltip.divid="eosglobaltt";globaltooltip.ifid="eosglobalttiframe";globaltooltip.useinternalstyle=true;globaltooltip.istooltip=true;globaltooltip.create();globaltooltip.draw(txt);}else{globaltooltip.draw(txt);}}
function eosHideTooltip(){if(globaltooltip){globaltooltip.draw("");globaltooltip.hide();globaltooltip.destroy();globaltooltip=false;}}
function getIFrameCoordinates(win,left,top){var parent;var listOfParentsIframes;var a;var i;var l;var frame;parent=win.parent;listOfParentsIframes=[];left=left||0;top=top||0;for(i=0,a=parent.document.getElementsByTagName('FRAME'),l=a.length;i<l;i++){listOfParentsIframes.push(a[i]);}
for(i=0,a=parent.document.getElementsByTagName('IFRAME'),l=a.length;i<l;i++){listOfParentsIframes.push(a[i]);}
for(i=0,l=listOfParentsIframes.length;i<l;i++){if(listOfParentsIframes[i].contentWindow==win){break;}}
frame=listOfParentsIframes[i];if(document.all){if(frame&&frame.offsetParent){left+=frame.offsetParent.offsetLeft;top+=frame.offsetParent.offsetTop;}}else{left+=frame.offsetLeft;top+=frame.offsetTop;}
if(win.parent&&win.parent!=win.top){getIFrameCoordinates(win.parent,left,top);}
return[left,top];}
function Listener(fp,scope,removing){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=[];}
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.remove=function(oSource,sEvent,fpDest,oScope){var idx=this.findForEvent(oSource[sEvent],fpDest,oScope);var iLast;if(idx!=-1){iLast=oSource[sEvent]._listeners.length-1;oSource[sEvent]._listeners[idx]=oSource[sEvent]._listeners[iLast];oSource[sEvent]._listeners.length--;}};Listener.findForEvent=function(fpEvent,fpDest,oScope){var i;if(fpEvent._listeners){for(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){var lstnr,fp,last,i;if(oSourceObj&&oSourceObj[sEvent]&&oSourceObj[sEvent]._listeners){last=oSourceObj[sEvent]._listeners.length-1;for(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);};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 posLib={getIeBox:function(el){return this.ie&&el.document.compatMode!="CSS1Compat";},getClientLeft:function(el){var r=el.getBoundingClientRect();return r.left-this.getBorderLeftWidth(this.getCanvasElement(el));},getClientTop:function(el){var r=el.getBoundingClientRect();return r.top-this.getBorderTopWidth(this.getCanvasElement(el));},getLeft:function(el){return this.getClientLeft(el)+this.getCanvasElement(el).scrollLeft;},getTop:function(el){return this.getClientTop(el)+this.getCanvasElement(el).scrollTop;},getInnerLeft:function(el){return this.getLeft(el)+this.getBorderLeftWidth(el);},getInnerTop:function(el){return this.getTop(el)+this.getBorderTopWidth(el);},getWidth:function(el){return el.offsetWidth;},getHeight:function(el){return el.offsetHeight;},getCanvasElement:function(el){var doc=el.ownerDocument||el.document;if(doc.compatMode=="CSS1Compat"){return doc.documentElement;}else{return doc.body;}},getBorderLeftWidth:function(el){return el.clientLeft;},getBorderTopWidth:function(el){return el.clientTop;},getScreenLeft:function(el){var doc=el.ownerDocument||el.document;var w=doc.parentWindow;return w.screenLeft+this.getBorderLeftWidth(this.getCanvasElement(el))+
this.getClientLeft(el);},getScreenTop:function(el){var doc=el.ownerDocument||el.document;var w=doc.parentWindow;return w.screenTop+this.getBorderTopWidth(this.getCanvasElement(el))+
this.getClientTop(el);}};function view_loaded(view_id){document.getElementById("viewloading_"+view_id).style.display="none";document.getElementById("viewbody_"+view_id).style.display="block";}
function eos_dropdown_select(eos_id,ref,call_me,ws,targets){var v,r;if(ref.options[ref.selectedIndex].value.length>0){bumpTargetGenerations(targets);v=ref.options[ref.selectedIndex].value.split('|');r=call_me?ref:null;switch(v[0]){case"pivot":top.eos_cmd('pivot',v[1]+"|"+eos_id+"="+v[2]+","+v[3],r,null,ws);break;case"deselectDropDown":top.eos_cmd('deselectDropDown',eos_id,r,null,ws);break;default:top.eos_cmd(v[0],eos_id+'='+v[1],r,null,ws);break;}}
if(!ref.blur()){top.focus();}}
function bumpTargetGenerations(targets){if(document.renderedComponentGenerations&&targets){for(var obj in document.renderedComponentGenerations){if(top.MochiKit.Base.findValue(targets,obj)!=-1){document.renderedComponentGenerations[obj]=parseInt(document.renderedComponentGenerations[obj],10)+1;}}}}
function eos_reload(g2obj){window.location.reload();}
function eos_dfl_ondragstart(m_evt){var eos_id;var targelm;try{if(document.all){evt=window.event;targelm=evt.srcElement;}else{evt=m_evt;targelm=evt.target;}
eos_id=targelm.getAttribute("eos_id");if(eos_id!==null){window.event.dataTransfer.setData('text',eos_id);}}catch(e){}}
document.ondragstart=eos_dfl_ondragstart;function getScreenRes(){var sc;var sw=screen.width;var sh=screen.height;if(navigator.appName!='Netscape'){sc=screen.colorDepth;}else{sc=screen.pixelDepth;}
return sw+'x'+sh+'x'+sc;}
function setcookie(name,value){var cookiestring=name+'='+escape(value)+';';document.cookie=cookiestring;}
function setcookie_full(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"");}
function getcookie(cookiename){var cookiestring=''+document.cookie;var index1=cookiestring.indexOf(cookiename);if(index1==-1||cookiename===''){return'';}
var index2=cookiestring.indexOf(';',index1);if(index2==-1){index2=cookiestring.length;}
return unescape(cookiestring.substring(index1+cookiename.length+1,index2));}
function clearcookie(name,path,domain){if(getcookie(name)){document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}}
function manageHighlighting(elm){var mSty=top.MochiKit.Style;if(globSelectedElement){mSty.setStyle(globSelectedElement,{"font-style":"normal"});}
if(globSelectedElementTr){try{if(document.all){if(globSelectedElementTrOldBg){mSty.setStyle(globSelectedElementTr,{"background-color":globSelectedElementTrOldBg});}else{mSty.setStyle(globSelectedElementTr,{"background-color":''});}}else{globSelectedElementTr.style.background=null;}}catch(ex){}}
globSelectedElementTr=false;try{var tr=document.getParentFromChild(elm,"TR");if(tr){globSelectedElementTrOldBg=mSty.getStyle(tr,"background-color");mSty.setStyle(tr,{"background-color":"#FFFF66"});globSelectedElementTr=tr;}}catch(ex){}
globSelectedElement=elm;}
var globSelectedElement;var globSelectedElementTr;var globSelectedElementTrOldBg;function eos_onclick(targelm){var treeSelectAction;var eos_id=getAttributeI(targelm,'eos_id');if(eos_id===''){return;}
var wsId=getAttributeI(targelm,'eos_ws_id');if(wsId===''){return;}
if((eos_id.substr(0,4)=='axes'||eos_id.substr(0,5)=='trees')&&(eos_id.indexOf('=')!=-1)){if(targelm.tagName.toLowerCase()=='img'){var src=targelm.getAttribute('src');if(src.indexOf('closed.gif')>=0){treeSelectAction='open';}
if(src.indexOf('open.gif')>=0){treeSelectAction='close';}
top.eos_cmd(treeSelectAction,eos_id,null,null,wsId);}else{if(!targelm.getAttribute('eos_nosel')){manageHighlighting(targelm);targelm.style.fontStyle='italic';if(document.getParentByTagClass(targelm,'eos-xtable','TABLE')){if(typeof(document.xtableClickWrapper)==="function"){var fp=document.xtableClickWrapper;var fpArgs=[targelm];if(document.xtableClickWrapperArguments){fpArgs.push(document.xtableClickWrapperArguments);}
top.eos_cmd("clickselect",eos_id,null,null,wsId,null,null,[fp,fpArgs]);}else{top.eos_cmd("clickselect",eos_id,null,null,wsId);}}else{top.eos_cmd("clickselect",eos_id,null,null,wsId);}}}}else if(eos_id.substr(0,7)=="sheets/"){manageHighlighting(targelm);targelm.style.fontStyle='italic';eos_sheets_click(targelm);}}
function hardcopy(openingElement){var pdfXmlEle=document.getElementById("pdfServiceXml");if(!pdfXmlEle){return;}
var defaults={"%sc%":"1","%fs%":"8","%po%":"landscape"};try{if(openingElement||document.showPrintOptionsDialog===true){openPrintOptionsDropdown(openingElement)
return;}}catch(ex){}
HYPERGENE.PrinterOptions.handlePrinterOptionsAndPrint(defaults);}
function excelExport(openingElement){try{if(document.showExcelExportOptionsDialog===true){openExcelOptionsDropdown(openingElement);return;}}catch(ex){}
HYPERGENE.ExcelOptions.handleExcelOptionsAndPrint();}
function addtree(wsId,nodeid){top.eos_cmd('addnode',top.addtree_tree+"="+nodeid,null,null,wsId);}
function execfromwin(params){var arr=params.split(":::");var cmd=arr[0].split("!").join("|");var newParams=arr[1].split("!").join("|");top.frames.workspace.frames.frameEdit.eos_moz_exec(cmd,newParams);}
document.getAscendingElement=function(element,tagName,className){if(!element){return null;}
if(!element.tagName){return null;}
var tagMatch=!tagName||(element.tagName.toLowerCase()==tagName.toLowerCase());var classMatch=false;var classes;if(className){classes=(document.all?element.className:element.getAttribute("class"));if(classes){classes=classes.toLowerCase().split(" ");for(var i in classes){if(classes[i]==className.toLowerCase()){classMatch=true;}}}}else{classMatch=true;}
if(tagMatch&&classMatch){return element;}else if(element.parentNode){return document.getAscendingElement(element.parentNode,tagName,className);}else{return null;}};document.getParentFromChild=function(element,tagName,className){if(!element){return null;}
if(!element.tagName){return null;}
var classMatch=false;var tagMatch=false;var ret=null;var classes;var classArr;var par;var tag;while(element){if(className){classes=element.className||"";if(classes.length){classArr=classes.split(" ");for(var cn in classArr){if(classArr[cn].toLowerCase()==className.toLowerCase()){classMatch=true;break;}}}}else{classMatch=true;}
tag=element.tagName||"";if(tag.toLowerCase()==tagName.toLowerCase()){tagMatch=true;}else{tagMatch=false;}
if(tagMatch&&classMatch){ret=element;break;}else{par=document.all?element.parentElement:element.parentNode;if(par){element=par;}else{break;}}}
return ret;};document.getParentByClass=function(element,className){var compClass;try{compClass="";if(document.all){compClass=element.parentNode.className;}else{compClass=element.parentNode.getAttribute("class");}
if(compClass==className){return element.parentNode;}else{return document.getParentByClass(element.parentNode,className);}}catch(e){return false;}};document.getParentByTag=function(element,tag){try{if(element.parentNode.tagName.toLowerCase()==tag.toLowerCase()){return element.parentNode;}else{return document.getParentByTag(element.parentNode,tag);}}catch(e){return false;}};document.getParentByTagClass=function(element,className,tag){var compClass;try{compClass="";if(document.all){compClass=element.parentNode.className;}else{compClass=element.parentNode.getAttribute("class");}
if((element.parentNode.tagName.toLowerCase()==tag.toLowerCase())&&(compClass==className)){return element.parentNode;}else{return document.getParentByTagClass(element.parentNode,className,tag);}}catch(e){return false;}};function bodyOffsetLeft(startnode,startval){if(startnode.parentNode.tagName=="BODY"){return startval;}else{return bodyOffsetLeft(startnode.parentNode,startval+startnode.parentNode.offsetLeft);}}
function bodyOffsetTop(startnode,startval){if(startnode.parentNode.tagName=="BODY"){return startval;}else if(startnode.parentNode.offsetParent.tagName=="BODY"){return startval+startnode.parentNode.offsetTop;}else{return bodyOffsetTop(startnode.parentNode,startval+startnode.parentNode.offsetTop);}}
var dataPointComments=[];function xtableShowComment(id){var comments=id.split(" ");if(comments.length>1){eosShowTooltip(sprintf(t_("Number of comments: %s"),comments.length));}else{eosShowTooltip(dataPointComments[id]);}
return;}
var dataSetComments=[];function checkAndDisplayDataSetComments(){if(dataSetComments.length){var allComments=dataSetComments.join(" ");numComments=dataSetComments.length;var ttText=sprintf(pluralise("%s comment","%s comments",numComments),numComments);var commentsElement=document.getElementById("viewtitletext");if(!commentsElement){var viewBodyTbl=document.getElementById("viewbodytbl");if(!viewBodyTbl){return;}
commentsElement=document.createElement("span");commentsElement.innerText=t_("Comments")+": "+ttText;viewBodyTbl.parentNode.insertBefore(commentsElement,viewBodyTbl);}
var cn=commentsElement.className;commentsElement.className=cn+" commentIndicator";commentsElement.setAttribute("eos_comment",allComments);if(document.all){commentsElement.attachEvent("onmouseover",function(){eosShowTooltip(ttText);});commentsElement.attachEvent("onmouseout",function(){eosHideTooltip();});}else{commentsElement.setAttribute("onmouseover","eosShowTooltip('"+ttText+"')");commentsElement.setAttribute("onmouseout","eosHideTooltip()");}}}
function __findPortalBackgroundStyle(styleName){var styleSheets=parent.document.styleSheets;var foundStyle=false;var styleSheet,rules,rawStyle,r,rule;for(var i=0;i<=styleSheets.length;i++){if(foundStyle!==false){break;}
styleSheet=styleSheets[i];rules=document.all?styleSheet.rules:styleSheet.cssRules;for(r=0;r<=rules.length;r++){rule=rules[r];if(!rule){continue;}
if(document.all){if(rule.selectorText.indexOf(styleName)>-1){foundStyle=rule.style.background;break;}}else{if(rule.cssText.indexOf(styleName)>-1){rawStyle=rule.cssText;try{foundStyle=rule.cssText.split("background: ")[1].split(";")[0];}catch(ex){return"";}
break;}}}}
return foundStyle;}
function findPortalBackgroundStyle(){var style="";try{style=__findPortalBackgroundStyle(".bigbox *");if(!style.length){style=__findPortalBackgroundStyle(".smallbox *");}}catch(ex){}
return style;}
function iframeresizer(){if(top.checkVFrameSize){top.checkVFrameSizes();}
var wframe=document.getElementById("wframe");var wmen=document.getElementById("MenuContainer");var menuHeight,statHeight,removeHeight;var wframeHeight;if(document.all){menuHeight=wmen?wmen.clientHeight:0;if(wmen){wmen.style.top="0px";wmen.style.left="0px";wmen.style.width=document.body.clientWidth;}
wframeHeight=document.body.clientHeight-menuHeight;if(wframeHeight<=0){wframeHeight=1;}
wframe.style.height=wframeHeight;wframe.style.top=menuHeight;}else{menuHeight=wmen?wmen.offsetHeight:0;wframe.style.top=menuHeight;wframeHeight=document.body.clientHeight-menuHeight;if(wframeHeight<=0){wframeHeight=1;}
wframe.style.height=wframeHeight;}
wframe.style.width=document.body.clientWidth;}
if(typeof(onHoverCursorCallback)!="function"){function onHoverCursorCallback(){jQuery(this).css({'cursor':'pointer'}).css({'cursor':'hand'});}
function onNotHoverCursorCallback(){jQuery(this).css({'cursor':'default'});}}
function recreateTheViewHeaderClickHandlers(){jQuery('.viewtitle').unbind('click');jQuery('.viewtitle').click(function(){jQuery('.viewpages').toggle();var frameToResize=jQuery(this).attr('rel');top.vw_frame_resize(frameToResize,document);jQuery("#viewtitletext").toggleClass("collapsed");}).hover(onHoverCursorCallback,onNotHoverCursorCallback);}
if(typeof Wait=='undefined'){Wait={}}
Wait.VERSION=0.02;Wait.EXPORT=['wait'];Wait.EXPORT_TAGS={':all':Wait.EXPORT};Wait.interval=100;Wait.wait=function(arg1,arg2,arg3,arg4){if(typeof arg1=='function'&&typeof arg2=='function'&&typeof arg3=='function'){return Wait._wait3(arg1,arg2,arg3,arg4);}
if(typeof arg1=='function'&&typeof arg2=='function'){return Wait._wait2(arg1,arg2,arg3);}}
Wait._wait2=function(test,callback,max){Wait._wait3(test,callback,function(){},max);}
Wait._wait3=function(test,callback,failed_callback,max){var func=function(){var interval=Wait.interval;var time_elapsed=0;var intervalId;var check_and_callback=function(){if(test()){callback();clearInterval(intervalId);}
time_elapsed+=interval;if(typeof max=='number'){if(time_elapsed>=max){if(typeof failed_callback=='function')
failed_callback();clearInterval(intervalId);}}}
intervalId=setInterval(check_and_callback,interval);}
func();}
var HYPERGENE=HYPERGENE||{};HYPERGENE.addBasePath=function(str){if(typeof(HYPERGENE.ExtraBasePath)=="undefined"){HYPERGENE.ExtraBasePath="";}
return HYPERGENE.ExtraBasePath+str;};var ow=[];var xpos=[];var ypos=[];var vw_frames=[];var sw_frames=[];function findG2ObjectFrames(lookIn,g2ObjectId,foundFrames){var frame,doc;if(!foundFrames){foundFrames=[];}
if(!lookIn.frames){return foundFrames;}
for(var i=0;i<lookIn.frames.length;++i){frame=lookIn.frames[i];doc=frame.document;if(!doc||!doc.body||doc.reloading){continue;}
if(doc.renderedComponentGenerations&&doc.renderedComponentGenerations[g2ObjectId]){foundFrames.push(doc);}
foundFrames.concat(top.findG2ObjectFrames(frame,g2ObjectId,foundFrames));}
return foundFrames;}
function locateWsGrid(gridFQN){var wsgFrames=findG2ObjectFrames(top.window,gridFQN);var cg=false;function domIdFromFqn(string){var result;result=string.replace(']','','g');result=result.replace('[','','g');result=result.replace('.','','g');return result;}
for(var frm in wsgFrames){var feFrame=wsgFrames[frm];if(feFrame.body._acmComponent&&feFrame.body._acmComponent.getComponentById('cellGrid')){cg=feFrame.body._acmComponent.getComponentById('cellGrid');break;}
var fqn=domIdFromFqn(gridFQN);if(feFrame&&feFrame.ExtReference&&feFrame.ExtReference.getCmp(fqn)){cg=feFrame.ExtReference.getCmp(fqn);break;}}
return cg;}
top.onAfterInvalidate=false;function countDict(dict){var i=0;for(var x in dict){i++;}
return i;}
top.validComponentGenerations=top.validComponentGenerations||{};function isDocumentLoaded(doc){if(!doc||doc.reloading){return false;}
if(doc.body){return true;}
var frameSets=doc.getElementsByTagName('FRAMESET');if(frameSets.length){return true;}
return false;}
function updateAndCheckFrames(lookIn,timeStamp){var nRefreshing=0;var frame,doc;var needsReload,needsImmediateLoadingMessage,needsPortalReload;if(!lookIn.frames){return nRefreshing;}
for(var i=0;i<lookIn.frames.length;++i){frame=lookIn.frames[i];doc=frame.document;if(!isDocumentLoaded(doc)){++nRefreshing;continue;}
if(doc.renderedComponentGenerations){needsPortalReload=false;needsReload=false;needsImmediateLoadingMessage=false;for(var obj in doc.renderedComponentGenerations){if(obj.indexOf("views[")>=0||obj.indexOf("sheets[")>=0){needsImmediateLoadingMessage=true;}
if(MochiKit.Base.isUndefinedOrNull(top.validComponentGenerations[obj])){continue;}
if(parseInt(top.validComponentGenerations[obj],10)>parseInt(doc.renderedComponentGenerations[obj],10)){needsReload=true;if(!document.all){if(doc.location.href.indexOf("portal.php")>=0||doc.location.href.indexOf("ws_toprow.php")>=0){needsPortalReload=true;}}}}
if(needsReload){if(needsImmediateLoadingMessage){top.showLoadingMessage();}
doc.reloading=true;if(needsPortalReload){var docQs=doc.location.search.substr(1);var qsDict=MochiKit.Base.parseQueryString(docQs);qsDict["portalRandom"]=Math.random();doc.location.search=MochiKit.Base.queryString(qsDict);}else{doc.location.reload();}
++nRefreshing;continue;}}
nRefreshing+=top.updateAndCheckFrames(frame,timeStamp);}
return nRefreshing;}
function getFrameById(lookIn,frameName){if(!lookIn){return null;}
if(lookIn.name==frameName){return lookIn;}
var doc,frame;for(var i=0;i<lookIn.frames.length;++i){frame=getFrameById(lookIn.frames[i],frameName);if(frame){return frame;}}
return null;}
var updateTimeout=null;var loadingMessageTimeout=null;function doUpdating(timeStamp){if(top.updateAndCheckFrames(window,timeStamp)){window.clearTimeout(top.updateTimeout);top.updateTimeout=window.setTimeout(top.doUpdating,250,timeStamp);}else{top.validComponentGenerations={};top.hideLoadingMessage();}}
function hideLoadingMessage(){window.clearTimeout(top.loadingMessageTimeout);top.loadingMessageTimeout=null;var loadingDiv=top.document.getElementById("loadingDiv");if(loadingDiv){top.document.body.removeChild(loadingDiv);top.document.body.removeChild(top.document.getElementById("loadingIFrame"));}}
function showLoadingMessage(){window.clearTimeout(top.loadingMessageTimeout);top.loadingMessageTimeout=null;if(top.document.getElementById("loadingDiv")){return;}
var iFrame=top.document.createElement("IFRAME");iFrame.src="javascript:false";var div=top.document.createElement("DIV");var objs=[iFrame,div];var zIndex=999;for(var o in objs){var obj=objs[o];obj.style.position="absolute";obj.style.top="50%";obj.style.left="50%";obj.style.width="164px";obj.style.height="67px";obj.style.zIndex=zIndex++;obj.style.marginLeft="-150px";obj.style.marginTop="-50px";obj.style.border='0';obj.style.backgroundColor='transparent';}
iFrame.style.width="150px";iFrame.style.height="47px";iFrame.style.marginLeft='-141px';iFrame.style.marginTop='-44px';div.id="loadingDiv";iFrame.id="loadingIFrame";var bgImgUrl=top.HYPERGENE.addBasePath("images/progress-bg.png");var animImgUrl=top.HYPERGENE.addBasePath("images/busy-20.gif");var html="<table border='0' width='100%' height='100%'><tr>";html+="<td id='loading-img' width='100%' height='100%' align='center' halign='middle' style='font: bold 14px tahoma,verdana; color:black; background: transparent url("+bgImgUrl+") no-repeat top left;'>";html+="<img src='"+animImgUrl+"' width='20' height='20' align='absmiddle'>&nbsp;"+t_("Loading...")+"</td>";html+="</tr></table>";div.innerHTML=html;top.document.body.appendChild(iFrame);top.document.body.appendChild(div);if(typeof(jQuery)!=='undefined'){jQuery("#loading-img").pngfix();}}
function storePos(ref,id){try{var doc=ref.body?ref:ref.document;if(document.all){var o=doc.getElementById("fixedHeaders");if(o){xpos[id]=o.scrollLeft;ypos[id]=o.scrollTop;return;}}
xpos[id]=doc.body.scrollLeft;ypos[id]=doc.body.scrollTop;}catch(ex){}}
function setPos(ref,id){var doc=ref.body?ref:ref.document;if(!doc){return;}
if(!xpos[id]||!ypos[id]){return;}
var fixedHeaders;if(document.all){fixedHeaders=doc.getElementById("fixedHeaders");if(fixedHeaders){fixedHeaders.scrollLeft=xpos[id];fixedHeaders.scrollTop=ypos[id];return;}}
doc.body.scrollLeft=xpos[id];doc.body.scrollTop=ypos[id];}
function storeDivPos(ref,id){xpos[id]=ref.scrollLeft;ypos[id]=ref.scrollTop;}
function setDivPos(ref,id){if(MochiKit.Base.isUndefinedOrNull(xpos[id])||MochiKit.Base.isUndefinedOrNull(ypos[id])){return;}
ref.scrollLeft=xpos[id];ref.scrollTop=ypos[id];}
function center_window(w,h){var ie_offset=130;var tw=top.window;var tw_left=typeof tw.screenX!="undefined"?tw.screenX:tw.screenLeft;var tw_top=typeof tw.screenY!="undefined"?tw.screenY:(tw.screenTop-ie_offset);var tw_width=typeof tw.outerWidth!="undefined"?tw.outerWidth:tw.document.body.offsetWidth;var tw_height=typeof tw.outerHeight!="undefined"?tw.outerHeight:(tw.document.body.offsetHeight+ie_offset);var c={};c.x=(tw_left+tw_width/2)-w/2;c.y=(tw_top+tw_height/2)-h/2;if(c.x<0){c.x=0;}
if(c.y<0){c.y=0;}
return c;}
top.ajaxExecUrl="ajaxExec.php";function eos_cmd(cmd,params,caller_ref,wsNode,cmdWs,afterInvalidateMessage,relocationUrl,afterInvalidateFuncAndArgs,returnUrl){if(cmd=='click'){cmd='select';}
var id;switch(cmd){case"setworkspace":p=params.split("|");top.location.search="?ws="+p[0]+"&mode="+p[1];cmd=null;break;case"restoreworkspace":if(!top.confirmDiscardGridEdits()){return false;}
cmdWs=params;break;case"loadworkspace-popup":id="popupws_"+params;if((!top.ow[id])||(typeof top.ow[id].title=="unknown")){top.ow[id]=open_win2("ws_top.php?mode=popup&node_id="+params,id);}else{top.ow[id].focus();}
cmd=null;break;case"openguide":id="guide_"+params.toString().replace(/\$/,"");if((!top.ow[id])||(typeof top.ow[id].title=="unknown")){top.ow[id]=open_win3("guide.php?id="+params,id);}else{top.ow[id].focus();}
cmd=null;break;case"saveworkspaceas":if(!params){params='';}
if(params=prompt(t_("Enter new workspace name."),params)){cmd="saveworkspace";}else{cmd=null;}
break;case"deleteworkspace":if(!confirm(t_("Do you really want to DELETE this workspace?"))){cmd=null;}
break;case"restart_server":if(!confirm(t_("Do you really want to restart the server?"))){cmd=null;}
break;case"deleteobject":if(!confirm(sprintf(t_("Do you want to remove the object '%s'?"),params))){cmd=null;}
break;case"createobject":if(name=prompt(t_("Enter the name of the new object:"),t_("New object"))){params=params+",title="+name;}else{cmd=null;}
break;case"shownotes":case"showhelp":case"style":open_win(cmd+".php?ws="+ws+"&obj="+escape(params),"_blank",400,200,{'scrollbars':'auto'});cmd=null;break;case"editobject":p=params.split("|");open_win("editor/edit_object.php?ws="+ws+"&g2obj="+escape(p[0])+"&from="+(p[1]?p[1]:"")+"&is_dialog=1","edit_window");cmd=null;break;case"editobject_inv":p=params.split("|");open_win("editor/edit_object.php?ws="+escape(p[1])+"&g2obj="+escape(p[0])+"&is_dialog=1&doinv=1","edit_window");cmd=null;break;case"clickselect":cmd="select";break;case"mouseover":case"tooltip":cmd=null;break;}
if(!params){params="";}
if(cmd){var wsAdd='';if(cmdWs){wsAdd="&ws="+MochiKit.Base.urlEncode(cmdWs);}
if(wsNode){wsAdd+="&wsNode="+MochiKit.Base.urlEncode(wsNode);}
var aeUrl="ajaxExec.php";if(top.ajaxExecUrl){aeUrl=top.ajaxExecUrl;}
var url=aeUrl+"?cmd="+MochiKit.Base.urlEncode(cmd)+"&params="+MochiKit.Base.urlEncode(params)+wsAdd;msg='';if(afterInvalidateMessage){msg=escape(afterInvalidateMessage);}
reloc='';if(relocationUrl){reloc=escape(relocationUrl);}
if(returnUrl){return url;}else{window.setTimeout(function(){top.sendAjaxCommand(url,msg,reloc,afterInvalidateFuncAndArgs);},1);}}}
function eos_cmd_msg(cmd,params,msg,reloc,ws){top.eos_cmd(cmd,params,false,false,ws,msg,reloc);}
function getTimeStamp(){var d=new Date();return d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+":"+d.getMilliseconds()+"/"+d.getTime();}
top.allAjaxRequests=top.allAjaxRequests||{};function sendAjaxCommand(url,afterInvalidateMessage,relocationUrl,afterInvalidateFuncAndArgs){var req=MochiKit.Async.loadJSONDoc(url);top.loadingMessageTimeout=window.setTimeout(top.showLoadingMessage,1000);var success=function(timeStamp,data){if(data.metadata&&data.message&&data.action){top.HYPERGENE.StaleSessionHandler.handleError(data);}
var reload=data["0"];var updatedObjects=data["1"];var info=data["2"];var nUpdatedObjects=0;for(var obj in updatedObjects){top.validComponentGenerations[obj]=updatedObjects[obj];++nUpdatedObjects;}
if(info&&info.alert&&info.alert.length){top.hideLoadingMessage();alert(info.alert);return;}
var wframe;if(reload.length){top.validComponentGenerations={};switch(reload){case"closeWindow":top.window.close();break;case"saveworkspace":var firstPart;for(firstPart in updatedObjects){break;}
var wsIdMatch=firstPart.match(/workspaces\[(.*)\]/);if(wsIdMatch){urlToRedirectTo=HYPERGENE.addBasePath("ws_top.php?mode=edit&ws="+wsIdMatch[1]);top.location.href=urlToRedirectTo;}else{throw(t_("Malformed saveworkspace response")+": "+firstPart);}
break;case"restoreworkspace":var twframe=top.document.getElementById("wframe");if(twframe){wframe=document.all?top.frames.wframe:twframe.contentDocument;if(twframe.src.indexOf("portal.php")>=0){wframe.location.reload();}else{top.location.reload();}}
break;case"portal":wframe=document.all?top.frames.wframe:top.document.getElementById('wframe').contentDocument;wframe.location.href=HYPERGENE.addBasePath('portal.php');break;case"budget":wframe=document.all?top.frames.wframe:top.document.getElementById('wframe').contentDocument;wframe.location.href=HYPERGENE.addBasePath('portal.php?dyn_main=budget');break;default:top.frames.workspace.location.reload();break;}
top.hideLoadingMessage();return;}
if(nUpdatedObjects){window.clearTimeout(top.updateTimeout);top.updateTimeout=window.setTimeout(top.doUpdating,1,timeStamp);}else{top.hideLoadingMessage();}
if(afterInvalidateMessage.length){alert(unescape(afterInvalidateMessage));}
if(top.MochiKit.Base.isArrayLike(afterInvalidateFuncAndArgs)){if(typeof(afterInvalidateFuncAndArgs[0])=="function"){try{var tempFunc=afterInvalidateFuncAndArgs[0];var tempArgs=afterInvalidateFuncAndArgs[1];tempFunc(tempArgs);}catch(afterInvExecEx){alert("Error in afterInvalidate function:\n"+afterInvExecEx.message);}}}
if(relocationUrl.length){if(relocationUrl.indexOf("portal.php")===0){wframe=document.all?top.frames.wframe:top.document.getElementById('wframe').contentDocument;wframe.location.href=unescape(relocationUrl);}
else{top.location.href=unescape(relocationUrl);}}};var xhrFailure=function(error){top.hideLoadingMessage();alert(t_("A technical error occurred")+":\n"+error.message);};var ourFailure=function(error){top.hideLoadingMessage();alert(t_("Internal technical error")+': '+error.message);};var ts=getTimeStamp();req.addCallback(success,ts);req.addErrback(xhrFailure);req.addErrback(ourFailure);}
function simpleAjaxExec(config){var params={"url":"string","success":"function","failure":"function"};for(var name in params){var type=params[name];if(!config[name]){throw("simpleAjaxExec missing "+name+" config param");}
if(typeof(config[name])!=type){throw("simpleAjaxExec: "+name+" param is of type "+typeof(config[name])+", expected "+type);}}
var req=MochiKit.Async.loadJSONDoc(config.url);req.addCallback(config.success);req.addErrback(config.failure);}
function buildQS(obj){var qs=[];for(var varName in obj){if(typeof(obj[varName])=="object"){try{var temp=obj[varName];for(var x in temp){qs.push(varName+"["+x+"]="+escape(temp[x]));}}catch(e){qs.push(varName+"="+escape(obj[varName]));}}else{qs.push(varName+"="+escape(obj[varName]));}}
return qs.join("&");}
function postJson(url,data,successFunc){var xhr=MochiKit.Async.getXMLHttpRequest();xhr.open("POST",url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-1');xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status=="200"||xhr.status=="0"){var json=xhr.responseText;var o;eval("o = "+json);successFunc(o);}else{alert("postJson: "+t_("An error occurred"));}}};var postData=MochiKit.Base.queryString(data);xhr.send(postData);}
var open_win_wins=[];function makeWindowOptionString(w,h,opts,delim){if(!delim){delim=', ';if(!opts){opts={};}
if(!h){h=200;}
opts.height=String(h);if(!w){w=100;}
opts.width=String(w);}
var strParts=[];for(var op in opts){if(opts[op].length>0){strParts.push(op+"="+opts[op]);}else{strParts.push(op);}}
return strParts.join(delim);}
function open_win(w_url,w_name,w,h,winOptions){if(!w){w=400;}
if(!h){h=200;}
if(!winOptions){winOptions={};}
var defaultWinOptions={'toolbar':'no','status':'no','scrollbars':'yes','resizable':'yes','menubar':'no','location':'no','directories':'no'};winOptions=MochiKit.Base.merge(defaultWinOptions,winOptions);var optionString=makeWindowOptionString(w,h,winOptions);var c=center_window(w,h);open_win_wins[w_name]=window.open(w_url,w_name,optionString,true);return open_win_wins[w_name];}
function open_win2(w_url,w_name,winOptions){if(!winOptions){winOptions={};}
var opts={'left':'20','top':'20','toolbar':'no','status':'no','scrollbars':'yes','resizable':'yes','menubar':'no','location':'no','directories':'no'};winOptions=MochiKit.Base.merge(opts,winOptions);var optString=makeWindowOptionString(screen.availWidth-70,screen.availHeight-70,winOptions);return window.open(w_url,w_name,optString,true);}
function open_win3(w_url,w_name,winOptions){var opts={'left':'0','top':'0','toolbar':'no','status':'no','scrollbars':'yes','resizable':'yes','menubar':'no','location':'no','directories':'no','fullscreen':''};winOptions=MochiKit.Base.merge(opts,winOptions);var optString=makeWindowOptionString(screen.availWidth-10,screen.availHeight-50,winOptions);return window.open(w_url,w_name,optString,true);}
function generic_popup(url,w,h){var opts={'toolbar':'no','status':'yes','scrollbars':'yes','resizable':'yes','menubar':'no','location':'no','directories':'no','fullscreen':'no'};var wp=window.open(url,'popwin',makeWindowOptionString(w,h,opts));wp.focus();return wp;}
function clean_popup(url,w,h){var opts={'toolbar':'no','status':'no','scrollbars':'no','resizable':'no','menubar':'no','location':'no','directories':'no'};return window.open(url,"eos_clean_popwin",makeWindowOptionString(w,h,opts),true);}
function add_vw_frame(frameid,viewid){if(frameid=='1'){vw_frames=[];}
vw_frames[frameid]=viewid;}
function add_sw_frame(frameid,sheetid){if(frameid=='1'){sw_frames=[];}
sw_frames[frameid]=sheetid;}
function get_vw_resize_frame(id){var frame;var hwsFrame;var dtfFrame;try{if(document.getElementById(id)){frame=document.getElementById(id);return frame;}
if(top.frames.workspace){hwsFrame=top.frames.workspace.document.getElementById("hwsframe");}
if(!hwsFrame){hwsFrame=top.document.getElementById("ws_guide");}
if(hwsFrame){lookIn=hwsFrame;lookInDoc=document.all?lookIn.contentWindow.document:lookIn.contentDocument;lookInFrames=lookIn.contentWindow.frames;}else{lookIn=top.frames.workspace;lookInDoc=lookIn.document;lookInFrames=lookIn.frames;}
if(lookInDoc.getElementById(id)){frame=lookInDoc.getElementById(id);}else if(lookInDoc.getElementById("dtfIFrame")){dtfFrame=lookInDoc.getElementById("dtfIFrame");dtfDoc=document.all?dtfFrame.contentWindow.document:dtfFrame.contentDocument;frame=dtfDoc.getElementById(id);}else if(lookInFrames.ws_main.document.getElementById(id)){frame=lookInFrames.ws_main.document.getElementById(id);}else if(lookInFrames.ws_bottom.document.getElementById(id)){frame=lookInFrames.ws_bottom.document.getElementById(id);}}catch(e){return false;}
if(frame===null){frame=false;}
return frame;}
function vw_frame_resize(id,doc,minSize){var frame=get_vw_resize_frame(id);if(frame===false){return false;}
var newHeight=0;if(document.all){newHeight=doc.body.scrollHeight+30;}else{var addpxl=10;if(frame.scrolling=="auto"){addpxl=30;}
newHeight=doc.body.offsetHeight+addpxl;}
if(typeof(minSize)==='undefined'){minSize=150;}
if(newHeight<minSize){newHeight=minSize;}
frame.height=newHeight;}
function vw_frame_resizewidth(id,doc){var frame=get_vw_resize_frame(id);if(frame===false){return false;}
var addpxl=0;if(frame.scrolling=="auto"){addpxl=30;}
frame.width="10";var rw;try{rw=(doc.getElementById("fixedHeaders").scrollWidth+addpxl);}catch(e){rw=(doc.body.scrollWidth+addpxl);}
frame.width=rw;}
function checkVFrameSizes(){var frame,id;for(id in top.vw_frames){frame=get_vw_resize_frame("vframe"+id);if(frame===false){continue;}
if(parseInt(frame.width,10)<frame.ownerDocument.body.clientWidth){frame.width="100%";}}
for(id in top.sw_frames){frame=get_vw_resize_frame("sframe"+id);if(frame===false){continue;}
if(parseInt(frame.width,10)<frame.ownerDocument.body.clientWidth){frame.width="100%";}}}
var omwPtr=null;function openModalWindow(url,w,h){var opts;var optString;if(document.all){if(BrowserDetect.browser=='Explorer'&&BrowserDetect.version<7){h+=50;}
var opts={'center':'1','resizable':'0','scroll':'1','status':'0','help':'0','dialogHeight':h+'px','dialogWidth':w+'px'};omwPtr=window.showModalDialog(url,window,makeWindowOptionString(null,null,opts,'; '));}else{if(omwPtr===null||typeof(omwPtr.title=="unknown"||!omwPtr.focus())){opts={'location':'no','status':'no','toolbar':'no','scrollbars':'yes','menubar':'no','resizable':'no'};optString=makeWindowOptionString(w,h,opts);omwPtr=window.open(url,'eos_omw_dialog',optString);}}}
function set_fokuskommun(node_id){var params="fokuskommun|"+node_id;top.eos_cmd("cookie_gstate",params);}
var tabScrollPos=0;function storeTabScrollPos(doc){var fixedHeaders;if(document.all){fixedHeaders=doc.getElementById("fixedHeaders");if(fixedHeaders){tabScrollPos=fixedHeaders.scrollTop;}else{tabScrollPos=doc.getElementById("content").scrollTop;}}}
function setTabScrollPos(doc){var fixedHeaders;if(document.all){fixedHeaders=doc.getElementById("fixedHeaders");if(fixedHeaders){fixedHeaders.scrollTop=tabScrollPos;}else{doc.getElementById("content").scrollTop=tabScrollPos;}}}
function confirmDiscardGridEdits(){var numOfDirtyGrids=top.SaveChecker.checkAll();if(numOfDirtyGrids<=0){return true;}
if(confirm(sprintf(t_("There is unsaved data in %s grid(s). Would you like to continue without saving?"),numOfDirtyGrids))){SaveChecker.clearAll();return true;}
return false;}
top.SaveChecker={grids:{},add:function(fqn){this.grids[fqn]=true;},remove:function(fqn){delete this.grids[fqn];},checkAll:function(){var grid;var dirtyGrids=0;for(var fqn in this.grids){grid=locateWsGrid(fqn);if(!grid){this.remove(fqn);continue;}
if(grid&&grid.getEnableUnsavedConfirmation()&&grid.getGridDirty()){dirtyGrids++;}}
return dirtyGrids;},clearAll:function(){var grid;for(var fqn in this.grids){grid=locateWsGrid(fqn);if(grid&&grid.getGridDirty()){grid.clearGridDirty();this.remove(fqn);}}}};function portalCloseWorkspace(workspaceNodeId){if(typeof(workspaceNodeId)!=='undefined'){if(top.confirmDiscardGridEdits()){top.eos_cmd('closeworkspace','portal',null,workspaceNodeId);}}else{alert(t_("Unable to identify workspace!"));}}
function closeWorkspaceAndRelocate(workspaceNodeId,relocUrl){var returnUrlForCmd=true;var cmdUrl=top.eos_cmd("closeworkspace","portal",null,workspaceNodeId,null,null,null,null,returnUrlForCmd);if(top.confirmDiscardGridEdits()){top.simpleAjaxExec({url:cmdUrl,success:function(data){top.portalRelocate(top.HYPERGENE.addBasePath(relocUrl));},failure:function(error){alert("Failed to close workspace: "+error.message);}});}}
function backToBudget(workspaceNodeId){if(top.confirmDiscardGridEdits()){top.eos_cmd("closeworkspace","budget",null,workspaceNodeId);}}
function portalShowStartpage(url){top.frames.workspace.document.location.href='portal.php';}
function portalRelocate(relocationUrl){wframe=document.all?top.frames.wframe:top.document.getElementById('wframe').contentDocument;wframe.location.href=unescape(relocationUrl);}
top.dlWin=false;top.dlw=function(v){if(!top.dlWin){var opts={'toolbar':'no','menubar':'no','status':'no','scrollbars':'yes','resizable':'yes'};var optString=makeWindowOptionString(500,500,opts);top.dlWin=window.open("_log.html","dlWin",optString);setTimeout("top.dlWin.document.dlog('"+v+"')",10);}else{try{top.dlWin.document.dlog(v);}catch(ex){}}};function dirtylog(v,doAlert,clear){if(!top.document.getElementById("dirtylogger")){var dl=top.document.createElement("TEXTAREA");dl.style.top="0px";dl.style.right="0px";dl.style.width="400px";dl.style.height="300px";dl.id="dirtylogger";dl.style.backgroundColor='white';dl.style.border="1px solid #909090";var dv=top.document.createElement("DIV");dv.style.top="0px";dv.style.right="0px";dv.style.width="400px";dv.style.height="330px";dv.style.overflow="auto";dv.style.position="absolute";dv.style.backgroundColor="white";dv.style.zIndex=200;dv.id="dirtyloggerdiv";dv.appendChild(dl);var html='<input type="button" onclick="dirtyselect();" value="select">';html+='<input type="button" onclick="dirtyclear();" value="clear">';html+='<input type="button" onclick="dirtyclose();" value="close">';dv.innerHTML+=html;top.document.body.appendChild(dv);}
if(clear){top.document.getElementById("dirtylogger").value=v+"\n";}else{top.document.getElementById("dirtylogger").value+=v+"\n";}
if(doAlert){alert("Break:\n"+v);}}
top.dl=dirtylog;function dirtyfocus(){top.document.getElementById("dirtylogger").focus();}
function dirtyselect(){top.document.getElementById("dirtylogger").select();}
function dirtyclear(){var x=top.document.getElementById("dirtylogger");if(x){x.value='';}}
function dirtyclose(){var x=top.document.getElementById("dirtyloggerdiv");if(x){top.document.body.removeChild(x);}}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1){return data[i].identity;}}else if(dataProp){return data[i].identity;}}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1){return;}
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();top.activeWsCloseButton=true;function wsCloseButtonActive(){currentState=top.activeWsCloseButton;if(currentState){top.activeWsCloseButton=false;top.setTimeout("top.activeWsCloseButton=true",2000);return true;}else{return false;}}
function openWsHelp(wsNodeId,wsHelpTitle,editMode){var editStr="&edit=0";if(editMode){editStr="&edit=1";}
open_win('ws_help.php?wsNodeId='+wsNodeId+'&wsHelpTitle='+wsHelpTitle+editStr,'_blank',800,500,{'scrollbars':'yes','status':'no'});}
function ColorPickerFactory(pickerFile,varName){this.pickers=[];this.file=pickerFile;this.winWidth=300;this.winHeight=350;this.varName=varName;this.newPicker=function(id,formElement){this.pickers[id]=formElement;};this.setValueFromPicker=function(id,val){this.pickers[id].value=val;};this.openPicker=function(id){var url=this.file+"?id="+id+"&name="+this.varName;var params="width="+this.winWidth+", height="+this.winHeight+", directories=no, location=no,";params+="menubar=no, scrollbars=no, scrolling=auto, status=no, toolbar=no, resizable=no";var winName="cpicker"+id;ptr=window.open(url,winName,params);};this.openNew=function(id,formElement){this.newPicker(id,formElement);this.openPicker(id);};}
function Epoch(name,mode,targetelement,multiselect,win,fullyQualifiedG2Id)
{var w,p=win.parent;while(p)
{if(p.document.body.tagName=='BODY')
{w=p;break;}
p=p.parent;}
if(w)
{this.topWin=w;}
else
alert('no body');this.win=win;this.g2id=fullyQualifiedG2Id;this.state=0;this.name=name;this.curDate=new Date();this.mode=mode;this.selectMultiple=(multiselect==true);this.selectedDates=new Array();this.calendar;this.calHeading;this.calCells;this.rows;this.cols;this.cells=new Array();this.monthSelect;this.yearSelect;this.mousein=false;this.calConfig();this.setDays();this.displayYear=this.displayYearInitial;this.displayMonth=this.displayMonthInitial;this.createCalendar();if(this.mode=='popup'&&targetelement&&targetelement.type=='text')
{this.tgt=targetelement;this.calendar.style.position='absolute';this.topOffset=this.tgt.offsetHeight;this.leftOffset=0;this.calendar.style.top=this.getTop(targetelement)+this.topOffset+'px';this.calendar.style.left=this.getLeft(targetelement)+this.leftOffset+'px';top.document.body.appendChild(this.calendar);this.tgt.calendar=this;var self=this;this.tgt.ondblclick=function(evt){if(document.all){evt=self.win.event;}
var viewPortLeftPos=0;var viewPortTopPos=0;if(document.all){viewPortLeftPos=top.window.screenLeft;viewPortTopPos=top.window.screenTop;}else{windowLeftPos=top.window.screenX;windowTopPos=top.window.screenY;decorationWidth=window.outerWidth-window.innerWidth;decorationHeight=window.outerHeight-window.innerHeight;viewPortLeftPos=decorationWidth+windowLeftPos;viewPortTopPos=decorationHeight+windowTopPos;}
var left=evt.screenX-viewPortLeftPos;var mtop=evt.screenY-viewPortTopPos;self.calendar.style.left=self.iframe.style.left=left+'px';self.calendar.style.top=self.iframe.style.top=mtop+'px';self.calendar.style.zIndex=1000;this.calendar.show();self.updateDate();};this.tgt.onblur=function(){if(!this.calendar.mousein){this.calendar.hide();}};this.tgt.onkeyup=function(){self.updateDate();}}
else
{this.container=targetelement;this.container.appendChild(this.calendar);}
this.state=2;this.visible?this.show():this.hide();}
Epoch.prototype.calConfig=function()
{this.displayYearInitial=this.curDate.getFullYear();this.displayMonthInitial=this.curDate.getMonth();this.rangeYearLower=2005;this.rangeYearUpper=2037;this.minDate=new Date(2005,0,1);this.maxDate=new Date(2037,0,1);this.startDay=1;this.showWeeks=true;this.selCurMonthOnly=false;this.clearSelectedOnChange=true;switch(this.mode)
{case'popup':this.visible=false;break;case'flat':this.visible=true;break;}
this.setLang();};Epoch.prototype.setLang=function()
{this.daylist=new Array(t_("Su"),t_("Mo"),t_("Tu"),t_("We"),t_("Th"),t_("Fr"),t_("Sa"),t_("Su"),t_("Mo"),t_("Tu"),t_("We"),t_("Th"),t_("Fr"),t_("Sa"));this.months_sh=new Array(t_("Jan"),t_("Feb"),t_("Mar"),t_("Apr"),t_("May"),t_("Jun"),t_("Jul"),t_("Aug"),t_("Sep"),t_("Oct"),t_("Nov"),t_("Dec"));this.monthup_title=t_("Go to the next month");this.monthdn_title=t_("Go to the previous month");this.clearbtn_caption=t_("Clear");this.clearbtn_title=t_("Clears any dates selected on the calendar");this.maxrange_caption=t_("This is the maximum range");};Epoch.prototype.getTop=function(element)
{var oNode=element;var iTop=0;while(oNode.tagName!='BODY'){iTop+=oNode.offsetTop;oNode=oNode.offsetParent;}
return iTop;};Epoch.prototype.getLeft=function(element)
{var oNode=element;var iLeft=0;while(oNode.tagName!='BODY'){iLeft+=oNode.offsetLeft;oNode=oNode.offsetParent;}
return iLeft;};Epoch.prototype.show=function()
{this.calendar.style.display='block';this.visible=true;};Epoch.prototype.hide=function()
{this.calendar.style.display='none';this.visible=false;};Epoch.prototype.toggle=function()
{if(this.visible){this.hide();}
else{this.show();}};Epoch.prototype.setDays=function()
{this.daynames=new Array();var j=0;for(var i=this.startDay;i<this.startDay+7;i++){this.daynames[j++]=this.daylist[i];}
this.monthDayCount=new Array(31,((this.curDate.getFullYear()-2000)%4?28:29),31,30,31,30,31,31,30,31,30,31);};Epoch.prototype.setClass=function(element,className)
{element.setAttribute('class',className);element.setAttribute('className',className);};Epoch.prototype.createCalendar=function()
{this.iframe=top.document.createElement('iframe');this.iframe.src="javascript:false";this.iframe.style.position='absolute';this.iframe.style.width='200px';this.iframe.style.height='190px';this.iframe.border=this.iframe.frameBorder=0;var tbody,tr,td;this.calendar=top.document.createElement('table');this.calendar.setAttribute('id',this.name+'_calendar');this.setClass(this.calendar,'calendar');this.calendar.onselectstart=function(){return false;};this.calendar.ondrag=function(){return false;};tbody=document.createElement('tbody');tr=top.document.createElement('tr');td=top.document.createElement('td');td.appendChild(this.createMainHeading());tr.appendChild(td);tbody.appendChild(tr);tr=top.document.createElement('tr');td=top.document.createElement('td');td.appendChild(this.createDayHeading());tr.appendChild(td);tbody.appendChild(tr);tr=top.document.createElement('tr');td=top.document.createElement('td');td.setAttribute('id',this.name+'_cell_td');this.calCellContainer=td;td.appendChild(this.createCalCells());tr.appendChild(td);tbody.appendChild(tr);tr=top.document.createElement('tr');td=top.document.createElement('td');td.appendChild(this.createFooter());tr.appendChild(td);tbody.appendChild(tr);this.calendar.appendChild(tbody);this.calendar.owner=this;this.calendar.onmouseover=function(){this.owner.mousein=true;};this.calendar.onmouseout=function(){this.owner.mousein=false;};};Epoch.prototype.createMainHeading=function()
{var container=document.createElement('div');container.setAttribute('id',this.name+'_mainheading');this.setClass(container,'mainheading');this.monthSelect=document.createElement('select');this.yearSelect=document.createElement('select');var monthDn=document.createElement('input'),monthUp=document.createElement('input');var opt,i;for(i=0;i<12;i++)
{opt=document.createElement('option');opt.setAttribute('value',i);if(this.state==0&&this.displayMonth==i){opt.setAttribute('selected','selected');}
opt.appendChild(document.createTextNode(this.months_sh[i]));this.monthSelect.appendChild(opt);}
for(i=this.rangeYearLower;i<=this.rangeYearUpper;i++)
{opt=document.createElement('option');opt.setAttribute('value',i);if(this.state==0&&this.displayYear==i){opt.setAttribute('selected','selected');}
opt.appendChild(document.createTextNode(i));this.yearSelect.appendChild(opt);}
monthUp.setAttribute('type','button');monthUp.setAttribute('value','>');monthUp.setAttribute('title',this.monthup_title);monthDn.setAttribute('type','button');monthDn.setAttribute('value','<');monthDn.setAttribute('title',this.monthdn_title);this.monthSelect.owner=this.yearSelect.owner=monthUp.owner=monthDn.owner=this;monthUp.onmouseup=function(){this.owner.nextMonth();};monthDn.onmouseup=function(){this.owner.prevMonth();};this.monthSelect.onchange=function(){this.owner.displayMonth=this.value;this.owner.displayYear=this.owner.yearSelect.value;this.owner.goToMonth(this.owner.displayYear,this.owner.displayMonth);};this.yearSelect.onchange=function(){this.owner.displayMonth=this.owner.monthSelect.value;this.owner.displayYear=this.value;this.owner.goToMonth(this.owner.displayYear,this.owner.displayMonth);};container.appendChild(monthDn);container.appendChild(this.monthSelect);container.appendChild(this.yearSelect);container.appendChild(monthUp);return container;};Epoch.prototype.createFooter=function()
{var container=document.createElement('div');var clearSelected=document.createElement('input');clearSelected.setAttribute('type','button');clearSelected.setAttribute('value',this.clearbtn_caption);clearSelected.setAttribute('title',this.clearbtn_title);clearSelected.owner=this;clearSelected.onclick=function(){this.owner.resetSelections(false);};container.appendChild(clearSelected);var closeButton=document.createElement('input');closeButton.setAttribute('type','button');closeButton.setAttribute('value',t_("Close"));closeButton.setAttribute('title',t_("Close"));closeButton.owner=this;closeButton.onclick=function(){this.owner.hide()};container.appendChild(closeButton);return container;};Epoch.prototype.resetSelections=function(returnToDefaultMonth)
{this.selectedDates=new Array();this.rows=new Array(false,false,false,false,false,false,false);this.cols=new Array(false,false,false,false,false,false,false);if(this.tgt)
{this.tgt.value='';if(this.mode=='popup'){this.hide();}}
if(returnToDefaultMonth==true){this.goToMonth(this.displayYearInitial,this.displayMonthInitial);}
else{this.reDraw();}};Epoch.prototype.createDayHeading=function()
{this.calHeading=document.createElement('table');this.calHeading.setAttribute('id',this.name+'_caldayheading');this.setClass(this.calHeading,'caldayheading');var tbody,tr,td;tbody=document.createElement('tbody');tr=document.createElement('tr');this.cols=new Array(false,false,false,false,false,false,false);if(this.showWeeks)
{td=document.createElement('td');td.setAttribute('class','wkhead');td.setAttribute('className','wkhead');tr.appendChild(td);}
for(var dow=0;dow<7;dow++)
{td=document.createElement('td');td.appendChild(document.createTextNode(this.daynames[dow]));if(this.selectMultiple){td.headObj=new CalHeading(this,td,(dow+this.startDay<7?dow+this.startDay:dow+this.startDay-7));}
tr.appendChild(td);}
tbody.appendChild(tr);this.calHeading.appendChild(tbody);return this.calHeading;};Epoch.prototype.createCalCells=function()
{this.rows=new Array(false,false,false,false,false,false);this.cells=new Array();var row=-1,totalCells=(this.showWeeks?48:42);var beginDate=new Date(this.displayYear,this.displayMonth,1);var endDate=new Date(this.displayYear,this.displayMonth,this.monthDayCount[this.displayMonth]);var sdt=new Date(beginDate);sdt.setDate(sdt.getDate()+(this.startDay-beginDate.getDay())-(this.startDay-beginDate.getDay()>0?7:0));this.calCells=document.createElement('table');this.calCells.setAttribute('id',this.name+'_calcells');this.setClass(this.calCells,'calcells');var tbody,tr,td;tbody=document.createElement('tbody');for(var i=0;i<totalCells;i++)
{if(this.showWeeks)
{if(i%8==0)
{row++;tr=document.createElement('tr');td=document.createElement('td');if(this.selectMultiple){td.weekObj=new WeekHeading(this,td,sdt.getWeek(),row)}
else
{td.setAttribute('class','wkhead');td.setAttribute('className','wkhead');}
td.appendChild(document.createTextNode(sdt.getWeek()));tr.appendChild(td);i++;}}
else if(i%7==0)
{row++;tr=document.createElement('tr');}
td=document.createElement('td');td.appendChild(document.createTextNode(sdt.getDate()));var cell=new CalCell(this,td,sdt,row);this.cells.push(cell);td.cellObj=cell;sdt.setDate(sdt.getDate()+1);tr.appendChild(td);tbody.appendChild(tr);}
this.calCells.appendChild(tbody);this.reDraw();return this.calCells;};Epoch.prototype.reDraw=function()
{this.state=1;var i,j;for(i=0;i<this.cells.length;i++){this.cells[i].selected=false;}
for(i=0;i<this.cells.length;i++)
{for(j=0;j<this.selectedDates.length;j++){if(this.cells[i].date.getUeDay()==this.selectedDates[j].getUeDay()){this.cells[i].selected=true;}}
this.cells[i].setClass();}
this.state=2;};Epoch.prototype.deleteCells=function()
{this.calCellContainer.removeChild(this.calCellContainer.firstChild);this.cells=new Array();};Epoch.prototype.goToMonth=function(year,month)
{this.monthSelect.value=this.displayMonth=month;this.yearSelect.value=this.displayYear=year;this.deleteCells();this.calCellContainer.appendChild(this.createCalCells());};Epoch.prototype.nextMonth=function()
{if(this.monthSelect.value<11){this.monthSelect.value++;}
else
{if(this.yearSelect.value<this.rangeYearUpper)
{this.monthSelect.value=0;this.yearSelect.value++;}
else{alert(this.maxrange_caption);}}
this.displayMonth=this.monthSelect.value;this.displayYear=this.yearSelect.value;this.deleteCells();this.calCellContainer.appendChild(this.createCalCells());};Epoch.prototype.prevMonth=function()
{if(this.monthSelect.value>0)
this.monthSelect.value--;else
{if(this.yearSelect.value>this.rangeYearLower)
{this.monthSelect.value=11;this.yearSelect.value--;}
else{alert(this.maxrange_caption);}}
this.displayMonth=this.monthSelect.value;this.displayYear=this.yearSelect.value;this.deleteCells();this.calCellContainer.appendChild(this.createCalCells());};Epoch.prototype.addZero=function(vNumber)
{return((vNumber<10)?'0':'')+vNumber;};Epoch.prototype.addDates=function(dates,redraw)
{var j,in_sd;for(var i=0;i<dates.length;i++)
{in_sd=false;for(j=0;j<this.selectedDates.length;j++)
{if(dates[i].getUeDay()==this.selectedDates[j].getUeDay())
{in_sd=true;break;}}
if(!in_sd){this.selectedDates.push(dates[i]);}}
if(redraw!=false){this.reDraw();}};Epoch.prototype.removeDates=function(dates,redraw)
{var j;for(var i=0;i<dates.length;i++)
{for(j=0;j<this.selectedDates.length;j++)
{if(dates[i].getUeDay()==this.selectedDates[j].getUeDay()){this.selectedDates.splice(j,1);}}}
if(redraw!=false){this.reDraw();}};Epoch.prototype.outputDate=function(vDate,vFormat)
{var vDay=this.addZero(vDate.getDate());var vMonth=this.addZero(vDate.getMonth()+1);var vYearLong=this.addZero(vDate.getFullYear());var vYearShort=this.addZero(vDate.getFullYear().toString().substring(3,4));var vYear=(vFormat.indexOf('yyyy')>-1?vYearLong:vYearShort);var vHour=this.addZero(vDate.getHours());var vMinute=this.addZero(vDate.getMinutes());var vSecond=this.addZero(vDate.getSeconds());return vFormat.replace(/dd/g,vDay).replace(/mm/g,vMonth).replace(/y{1,4}/g,vYear).replace(/hh/g,vHour).replace(/nn/g,vMinute).replace(/ss/g,vSecond);};Epoch.prototype.updatePos=function(target)
{this.calendar.style.top=this.getTop(target)+this.topOffset+'px'
this.calendar.style.left=this.getLeft(target)+this.leftOffset+'px'}
function CalHeading(owner,tableCell,dow)
{this.owner=owner;this.tableCell=tableCell;this.dayOfWeek=dow;this.tableCell.onclick=this.onclick;}
CalHeading.prototype.onclick=function()
{var owner=this.headObj.owner;var sdates=owner.selectedDates;var cells=owner.cells;owner.cols[this.headObj.dayOfWeek]=!owner.cols[this.headObj.dayOfWeek];for(var i=0;i<cells.length;i++)
{if(cells[i].dayOfWeek==this.headObj.dayOfWeek&&(!owner.selCurMonthOnly||cells[i].date.getMonth()==owner.displayMonth&&cells[i].date.getFullYear()==owner.displayYear))
{if(owner.cols[this.headObj.dayOfWeek])
{if(Epoch.arrayIndex(owner.selectedDates,cells[i].date)==-1){sdates.push(cells[i].date);}}
else
{for(var j=0;j<sdates.length;j++)
{if(cells[i].dayOfWeek==sdates[j].getDay())
{sdates.splice(j,1);break;}}}
cells[i].selected=owner.cols[this.headObj.dayOfWeek];}}
owner.reDraw();};function WeekHeading(owner,tableCell,week,row)
{this.owner=owner;this.tableCell=tableCell;this.week=week;this.tableRow=row;this.tableCell.setAttribute('class','wkhead');this.tableCell.setAttribute('className','wkhead');this.tableCell.onclick=this.onclick;}
WeekHeading.prototype.onclick=function()
{var owner=this.weekObj.owner;var cells=owner.cells;var sdates=owner.selectedDates;var i,j;owner.rows[this.weekObj.tableRow]=!owner.rows[this.weekObj.tableRow];for(i=0;i<cells.length;i++)
{if(cells[i].tableRow==this.weekObj.tableRow)
{if(owner.rows[this.weekObj.tableRow]&&(!owner.selCurMonthOnly||cells[i].date.getMonth()==owner.displayMonth&&cells[i].date.getFullYear()==owner.displayYear))
{if(Epoch.arrayIndex(owner.selectedDates,cells[i].date)==-1){sdates.push(cells[i].date);}}
else
{for(j=0;j<sdates.length;j++)
{if(sdates[j].getTime()==cells[i].date.getTime())
{sdates.splice(j,1);break;}}}}}
owner.reDraw();};function CalCell(owner,tableCell,dateObj,row)
{this.owner=owner;this.tableCell=tableCell;this.cellClass;this.selected=false;this.date=new Date(dateObj);this.dayOfWeek=this.date.getDay();this.week=this.date.getWeek();this.tableRow=row;this.tableCell.onclick=this.onclick;this.tableCell.onmouseover=this.onmouseover;this.tableCell.onmouseout=this.onmouseout;this.setClass();}
CalCell.prototype.onmouseover=function()
{this.setAttribute('class',this.cellClass+' hover');this.setAttribute('className',this.cellClass+' hover');};CalCell.prototype.onmouseout=function()
{this.cellObj.setClass();};CalCell.prototype.onclick=function()
{var cell=this.cellObj;var owner=cell.owner;if(!owner.selCurMonthOnly||cell.date.getMonth()==owner.displayMonth&&cell.date.getFullYear()==owner.displayYear)
{if(owner.selectMultiple==true)
{if(!cell.selected)
{if(Epoch.arrayIndex(owner.selectedDates,cell.date)==-1){owner.selectedDates.push(cell.date);}}
else
{var tmp=owner.selectedDates;for(var i=0;i<tmp.length;i++)
{if(tmp[i].getUeDay()==cell.date.getUeDay()){tmp.splice(i,1);}}}}
else
{owner.selectedDates=new Array(cell.date);if(owner.tgt)
{owner.tgt.value=owner.selectedDates[0].dateFormat();if(owner.mode=='popup'){owner.hide();}}}
owner.reDraw();}};CalCell.prototype.setClass=function()
{if(this.selected){this.cellClass='cell_selected';}
else if(this.owner.displayMonth!=this.date.getMonth()){this.cellClass='notmnth';}
else if(this.date.getDay()>0&&this.date.getDay()<6){this.cellClass='wkday';}
else{this.cellClass='wkend';}
if(this.date.getFullYear()==this.owner.curDate.getFullYear()&&this.date.getMonth()==this.owner.curDate.getMonth()&&this.date.getDate()==this.owner.curDate.getDate()){this.cellClass=this.cellClass+' curdate';}
this.tableCell.setAttribute('class',this.cellClass);this.tableCell.setAttribute('className',this.cellClass);};Date.prototype.getDayOfYear=function()
{return parseInt((this.getTime()-new Date(this.getFullYear(),0,1).getTime())/86400000+1);};Date.prototype.getWeek=function(dowOffset)
{dowOffset=typeof(dowOffset)=='int'?dowOffset:1;var newYear=new Date(this.getFullYear(),0,1);var day=newYear.getDay()-dowOffset;day=(day>=0?day:day+7);var daynum=Math.floor((this.getTime()-newYear.getTime()-(this.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000)+1;var weeknum;if(day<4){weeknum=Math.floor((daynum+day-1)/7)+1;if(weeknum>52){nYear=new Date(this.getFullYear()+1,0,1);nday=nYear.getDay()-dowOffset;nday=nday>=0?nday:nday+7;weeknum=nday<4?1:53;}}
else{weeknum=Math.floor((daynum+day-1)/7);}
return weeknum;};Date.prototype.getUeDay=function()
{return parseInt(Math.floor((this.getTime()-this.getTimezoneOffset()*60000)/86400000));};Date.prototype.dateFormat=function(format)
{if(!format){format='Y-m-d';}
LZ=function(x){return(x<0||x>9?'':'0')+x};var MONTH_NAMES=new Array(t_("January"),t_("February"),t_("March"),t_("April"),t_("May"),t_("June"),t_("July"),t_("August"),t_("September"),t_("October"),t_("November"),t_("December"),t_("Jan"),t_("Feb"),t_("Mar"),t_("Apr"),t_("May"),t_("Jun"),t_("Jul"),t_("Aug"),t_("Sep"),t_("Oct"),t_("Nov"),t_("Dec"));var DAY_NAMES=new Array(t_("Sunday"),t_("Monday"),t_("Tuesday"),t_("Wednesday"),t_("Thursday"),t_("Friday"),t_("Saturday"),t_("Sun"),t_("Mon"),t_("Tue"),t_("Wed"),t_("Thu"),t_("Fri"),t_("Sat"));format=format+"";var result="";var i_format=0;var c="";var token="";var y=this.getFullYear().toString();var M=this.getMonth()+1;var d=this.getDate();var E=this.getDay();var H=this.getHours();var m=this.getMinutes();var s=this.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();value['Y']=y.toString();value['y']=y.substring(2);value['n']=M;value['m']=LZ(M);value['F']=MONTH_NAMES[M-1];value['M']=MONTH_NAMES[M+11];value['j']=d;value['d']=LZ(d);value['D']=DAY_NAMES[E+7];value['l']=DAY_NAMES[E];value['G']=H;value['H']=LZ(H);if(H==0){value['g']=12;}
else if(H>12){value['g']=H-12;}
else{value['g']=H;}
value['h']=LZ(value['g']);if(H>11){value['a']='pm';value['A']='PM';}
else{value['a']='am';value['A']='AM';}
value['i']=LZ(m);value['s']=LZ(s);while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);}
if(value[token]!=null){result=result+value[token];}
else{result=result+token;}}
return result;};Epoch.arrayIndex=function(arr,searchVal,startIndex)
{startIndex=(startIndex!=null?startIndex:0);for(var i=startIndex;i<arr.length;i++)
{if(searchVal==arr[i]){return i;}}
return-1;};Epoch.prototype.updateDate=function()
{if(this.tgt.value&&/[0-9]{4}\-[0-9]{2}\-[0-9]{2}/.test(this.tgt.value))
{var arr=this.tgt.value.split('-');this.displayYear=arr[0];this.displayMonth=parseInt(arr[1].charAt(0)=='0'?arr[1].substr(1):arr[1])-1;this.goToMonth(this.displayYear,this.displayMonth);this.selectedDates=new Array();var d=new Date(this.displayYear,this.displayMonth,arr[2]);this.addDates([d]);}}
var HYPERGENE=HYPERGENE||{};HYPERGENE.StaleSessionHandler=HYPERGENE.StaleSessionHandler||{};HYPERGENE.StaleSessionHandler.handleError=function(json){var urlEnc;if(typeof(encodeURIComponent)!="undefined"){urlEnc=function(unencoded){return encodeURIComponent(unencoded).replace(/\'/g,'%27');};}else{urlEnc=function(unencoded){return escape(unencoded).replace(/\+/g,'%2B').replace(/\"/g,'%22').rval.replace(/\'/g,'%27');};}
var EosErrorJson;if(typeof(json)!="string"){EosErrorJson=json;}else{eval(json);}
var o=EosErrorJson;names=[];values=[];for(var k in o){var v=o[k];if(typeof(v)!="function"){names.push(k);values.push(v);}}
var rval=[];var len=Math.min(names.length,values.length);for(var i=0;i<len;i++){v=values[i];if(typeof(v)!='undefined'&&v!==null){rval.push(urlEnc(names[i])+"="+urlEnc(v));}}
var qs=rval.join("&");if(window.top){if(top.HYPERGENE.EosIsEmbedded){if(EosErrorJson.staleSessionHandlerPath){window.top.document.getElementById("wframe").src=EosErrorJson.staleSessionHandlerPath+'/staleSession.php?'+qs;}else{window.top.document.getElementById("wframe").src=top.HYPERGENE.addBasePath('staleSession.php?'+qs);}}else{if(EosErrorJson.staleSessionHandlerPath){window.top.location.href=EosErrorJson.staleSessionHandlerPath+'/staleSession.php?'+qs;}else{window.top.location.href='staleSession.php?'+qs;}}}else{alert('stale session handler: we got to the "no top" part');}};var HYPERGENE=HYPERGENE||{};HYPERGENE.Ui=HYPERGENE.Ui||{};HYPERGENE.Ui.getSidebar=function(){var mb=MochiKit.Base;var mi=MochiKit.Iter;var portalDoc;var goSetPortalDoc=function(no){if(no.id=='wframe'){portalDoc=no.contentDocument||(no.contentWindow&&no.contentWindow.document)||(no.name&&document.frames[no.name]&&document.frames[no.name].document)||null;}else if(no.childNodes){return no.childNodes;}}
mb.nodeWalk(window.document.body,goSetPortalDoc);if(!portalDoc){return;}
var framesetParent=portalDoc.getElementById('hwsframe');if(!framesetParent){return;}
var iframe=framesetParent.contentDocument||(framesetParent.contentWindow&&framesetParent.contentWindow.document)||(framesetParent.name&&document.frames[framesetParent.name]&&document.frames[framesetParent.name].document)||null;return iframe.getElementsByTagName('frameset')[0];};HYPERGENE.Ui.getFramesetWidth=function(frameset){if(frameset){return frameset.getAttribute('cols');}else{return'0';}};HYPERGENE.Ui.toggleFolding=function(indicator){var md=MochiKit.DOM;var theFrameset=this.getSidebar();try{if(this.getFramesetWidth(theFrameset).substring(0,1)=='0'){md.setNodeAttribute(theFrameset,'cols','250,*');md.setNodeAttribute(indicator.firstChild,'src','images/application_side_contract.png');}else{md.setNodeAttribute(theFrameset,'cols','0,*');md.setNodeAttribute(indicator.firstChild,'src','images/application_side_expand.png');}}catch(e){return;}};