function SubmitForm()
{
   
    element=document.getElementById('thread_cat_id');
    
    if(element!=null)
    {
        if(trim(element.value)=='')
        {
            alert("Please select "+element.title);
            element.focus();
            return false;
        }
    }
	
    
    element=document.getElementById('thread_title');
    
    if(element!=null)
    {
        if(trim(element.value)=='')
        {
            alert("Please Enter "+element.title);
            element.focus();
            return false;
        }
    }
    
    
    element=document.getElementById('thread_description');
    
    if(element!=null)
    {
        if(trim(element.value)=='')
        {
            alert("Please Enter Description");
            element.focus();
            return false;
        }
    }
        

 return true;   

}

function SubmitPost()
{
   
    element=document.getElementById('thread_description');
    
    if(element!=null)
    {
        if(trim(element.value)=='')
        {
            alert("Please enter "+element.title);
            element.focus();
            return false;
        }
    }
  return true;
}



function IsNumeric(strString)
{
   var strValidChars = "0123456789";
   for (i = 0; i < strString.length; i++)
   {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
      {
         return false;
      }
   }
   return true;
}

/*########################## */

function trim(inputString)
{
    inputString = inputString.replace(/^\s+/g,"");
    inputString = inputString.replace(/\s+$/g,"");
    return inputString;
}