// Check for a positive integer
function checkNumber(checkString)
{
  newString = "";
	
	for (i = 0; i < checkString.length; i++ ) {
	  ch = checkString.substring(i, i+1);
		
		if (ch >= "0" && ch <= "9") {
		  newString += ch;
	  }
	}
	
	if (checkString != newString) {
	  // Verify that it's OK to remove invalid characters
		if (confirm("The value you have entered\ncontails invalid characters,\nis it okay to remove them?")) {
		  return newString;
		} else {
		  return checkString;
		}
	}
	return checkString;
}

// Open a mini window to display hot text...
function
openWin(url, name, x, y)
{
  sOption = "height=" + y + ",width=" + x + ",resizable=yes,scrollbars=yes";
	window.open(url, '', sOption);
}

// Debug functions
function displayObject(object) {  
        var newWindow = window.open("","","HEIGHT=400,WIDTH=350,status=1,resizable=1,scrollbars=1");  
        newWindow.document.write("<HTML><HEAD><TITLE>Display Object</TITLE></HEAD>")  ;
        newWindow.document.write(getProperties(object));  
        newWindow.document.close();        
}  
function getProperties(obj) {   
    var properties = "";   
    var i = 0;
    
    properties = '<BODY><TABLE BORDER="2" WIDTH="90%" COLS="2">';  
    properties += '<TR ALIGN="left" BGCOLOR="lightgrey"><TH>Property</TH><TH>Value</TH></TR>';  
    for (var propName in obj) {  
//    i++; alert ("i="+i+"propname="+propName);
    if (propName == "fileCreatedDate") { continue; } 
    if (propName == "mimeType") { continue; }  
    if (propName == "fileModifiedDate") { continue; }
    if (propName == "fileSize") { continue ; }
   properties +="<TR><TD>"+propName+"</TD><TD>"+obj[propName]+"&nbsp;</TD></TR>";
    }   
    properties +="</TABLE></BODY></HTML>";  
    return properties;   
} 

function getListValue(list)   
{   
   var listValue = "";   
   if (list.selectedIndex != -1) {   
      listValue = list.options[list.selectedIndex].value;   
   }   

   return (listValue);   
}

