what is wrong with this javascript with jsp - asap help needed

<script language="javascript">

function checkSubmit(form){

// Loop from zero to the one minus the number of radio button selections

for (counter=0; counter < document.submitform.authortitle.length; counter++){

if (form.authortitle[counter].checked){

var splitStr = document.submitform.authortitle[counter].value;

alert(splitStr);

var splitStrArray =new Array();

splitStrArray = splitStr.split(","); alert(splitStrArray[2]);

splitStrArray[2].trim();

if(splitStrArray[2].equals("null")){

alert("true");

//replace the form action with somefile.jsp

document.forms[0].action="searchAmazon.jsp";

form.submit();

}else{

document.forms[0].action="isbnSearch.jsp";

form.submit();

}

}

}

}

</script>

the above javascript method is acting stupid.. it shows the first two alerts but does not go in the if statement "if(splitStrArray[2].equals("null")){ " and does not show the third alert. i do not c any problems pls help... when i click the option and submit it gives me a jasper exception pointing to some line which does not involve this code...

[1836 byte] By [moh_1_and_onlya] at [2007-11-27 1:29:01]
# 1
what value is displayed by alert(splitStrArray[2]);
tolmanka at 2007-7-12 0:27:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
splitStrArray[2] can either have an isbn actual no i.e. "1728172781" or if no isbn no has been found then i replace it with a "null" string. so both are strings.
moh_1_and_onlya at 2007-7-12 0:27:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
anyone that can help
moh_1_and_onlya at 2007-7-12 0:27:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
it has started working now basically the problem was the trim() method which i have removed and have changed .equals("null")to== ..BUT NOW it always does the else command and goes to the isbnsearch page even if the value is null (if null then it should go to another page)...
moh_1_and_onlya at 2007-7-12 0:27:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Cross post http://forum.java.sun.com/thread.jspa?threadID=5161702&messageID=9617902#9617902
rym82a at 2007-7-12 0:27:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...