<!--
/*==========================================================================
      Copyright (c) 2000 Oracle Corporation, Redwood Shores, CA, USA
                         All rights reserved.
============================================================================
 FILENAME
    ibeCButton.js

 DESCRIPTION
    This is used to print the button which looks similar to BLAF UI. There is
    also a generic function which can be used to submit the form.

 HISTORY
    11/01/2002  makulkar   created.
    17/10/2003  Knachiap - ADA Change
    31/12/2003  Knachiap - 3156992 Moved ButtonText class into HREF 
    09/01/2006  savrghe  - swan changes Bug # 4890399
========================================================================= */
// -->
<!-- $Header: ibeCButton.js 120.9 2006/01/17 15:15:19 savarghe ship $ -->

// This is the central function to create buttons
function buttonGen() 
{
  var js=buttonGen.arguments[1];
  if (buttonGen.arguments[1]=="disabled")
  {
    document.writeln('<table cellpadding="0" cellspacing="0" border="0"><tr><td>');
  	document.writeln('<input type="button" ' + 
	                 'value="' + buttonGen.arguments[0] + '" ' +
					 'name="' + buttonGen.arguments[0] +  '" ' +
					 'alt="' + buttonGen.arguments[0] + '" ' +
					 'disabled class="OraButtonTextDisabled">');
    document.writeln('</td></tr></table>'); 
  }
  else
  {
    document.writeln('<table cellpadding="0" cellspacing="0" border="0"><tr><td>');
    document.writeln('<input type="button" ' + 
	                 'value="' + buttonGen.arguments[0] + '" ' +
					 'name="' + buttonGen.arguments[0] + '" ' + 
					 'alt="' + buttonGen.arguments[0] + '" ');

    if (js.search(/javascript:/i)<0) {
		document.writeln('onClick="window.location=\'' + js + '\'" ');		
    }
    else {
        document.writeln('onclick="' + js + '" ');
    }
    document.writeln('class="OraButtonText">');
    document.writeln('</td></tr></table>'); 
  }
}

//2. submitForm function will accept the event and formname parameter.
function submitForm(event,formName)
{
  var windowForm = document.forms[formName];
  windowForm.event.name = event;

  //alert("name="+windowForm.event.name);  
  windowForm.submit();
  return true;
}


//3. putNbsp
function putNbsp ()
{
  document.writeln('&nbsp');
}
   
//4. buttonGenRightFlat
function buttonGenRightFlat() 
{
  document.writeln('<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="0">');
  document.writeln('   <tr>');
  for (i=0; i < buttonGenRightFlat.arguments.length; i++) 
  {
    document.writeln('      <td nowrap>');
    document.writeln('         <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" nowrap>');
    document.writeln('            <tr>');
    document.writeln('               <td rowspan="4" width="9"><img src="/OA_MEDIA/buttonL.gif" width="9" height="19"></td>');
    document.writeln('               <td valign="TOP"><img src="/OA_MEDIA/ibeBtnStretch2.gif" width="1" height="1"></td>');
    document.writeln('               <td rowspan="4" width="5"><img src="/OA_MEDIA/ibeBtnRightFlat.gif" width="5" height="19"></td>');
    document.writeln('            </tr>');
    document.writeln('            <tr>');
    document.writeln('               <td nowrap>');
    document.writeln('                   <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" class="BUTTON">');
    document.writeln('                      <tr><TD ALIGN="center" VALIGN="top" class="BUTTON" nowrap height="15">');
    //document.writeln('                 <A class=OraButtonText HREF="' + link +'">' + value +'</A></TD></tr>');

    var js=buttonGenRightFlat.arguments[i+1];
    if (js.indexOf("history")<0) 
    {
      document.writeln('                              <A class=buttonText HREF="' + buttonGenRightFlat.arguments[i+1] +'">' + buttonGenRightFlat.arguments[i] +'</A></TD></tr>');
    }
    else
    {
      document.writeln('                              <A class=buttonText HREF="#" onClick=' + buttonGenRightFlat.arguments[i+1] +'>' + buttonGenRightFlat.arguments[i]+'</A></TD></tr>');
    }
    document.writeln('                   </table>');
    document.writeln('               </td>');
    document.writeln('            </tr>');
    document.writeln('            <tr>');
    document.writeln('               <td  valign="TOP"><img src="/OA_MEDIA/ibeBtnStretch2.gif" width="1" height="1"></td> </tr>');
    document.writeln('            <tr><td  valign="TOP"><img src="/OA_MEDIA/ibeBtnStretch2.gif" width="1" height="1"></td></tr>');
    document.writeln('         </table>');
    document.writeln('      </td>');
    i += 1;
  } // end for loop

  document.writeln('   </tr>');
  document.writeln('</TABLE>');
  
} // end buttonGenRightFlat function
  

//5. buttonGenLeftFlat
function buttonGenLeftFlat() 
{
  document.writeln('<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="0">');
  document.writeln('   <tr>');
  for (i=0; i < buttonGenLeftFlat.arguments.length; i++) 
  {
    document.writeln('      <td nowrap>');
    document.writeln('         <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" nowrap>');
    document.writeln('            <tr>');
    document.writeln('               <td rowspan="4" width="5"><img src="/OA_MEDIA/ibeBtnLeftFlat.gif" width="5" height="19"></td>');
    document.writeln('               <td valign="TOP"><img src="/OA_MEDIA/ibeBtnStretch2.gif" width="1" height="1"></td>');
    document.writeln('               <td rowspan="4" width="9"><img src="/OA_MEDIA/buttonR.gif" width="9" height="19"></td>');
    document.writeln('            </tr>');
    document.writeln('            <tr>');
    document.writeln('               <td nowrap>');
    document.writeln('                   <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" class="BUTTON">');
    document.writeln('                      <tr><TD ALIGN="center" VALIGN="top" class="BUTTON" nowrap height="15">');
    //document.writeln('                 <A class=OraButtonText HREF="' + link +'">' + value +'</A></TD></tr>');

    var js=buttonGenLeftFlat.arguments[i+1];
    if (buttonGenLeftFlat.arguments[i+1]=="disabled")
    {
      document.writeln('<FONT class="DISABLEDBUTTONTEXT">' + buttonGenLeftFlat.arguments[i] +'</font></TD></tr>');
    }
    else
    {      
      if (js.indexOf("history")<0) 
      {
        document.writeln('                              <A class=BUTTONTEXT HREF="' + buttonGenLeftFlat.arguments[i+1] +'">' + buttonGenLeftFlat.arguments[i] +'</A></TD></tr>');
      }
      else
      {
        document.writeln('                              <A class=BUTTONTEXT HREF="#" onClick=' + buttonGenLeftFlat.arguments[i+1] +'>' + buttonGenLeftFlat.arguments[i]+'</A></TD></tr>');
      }
    }

    document.writeln('                   </table>');
    document.writeln('               </td>');
    document.writeln('            </tr>');
    document.writeln('            <tr>');
    document.writeln('               <td   valign="TOP"><img src="/OA_MEDIA/ibeBtnStretch2.gif" width="1" height="1"></td> </tr>');
    document.writeln('            <tr><td  valign="TOP"><img src="/OA_MEDIA/ibeBtnStretch2.gif" width="1" height="1"></td></tr>');
    document.writeln('         </table>');
    document.writeln('      </td>');
    i += 1;
  } // end for loop

  document.writeln('   </tr>');
  document.writeln('</TABLE>');

} // end buttonGenLeftFlat function



