/*
/// <summary>makes the post form visible - not working for ns4</summary>
*/
function MakePostFormVisible ()
{
	var ns4 = (document.layers);
	
	if (ns4)
	{
		document.PostForm.visibility = "hide";
		document.PostForm.display	 = "block";
	}
	else
	{
		var oPostForm = window.document.getElementById("PostForm");
		oPostForm.style.visibility	= "visible";
		oPostForm.style.display		= "block";
	}
}

/*
/// <summary>changes the location, used for sorting posts</summary>
*/
function changeLocation(oSelect)
{
	if(oSelect.selectedIndex != 0 && 
		oSelect.options[oSelect.selectedIndex].value != null && 
		oSelect.options[oSelect.selectedIndex].value != '')
	{
		window.location.href = oSelect.options[oSelect.selectedIndex].value;
	}

}

function trim(inputString) {

   if (typeof inputString != "string") { alert("bad string");return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   
    // Check for spaces at the beginning of the string
   while (ch == " ") 
   {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   
   ch = retValue.substring(retValue.length-1, retValue.length);
   
   // Check for spaces at the end of the string
   while (ch == " ") 
   { 
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   
    // Note that there are two spaces in the string - look for multiple spaces within the string
   while (retValue.indexOf(" ") != -1) 
   {
      retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   
   // Return the trimmed string back to the user
   return retValue; 
   
}// trim