function ChkISBN() {
 var ta= document.searchForm.search_by_text.value;
 ta = trim(ta);
 var temp_str = ta.replace(/-/g, '');
    if (temp_str.length == '10') {
  temp_str = temp_str.match( /[0-9]{9}[Xx0-9]{1}/g );
   if (temp_str) {
    document.searchForm.isISBN.value = 'Y';
   }
 } else if (temp_str.length == '13') {
  temp_str = temp_str.match( /[0-9]{13}/g );
   if (temp_str) {
    document.searchForm.isISBN.value = 'Y';
   }
 }
 //alert(document.searchForm.isISBN.value);
  
   
 return true;
 }

function trim(strText) 
{	
        // this will get rid of leading spaces 
        while (strText.substring(0,1) == ' ') 
            strText = strText.substring(1, strText.length);

        // this will get rid of trailing spaces 
        while (strText.substring(strText.length-1,strText.length) == ' ')
            strText = strText.substring(0, strText.length-1);

        return strText;
}
