/*  Copyright (c) 2000, 2009, Oracle. All rights reserved.
    ToolsRel: 8.50.05 */
var gFocusObj = null;
var bRichTextEnabled = 0;
var gRichTextField = null;
var bTimer = null;;
if (window.showhide == null)
{
window.showhide = function (obj, bShow)
    {
    if (obj == null)
        return;
    if (bShow)
        {
        obj.style.top = getScrollY();
        var x = getScrollX();
        obj.style.right = (x > 0) ? (0 - x) : x;	        
        obj.style.visibility = "visible";
        obj.style.display = "block";
        }
    else
        {
        obj.style.visibility = "hidden";
        obj.style.display = "none";
        }
    }
}

function setSaveText_win0(txt)
{
var saveobj = document.getElementById("SAVED_win0");
if (saveobj) 
   {
   document.getElementById("ptStatusText_win0").innerHTML = txt;
   showhide(saveobj, true);
   document.getElementById("saveWait_win0").style.display = "";   
   } 
}

function processing_win0(opt,waittime)
{
var waitobj = document.getElementById("WAIT_win0");
var saveobj = document.getElementById("SAVED_win0");
var saveWaitObj = document.getElementById("saveWait_win0");
if (opt == 0)
{
    showhide(waitobj, false);
    showhide(saveobj, false);
    return;
}
if (opt == 1)
{
    if (saveobj && (saveobj.style.visibility != "hidden") && (saveobj.style.display != "none") 
       && (saveWaitObj.style.display != "none"))
       return;
    showhide(waitobj, true);
    showhide(saveobj, false);
    if(typeof bTimer != "undefined" && bTimer != null)
      clearTimeout(bTimer);
    return;
}
if (opt == 2)
{
    showhide(waitobj, false);
    setSaveText_win0('Saved');
    saveWaitObj.style.display = "none";
    bTimer = setTimeout("processing_win0(0)",waittime);
}
}

function isAltKey(evt)
{
if (!evt && window.event)
    evt = window.event;
if (!evt)
    return false;
if (evt.altKey)
    return true;
if (evt.modifiers)
    return (evt.modifiers & Event.ALT_MASK) != 0;
return false;
}

function isCtrlKey(evt)
{
if (!evt && window.event)
    evt = window.event;
if (!evt)
    return false;
if (evt.ctrlKey)
    return true;
if (evt.modifiers)
    return (evt.modifiers & Event.CONTROL_MASK) != 0;
return false;
}

function isShiftKey(evt)
{
if (!evt && window.event)
    evt = window.event;
if (!evt)
    return false;
if (evt.shiftKey)
    return true;
if (evt.modifiers)
    return (evt.modifiers & Event.SHIFT_MASK) != 0;
return false;
}

function getKeyCode(evt)
{
if (!evt && window.event)
    evt = window.event;
if (!evt)
    return 0;
if (evt.keyCode)
    return evt.keyCode;
if (evt.which)
    return evt.which;
return 0;
}

function cancelBubble(evt)
{
if (!evt && window.event)
    evt = window.event;
if (!evt)
    return;
if (typeof evt.cancelBubble != "undefined")
    evt.cancelBubble = true;
if (typeof evt.stopPropagation != "undefined" && evt.stopPropagation)
    evt.stopPropagation();
}

function isPromptKey(evt)
{
if (isAltKey(evt) && getKeyCode(evt) == "5".charCodeAt(0))
{
    cancelBubble(evt);
    return true;
}
return false;
}

function getEventTarget(evt)
{
if (!evt && window.event)
    evt = window.event;
if (!evt)
    return null;
if (evt.srcElement)
    return evt.srcElement;
if (evt.target)
    return evt.target;
return null;
}

function getModifiers(evt)
{
var res = "";
if (isAltKey(evt))
    res += "A";
if (isCtrlKey(evt))
    res += "C";
if (isShiftKey(evt))
    res += "S";
return res;
}

var nLastKey_win0 = 0;

function doKeyDown_win0(evt)
{
var target = getEventTarget(evt);
if (bFieldFocus)          // control receives focus
{
   bFieldFocus=0;         // reset flag to 0 such that it will not reset session timeout timers while typing in text in the same control
   setupTimeout();        // reset timer for session timeout control 
}

if (target && target.form && target.form.name != "win0")
    return findHandler("doKeyDown_" + target.form.name, evt);

nLastKey_win0 = getKeyCode(evt);
if (nLastKey_win0 != "\t".charCodeAt(0)) {

if (ptCommonObj.isGridNav(evt))
	ptGridObj_win0.doArrowNavGrid(evt);

if (ptCommonObj.isTypeAheadEl(evt))
 	ptTAObj_win0.KeyUpDown(evt);

    return true;
}

if (isCtrlKey(evt))
    return tryFocus(oFirstTab_win0);
if (isAltKey(evt) || (isShiftKey(evt) && !ptCommonObj.isGridNav(evt)))
    return true;

if (target == oLastTab_win0)
{
if (oFirstTB_win0)
    {
    if (!bTabOverTB_win0)
        return true;
    }
if (oFirstPg_win0)
    {
    if (!bTabOverPg_win0)
        return tryFocus(oFirstPg_win0);
    }
if (bTabOverNonPS_win0 || oFirstTB_win0 != null || oFirstPg_win0 != null)
    return tryFocus(oFirstTab_win0);
return true;
}
if (target == oLastTB_win0)
{
  if (oFirstPg_win0)
  {
    if (!bTabOverPg_win0)
       return tryFocus(oFirstPg_win0);
  }
  if (bTabOverNonPS_win0 || oFirstPg_win0 != null)
    return tryFocus(oFirstTab_win0);
  return true;
}

if (target == oLastPg_win0)
{
  if (bTabOverNonPS_win0)
    return tryFocus(oFirstTab_win0);
  return true;
}

if (nLastKey_win0 == "\t".charCodeAt(0) && ptCommonObj.isTypeAheadEl(evt)) 
{
	ptTAObj_win0.KeyUpDown(evt);
	return true;
}

}

function getLastKey_win0()
{
var nTemp = nLastKey_win0;
nLastKey_win0 = 0;
return nTemp;
}

function doKeyUp_win0(evt)
{

var target = getEventTarget(evt);
if (target && target.form && target.form.name != "win0")
    return findHandler("doKeyUp_" + target.form.name, evt);
var key = getKeyCode(evt);
var keyChar = String.fromCharCode(key);
if (isCtrlKey(evt) && key == 220) //debugger console ctl-\
    	{
        ptConsole.active();
        return false;
    	}
if (keyChar == "\r" || key == 27)
	{
    
    if (target != null && target.id.indexOf("$delete") != -1)
       {
	   DeleteCheck2_win0(target.id);
	   return;
	   }

	if (typeof(bPromptPage_win0) != "undefined" && bPromptPage_win0)
		{
		
		if (key == 27)	
			ptCommonObj.updatePrompt(document.win0, "#ICCancel");
		}
	else if (typeof(bModalPage_win0) != "undefined" && bModalPage_win0)
		{
		if (key == 27)
			
		    if (popupModalObj_win0.isModalElement)
		     
		       ptCommonObj.endModalCntrl(document.win0, "#ICOKZG", true);
		    else
		       ptCommonObj.endModalCntrl(document.win0, "#ICCancel");
																	
		else if (target != null && (target.href						
				|| typeof target.onclick == "function"
				|| target.tagName == "SELECT"						
				|| target.tagName == "HTML"							
				|| target.tagName == "BODY"							
				|| target.type == "textarea"))						
			;
		else if (popupModalObj_win0.isModalElement)
			
		  	ptCommonObj.endModalCntrl(document.win0, "#ICOKZG", true);
		else
			
  			ptCommonObj.endModalCntrl(document.win0, "#ICSave");
		} 
	return true;
	}

if (!routeKeyEvent(evt))
    return false;
var bAlt = isAltKey(evt);
var bCtrl = isCtrlKey(evt);
var bNotMine = false;
if (bAlt)
	{
    if (bCtrl || altKey_win0.indexOf(keyChar) < 0)
        if (keyChar == "9" || key == 220)
            return true;
        else
            bNotMine = true;
	}
else if (bCtrl)
	{   
    if (key == 88 || key == 120) //debugger console ctl-x
    	{
        ptConsole.deactive();
        return false;
    	}
    keyChar = String.fromCharCode(key | 0x40);
    if (ctrlKey_win0.indexOf(keyChar) < 0)
        bNotMine = true;
	}
else
	{
    if (baseKey_win0.indexOf(keyChar) < 0)
    bNotMine = true;
	}

if (bNotMine) {

	
	if (bAlt || bCtrl) {
			
		
		var navFrame = parent.frames["NAV"];
        if (!navFrame) {
            navFrame = parent.frames["UniversalHeader"];
		}	
		if (navFrame && !isCrossDomain(navFrame) && navFrame.parentKeyHandler) {
            navFrame.parentKeyHandler(window, key, bAlt, bCtrl);
		
		} else if (!isCrossDomain(parent) && parent.ptIframe && parent.ptIframe.parentKeyHandler) {
			parent.ptIframe.parentKeyHandler(window,key,bAlt,bCtrl);
        }
	}
	if (ptCommonObj.isGridNav(evt)) //for grid
    	ptCommonObj.terminateEvent(evt); 

    if (ptCommonObj.isTypeAheadEl(evt)) // for type ahead suggest        
		ptTAObj_win0.GiveOptions(evt);

	return true;
}


var code = getModifiers(evt) + keyChar;
if (target && target.name)
    document.win0.ICFocus.value = target.name;

if (code == "A8")
    if (!doDeleteKey_win0(target))
        return false;
if (code == "A\xbf")
{
    if (window.FindString_win0
    && document.win0.ICFind
    && findScroll(target))
    {
        if (!FindString_win0(document.win0.ICFind))
            return false;
    }
else
    return false
}

if (code == "A7")
    if (!doInsertKey_win0(target))
        return false;

if (code == "A\xbc" || code == "A\xbe" || code == "A\xde")
    if (!activeLink(target,code))
        return false;

if (code == 'A5') 
{
var id_s = target.id.split("$")[0];
var occ_s = target.id.split("$")[1];
var pid = id_s+"$prompt";
if (occ_s && typeof occ_s != "undefined")
pid +="$"+occ_s;
var pobj = document.getElementById(pid);
var operation = "";
if (!pobj || typeof pobj == "undefined" ) {
     pid = id_s+"$spellcheck";
     if (occ_s && typeof occ_s != "undefined")
     pid +="$"+occ_s;     
     pobj = document.getElementById(pid);
     if (pobj && typeof pobj != "undefined" ) operation = "$spellcheck";
   }

if (!pobj || typeof pobj == "undefined" ) {
    pid = target.id+"$prompt";
    pobj = document.getElementById(pid);
    if (!pobj || typeof pobj == "undefined" )
        return false;
}
}

if (saveWarningKeys_win0.indexOf(code) >= 0)
{
   var url = "javascript:submitAction_win0(document.win0, \'#KEY" + code;  
   if (code == 'A5') 
	     url = url  + "\', " + target.id + ")";
   else
        url = url + "\')";
   if (!saveWarning("", null, "", url))
        return false;
}

if (key == 13 && !ptCommonObj.isSearchPage(target.form)) //enter key pressed
{
 if (typeof event != "undefined")
    submitAction_win0(document.win0, event.srcElement.id);
 else // for firefox
    submitAction_win0(document.win0, evt.target.id);
}else
{
if (code == 'A5')
 submitAction_win0(document.win0, "#KEY" + code + operation, target.id);
else {
 if (bAlt && (key == 49)) //Alt+1 = Saving
    setSaveText_win0('Saving...', true, false);
 submitAction_win0(document.win0, "#KEY" + code);
 }
}

return false;
}

function activeLink(obj, akey)
{
var scrl = findScroll(obj);
var btnid;
if (!scrl)
    return false;
if (akey == "A\xbc")
    btnid = "\$hup\$";
else if (akey == "A\xbe")
    btnid = "\$hdown\$";
else if (akey == "A\xde")
    btnid = "\$hviewall\$";
btnid = scrl.id.replace(/\$scroll[im]?\$/,btnid);
var btn = document.getElementById(btnid);
if(btn)
    return true;
return false;
}

function findHandler(handlerName, evt)
{
var obj = window[handlerName];
if (typeof obj == "function")
    return obj(evt);
return true;
}

function keyHandler(keyCode, bIsAlt, bIsCtrl)
{
return keyHandler_win0(keyCode, bIsAlt, bIsCtrl);
}

function keyHandler_win0(keyCode, bIsAlt, bIsCtrl)
{
var keyChar = String.fromCharCode(keyCode);
var code = "";
if (bIsAlt)
{
    code = "A";
    if (bIsCtrl || altKey_win0.indexOf(keyChar) < 0)
        return false;
}
else if (bIsCtrl)
{
    code = "C";
    keyChar = String.fromCharCode(keyCode | 0x40);
    if (ctrlKey_win0.indexOf(keyChar) < 0)
        return false;
}
else
    return false;
code += keyChar;

if (code  == "A8" || code == "A\xbf" || code == "A7")
    return false;

submitAction_win0(document.win0, "#KEY" + code);
return true;
}

function doDeleteKey_win0(obj)
{
if (!window.DeleteCheck2_win0)
    return false;
var scroll = findScroll(obj);
if (!scroll)
    return false;
if (scroll.id.search(/^(.*)(\$scroll[im]?\$)(.*)$/,"$fdelete$") < 0)
    buttonid = scroll.id;
else
    buttonid =  RegExp["$1"] + "$fdelete$" +  RegExp["$3"];
if (document.getElementById(buttonid))
    return DeleteCheck2_win0(buttonid);
if (obj.name == null || obj.name.search(/\$(\d*)(\$\$\d*)?$/) < 0)
    return false;
var row = RegExp.$1;
if (buttonid.search(/^(.*)(\$fdelete\$)(.*)$/) < 0)
    return false;
buttonid = RegExp["$1"] + "$delete$" + row + "$$" + RegExp["$3"];

if (document.getElementById(buttonid))
    return DeleteCheck2_win0(buttonid);
return false;
}

function doInsertKey_win0(obj)
{
if (!window.AddMultiple_win0)
    return false;
var scroll = findScroll(obj);
if (!scroll)
    return false;
var bHasInsertBtn = false;
if (scroll.id.search(/^(.*)(\$scroll[im]?\$)(.*)$/,"$fnew$") < 0)
    buttonid = scroll.id;
else
    buttonid =  RegExp["$1"] + "$fnew$" +  RegExp["$3"];
if (document.getElementById(buttonid))
    bHasInsertBtn = true;
if (obj.name == null || obj.name.search(/\$(\d*)(\$\$\d*)?$/) < 0)
    return false;
var row = RegExp.$1;
if (buttonid.search(/^(.*)(\$fnew\$)(.*)$/) < 0)
    return false;
buttonid = RegExp["$1"] + "$new$" + row + "$$" + RegExp["$3"];
if (!bHasInsertBtn)
{
    if(document.getElementById(buttonid))
        bHasInsertBtn = true;
}
if (!bHasInsertBtn)
{
    /* try multiple insert key */
    buttonid = RegExp["$1"] + "$newm$" + row + "$$" + RegExp["$3"];
    if(document.getElementById(buttonid))
        bHasInsertBtn = true;
}
if (bHasInsertBtn)
{
    if (scroll.id.match(/\$scrollm\$/))
        return AddMultiple_win0(document.win0.ICAddCount);
    if (scroll.id.match(/\$scrolli\$/))
        return true;
}
return false;
}

function findScroll(obj)
{
while (obj)
{
    if (typeof obj.id  != "undefined")
        if (obj.id.match(/\$scroll/))
            return obj;
    if (typeof obj.parentNode != "undefined")
        obj = obj.parentNode;
    else    if (typeof obj.offsetParent != "undefined")
        obj = obj.offsetParent;
    else
        return null;
}
}

if (window.doKeyPress_win0 == null)
{
window.doKeyPress_win0 = function (evt)
    {
    var target = getEventTarget(evt);
    if (target && target.form && target.form.name != "win0")
        return findHandler("doKeyPress_" + target.form.name, evt);

    var key = getKeyCode(evt);
    var keyChar = String.fromCharCode(key);
    if (key==27)  // ESC key was pressed	
    	{
        if (typeof(MOpopupObj_win0.bIs_shown) != "undefined" && MOpopupObj_win0.bIs_shown) // ESC key pressed when mouseover popup page is displayed
            return MOpopupObj_win0.StopAccess(evt);   // close mouseover popup
        else if (typeof(bPromptPage_win0) != "undefined" && bPromptPage_win0)
        	return true;
		else if (typeof(bModalPage_win0) != "undefined" && bModalPage_win0)
        	return true;
        else if (ptCommonObj.isTypeAheadEl(evt))		//ICE#1850813000
            return true;
		}

    if (keyChar != "\r" && key != 27)
        return true;

	if (keyChar == "\r" && typeof(bModalPage_win0) != "undefined" && bModalPage_win0)	
		{
		ShowOrCloseModalOnEnter(key, target);
		return true;
		}

    
    if (!routeKeyEvent(evt))
        return false;

    if (target && key != 27)
    {
        if ((typeof target.onclick == "function" || target.href)
        && target.type != "radio" && target.type != "checkbox")
            return true;
        if (target.type == "textarea")
            return true;
    }
    var code = getModifiers(evt) + keyChar;

    if (target && target.name)
        document.win0.ICFocus.value = target.name;

	if (ShowOrCloseModalOnEnter(key, target)) 
		return true;

	
	if ((key == 13) && ptCommonObj.isTypeAheadEl(evt) && ptTAObj_win0.IsGrabHighlighted())  
	{
		ptTAObj_win0.HideTheBox();  
		return false;
	}
    
    submitAction_win0(document.win0, "#KEY" + code);
    return false;
    }
}

//display modal or close modal if a hyperlink/pushbutton that can display or close a modal 
//is specified in ide as activate by enter key
function ShowOrCloseModalOnEnter(theKey, theTarget) {

if (theKey == 13) {

if (typeof(bPromptPage_win0) != "undefined" && bPromptPage_win0)
	return false; 

if (typeof document.activeElement.onclick == "function" || 	document.activeElement.href)
	return false;

if  (document.activeElement.id.indexOf("popup") != -1)
	return true;

	for (var j = 0; j < 2; j++) {
		
		
		var elements = null;
		if (j == 0)			
			elements = document.getElementsByTagName('a');
		else
			elements = document.getElementsByTagName('input');
	
		for (var i = 0; i < elements.length; i++) {
			if (elements[i].getAttribute('ActivateByEnter') != null) {
				if (elements[i].getAttribute('ActivateByEnter') == 'CLOSE') {
					ptCommonObj.endModalCntrl(document.win0,elements[i].name);
					//ptCommonObj.endModalCntrl(this.win0,elements[i].name);
					//ptCommonObj.endModalCntrl(win0,elements[i].name);
					return true;
					}
				else {
					var params = elements[i].getAttribute('ActivateByEnter').split('-');
					if (params[0] != 0 && params[1] != 0)
						mAction_win0(document.win0,elements[i].name, params[0], params[1], params[2]);
					else
						mAction_win0(document.win0,elements[i].name, params[0], params[1], params[2], null, true);

					return true;
					}
				}
			}
		}
	}

return false;
}

var oFirstTab_win0 = null;
var oLastTab_win0 = null;
var oFirstTB_win0 = null;
var oLastTB_win0 = null;
var oFirstPg_win0 = null;
var oLastPg_win0 = null;

var nFirstTBIndex = 5000;        var nFirstPgIndex = 10000;

function checkTabIndex(obj)
{
if (obj.tabIndex && obj.tabIndex >= 0)
{
    if (obj.tabIndex < nFirstTBIndex)
    {
        if (oLastTab_win0 == null || obj.tabIndex > oLastTab_win0.tabIndex)
            oLastTab_win0 = obj;
        if (oFirstTab_win0 == null || obj.tabIndex < oFirstTab_win0.tabIndex)
            oFirstTab_win0 = obj;
    }
    else if (obj.tabIndex < nFirstPgIndex)
    {
        if (oLastTB_win0 == null || obj.tabIndex > oLastTB_win0.tabIndex)
            oLastTB_win0 = obj;
        if (oFirstTB_win0 == null || obj.tabIndex < oFirstTB_win0.tabIndex)
            oFirstTB_win0 = obj;
    }
    else
    {
        if (oLastPg_win0 == null || obj.tabIndex > oLastPg_win0.tabIndex)
            oLastPg_win0 = obj;
        if (oFirstPg_win0 == null || obj.tabIndex < oFirstPg_win0.tabIndex)
            oFirstPg_win0 = obj;
    }
}
}

function setEventHandlers_win0(sFirst, sLast, bMac)
{
var focus1, focus2;
focus1 = function (evt) {doFocus_win0(this, true, true);};
focus2 = function (evt) {doFocus_win0(this, false, true);};

var i;

if (sFirst!="")
{
    var docanchors = document.anchors;
    var docanclen = docanchors.length;

    for (i = 0; i < docanclen; ++i)
    {
        if (docanchors[i].name == sFirst) break;
    }
    for (++i; i < docanclen; ++i)
    {
        var anc =  docanchors[i];
        if (anc.name == sLast) break;
        checkTabIndex(anc);
        checkAccessKeys(anc);
                if  (typeof anc.onfocus != "function")
            anc.onfocus = focus1;
    }
}
var frm = document.win0;
if (!frm) return;
var frmlen = frm.length;
for (i = 0; i < frmlen; ++i)
{
    var frmi  =  frm[i];
    if (frmi.type=="hidden") continue;
    checkTabIndex(frmi);
    checkAccessKeys(frmi);
    if (typeof frmi.onfocus != "function")
    {
    if (typeof frmi.onclick == "function")
        frmi.onfocus = focus1;
    else
        frmi.onfocus = focus2;
    }
}
}
if (window.setKeyEventHandler_win0 == null)
{
    window.setKeyEventHandler_win0 = function ()
    {
    if (typeof(baseKey_win0) != "undefined")
        {
        document.onkeyup = doKeyUp_win0;
        if (baseKey_win0.indexOf("\r") >= 0 || baseKey_win0.indexOf("\x1b") >= 0)
            document.onkeypress = doKeyPress_win0;
        }
    document.onkeydown = doKeyDown_win0;
    }
}
var oTop = null;
var oBottom = null;
if (window.routeKeyEvent == null)
  {
  window.routeKeyEvent = function(evt)
  {
  if (!isAltKey(evt) || isCtrlKey(evt))
  return true;
  var key = getKeyCode(evt);
  var keyChar = String.fromCharCode(key);
  if (keyChar == "9"  && oTop != null)
  {
  oTop.focus();
  return false;
  }
  if (key == 220 && oBottom != null)
  {
  oBottom.focus();
  return false;
  }
    return true;
    }
  }
if (window.checkAccessKeys == null)
{
window.checkAccessKeys = function(obj)
{
  var attr = obj.getAttribute("PSaccesskey");
  if (attr == "9")
    oTop = obj;
  else if (attr == "\\")
    oBottom = obj;
}
}
function setFocus_win0(fldname, indx, oDoc0)
{
gRichTextField = fldname;
if(typeof CKEDITOR != 'undefined')
{
for ( var instanceName in CKEDITOR.instances )
{

if (instanceName == fldname)
{
bRichTextEnabled = 1;
gRichTextField = fldname;

}
}
}
if (bRichTextEnabled == 0)
{
var oDoc = null;
if (!oDoc0 || typeof oDoc0 == "undefined")
	oDoc = document;
else
	oDoc = oDoc0;
var obj = null;
if (oDoc.win0)
{
    obj = oDoc.win0.elements[fldname];
    if (!obj)
        obj = oDoc.win0[fldname];
}
if (!obj)
    obj = oDoc.getElementById(fldname);
if (!obj) return false;
if (indx >= 0 && obj.length && indx < obj.length)
    obj = obj[indx];
if (!oDoc0 || typeof oDoc0 == "undefined")
return !tryFocus(obj);
else
return !tryFocus0(obj);
}
}
function tryFocus(obj)
{
if (!tryFocus0(obj))
    gFocusObj = obj;
return;
}

function tryFocus0(obj)
{
if (obj && typeof obj.focus != "undefined" && !obj.disabled && obj.style.visibility!="hidden")
{
    var b = navigator.userAgent.toLowerCase();
    try {            // check access violation because of trying to focus on invisible field
       obj.focus();
    }
    catch (err) {
       return true;
    }
    if (b.indexOf("msie")!=-1)
       obj.setActive();

    if (window.focusHook)
        focusHook(obj);

 	var gn = ptCommonObj.isGridEl(null,obj.id); 
    if (gn != null)
        ptGridObj_win0.doScrollOnFocus(gn, obj);
    return false;
}
return true;
}
if (typeof CKEDITOR != 'undefined') CKEDITOR.on( 'instanceReady', function( ev )
{
                 ev.editor.dataProcessor.writer.setRules( 'p',
                      {
                           indent : false,
                           breakBeforeOpen : false,
                           breakAfterOpen : false,
                           breakBeforeClose : false,
                           breakAfterClose : false
                         });

for ( var instanceName in CKEDITOR.instances )
{
if (instanceName == gRichTextField)
{
CKEDITOR.instances[instanceName].focus();
}
}
});