function InArray(string, arrayToSearch)
{


for (var i = 0; i < arrayToSearch.length; i++) if (arrayToSearch[i] == string) return (true);

return (false);


}






function ListAttributes(id)
{


var atts, attribs = document.getElementById(id).attributes;


atts = 'The element has the following attributes:';

for (a = 0; a < attribs.length; a++) atts += '<br>'+attribs[a].nodeName+' = '+document.getElementById(id)[attribs[a].nodeName];


return (atts);


}






// returns a random integer from 1 to maximum

function RandomInteger(maximum)
{


today = new Date();

return (Math.ceil((((today.getTime() * 9301 + 49297) % 233280) / 233280.0) * maximum));


}






// makes all links on page open in a new window
// to use, insert this PHP code: $doc->bodyOnload[] = 'LinksInNewWindow()';

function LinksInNewWindow()
{


for (var i = 0; i < document.links.length; i++) document.links[i].target = '_blank';


}






// to be used with LinksInNewWindow()
// displays a note about all the links on the page opening in a new window
// to use, insert this PHP code:
//  $doc->bodyOnload[] = 'LinksInNewWindowNote()';
//  $doc->body->leftcolumn->extras[] = '<div id="linksInNewWindowNote"></div>';

function LinksInNewWindowNote()
{


var anchors = document.getElementsByTagName('a');

if (document.links[0].target == '_blank') document.getElementById('linksInNewWindowNote').innerHTML =
	'<table width="100%" cellpadding="3" cellspacing="0"><tr><td align="center" bgcolor="#ffffff">'
	+'<font class="lil">All links on this page<br>open in a new window.</font>'
	+'</td></tr></table>';


}






function IsNumeric(strString)
{


var strValidChars = '0123456789.-';
var strChar;
var blnResult = true;


if (strString.length == 0) return (false);


for (i = 0; i < strString.length && blnResult == true; i++) {
    strChar = strString.charAt(i);
    if (strValidChars.indexOf(strChar) == -1) blnResult = false;
}


return (blnResult);


}






function CopyToClipboard(text)
{


clipboardData.setData('Text', text);


}