//  Copyright (c) 2000, 2007, Oracle. All rights reserved.

//  ToolsRel: 8.49.27




document.props = new Object();

document.props.location = document.location.href;

document.props.domain = document.domain;



function saveWarning2(frameName,form,target,Hide, url)

{

var currUrl=getFrameCurrUrl();

if (currUrl.length==0)

currUrl = url;



if (currUrl.indexOf("h=Y")!=-1)

currUrl = currUrl.replace("h=Y","h=N");

else if (currUrl.indexOf("h=N")!=-1)

currUrl = currUrl.replace("h=N","h=Y");

else if (currUrl.indexOf("?")!=-1)

currUrl = currUrl+"&h="+Hide;

else

currUrl = currUrl+"?h="+Hide;



saveWarning(frameName,form,target,currUrl);

}



function saveWarning(frameName,form,target,url)

{

var changed=null;



if (form)

  changed = checkFormChanged(form, null);



if (changed==null && top.frames && frameName.length>0 )

{

  objFrame = top.frames[frameName];

  if (objFrame)

    changed=checkFrameChanged(objFrame);

}



if ((changed==null) && top.frames)

  changed = checkAnyFrameChanged(top.frames);



var rtn = true;

if (changed)

  rtn = !confirm("You have unsaved data on this page. Click OK to go back and save, or Cancel to continue.");



if (!url)

  return rtn;           



if (rtn)

  open(url, target)



}




function setAnchorAndFocus(link) 

{

setAnchor(link);



var obj = document.anchors[link];

if (obj == null && document.getElementById) 

    obj=document.getElementById(link);

if (obj != null)

    tryFocus(obj);

} 






function setAnchor(link) 

{

var obj = document.anchors[link];

if (obj == null && document.getElementById) 

    obj=document.getElementById(link);



if (obj!=null && typeof obj == 'object')

    {

    if (obj.scrollIntoView) 

        obj.scrollIntoView();

    else 

        

        

        

        

	    if (document.location.hash != ("#" + link) && document.location.hash != link) 

            document.location.href = "#"+link;

    }

}                




function checkAnyFrameChanged(frames)

{

for (var j=0; j < frames.length; ++j)

{

  var objFrame = frames[j];

  if (checkFrameChanged(objFrame))

    return true;

  

  if ((!isCrossDomain(objFrame)) && (objFrame.frames))

    if (checkAnyFrameChanged(objFrame.frames))

      return true;

}

}




function checkFrameChanged(objFrame)

{

if (isCrossDomain(objFrame))

  return null;



var objForms = objFrame.document.forms;

if (!objForms)

  return null;



var retval = null;

for (var i=0; i < objForms.length; i++)

{

  var change = checkFormChanged(objForms[i], objFrame);

  if (change != null)

  {

    if (change)

      return true;

    retval = change;

  }

}


return retval;

}





function checkFormChanged(form, objFrame)

{

if (!form.ICChanged)

  return null;          

if (form.ICChanged.value == "-1")

  return false;        

if (form.ICChanged.value == "1" && form.ICSaveWarningFilter) {

  if (form.ICSaveWarningFilter.value != "1")

     return true;          

}

else if (form.ICChanged.value == "1")

  return true;

var bIsChanged;

for (var j = 0; j < form.length; ++j)

{

  bIsChanged = isChanged(form.elements[j], objFrame);

  if (bIsChanged  && form.ICSaveWarningFilter) {

     if (form.ICSaveWarningFilter.value != "1")

       return true;

  }

  else if (bIsChanged)

     return true;

}

return false;

}



function ignoreChg(obj, objFrame)

{

if (obj.getAttribute == null)

  {

  var ignoreChgElem = null; 

  if (objFrame != null)

    ignoreChgElem = objFrame.ignoreChgElem;

  if (ignoreChgElem == null)

    return false;

  for (var i=0; i<ignoreChgElem.length; i++)

    if (obj.name == ignoreChgElem[i])

      return true;

  return false;

  }

else

  return obj.getAttribute("PSnchg");

}




function isChanged(obj, objFrame)

{

if (obj.type == "checkbox"  || obj.type == "radio")

  return (obj.checked != obj.defaultChecked) && !ignoreChg(obj, objFrame);

else if (obj.type == "select-one" && obj.selectedIndex > -1)

  return !(obj.options[obj.selectedIndex].defaultSelected) && !ignoreChg(obj, objFrame);

else if (obj.type == "select-multiple")

{

  for (var i =0; i < obj.options.length; ++i)

  {

     if (obj.options[i].defaultSelected != obj.options[i].selected)

        return !ignoreChg(obj, objFrame);

  }

  return false;

}

else if (obj.type == "hidden" || obj.type == "button")

  return false;

else

  return (obj.value != obj.defaultValue) && !ignoreChg(obj, objFrame);

}



var timeoutWin;

var timeoutWarningID;

var timeoutID;





function setupTimeoutMac()  

{

window.setTimeout("setupTimeout();", 1000);		

}




function setupTimeout() 

{

if (totalTimeoutMilliseconds <= 2073200000)

{

  if (!isSessionLoggedout())

  {

  window.clearTimeout(timeoutWarningID);

  window.clearTimeout(timeoutID);

  timeoutID = window.setTimeout('displayTimeoutMsg()', totalTimeoutMilliseconds);	

  timeoutWarningID = window.setTimeout('displayTimeoutWarningMsg()', warningTimeoutMilliseconds); 

  }

}

}




function displayTimeoutMsg() 

{

timeoutMsg = "Your session has been timed out. As a security precaution"

    + " " + totalTimeoutMilliseconds/60000 + " " + "minutes of inactivity."; 

self.location = timeOutURL;   

}




function displayTimeoutWarningMsg()                      

{

timeoutWinOption = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=330,height=220";

timeoutWin =window.open( timeoutWarningPageURL, "timeoutWarning", timeoutWinOption, true); 

timeoutWin.focus(); 

}



function getForm(document,formname)

{

var objForms = document.forms;

if (!objForms)

  return null;



for (var i=0; i < objForms.length; i++)

{

  if (objForms[i].name==formname)

    return objForms[i];

}

return null;

}



function getLoginCookieValue(cookiename)

{

var allcookies;

allcookies = document.cookie;



if (allcookies == "")

  return "-1";




var start = allcookies.indexOf(cookiename + '=');

if (start == -1) return "-1";          

start += cookiename.length + 1;   

//alert(" looking for " + cookiename +"  in  "+ allcookies +"  start = " + start);     

    

var end = allcookies.indexOf(';', start);

if (end == -1) end = allcookies.length;

var cookieval = allcookies.substring(start, end);

var a = cookieval.split(' ');

var winhref=window.location.href;    

winhref=winhref.toLowerCase();

var winurlpath;

var s=0;

s=winhref.indexOf("//");

if (s==-1)

   s=0;

s=winhref.indexOf("/",s+2);

if (s==-1)

   winurlpath = winhref;

else

   winurlpath = winhref.substring(0,s);



for(var i=0; i < a.length; i++)

{  

  if (a[i].length>0)

  {

    var urlpath = a[i].substring(0,a[i].lastIndexOf("/"));

    var pshome = a[i].substring(a[i].lastIndexOf("/"),a[i].length);       

    urlpath = urlpath.toLowerCase();

    pshome = pshome.toLowerCase();

//alert("urlpath: "+urlpath + "; pshome: " + pshome + "; winurlpath:"+winurlpath );

    if ((urlpath.indexOf(winurlpath) !=-1) && urlpath.length == winurlpath.length && (winhref.indexOf(pshome) !=-1)) 

       return a[i];

  }

}



return "-1";

}



function getPSLoginCookieValue()

{

  return getLoginCookieValue("PS_LOGINLIST");

}



function isLoginError()

{

var winhref=window.location.href;    

winhref=winhref.toLowerCase();   // document location

if (winhref.indexOf("error") !=-1)

    return true;

else

    return false;     

}



function isSessionLoggedout()

{

var val =  getPSLoginCookieValue();

if (val==-1)

{

  self.location=timeOutURL;

  return true;

}

return false;

}



function isIE() {

var isIE = navigator.appVersion.indexOf("MSIE")>0;

return isIE;

}



function isMAC() {

var isMAC = navigator.appVersion.indexOf("Mac")>0;

return isMAC;

}



function addExtraParam(saveWarn,frameName,form,target,tgturl,openNewWindowOption)

{

  var rtn = true;



  if (saveWarn == "Y")

  {

    var changed=null;



    if (form)

      changed = checkFormChanged(form, null);



    if (changed==null && top.frames && frameName.length>0 )

    {

      objFrame = top.frames[frameName];

      if (objFrame)

        changed=checkFrameChanged(objFrame);

    }



    if ((changed==null) && top.frames)

      changed = checkAnyFrameChanged(top.frames);



    if (changed)

      rtn = !confirm("You have unsaved data on this page. Click OK to go back and save, or Cancel to continue.");



    if (!tgturl)

      return rtn;           

  }

  

  if (rtn)

  {

    var newurl = "";

    if (typeof URLIntercept == "function"){

      newurl = URLIntercept(tgturl,target);

      if (newurl == "") 

        return;  

      else

        tgturl = newurl;  

      }  

      // open(tgturl, target);

     var bIsNS7 = (navigator.appName == "Netscape" && ((navigator.vendorSub == "7.0") || (navigator.vendorSub == "7.01") ));

     if (bIsNS7) 

        open(tgturl, '_top');

     else

     	open(tgturl, target, ((target.toLowerCase() == '_blank') ? openNewWindowOption : ''));

  }

}





function getFrameCurrUrl()

{

var objFrame =  top.frames['TargetContent'];

if (!objFrame)

  return "";

else

{

if (!objFrame.strCurrUrl)

return "";

else

  return objFrame.strCurrUrl;

}

}