function dialogwin(fileName,str_dialogWidth,str_dialogHeight)

    str_dialogHeight = str_dialogHeight + 50;
    var random = Math.random();
    if(fileName.indexOf("?",0)!=-1)
    {
       var retVal=window.showModalDialog(fileName,window,";dialogWidth:"+str_dialogWidth+"px;dialogHeight:"+str_dialogHeight+"px;center:1;scroll:auto;help:0;status:0");
       return retVal;
    }
   else
   {
      var retVal=window.showModalDialog(fileName+"&" + random,window,";dialogWidth:"+str_dialogWidth+"px;dialogHeight:"+str_dialogHeight+"px;center:1;scroll:auto;help:0;status:0");
      return retVal;
    }
}
fileName是个链接,我要他后面跟着参数的时候就给他加上个随机数,所以判断他是否有问号,不然的话,他没带参数我却加上随机数,他就找不到页面了,要怎么判断,我现在写的判断,没效果。