/*<!-- VERSION = $Rev: 8 $ $Date: 2007-04-25 22:38:39 -0700 (Wed, 25 Apr 2007) $ --> */
function URLDecode( sEncodeString )
{
// Create a regular expression to search all +s in the string
var lsRegExp = /\+/g;
// Return the decoded string
return unescape(String(sEncodeString).replace(lsRegExp, " "));
}

function changeCursor( elementID, cursorStyle )
{
var sElement = document.getElementById(elementID);
if ( sElement )
{
   sElement.style.cursor = cursorStyle;
}
}

function addInput( sType, sName, sValue )
{
var inputRow = document.createElement('INPUT');
inputRow.setAttribute('type', sType);
inputRow.setAttribute('name', sName);
inputRow.setAttribute('value', sValue);
inputRow.setAttribute('id', sName);
document.appendChild(inputRow);
/* return inputRow */
}

function addButton(sValue,sName)
{
var newButton = document.createElement("INPUT");
newButton.setAttribute("type","button");
newButton.setAttribute("value",sValue);
newButton.setAttribute("name",sName);
newButton.setAttribute("id",sName);
document.appendChild(newButton);
/*return newButton;*/
}

function isBrowserIE()
{
var ie=0;
if ( navigator.appName.indexOf('Explorer')>-1 )
   ie=1;
return ie;
}

function escapeQuot( str )
{
s = s.replace(/"/g,"&quot;");
return s;
}

function trim( str ) 
{
if ( str.length > 0 ) 
{
  if ( str.charAt(0)==' ' ) 
  {
    str = str.substr(1,str.length-1);
    str = trim(str);
  }
  if ( str.charAt(str.length-1)==' ' ) 
  {
    str = str.substr(0,str.length-1);
    str = trim(str);
  }
}
return str;
}

function replaceOrRedraw( newURL )
{
if( navigator.appVersion.charAt( 0 ) < '3' )
   parent.location = newURL;
else
   parent.location.replace( newURL );
return false;
}

function replaceOrRedrawParent( new_URL )
{
//var oBase = document.all.tags('base');
//if (oBase && oBase.target) oBase.target = _self;
if ( navigator.appVersion.charAt( 0 ) < '3' )
	parent.location = new_URL;
else
	parent.location.replace( new_URL );
return false;
}

function openNewWindow( newURL )
{
var w = window.open(newURL, 'newwin', 'width=550,height=650,status=yes,scrollbars=yes,resizable');
w.focus();
return false;
}

function timeout ( )
{
window.location.replace ('www.drbeth.com'); 
return false;
}
//window.setTimeout('timeout()', 9999999999);

function addBreaks( nbrBR )
{
var htmlString = "";
for ( var i = 0; i < nbrBR; i++ )
    htmlString += "<br />"; 
document.writeln(htmlString);
}

function addPara( nbrPara )
{
var htmlString = "";  
for ( var i = 0; i < nbrPara; i++ )
    htmlString += "<p>&nbsp;</p>";
document.writeln(htmlString);
}
