function hdnSubmitForm() {
	var strValue = "";
	var strDelimeter = "|";
	var intInc = 0;
	var strlength = document.frmDocSearch.elements.length;
	for (var i=0;i < strlength;i++)	{
		objType = document.frmDocSearch.elements[i].type;
	    if (objType == "hidden" && strValue != "") {
		 document.frmDocSearch.elements[i].value = strValue;
		 strValue = "";
		 intInc = 0;
		}
		if (objType == "select-multiple") {
			intInc = 0;
			for(var j=0; j < document.frmDocSearch.elements[i].length; j++) {
				if(document.frmDocSearch.elements[i].options[j].selected && document.frmDocSearch.elements[i].options[j].value != "") {
					if (intInc == 0) {
						strValue = strValue + document.frmDocSearch.elements[i].options[j].value;
						intInc = intInc + 1;
					} else {
						strValue = strValue + strDelimeter + document.frmDocSearch.elements[i].options[j].value
					}
				}
			}
		}
	}	
}
function SubmitForm(totalCount,actionstring) {
	hdnSubmitForm();
	document.frmDocSearch.hdnFirstPage.value="1";
	document.frmDocSearch.hdnLastPage.value="10";
	document.frmDocSearch.hdnLastPage.value="10";
	document.frmDocSearch.hdnPageNo.value = "0";
	document.frmDocSearch.hdnSubmit.value = "Y";
	document.frmDocSearch.action=actionstring;
	document.frmDocSearch.submit();
	
}
function onClear() {
	var size = document.frmDocSearch.elements.length;
	for(var i=0; i < size; i++)	{
		var elName = document.frmDocSearch.elements[i].name;
		var subName = elName.substring(0,3);
		if(subName == "txt" || subName == "sel" ) {
			document.frmDocSearch.elements[i].value = "";
		}
	}
	return;
}
function downloadtime(bytes) {
	var Sec = Math.round(bytes / (56600 / 8));
	var TotalHours = Math.floor(Sec / 3600);
	var TotalMin = Math.floor((Sec - (TotalHours * 3600)) / 60);
	var TotalSec = Math.floor(Sec - ((TotalHours * 3600) + (TotalMin * 60)))
	if (TotalHours > 0) {
		document.write(TotalHours + " Hour(s), " + TotalMin + " Minute(s), and " + TotalSec + " Seconds");
	} else if (TotalMin > 0 && TotalHours == 0) {
		document.write(TotalMin + " Minute(s), and " + TotalSec + " Seconds");
	} else if (TotalMin == 0 && TotalHours == 0) {
		document.write(TotalSec + " Seconds");
	}
	return;
}

function viewprintable (actionstr) {
	hdnSubmitForm();
	document.frmDocSearch.action=actionstr;
	document.frmDocSearch.submit();
}