Need a different pair of eyes on this, methinks. <script> function FindJump(gogo) { gogo=''; str=navigator.userAgent; // Agent is unique for our purposes /* lotza working code edited out */ var isGek=str.indexOf("Gecko"); // Presumes is in all variants mentioned if (isGek>=0) { gogo='PCbase.html'; } var z = gogo; // So, if not found, ASSuME we have mobile phone browser if (z='') { gogo='Mobile.html'; } document.writeln('3 gogo='+gogo+'|<BR>'); document.writeln('4 z='+z+'|<BR>'); return 'foo'+z+'||' //gogo; }; </script> <script> str=navigator.userAgent; // Agent is unique for our purposes document.writeln(str+"|<BR>"); // <a onTimeout="doOut(this, '/'+str', 'sass');return false;"></a><br> var jmp=FindJump("hi"); document.writeln('jmp='+jmp); </script> /* on a PC, one sees: /* on a mobile phone, one sees: 3 gogo=PCbase.html| jmp=Mobile.html| 4 z=| jmp=foo|| */ For a mobile phone: 1) What is seen is reasonable, as contents of "str" had been previously detected and the proper string was returned earlier in the function. For a PC: 1) Line 3 shows that "z" was not empty; if it was, then "gogo" would contain 'Mobile.html' 2) But line 4 then shows "z" as empty. WTF? 3) Likewise,the next line shows "z" as empty.