func: function () payable {
          require(!token.lockOf(msg.sender) && !crowdsaleClosed && stage<2 && msg.value >= 1 * (1 ether)/10);
          if(stage==1 && (now < presaleEndTime.add(countdownDuration) || amountRaisedPreSale+amountRaisedICO+msg.value > hardCap)) {
              throw;
          }
          uint amount = msg.value;
          balanceOf[msg.sender] += amount;
          if(stage==0) {  
              amountRaisedPreSale += amount;
              token.mint(msg.sender, amount.mul(2) * price);
          } else {
              amountRaisedICO += amount;
              token.mint(msg.sender, amount * price);
          }
          FundTransfer(msg.sender, amount, true);
      }