func: function () public payable 
      {
          uint curIcoRate = 0;
          uint icoRuleIndex = 500;
          for (uint i = 0; i < icoRuleList.length ; i++)
          {
              if ((icoRuleList[i].canceled != true) && (icoRuleList[i].startTime < now && now < icoRuleList[i].endTime)) {
                  curIcoRate = icoRuleList[i].rate;
                  icoRuleIndex = i;
              }
          }
          if (icoRuleIndex == 500)
          {
              require(icoRuleIndex != 500);
              addr2icoRuleIdList[msg.sender].push( 0 );
              addr2shareRuleGroupId[msg.sender] = addr2shareRuleGroupId[msg.sender] > 0 ? addr2shareRuleGroupId[msg.sender] : 0;
          }
          else
          {
              addr2shareRuleGroupId[msg.sender] = addr2shareRuleGroupId[msg.sender] > 0 ? addr2shareRuleGroupId[msg.sender] : icoRuleList[icoRuleIndex].shareRuleGroupId;
              addr2icoRuleIdList[msg.sender].push( icoRuleIndex + 1 );
              icoPushAddr(icoRuleIndex, msg.sender);
          }
          uint amountTKG = 0;
          amountTKG = msg.value.mul( curIcoRate );
          balances[msg.sender] = balances[msg.sender].add(amountTKG);
          icoAmount[msg.sender] = icoAmount[msg.sender].add(amountTKG);
          balances[owner] = balances[owner].sub(amountTKG);
          ADDR_TKG_ORG.transfer(msg.value);
      }