//<script LANGUAGE="JavaScript">
<!--
function rwkClose()
//================================================================
// FUNCTION   - rwkClose
// Parameters - none
// Processing - Closes the window
// Output     - nothing
//================================================================
{
				 window.close();
}
function rwkReturn (szzAddress, bzzNewPage)
//================================================================
// FUNCTION   - rwkReturn
// Parameters - szzAddress
//              bzzNewPage
// Processing - Opens a new window or the current window
//              for the passed address
// Output     - window open at the passed address
//================================================================
{
		try
		{
				if (bzzNewPage == true)
				{
				    window.open(szzAddress);               //Open URL in New Window
				}
				else
				{
				    window.open(szzAddress, '_self');      //Open URL in current Window
				}
		}
		catch (err)
		{
        rwkErr('Function rwkReturn ',err.description);
		}
}
function rwkWaitToShow (lzzdelay)
//================================================================
// FUNCTION   -  rwkWaitToShow
// PARAMETERS -  lzzdelay - number of seconds to delay
//                          before re- showing the button
//               NB it doesn't work with the button name
//                  passed as a parameter - probably because
//                  it is a recursive function call!!
// Causes a delay before re-displaying the passed Button ID
//================================================================
{
	 try
	 {
   if (lzzdelay > 1)
			{
				 setTimeout("rwkWaitToShow(1)",3000);
	    }
			else
			{
	       document.getElementById("RowToHide").style.display = '';
			}
	 }
	 catch(err)
	 {
	    rwkErr('Waiting to Show Button ' + szzButtonToHide ,err.description);
	 }
}
function rwkPrintPage ()
//================================================================
// Function  - rwkPrintPage
// Process   - Will hide the Print Button - (nb this could be a whole row)
//             call the Print
//             run the Wait to show - which will re-show the hidden button
//             (code basically found on a PayPal print page)
//================================================================
{
		try
		{
		    document.getElementById("RowToHide").style.display = 'none';
				window.print();
		    eval("rwkWaitToShow(2)");
		}
		catch (err)
		{
	      rwkErr('Printing from button ', err.description);
		}
}
function rwkSetCookie(szzName, szzValue, lzzExpireDays)
//================================================================
// FUNCTION    - rwkSetCookie
// Parameters  - szzName - Name of the Cookie
//               szzValue - string  value
//               lzzExpireDays - number of days the cookie is active
//================================================================
{
var ezzDate=new Date();
	try
	{
	    ezzDate.setDate(ezzDate.getDate()+lzzExpireDays);
	    document.cookie=szzName+ "=" +escape(szzValue)+((lzzExpireDays==null) ? "" : ";expires="+ezzDate.toGMTString());
	}
	catch (err)
	{
	      rwkErr('Setting the Cookie ' + szzName, err.description);
	}
}
function rwkGetCookie(szzName)
//================================================================
// FUNCTION    - rwkGetCookie
// Parameters  - szzName
//
//================================================================
{
	try
	{

	if (document.cookie.length>0)
 	{
	   lwkstart=document.cookie.indexOf(szzName + "=");
	   if (lwkstart!=-1)
 	   {
	      lwkstart=lwkstart + szzName.length+1;
	   	  lwkend=document.cookie.indexOf(";",lwkstart);
	      if (lwkend==-1) lwkend=document.cookie.length;
	      return unescape(document.cookie.substring(lwkstart,lwkend));
	    }
	  }
	  return "";
	}
	catch (err)
	{
	      rwkErr('Gettin the Cookie ' + szzName, err.description);
	}
}
function rwkDeleteCookie( szzName)
//================================================================
// FUNCTION    - rwkDeleteCookie
// Parameters  - szzName
//
//================================================================
{
	try
	{
	    document.cookie = szzName+"=; max-age=0; path=/";
	}
	catch (err)
	{
	      rwkErr('Gettin the Cookie ' + szzName, err.description);
	}
}
//</script>
