 
 $ ->
     initialDatasetSelection = ->
-      defaultSpecies = getDefaultValue("species")
-      defaultSet = getDefaultValue("cross")
-      defaultType = getDefaultValue("tissue")
-      defaultDB = getDefaultValue("database")
-      if navigator.userAgent.indexOf("MSIE") >= 0
-        sOptions = fillOptionsForIE(null, defaultSpecies)
-        menu0 = "<SELECT NAME='species' ID='species' SIZE='1' onChange='fillOptions(\"species\");'>" + sOptions + "</Select>"
-        document.getElementById("menu0").innerHTML = menu0
-        gOptions = fillOptionsForIE("species", defaultSet)
-        menu1 = "<Select NAME='cross' size=1 id='cross' onchange='fillOptions(\"cross\");'>" + gOptions + "</Select><input type=\"button\" class=\"button\" value=\"Info\" onCLick=\"javascript:crossinfo();\">"
-        document.getElementById("menu1").innerHTML = menu1
-        tOptions = fillOptionsForIE("cross", defaultType)
-        menu2 = "<Select NAME='tissue' size=1 id='tissue' onchange='fillOptions(\"tissue\");'>" + tOptions + "</Select>"
-        document.getElementById("menu2").innerHTML = menu2
-        dOptions = fillOptionsForIE("tissue", defaultDB)
-        menu3 = "<Select NAME='database' size=1 id='database'>" + dOptions + "</Select><input type=\"button\" class=\"button\" value=\"Info\" onCLick=\"javascript:databaseinfo();\">"
-        document.getElementById("menu3").innerHTML = menu3
-      else
-        fillOptions null
-      searchtip()
-      
+        defaultSpecies = getDefaultValue("species")
+        defaultSet = getDefaultValue("cross")
+        defaultType = getDefaultValue("tissue")
+        defaultDB = getDefaultValue("database")
+        if navigator.userAgent.indexOf("MSIE") >= 0
+            sOptions = fillOptionsForIE(null, defaultSpecies)
+            menu0 = "<SELECT NAME='species' ID='species' SIZE='1' onChange='fillOptions(\"species\");'>" + sOptions + "</Select>"
+            document.getElementById("menu0").innerHTML = menu0
+            gOptions = fillOptionsForIE("species", defaultSet)
+            menu1 = "<Select NAME='cross' size=1 id='cross' onchange='fillOptions(\"cross\");'>" + gOptions + "</Select><input type=\"button\" class=\"button\" value=\"Info\" onCLick=\"javascript:crossinfo();\">"
+            document.getElementById("menu1").innerHTML = menu1
+            tOptions = fillOptionsForIE("cross", defaultType)
+            menu2 = "<Select NAME='tissue' size=1 id='tissue' onchange='fillOptions(\"tissue\");'>" + tOptions + "</Select>"
+            document.getElementById("menu2").innerHTML = menu2
+            dOptions = fillOptionsForIE("tissue", defaultDB)
+            menu3 = "<Select NAME='database' size=1 id='database'>" + dOptions + "</Select><input type=\"button\" class=\"button\" value=\"Info\" onCLick=\"javascript:databaseinfo();\">"
+            document.getElementById("menu3").innerHTML = menu3
+        else
+            fillOptions null
+        searchtip()
+        
     
     # 
     #*  input: selectObjId (designated select menu, such as species, cross, etc... )

    #*  output: null
    #
    fillOptions = (selectObjId) ->
      unless selectObjId?
        speciesObj = document.getElementById("species")
        len = sArr.length
        i = 1
    
        while i < len
          
          # setting Species' option
          speciesObj.options[i - 1] = new Option(sArr[i].txt, sArr[i].val)
          i++
        updateChocie "species"
      else if selectObjId is "species"
        speciesObj = document.getElementById("species")
        groupObj = document.getElementById("cross")
        len = lArr.length
        arr = []
        idx = 0
        i = 1
    
        while i < len
          
          #get group(cross) info from lArr
          arr[idx++] = lArr[i][1]  if lArr[i][0] is (getIndexByValue("species", speciesObj.value)).toString() and not Contains(arr, lArr[i][1])
          i++
        idx = 0
        len = arr.length
        removeOptions "cross"
        i = 0
    
        while i < len
          
          # setting Group's option
          groupObj.options[idx++] = new Option(gArr[arr[i]].txt, gArr[arr[i]].val)
          i++
        updateChocie "cross"
      else if selectObjId is "cross"
        speciesObj = document.getElementById("species")
        groupObj = document.getElementById("cross")
        typeObj = document.getElementById("tissue")
        len = lArr.length
        arr = []
        idx = 0
        i = 1
    
        while i < len
          
          #get type(tissue) info from lArr
          arr[idx++] = lArr[i][2]  if lArr[i][0] is (getIndexByValue("species", speciesObj.value)).toString() and lArr[i][1] is (getIndexByValue("cross", groupObj.value)).toString() and not Contains(arr, lArr[i][2])
          i++
        idx = 0
        len = arr.length
        removeOptions "tissue"
        i = 0
    
        while i < len
          
          # setting Type's option
          typeObj.options[idx++] = new Option(tArr[arr[i]].txt, tArr[arr[i]].val)
          i++
        updateChocie "tissue"
      else if selectObjId is "tissue"
        speciesObj = document.getElementById("species")
        groupObj = document.getElementById("cross")
        typeObj = document.getElementById("tissue")
        databaseObj = document.getElementById("database")
        len = lArr.length
        arr = []
        idx = 0
        i = 1
    
        while i < len
          
          #get dataset(database) info from lArr
          arr[idx++] = lArr[i][3]  if lArr[i][0] is (getIndexByValue("species", speciesObj.value)).toString() and lArr[i][1] is (getIndexByValue("cross", groupObj.value)).toString() and lArr[i][2] is (getIndexByValue("tissue", typeObj.value)).toString() and not Contains(arr, lArr[i][3])
          i++
        idx = 0
        len = arr.length
        removeOptions "database"
        i = 0
    
        while i < len
          
          # setting Database's option
          databaseObj.options[idx++] = new Option(dArr[arr[i]].txt, dArr[arr[i]].val)
          i++
        updateChocie "database"
    
    # 
    #*  input: arr (targeted array); obj (targeted value)

    #*  output: index info
    #
    getIndexByValue = (selectObjId, val) ->
        if selectObjId is "species"
            i = 1
    
            while i < sArr.length
                return i  if sArr[i].val is val
                i++
        else if selectObjId is "cross"
            i = 1
    
            while i < gArr.length
                return i  if gArr[i].val is val
                i++
        else if selectObjId is "tissue"
            i = 1
    
            while i < tArr.length
                return i  if tArr[i].val is val
                i++
        else
            return
    
    # 
    #*  input: objId (designated select menu, such as species, cross, etc... )
