function GetValidString(strString)
{
 var strText = String(strString);
 if(strText.search(/\S.*/) != -1 && strText != "undefined")
  return String(strText.match(/\S[\w\W]*\S|\S/));
 else
  return "";
}

function InsertValue(optAttribut, txtInsert)
{
 txtInsert.value = optAttribut[optAttribut.selectedIndex].value;
}

function RemoveSpaces(frmForm)
{
 var strInput;
 for(var i = 0; frmForm.elements[i]; i++)
 {
  if(frmForm.elements[i].type == "text")
  {
   strInput = GetValidString(frmForm.elements[i].value);
   if(strInput != "")
   {
    frmForm.elements[i].value = strInput;
   }
   else
    frmForm.elements[i].value = "";
  }
 } 
}

function GetApxLeft(nWndWidth)
{
 var nLeft = 100;
 if(screen.availWidth)
 {
  if(screen.availWidth < nWndWidth)
   nWndWidth = screen.availWidth-40;
  nLeft = parseInt((screen.availWidth-nWndWidth)/2);
 }
 return nLeft
}  

function GetApxTop(nWndHeight)
{
 var nTop = 100;
 if(screen.availHeight)
 {
  if(screen.availHeight < nWndHeight)
   nWndHeight = screen.availHeight-40;
  nTop = parseInt((screen.availHeight-nWndHeight)/2);
 }
 return nTop
}  
