<!--

//Returns string with binary notation of n bytes, rounded to 2 decimal places
function num2bytes(n)
{
   if(n<=0)
   {  return '0 Bytes';
   }
   var bSize=Array('Bytes', 'KB', 'MB', 'GB'); // add higher powers as appropriate: 'TB', 'PB', 'EB', 'ZB', 'YB'
   for(var i=bSize.length-1; i>=0; i--)
   {  if(n>=Math.pow(1000, i))
      {  return Math.round((n/Math.pow(1024, i))*100)/100+' '+bSize[i];
      }
   }
}


function doHideFAQ()
{
   var i, ie4, divColl;
   ie4=document.all; if(ie4) { divColl=document.all.tags("DIV"); } else { divColl=document.getElementsByTagName("DIV"); }
   for(i=0; i<divColl.length; i++)
      if(divColl[i].id.substr(0, 2)=="ci")
      {  divColl[i].style.display="none";
         if(divColl[i].parentNode!=null) { divColl[i].parentNode.className="faqcls"; }
      }
}

// Toggle Div
function ToggleFAQ(id) {
	var contentitem = document.getElementById('ci' + id);
	contentitem.style.display = (contentitem.style.display  != "none" ? "none" : "block");
    if(contentitem.parentNode!=null)
    { contentitem.parentNode.className=(contentitem.style.display  != "none" ? "faqopn" : "faqcls"); }
}

/*** search on another site ***/
// Adapted by DM 20081031 from common.js to wait for previous search to finish before starting new one
var goAjaxSearchHyde = null;
var gsSearchDivIDHyde = "";
var doNext=true;
function searchOtherSiteHyde(sDivID, iClientID, sKeywords, sXslFile) {
	var sUrl = "", sParams = "", cmd = "";

    if(!doNext)
    {
        cmd="searchOtherSiteHyde('"+sDivID+"', "+iClientID+", '"+sKeywords+"', '"+sXslFile+"')";
        setTimeout(cmd, 500);
        return;
    }
    doNext=false;

	sUrl = window.location.protocol + "//" + window.location.host + "/webservices/search.asmx/DoSearchFormatted";
	sParams = "ClientID=" + iClientID;
	sParams += "&Keywords=" + sKeywords;
	sParams += "&XslUrl=" + sXslFile;
	gsSearchDivIDHyde = sDivID;
	goAjaxSearchHyde = new EdeptiveAjax();
	goAjaxSearchHyde.postRequest(sUrl, sParams, onSearchResponseHyde);
}
function onSearchResponseHyde() {
	if(goAjaxSearchHyde.checkReadyState(gsSearchDivIDHyde, ".", "..", "...") == "OK") {
        doNext=true;
		if(document.getElementById(gsSearchDivIDHyde)) {
			var response = goAjaxSearchHyde.request.responseXML.documentElement;
			//document.getElementById(gsSearchDivIDHyde).insertAdjacentHTML("afterEnd", response.text);
			document.getElementById(gsSearchDivIDHyde).innerHTML = getText(response);
		}
	}
}

//-->