<!--
function trim(str) 
 {
   while (str.substring(0,1) == ' ')
   {
     	str = str.substring(1, str.length);
   }

   while (str.substring(str.length-1, str.length) == ' ')
   {
	str = str.substring(0,str.length-1);
   }
   
  return str;
}

var reg = /cosc[0-9]/i;

function submitform() 
{  
   with(document.searchform)
  {
	q.value = trim(q.value);
	output = q.value;

 	if (reg.test(q.value)) 
	{
	    output = q.value.substring(0,4) + ' ' + q.value.substring(4);
	}

  	q.value = output;

        submit();
  }
}

function pressenter(e)
{ 
  var charcode;

  if(e && e.which)
  {
      	e = e;
     	charcode = e.which; 
  }
  else{
	e = event;
	charcode = e.keyCode;
      }

  if(charcode == 13)
  { 
	submitform(); 
	return false;
  }
  else{
	return true; 
  }
}
//-->