var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_nav5 = (is_nav && (is_major == 5) || (agt.indexOf('gecko')==-1));
var is_nav5up = (is_nav && (is_major >= 5));
var is_ie   = (agt.indexOf("msie") != -1);
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 4.0")==-1) );
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5  = (is_ie && (is_major >= 4) && (agt.indexOf("msie 5")!=-1) );
var is_ie5up  = (is_ie  && is_ie5);
var HEIGHT = 585;
if( typeof( selectedHeader ) == "undefined" ) { selectedHeader = ""; }
function displayStatusMsg(msgStr) { window.status=msgStr; return true; }
function setCSSStyle(strLayer,elementID,strClass,strBrowser){
if (!strBrowser) {
if  (strLayer == "" || strLayer ==null || typeof(strLayer) =="undefined" ){
strLayer = window.parent.getit_main;
}
else {strLayer = self;}
var e = strLayer.document.getElementById(elementID);
e.className = strClass;
}
}
function spinner(inputText, iChange) {
var d = eval("document.forms[0]." + inputText);
if (d){
var i = getSpinnerValue(inputText);
iChange = iChange - 0;
if (isNaN(i))  i = 0;
d.value = Math.max(i + iChange, 0);
}
}
function getSpinnerValue(inputText){
var d = eval("document.forms[0]." + inputText);
if (d){
var i = d.value - 0;
return i;
}
else { return 0; }
}
function setSidebarForm(strForm){
if ( strForm == "" ) { strForm = "apphead.jsp"; }
if ( top.getit_header && top.getit_header.location.href  &&
top.getit_header.location.href.indexOf( strForm )==-1 )
top.getit_header.location.href = strForm;
}
function trySubmit( sDestination, sSubmit, sTarget, sForm, sButton, f, sWindowFeatures, submitMethod ){
var bSubmit = (sSubmit == "true");
sDestination = sDestination.replace(/\$\$p/g, "%");
var sTemplate = getTrySubmitURLOverride(bSubmit);
if( sTemplate != null )
{
sDestination = sDestination.replace(/\?/g,"_Q_").replace(/=/g,"_EQ_").replace(/&/g,"_AM_");
sDestination = sTemplate.replace(/__URL__/g, sDestination );
var sTemplateTarget = getTrySubmitTargetOverride(bSubmit);
if( sTemplateTarget != null )
sTarget = sTemplateTarget;
}
if ( !f || typeof(f) != 'undefined'){
if( sForm && typeof(sForm) != 'undefined') {f = document.forms[sForm];}
else  {f = document.forms[0]; }
}
if( bSubmit && self.document  && self.document.forms && f && f.__x ){
if (!submitMethod || typeof(submitMethod) == 'undefined' || submitMethod=='') {
if (!f.method || typeof(f.method) == 'undefined' || f.method == '')
submitMethod = "POST";
else
submitMethod = f.method;
}
var i = sDestination.lastIndexOf( "?", sDestination.length );
if (i  >= 0 ){
if ( f && f.__x ) {
var sParam = sDestination.substring( i+1, sDestination.length );
sDestination = sDestination.substring( 0, i );
f.__x.value = "_param=" + sParam;
}
}
if( typeof( f.onsubmit ) == "function" && ! f.onsubmit() ){
return false;
}
f.action = sDestination;
if ( sTarget  && sTarget != "" ) { f.target = sTarget; }
else { f.target = ''; }
f.method = submitMethod;
f.submit();
return true;
}
if(sTarget == "_blank"){
if( top.window.popupWindow && ! top.window.popupWindow.closed ){
top.window.popupWindow.close();
}
if( ! sWindowFeatures ){
top.window.popupWindow=window.open(sDestination, "popupWindow", "top=20,left=20,alwaysRaised=1,scrollbars=0,width=550,height=585");
}
else {
top.window.popupWindow=window.open(sDestination, "popupWindow", sWindowFeatures);
}
return;
}
if( sTarget && sTarget != "" && top.frames.length > 0 ){
var layer = null;
if( top.getit_main && top.getit_main.frames.length > 0 && sTarget.indexOf(".") == -1 ){
layer = top.getit_main.frames[sTarget];
}
if( ! layer ) { layer = top.frames[sTarget]; }
if( ! layer ) { layer = getLayer(sTarget); }
if( layer ) {
layer.location.href=sDestination;
return;
}
}
location.href= sDestination;
}
function getTrySubmitURLOverride(bSubmit)
{
return null;
}
function getTrySubmitTargetOverride(bSubmit)
{
return null;
}
function getLayer(layers){
var aLayers = layers.split(".");
var layer = top;
var i;
for( i=0; i < aLayers.length; ++i ){
if( ! layer ){ alert( "ERROR: Failed to find target:"+aLayers[i-1]+" in "+layers ); break; }
if( aLayers[i] == "top" ) { continue; }
if( aLayers[i] == "_top" ) { continue; }
else if( aLayers[i] == "opener" ){
if( window.opener ) { layer = window.opener.top; }
else { layer = null; }
}
else if( layer == top && eval("top."+aLayers[i] ) ) { layer = eval("top."+aLayers[i] ); }
else {
if( layer.frames && layer.frames.length > 0 ) { layer = layer.frames[aLayers[i]]; }
else { layer = layer.document.getElementById(aLayers[i]);}
}
}
return layer;
}
function popUpWindow( filename , title , windowHeight , windowWidth , scroll, options) {
var ScrollBar = 0;
if (scroll == "yes" || scroll == "Yes")
ScrollBar = 1;
var features = "top=20,left=20,alwaysRaised=1,resizable=yes,scrollbars=" + ScrollBar;
if( windowWidth && windowWidth > 0 ) { features += ",width=" + windowWidth; }
else { features += ",width=550"; }
if( windowHeight && windowHeight > 0 ) { features += ",height=" + windowHeight; }
else { features += ",height=585"; }
var strOptions = "";
if ( options && options != " " ){
var strChopList = options.split( ",");
strOptions = "?";
for (count = 0 ; count < strChopList.length; count++ ){
strOptions = strOptions + "&" + strChopList[ count ];
}
}
if( !title ) { title = "popupWindow"; }
if( top.window.popupWindow && ! top.window.popupWindow.closed )
top.window.popupWindow.close();
top.window.popupWindow=window.open(filename + strOptions, title, features);
}
if( typeof( homeInvokeArray ) == "undefined" ) { homeInvokeArray = new Array(); }
function invokeOnHome(invokeFunc){
var i;
for( i = 0; i < homeInvokeArray.length; ++i ){
if( homeInvokeArray[i] == "" ){
homeInvokeArray[i] = invokeFunc;
break;
}
}
if( i == homeInvokeArray.length )
homeInvokeArray[i] = invokeFunc;
}
function removeInvokeOnHome(invokeFunc){
if( homeInvokeArray.length > 0 ){
var i;
for( i = 0; i < homeInvokeArray.length; ++i ){
if( homeInvokeArray[i] == invokeFunc ){
homeInvokeArray[i] = "";
break;
}
}
}
}
if( typeof( logoutInvokeArray ) == "undefined" ) { logoutInvokeArray = new Array(); }
function invokeOnLogout(invokeFunc){
var i;
for( i = 0; i < logoutInvokeArray.length; ++i ){
if( logoutInvokeArray[i] == "" ){
logoutInvokeArray[i] = invokeFunc;
break;
}
}
if( i == logoutInvokeArray.length ) { logoutInvokeArray[i] = invokeFunc; }
}
function removeInvokeOnLogout(invokeFunc){
if( logoutInvokeArray.length > 0 ){
var i;
for( i = 0; i < logoutInvokeArray.length; ++i ){
if( logoutInvokeArray[i] == invokeFunc ){
logoutInvokeArray[i] = "";
break;
}
}
}
}
function onHome(){
if( homeInvokeArray.length > 0 ){
var i;
for( i = 0; i < homeInvokeArray.length; ++i ){
if( homeInvokeArray[i] != "" )
eval( homeInvokeArray[i] );
}
}
if( top.getit_main  )
top.getit_main.location.href = top._HomePage;
else
top.location.href= top._HomePage;
}
function onLogout(){
if( logoutInvokeArray.length > 0 ){
var i;
for( i = 0; i < logoutInvokeArray.length; ++i ){
if( logoutInvokeArray[i] != "" )
eval( logoutInvokeArray[i] );
}
}
closeChildWindows();
if( top.getit_main  ){
top.getit_main.location.href = top._LogoutPage;
}
else{
top.location.href= top._LogoutPage;
}
if ( top.getit_main_head.document.getElementById('user')){
top.getit_main_head.document.getElementById('user').innerHTML = "";
}
}
function setSelect(e,value){
for( var i=0; i < e.length; ++i ){
var sText = e.options[i].text;
if( sText==value){
e.selectedIndex=i;
return true;
}
}
return false;
}
function postBackChannel(href){
if(top.backchannel) { top.backchannel.location.href = href; }
}
function simpleLivePublishQuery(strQ){
location.replace("http://getanswer/lpBin20/lpext.dll?f=hitlist&t=main-hit-h.htm&x=Simple&v=2.0&s=Relevance-Weight&m=100&n=25&a=Title-Path&h1=Hit[Hit,10]&h2=Relevance-Weight[Rank,5]&h3=Title-Path[Document,85]&q=" + strQ);
}
function onHelp(){
var page = null;
if( top.getit_main && top.getit_main.currentPage )
page = top.getit_main.currentPage;
else if (top.thisPage)
page = top.thisPage;
if( page != null ){
var hDest= page.strHelpURL;
if( top.window.helpWindow && ! top.window.helpWindow.closed )
top.window.helpWindow.close();
top.window.helpWindow = window.open(hDest,'help','scrollbars=yes,resizable=yes,width=550,height=500');
}
}
function showMessageDetail(strID,message){
var page = null;
if( top.getit_main && top.getit_main.currentPage )
page = top.getit_main.currentPage;
else if (top.thisPage)
page = top.thisPage;
if( page != null ){
var hDest= page.strHelpURL;
if( top.window.helpWindow && ! top.window.helpWindow.closed )
top.window.helpWindow.close();
top.window.helpWindow = window.open("blank.htm",'help','scrollbars=yes,resizable=yes,width=550,height=500');
setTimeout('waitABitBeforeShowingMessageDetail("'+strID+'","'+message+'")',300);
}
}
function waitABitBeforeShowingMessageDetail(strID,message){
top.window.helpWindow.focus();
top.window.helpWindow.document.write("<TITLE> _ </TITLE>");
if( strID && strID != "" ){
top.window.helpWindow.document.write("<SPAN size=+2><B><I>"+strID+"</I></B></SPAN><HR>");
}
top.window.helpWindow.document.write(message);
top.window.helpWindow.document.write("<P align='right'><A href='JavaScript:window.close()'>"+top.window.CloseWindowMsg+"</A></P>");
}
function showMessageURL(strID,hDest){
if( top.window.helpWindow && ! top.window.helpWindow.closed )
top.window.helpWindow.close();
top.window.helpWindow = window.open(hDest,'help','scrollbars=yes,resizable=yes,width=550,height=500');
}
function onSubmit(){
if( top.getit_main ){
if( top.getit_main == this ){
var action = currentPage.strSubmitAction;
if( action ){ eval(action); }
}
else { top.getit_main.onSubmit(); }
}
}
function onConfigure( strConfigURL ){
if( top.getit_main && top.getit_main.currentPage ){
if ( !strConfigURL ) { strConfigURL = top.getit_main.currentPage.strConfigureURL;  }
if( strConfigURL != "" ){
var hDest = strConfigURL;
if( top.window.configWindow && ! top.window.configWindow.closed )
top.window.configWindow.close();
top.window.configWindow = window.open(hDest,'config','scrollbars=yes,resizable=yes,width=550,height=670,top=20,left=20');
top.window.configWindow.focus();
}
else if( top.getit_main.currentPage.strConfigureAction != "" ){
eval( top.getit_main.currentPage.strConfigureAction );
}
}
}
function closeConfig(){
if( top.getit_main && top.getit_main.currentPage.strConfigureURL != "" ){
var hDest = top.getit_main.currentPage.strConfigureURL;
if( top.window.configWindow && ! top.window.configWindow.closed )
setTimeout("top.window.configWindow.close()",100);
}
}
function onLookup(sName,hDest,iWidth,iHeight){
hDest = hDest.replace(/\$\$p/g, "%");
if ( !iWidth ) { iWidth = 520; }
if ( !iHeight ) { iHeight = 500; }
if( top.window.lookupWindow && ! top.window.lookupWindow.closed )
top.window.lookupWindow.close();
top.window.lookupWindow = window.open(hDest,sName,"scrollbars=yes,resizable=yes,width="+iWidth+",height="+iHeight+",top=20,left=20");
top.window.lookupWindow.focus();
}
function closeChildWindows(){
if( top.window.helpWindow && ! top.window.helpWindow.closed ){ top.window.helpWindow.close(); }
if( top.window.popupWindow && ! top.window.popupWindow.closed ){ top.window.popupWindow.close(); }
if( top.window.calendarWindow && ! top.window.calendarWindow .closed ){ top.window.calendarWindow .close(); }
if( top.window.lookupWindow && ! top.window.lookupWindow.closed ){ top.window.lookupWindow.close(); }
if( top.window.treeWindow && ! top.window.treeWindow.closed ){ top.window.treeWindow.close(); }
if( top.window.configWindow && ! top.window.configWindow.closed ){ top.window.configWindow.close(); }
if( top.window.debugWindow && ! top.window.debugWindow.closed ){ top.window.debugWindow.close(); }
}
function getCookie(label){
var labelLen = label.length;
var cookieList = document.cookie.split(";");
var iLen = cookieList.length;
var i = 0;
var iEnd;
while( i < iLen ){
var j = cookieList[i].indexOf("=");
if( j > 0 && cookieList[i].substring(0,j).indexOf(label) >= 0 ){
return unescape(cookieList[i].substring(j+1));
}
i++;
}
return "";
}
function setCookie(label,data,expires){
if( expires ) { document.cookie = label+"="+escape(data)+";expires="+expires; }
else { document.cookie = label+"="+escape(data); }
}
function removeCookie(label){ document.cookie = label+"=.;expires=Thu, 01-Jan-70 00:00:01 GMT" }
function showHideLayers() {
var i,p,v,obj,args=showHideLayers.arguments;if(document.getElementById){
for (i=0; i<(args.length-2); i+=3){ obj=ns6_findObj(args[i]);v=args[i+2];
v=(v=='show')?'visible':(v='hide')?'hidden':v;
if(obj)obj.style.visibility=v;}} else{
for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }}
}
function setDOMobject(){
var i,a,v,p,obj,args=setDOMobject.arguments;
for (i=0; i<(args.length-2); i+=3){
obj=ns6_findObj(args[i]);
a=args[i+1];
v=args[i+2];
if(obj){
obj.style[a]=v;
}
}
}
function createDOMElement(){
var i,a,e,v,obj,args=createDOMElement.arguments;
var b=document.getElementsByTagName("body").item(0);
for (i=0; i<(args.length-2); i+=3){
obj=args[i];
a=args[i+1];
v=args[i+2];
e = document.createElement(obj);
if(!document.getElementById(v)){
b.appendChild(e);
e.setAttribute(a,v);
}
}
return(document.getElementById(v));
}
function createDOMAttribute(){
var i,a,v,obj,args=createDOMAttribute.arguments;
for (i=0; i<(args.length-2); i+=3){
obj=ns6_findObj(args[i]);
a=args[i+1];
v=args[i+2];
obj.setAttribute(a,v);
}
}
function setFieldByName(strFieldName, strValue){
var field = eval(strFieldName);
if ( field != null )
setField(field,strValue);
}
function setField(field, strValue){
if ( field != null ) {
if (field.length > 1) {
for (i = 0; i < field.length; i++) {
if (field[i].value == strValue) {
if (field.type && field.type.indexOf("select") > -1)
field.options[i].selected = true;
else
setField(field[i],strValue);
break;
}
}
}
else if ((field.type=="checkbox" || field.type=="radio") && field.value == strValue){
field.checked = true;
}
else if ((typeof field.type)=="undefined") { field.innerHTML = strValue; }
else { field.value = strValue; }
}
}
function getFieldValue(field) {
var strValue = "";
if ( field ){
if ( field.type=="checkbox" && !field.checked )
strValue = "";
else if ( field.type=="select" || field.type=="select-one" ||  field.type=="select-multiple" ){
for (var k = 0; k < field.options.length; k++) {
if (field.options[k].selected) { strValue = field.options[k].value; break;}
}
}
else if (field.type=="radio" && field.checked ) {
strValue = field.value;
}
else if (field.length > 0 && field[0].type=="radio") {
for (var j = 0 ; j < field.length ; j++){
if ( field[j].checked ){ strValue = field[j].value; break; }
}
}
else if ((typeof field.type)=="undefined") {
strValue = field.innerHTML;
}
else {
strValue = field.value;
}
}
return strValue;
}
function findField( f, sName )
{
var field = null;
for ( var i = 0; i < f.elements.length; i++ )
{
var elem = f.elements[i];
if ( elem.name == sName )
{
if (elem.type=="radio")
{
if (field == null)
field = new Array();
field[field.length] = elem;
} else {
field = elem;
break;
}
}
}
return field;
}
function genPopupHeader( thisPage ){
if ( !top.getit_main && thisPage.strConfigure && thisPage.strConfigure != "" && !thisPage.bIs508 ){
var d = new Date();
var sWindowName = "config" + d.getTime();
document.write( "<A  href='JavaScript:window.open( \"" + thisPage.strConfigureURL + "&personalizetarget=1\", \"" + sWindowName + "\", \"scrollbars=yes,resizable=yes,width=550,height=585\");void(0);' " +
" class='HeaderMessages'>" + thisPage.strConfigure + "</A><BR>" );
}
}
function closePopup( w ){ w.setTimeout("close()",100); }
function encodeXMLAttribute( str ){
str = str.replace(/\'/g,"%%#x27%%");
str = str.replace(/\"/g,"%%#x22%%");
str = str.replace(/&/g,"%%#x38%%");
return str;
}
function decodeXMLAttribute( str ){
str = str.replace(/%%#x27%%/g,"'");
str = str.replace(/%%#x22%%/g,'"');
str = str.replace(/%%#x38%%/g,"&");
str = str.replace(/&#x27;/g,"'");
str = str.replace(/&#x22;/g,'"');
return str;
}
function clearLookup( strPrefix ){
if (strPrefix.length > 0) {
var iMax = arField.length;
for ( var i = 0; i < iMax; i++ ){
if ( arField[i].Name.indexOf( strPrefix,0 ) >= 0 ){
var f = document.getElementById( arField[i].Name );
if ( f )
{ setField( f, "" ); }
f = document.getElementById( arField[i].Name + "_display" );
if ( f )
{ setField( f, "" ); }
f = document.getElementById(arField[i].Name + "_display_span");
if (f)
{ f.innerHTML = ""; }
}
}
}
}
function CheckAll(gadget){
var aForm=document.forms[0]
for (var i=0;i<aForm.elements.length;i++){
var e = aForm.elements[i];
if (e.tagName == gadget.tagName) {
if (e.type == gadget.type) { e.checked = gadget.checked; }
}
}
}
function Field(strName,strLabel,strValue,strRequired){
this.Name = strName;
this.Label = strLabel;
this.Value = strValue;
this.Required = strRequired;
}
function addFieldToArray(arField,objFields,strName,strLabel,strRequired,strDisplayField)
{
var ilgt = arField.length;
var theField = document.getElementById(strName);
var strValue = getFieldValue(theField);
arField[ilgt] = new Field(strName,strLabel,strValue,"false");
objFields[strName] = arField[ilgt];
if (strRequired != "")
arField[ilgt].Required = strRequired;
if (strDisplayField != "")
arField[arField.length] = new Field(strDisplayField,"",strValue,"false");
}
function WebPage() {
this.strTitle = "";
this.bAutosubmit = false;
this.bDisplayFormInfo = false;
this.vstrAlerts = [];
this.strModule = "";
this.strActivity = "";
this.strForm = "";
this.strBookmarkSessionKey = false;
this.strNavigate = "";
this.strOnLoad = "";
this.strAccess = "";
this.strSidebar = "";
this.strADWPath = "";
this.strSubmit = "";
this.strConfigure = "";
this.vstrTokenKeys = [];
this.vstrTokenValues = [];
this.strCondition = "";
this.intTimeout = 0;
this.timerSessionTimeoutTrigger = null;
this.strImagePath = "images/skins/classic/";
this.strHelpURL = "";
this.strConfigureURL = "";
this.strConfigureAction = "";
this.strTranslateURL = "";
}
if( typeof( currentPage ) == "undefined" )
currentPage = null;
function setCurrentPage(webPage){
if( currentPage == null ){ currentPage = webPage; }
}
if( typeof( invokeArray ) == "undefined" ) { invokeArray = new Array(); }
function invokeOnPageLoad(func){ invokeArray[invokeArray.length] = func; }
function handleKeyPress(e){
var node = (is_ie)? window.event.srcElement :(!is_ie) ? e.target :null;
var nN = node.nodeName.toUpperCase();
var key = (is_ie)? window.event.keyCode : e.which;
if( key == 13 && currentPage && currentPage.strSubmitAction && !currentPage.bIs508 ){
if (node && ( nN=="A" || nN=="TEXTAREA" || nN=="DIV" || nN=="SPAN") ) {return true;}
eval( currentPage.strSubmitAction );
return false;
}
return true;
}
function doPageLoad(){
for( var i = 0; i != invokeArray.length; ++i ) {
var strInvoke = invokeArray[i];
if( strInvoke.indexOf( "return " ) == 0 ) {strInvoke = strInvoke.substring(7); }
eval( strInvoke );
}
if ( currentPage == null ) { return; }
if( currentPage.strSidebarForm ) { setSidebarForm(currentPage.strSidebarForm); }
else { setSidebarForm(""); }
doTitleAndToolbar();
if (window.document.captureEvents!=null) { document.captureEvents(Event.KEYPRESS); }
document.onkeypress = handleKeyPress;
if ( top.getit_main  ){
top.document.cookie="_bookmark=" + top.getit_main.location.pathname + top.getit_main.location.search;
top.document.cookie="_bookmarkSession="+currentPage.strBookmarkSession;
}
if (currentPage.strSetHeader != "false"){
setHeader();
}
if( currentPage.bAutosubmit ){
if ( currentPage.strSubmitAction ){ eval( currentPage.strSubmitAction ); }
else { self.document.forms[0].submit(); }
return;
}
if( top.build && top.debugWindow ){
if( top.getit_main && top.getit_main.strDebugLog && top.getit_main.buildScriptParams && top.getit_main.buildModel && top.getit_main.buildUser )
{ top.build("forminfo"); }
}
if( top.configWindow && ! top.configWindow.closed ){
if( currentPage.strConfigureURL != "" ){
if( top.configWindow.location.href.indexOf( currentPage.strConfigureURL ) < 0 ){
top.configWindow.location.href = currentPage.strConfigureURL;
}
}
else { top.configWindow.close(); }
}
setFormFocus();
if( currentPage.strOnLoad != null ) { eval( currentPage.strOnLoad ); }
setSessionTimer();
return true;
}
function setHeader(){
if ( currentPage == null || currentPage.bIsTemplate ) { return; }
if( !top.getit_main_head || top.getit_main_head.document == document ){ return; }
if( top.getit_main_head.refresh ) {
if( top.getit_main_head.refresh(currentPage.strAccess) ){ return; }
}
if( top.getit_main_head.build ) { top.getit_main_head.build(); }
}
function setSessionTimer(){
if( currentPage && currentPage.intTimeout > 0 && !( currentPage.strModule == "login" || currentPage.strModule == "logout" ) )
{
if( top.backchannel != null )
{
currentPage.timerSessionTimeoutTrigger = setTimeout( "doKeepAlive()", currentPage.intTimeout );
}
else
{
currentPage.timerSessionTimeoutTrigger = setTimeout( "doKeepAlive()", currentPage.intTimeout * 3 );
}
}
}
function setFormFocus(){
if( currentPage && self.document.forms.length > 0 && self.document.forms[0].elements.length > 0
&& ! ( currentPage.strModule == "portal" && currentPage.strActivity == "home" && currentPage.strForm == "start") && currentPage.strNoFormFocus != "true"){
for( var i = 0; i < self.document.forms[0].elements.length; ++i ){
var elt = self.document.forms[0].elements[i];
if( elt.focus && elt.type && elt.type != "" && elt.type != "hidden" && !elt.disabled){
self.document.forms[0].elements[i].focus();
break;
}
}
}
}
if( typeof( invokeArray2 ) == "undefined" ) { invokeArray2 = new Array(); }
function invokeOnPageUnload(func){ invokeArray2[invokeArray2.length] = func; }
function doPageUnload(){
for( var i = 0; i != invokeArray2.length; ++i ) { eval( invokeArray2[i] ); }
if ( currentPage == null ) { return; }
if( currentPage.timerSessionTimeoutTrigger != null ){
clearTimeout( currentPage.timerSessionTimeoutTrigger );
currentPage.timerSessionTimeoutTrigger = null;
}
if( top.getit_main_head && top.getit_main_head.setToolbar && !top.is_nav4 ){
top.getit_main_head.setToolbar(currentPage);
}
return true;
}
function doSessionTimeout(){
closeChildWindows();
if( top.getit_main != null ) { top.getit_main.location.href = top._ExpiredPage; }
else { top.location.href = top._ExpiredPage; }
}
function doKeepAlive(){
if( top.backchannel != null ) { top.backchannel.location.href = top._KeepAlivePage; }
else { top.location.href = top._ExpiredPage; }
}
function doTitleAndToolbar(counter){
if ( currentPage == null )
return;
var browser = null;
if( top.getit_main_head ){
browser = top.getit_main_head.document.getElementById("formTitles");
}
if( !top.getit_main_head || !top.getit_main_head.doTitleAndToolbar || !browser ){
if( !counter )
counter = 1;
else
counter++;
if( counter < 20 )
setTimeout( "doTitleAndToolbar("+counter+")", 200 );
}
else
top.getit_main_head.doTitleAndToolbar(currentPage);
}
function optElem(index,display,depends){
this.index = index;
this.display = display;
this.depends = depends;
}
function initDependency(fieldName,formName)
{
var obj = objFields[fieldName] = new Object();
obj.dependents = new Array;
obj = window.document.getElementById(fieldName);
if (obj != null)
checkDepends(obj);
}
function setDependency(dependentName,independentName)
{
var opts = objFields[dependentName];
opts.optionValues = new Array();
opts = opts.optionValues;
field = objFields[independentName];
if (typeof field != "undefined")
{
var a = field.dependents;
a[a.length] = dependentName;
}
return opts;
}
function checkDepends(theGadget){
if ( theGadget && ((typeof theGadget) != "undefined") && theGadget.name ) {
var strName = theGadget.name;
var indGadget = objFields[strName];
var index = theGadget.value;
if (typeof indGadget != "undefined") {
arr = indGadget.dependents;
if (arr != "undefined" && arr != null)
for (i=0 ; i < arr.length ; i++)
loadDependent(theGadget.form,theGadget.value,arr[i]);
}
}
}
function loadDependent(theform,index,strName){
var opt = eval("theform."+strName+".options");
opt.length = (opt.length > 0 && opt[0].text == "") ? 1 : 0;
var e=objFields[strName];
if (typeof e != "undefined") {
e = e.optionValues;
for (i=0 ; i < e.length ; i++)
if (e[i].depends == index){ opt[opt.length] = new Option(e[i].display,e[i].index,false,false); }
}
}
function wrapEvent(user,app) {
var isDone=true;
if (user.length > 0) { isDone = eval(user); }
if (isDone) { isDone = eval(app); }
return isDone;
}
function disableElements(obj){
var i,j=0,x,a=disableElements.arguments;
document.sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a[i]))!=null){
document.sr[j++]=x;
if(!x.oSrc) x.oSrc=x.src;
x.src=a[i+2];
}
obj.disabled = !(obj.disabled);
}
function swapImgRestore() {
var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function preloadImages() {
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function swapImage() {
var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function findObj(n, d) {
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function ns6_findObj(n){
var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
}else{x=document.getElementById(n)}return x;
}
function genDrillDown( strDrilldownForm, strField, strPopup )
{
if (strPopup != "false")
{
var d = new Date();
var strWindowName = "popup" + strField + d.getTime();
var w = window.open('', strWindowName, 'scrollbars=yes,resizable=yes,width=520,height=500,top=20,left=20');
w.focus();
top.window.lookupWindow = w;
setTimeout( 'genDrillDownSubmitter(\''+strDrilldownForm+'\', \''+strWindowName+'\', self.document)', 400 );
return "";
}
else
{
return "trySubmit('" + strDrilldownForm + "','true','',null,'',null,null,null);";
}
}
function genDrillDownSubmitter(strDrilldownForm, strWindowName, document)
{
var sOldSubmit=document.forms[0].onsubmit;
document.forms[0].onsubmit=null;
var sOldUpdateOption = null;
if (document.forms[0].bUpdateOption)
sOldUpdateOption = document.forms[0].bUpdateOption.value;
var sOldContext=document.forms[0]._docExplorerContext.value;
document.forms[0]._docExplorerContext.value='';
var _ctxidval = document.forms[0]._ctxidval.value;
var _ctxschema = document.forms[0]._ctxschema.value;
var _ctxobj = document.forms[0]._ctxobj.value;
var _ctxidfld = document.forms[0]._ctxidfld.value;
var __x = document.forms[0].__x.value;
trySubmit( strDrilldownForm, 'true', strWindowName, null, '', document.forms[0], null, null);
document.forms[0].onsubmit=sOldSubmit;
if (document.forms[0].bUpdateOption)
document.forms[0].bUpdateOption.value=sOldUpdateOption.value;
document.forms[0]._docExplorerContext.value=sOldContext;
document.forms[0]._ctxidval.value=_ctxidval;
document.forms[0]._ctxobj.value=_ctxobj;
document.forms[0]._ctxschema.value=_ctxschema;
document.forms[0]._ctxidfld.value=_ctxidfld;
document.forms[0].__x.value = __x;
};
function addItemToCollection(subdocument,destination,field,popup)
{
if ( document.forms[0]._ctxobj )
document.forms[0]._ctxobj.value=subdocument;
if ( document.forms[0]._docExplorerContext )
document.forms[0]._docExplorerContext.value=subdocument;
if ( document.forms[0]._ctxschema )
document.forms[0]._ctxschema.value='';
if (destination.indexOf('?')>-1)
destination +="&";
else
destination +="?";
destination += "_ctxobj="+subdocument+"&_docExplorerContext="+subdocument;
var strValue = genDrillDown( destination,field,popup);
eval( strValue );
void(0);
}
function navigateMore(subdocument,destination)
{
document.forms[0]._collection.value=subdocument;
var sOldContext=document.forms[0]._docExplorerContext.value;
document.forms[0]._docExplorerContext.value=subdocument;
if (document.forms[0]._ctxobj)
document.forms[0]._ctxobj.value=subdocument;
trySubmit(destination, 'true', null, null, null, null, null, null);
document.forms[0]._docExplorerContext.value=sOldContext;
if (document.forms[0]._ctxobj)
document.forms[0]._ctxobj.value=sOldContext;
}
function translate(elem)
{
var strValue = elem.innerText
if (elem.tagName.toUpperCase() == "INPUT")
{
strValue = getFieldValue(elem);
}
transWindow = top.window.translateWindow;
if (transWindow && !transWindow.closed)
{
var service = getFieldValue(transWindow.document.forms[0].serviceName);
var strTarget = "e_commonlookup_translator_start.do?_lookupfield=value&_lookupdisplay=translated&value=" + strValue + "&serviceName="+service;
onTranslate(strTarget,320,160);
}
}
function onTranslate(hDest,iWidth,iHeight){
if (!hDest)
hDest = "e_commonlookup_translator_start.do";
else
hDest = hDest.replace(/\$\$p/g, "%");
if ( !iWidth ) { iWidth = 320; }
if ( !iHeight ) { iHeight = 160; }
top.window.translateWindow = window.open(hDest,'lookup_translate',"scrollbars=yes,resizable=yes,width="+iWidth+",height="+iHeight+",top=20,left=20");
top.window.translateWindow.focus();
}
